| name | n8n-workflow-builder |
| description | Build n8n automation workflows using MCP tools. Use when creating workflows, configuring nodes, validating configurations, deploying templates, or integrating n8n with Rails apps. Supports Israeli market (Hebrew, WhatsApp Business, NIS payments). |
n8n Workflow Builder
Build production-ready n8n workflows using the available MCP tools.
MCP Tool Decision Tree
Discovery Phase
| Need | Tool | Example |
|---|
| Find a node | search_nodes | search_nodes({query: "slack"}) |
| Find workflow templates | search_templates | search_templates({searchMode: "by_task", task: "ai_automation"}) |
| Find templates using specific nodes | search_templates | search_templates({searchMode: "by_nodes", nodeTypes: ["n8n-nodes-base.slack"]}) |
| Get a specific template | get_template | get_template({templateId: 123, mode: "full"}) |
Configuration Phase
| Need | Tool | Example |
|---|
| How to configure a node | get_node | get_node({nodeType: "nodes-base.httpRequest", detail: "standard"}) |
| Node documentation | get_node | get_node({nodeType: "nodes-base.slack", mode: "docs"}) |
| Find specific property | get_node | get_node({nodeType: "...", mode: "search_properties", propertyQuery: "auth"}) |
| Real-world examples | get_node | get_node({..., detail: "standard", includeExamples: true}) |
Validation Phase
| Need | Tool | Example |
|---|
| Validate node config | validate_node | validate_node({nodeType: "...", config: {...}, mode: "full"}) |
| Validate full workflow | validate_workflow | validate_workflow({workflow: {...}}) |
Deployment Phase (requires API)
| Need | Tool |
|---|
| Create workflow | n8n_create_workflow |
| Update workflow | n8n_update_partial_workflow |
| Deploy template | n8n_deploy_template |
| Test workflow | n8n_test_workflow |
| Get execution results | n8n_executions |
Common Workflow Patterns
Pattern 1: Webhook -> Process -> Respond
Webhook -> Code (validate) -> HTTP Request -> Respond
Template: assets/templates/workflows/webhook-processor.json
Pattern 2: Lead Capture -> CRM -> Notify
Webhook -> IF (validate) -> CRM -> Slack -> Rails callback
Template: assets/templates/workflows/lead-capture-crm.json
Pattern 3: AI Agent with Tools
Chat Trigger -> AI Agent <- OpenAI Model
^
|- HTTP Request Tool
|- Code Tool
Template: assets/templates/workflows/ai-agent-basic.json
Pattern 4: WhatsApp Bot (Israeli Market)
Webhook -> Code (parse) -> Switch (msg type) -> HTTP Request (WhatsApp API)
Template: assets/templates/workflows/whatsapp-bot.json
Pattern 5: Scheduled Reports
Schedule Trigger -> HTTP (fetch data) -> Code (format) -> Email/Slack
Template: assets/templates/workflows/scheduled-report.json
Pattern 6: Rails Integration
Rails App -> Webhook -> Process -> HTTP (callback to Rails)
Template: assets/templates/workflows/rails-webhook-handler.json
MCP Tool Usage Examples
search_nodes - Finding Nodes
search_nodes({query: "database"})
search_nodes({query: "slak", mode: "FUZZY"})
search_nodes({query: "webhook", includeExamples: true})
get_node - Node Configuration
get_node({nodeType: "nodes-base.httpRequest", detail: "standard"})
get_node({nodeType: "nodes-base.slack", detail: "standard", includeExamples: true})
get_node({nodeType: "nodes-base.webhook", mode: "docs"})
get_node({nodeType: "nodes-base.httpRequest", mode: "search_properties", propertyQuery: "header"})
get_node({nodeType: "nodes-base.httpRequest", mode: "compare", fromVersion: "1.0", toVersion: "2.0"})
validate_node - Pre-build Validation
validate_node({
nodeType: "nodes-base.slack",
config: {resource: "channel", operation: "create"},
mode: "full",
profile: "strict"
})
validate_node({
nodeType: "nodes-base.httpRequest",
config: {method: "POST", url: "https://api.example.com"},
mode: "minimal"
})
validate_workflow - Full Workflow Validation
validate_workflow({
workflow: myWorkflowJson,
options: {
validateNodes: true,
validateConnections: true,
validateExpressions: true,
profile: "strict"
}
})
search_templates - Finding Templates
search_templates({searchMode: "by_task", task: "ai_automation"})
search_templates({searchMode: "by_task", task: "webhook_processing"})
search_templates({searchMode: "by_nodes", nodeTypes: ["n8n-nodes-base.openAi", "n8n-nodes-langchain.agent"]})
search_templates({searchMode: "by_metadata", complexity: "simple", maxSetupMinutes: 15})
search_templates({query: "slack notification"})
AI Agent Workflows
Connection Types (CRITICAL)
AI connections flow TO the consumer node:
| Connection Type | From | To | Purpose |
|---|
ai_languageModel | Language Model | AI Agent | REQUIRED - provides LLM |
ai_tool | Tool Node | AI Agent | Gives agent capabilities |
ai_memory | Memory Node | AI Agent | Conversation history |
ai_outputParser | Parser | Chain | Structured output |
Minimal AI Agent Setup
- Add Chat Trigger (or Manual Trigger)
- Add Language Model (OpenAI Chat Model / Anthropic)
- Add AI Agent
- Connect:
Chat Trigger -> AI Agent (main connection)
- Connect:
Language Model -> AI Agent (ai_languageModel type)
Adding Tools to Agent
{
"name": "Call API Tool",
"type": "@n8n/n8n-nodes-langchain.toolHttpRequest",
"parameters": {
"description": "Calls external API to fetch data"
}
}
Tool Description Requirements
- Minimum 15 characters
- Must clearly describe what the tool does
- Agent uses this to decide when to use the tool
See references/ai-agents-guide.md for advanced patterns.
Israeli Market Integration
WhatsApp Business API
{
"method": "POST",
"url": "https://graph.facebook.com/v18.0/{{PHONE_ID}}/messages",
"headers": {"Authorization": "Bearer {{ACCESS_TOKEN}}"},
"body": {
"messaging_product": "whatsapp",
"to": "972501234567",
"type": "text",
"text": {"body": "\u200F" + hebrewText}
}
}
Hebrew RTL Handling
const rtlText = "\u200F" + hebrewContent;
const mixed = `\u200F${hebrewPart}\u200E${englishPart}`;
Rate Limits by Tier
| Tier | Messages/day | Messages/sec |
|---|
| Unverified | 250 | 80 |
| Verified | 1,000 | 80 |
| Business | 10,000+ | 80 |
See references/israeli-market-integrations.md for WhatsApp templates and payment patterns.
Rails Integration
Triggering n8n from Rails
def trigger_webhook(webhook_url, payload)
HTTParty.post(webhook_url, {
body: payload.to_json,
headers: {'Content-Type' => 'application/json', 'X-Webhook-Secret' => ENV['N8N_SECRET']}
})
end
Receiving n8n Callbacks
signature = request.headers['X-N8N-Signature']
expected = OpenSSL::HMAC.hexdigest('sha256', ENV['N8N_SECRET'], request.raw_post)
unless ActiveSupport::SecurityUtils.secure_compare(signature.to_s, expected)
render json: {error: 'Unauthorized'}, status: 401
end
Selling Automations
- Automation model with
workflow_json, price, demo_webhook_url
- Purchase model with Stripe integration
- Delivery: JSON download, hosted deploy, or embedded viewer
See references/rails-integration-patterns.md for full implementation.
Validation Checklist
Before Building
Node Level
Workflow Level
AI Workflows
Pre-Deployment
Workflow JSON Structure
{
"name": "Workflow Name",
"nodes": [
{
"id": "uuid",
"name": "Node Name",
"type": "n8n-nodes-base.webhook",
"typeVersion": 2,
"position": [250, 300],
"parameters": {}
}
],
"connections": {
"Node Name": {
"main": [[{"node": "Next Node", "type": "main",
Scripts
Validate Before Deploy
python scripts/validate_before_deploy.py workflow.json
Generate Workflow Skeleton
python scripts/generate_workflow_skeleton.py --type webhook --name "My Workflow"
python scripts/generate_workflow_skeleton.py --type ai-agent --name "Support Bot"
References
| Topic | File |
|---|
| MCP Tools (all 19) | references/mcp-tools-guide.md |
| AI Agent Patterns | references/ai-agents-guide.md |
| Rails Integration | references/rails-integration-patterns.md |
| Israeli Market | references/israeli-market-integrations.md |
| Node Configs | references/node-configuration-patterns.md |
| Code Patterns | references/code-node-patterns.md |
| Validation | references/validation-checklist.md |
Templates
Workflows
assets/templates/workflows/webhook-processor.json
assets/templates/workflows/lead-capture-crm.json
assets/templates/workflows/whatsapp-bot.json
assets/templates/workflows/ai-agent-basic.json
assets/templates/workflows/scheduled-report.json
assets/templates/workflows/rails-webhook-handler.json
Nodes
assets/templates/nodes/webhook-trigger.json
assets/templates/nodes/http-request-auth.json
assets/templates/nodes/code-transform.json
assets/templates/nodes/if-conditions.json
assets/templates/nodes/error-handler.json
Israeli Market
assets/templates/israel/whatsapp-message-types.json
assets/templates/israel/hebrew-templates.json
assets/templates/israel/payment-webhook.json