π Generate n8n workflows from chat using MCP tools, Claude and Postgres
β‘ 771 views Β· π Internal Wiki & Knowledge Base
Description
Describe any automation in plain English. This AI agent builds, validates, and deploys a working n8n workflow into your instance in seconds β no node dragging, no JSON editing, no guesswork.
πΊ Full setup guide: [https://youtu.be/HMXBInLaUB8?si=Q21gt48omSyzsTGl]
ββββββββββββββββββββββββββββββββββββββββ π― WHO IS THIS FOR? ββββββββββββββββββββββββββββββββββββββββ
β n8n builders who want to generate workflows by chatting instead of configuring every node manually β Agencies building automations for clients at speed β Developers who want an AI co-pilot with real n8n knowledge β Non-technical teams who need to create workflows by describing them in plain language
ββββββββββββββββββββββββββββββββββββββββ β‘ WHAT MAKES THIS DIFFERENT ββββββββββββββββββββββββββββββββββββββββ
Most AI workflow generators hallucinate node names, guess parameters, and produce broken JSON. This one doesnβt.
It uses the official n8n MCP Client Tool node β natively built into n8n, no community packages required β to connect to a self-hosted n8n-mcp server (czlonkowski/n8n-mcp, 16k+ GitHub stars). That server holds the complete, structured documentation of 1,396 n8n nodes in a SQLite database with 12ms response time and zero rate limits.
The agent never guesses. It looks everything up first.
ββββββββββββββββββββββββββββββββββββββββ β WHAT IT DOES ββββββββββββββββββββββββββββββββββββββββ
β Accepts plain English prompts via n8nβs built-in chat UI β Looks up exact node type strings β never assumes from training data β Validates every node config before building anything β Runs 3 separate post-build checks: structure, connections, and expression syntax β Deploys directly to your n8n instance via the REST API β Returns only the workflow URL + credential checklist β Remembers conversation history for follow-up edits β Modifies existing workflows with diff updates, not rebuilds
ββββββββββββββββββββββββββββββββββββββββ βοΈ HOW IT WORKS β STEP BY STEP ββββββββββββββββββββββββββββββββββββββββ
-
Chat Trigger receives your message and assigns a session ID
-
Postgres Chat Memory stores conversation history so follow-ups like βchange the trigger to a webhookβ work naturally without losing context
-
AI Agent (Claude Sonnet 4.5) reads the system prompt and begins calling MCP tools in strict order:
β tools_documentation() to load current best practices β search_nodes() for exact node type strings β get_node_essentials() for the 10-20 params that matter β search_templates() to find proven real-world patterns from 2,646 templates β validate_node_minimal() + validate_node_operation() to pre-validate before building β validate_workflow() + validate_workflow_connections()
- validate_workflow_expressions() post-build β n8n_create_workflow() to deploy live β n8n_validate_workflow() to confirm deployment
-
MCP Client Tool (official n8n node, no community packages) connects to the n8n-mcp Docker container on the same Docker network β all 42 tools exposed, bearer auth secured
-
Respond To Chat sends only the workflow URL and a credential checklist β never raw JSON
ββββββββββββββββββββββββββββββββββββββββ π§ WHAT YOU NEED ββββββββββββββββββββββββββββββββββββββββ
β Self-hosted n8n (Docker) β n8n-mcp container on the same Docker network (full docker-compose in sticky notes) β OpenRouter API key (or native Anthropic node) β Postgres for chat memory β n8n API key with workflow create permissions β Bearer token credential for n8n-mcp
No community nodes required. MCP Client Tool is an official built-in node in n8n.
ββββββββββββββββββββββββββββββββββββββββ π οΈ NODES IN THIS WORKFLOW ββββββββββββββββββββββββββββββββββββββββ
β Chat Trigger β public chat UI, auto session management β AI Agent (Tools Agent, v3.1) β 25 iterations, full prompt β MCP Client Tool (official) β all 42 tools, bearer auth β OpenRouter Chat Model β Claude Sonnet 4.5 β Postgres Chat Memory β 10-message window per session β Respond To Chat β formatted reply with error fallback
ββββββββββββββββββββββββββββββββββββββββ π CUSTOMISATION ββββββββββββββββββββββββββββββββββββββββ
β Swap to any LLM via OpenRouter or native Anthropic node β Adjust Postgres memory window (default: 10 messages) β Restrict the system prompt to specific workflow categories β Add a human approval step before deployment β Deploy n8n-mcp on Railway or any VPS for remote access
ββββββββββββββββββββββββββββββββββββββββ β οΈ SELF-HOSTED ONLY ββββββββββββββββββββββββββββββββββββββββ
Requires self-hosted n8n. The n8n-mcp container must be reachable from n8n over HTTP on the same Docker network. Not compatible with n8n Cloud without exposing the MCP server publicly.
Docker Compose.yml and .env files https://docs.google.com/document/d/1qvkJnybhjeS3T2ySKsJ0MZF1rPZYcC1nbxBJjxC6Pqk/edit?usp=sharing
ββββββββββββββββββββββββββββββββββββββββ π¬ SUPPORT ββββββββββββββββββββββββββββββββββββββββ
Email: salmanmehboob1947@gmail.com LinkedIn: https://www.linkedin.com/in/salman-mehboob-pro/
π Nodes Used
AI Agent, Chat Trigger, Postgres Chat Memory, OpenRouter Chat Model, MCP Client Tool, Chat
π₯ Import
Download workflow.json and import into n8n:
Workflow menu β Import from File