Skip to main content

Generate n8n workflows from chat using MCP tools, Claude and Postgres

Workflow preview

Workflow preview
100%
Generate n8n workflows from chat using MCP tools, Claude and Postgres preview
Open on n8n.io

1. Workflow Overview

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. Ful...

Best for

  • Internal Wiki automation workflows
  • AI Chatbot automation workflows
  • intermediate n8n builders looking for reusable templates

Tools used

@n8n/n8n-nodes-langchain.agent, @n8n/n8n-nodes-langchain.mcpclienttool, @n8n/n8n-nodes-langchain.lmchatopenrouter, @n8n/n8n-nodes-langchain.memorypostgreschat, @n8n/n8n-nodes-langchain.chattrigger, n8n-nodes-base.stickynote, @n8n/n8n-nodes-langchain.chat

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Salman Mehboob.

Original n8n.io source

1.1 Workflow description

Title
Generate n8n workflows from chat using MCP tools, Claude and Postgres
Workflow name
Generate n8n workflows from chat using MCP tools, Claude and Postgres

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 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

  1. Chat Trigger receives your message and assigns a session ID

  2. Postgres Chat Memory stores conversation history so follow-ups like "change the trigger to a webhook" work naturally without losing context

  3. 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
  1. 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

  2. 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: [email protected] LinkedIn: https://www.linkedin.com/in/salman-mehboob-pro/

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - AI Agent

Type / Role
@n8n/n8n-nodes-langchain.agent - agent
Config choices
Version 3.1

Block 2 - MCP Client

Type / Role
@n8n/n8n-nodes-langchain.mcpClientTool - mcpClientTool
Config choices
Version 1.2

Block 3 - OpenRouter Chat Model

Type / Role
@n8n/n8n-nodes-langchain.lmChatOpenRouter - lmChatOpenRouter
Config choices
Version 1

Block 4 - Postgres Chat Memory

Type / Role
@n8n/n8n-nodes-langchain.memoryPostgresChat - memoryPostgresChat
Config choices
Version 1.3

Block 5 - Chat Trigger

Type / Role
@n8n/n8n-nodes-langchain.chatTrigger - chatTrigger
Config choices
Version 1.4

Block 6 - Sticky Note

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 7 - Sticky Note1

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 8 - Sticky Note2

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 9 - Sticky Note3

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 10 - Respond To Chat

Type / Role
@n8n/n8n-nodes-langchain.chat - chat
Config choices
Version 1.3

Block 11 - Sticky Note6

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

3. Summary Table

Workflow Generate n8n workflows from chat using MCP tools, Claude and Postgres
Complexity intermediate
Nodes 11
Categories Internal Wiki, AI Chatbot
Author Salman Mehboob
Published 11 Apr 2026

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/14990/14990.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Generate n8n workflows from chat using MCP tools, Claude and Postgres do?

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. Ful...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Internal Wiki, AI Chatbot use case.