Agent skill
n8n-builder
Generates production-ready n8n 2.0+ workflow JSON with nodes, connections, AI agents, RAG pipelines, Task Runners, MCP clients, and validation. Use when building workflow automations, scaffolding LangChain agents with tools/memory, implementing RAG retrieval systems, or converting requirements to n8n JSON.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/other/n8n-builder
SKILL.md
[H1][N8N-BUILDER]
Dictum: Schema compliance enables n8n import without runtime validation errors.
Generate valid n8n workflow JSON.
Tasks:
- Read schema.md — Root structure, settings
- Read nodes.md — Node definition, typeVersion
- Read connections.md — Graph topology, AI types
- (dynamic values) Read expressions.md — Variables, functions
- (specific nodes) Read integrations.md — Node parameters
- Generate JSON — Apply template from workflow.template.md
- Validate — Run
uv run .claude/skills/n8n-builder/scripts/validate-workflow.py
REFERENCE: index.md — File listing.
[0][N8N_2.0]
Dictum: Breaking changes invalidate pre-2025 patterns.
Breaking Changes (December 2025):
| [INDEX] | [CHANGE] | [DETAIL] |
|---|---|---|
| [1] | Database | PostgreSQL required; MySQL/MariaDB support dropped |
| [2] | Python | "language": "python" removed; use "pythonNative" with Task Runners |
| [3] | Security | ExecuteCommand and LocalFileTrigger disabled by default |
| [4] | Code Isolation | Environment variable access blocked (N8N_BLOCK_ENV_ACCESS_IN_NODE=true) |
| [5] | Agent Type | Agent type selection removed (v1.82+); all agents are Tools Agent |
| [6] | Task Runners | Enabled by default for code execution isolation; external process sandbox |
| [7] | MCP Client | mcpClient standalone node for calling external MCP servers as AI tools |
| [8] | HITL | Human-in-the-loop for AI tool calls; agent pauses for human approval |
| [9] | MCP OAuth | MCP servers support OAuth 2.1 authentication for credential exchange |
| [10] | Publish/Save | Save preserves edits (draft); Publish updates live version (separate act) |
| [11] | SQLite Pool | High-performance pooling driver reduces "Database Locked" errors |
| [12] | Sub-Workflow Wait | Sub-workflows pause, wait for external input (Slack approval), return data |
| [13] | Project Vars | Project-level variables alongside global; override global per project |
[CRITICAL]:
- [ALWAYS] Use Task Runners for Code node execution — default isolation mode since 2025.
- [ALWAYS] Use
mcpClientnode (not HTTP) for MCP server integration — handles protocol negotiation. - [NEVER] Use deprecated
"language": "python"— fails silently with Task Runners enabled.
[1][SCHEMA]
Dictum: Root structure enables n8n parser recognition and execution.
Guidance:
AI Workflows— RequireexecutionOrder: "v1"in settings; async node ordering fails without.Portability— Credential IDs and errorWorkflow UUIDs are instance-specific; expect reassignment post-import.Optional Fields— Include empty objects ("pinData": {}) over omission; prevents import edge cases.Sub-Workflow Typing— UseworkflowInputsschema on trigger nodes to validate caller payloads before execution.pinData Limits— Keep under 12MB; large payloads slow editor rendering and cannot contain binary data.
Best-Practices:
- [ALWAYS] Set
"active": falseon generation; activation is a deployment decision. - [NEVER] Hardcode credential IDs; use placeholder names for cross-instance transfer.
[2][NODES]
Dictum: Unique identity enables deterministic cross-node references.
Guidance:
Name Collisions— n8n auto-renames duplicates (Set→Set1); breaks$('NodeName')expressions silently.Version Matching— typeVersion must match target n8n instance; newer versions may lack backward compatibility.Error Strategy— UseonError: "continueErrorOutput"for fault-tolerant pipelines; default stops execution.Node Documentation— Usenotesfield for inline documentation;notesInFlow: truedisplays on canvas.
Best-Practices:
- [ALWAYS] Generate UUID per node before building connections; connections reference node.name.
- [ALWAYS] Space nodes 200px horizontal, 150px vertical for canvas readability.
[3][CONNECTIONS]
Dictum: Connection types enable workflow mode distinction at parse time.
Guidance:
AI vs Main— AI nodes require specialized types (ai_tool,ai_languageModel);maincauses silent tool invisibility.Fan-out— Single output to multiple nodes executes in parallel; order within array is non-deterministic.Multi-output— Array index maps to output port; IF node: index 0 = true branch, index 1 = false branch.Single Model— Agent accepts exactly oneai_languageModelconnection; multiple models conflict silently.Memory Scope—ai_memorypersists within single trigger execution only; no cross-session persistence.
Best-Practices:
- [ALWAYS] Match connection key AND
typeproperty; mismatches cause silent failures. - [NEVER] Connect AI tools via
maintype; agent cannot discover them. - [NEVER] Connect multiple language models to single agent; use Model Selector node for dynamic selection.
[4][EXPRESSIONS]
Dictum: Dynamic evaluation eliminates hardcoded parameters.
Guidance:
Static vs Dynamic— Prefix=signals evaluation; without it, value is literal string including{{ }}.Pinned Data— Test mode pins lack execution context;.itemfails, use.first()or.all()[0]instead.Complex Logic— IIFE pattern{{(function(){ return ... })()}}enables multi-statement evaluation.Scope Confusion—$jsonaccesses current node input only; use$('NodeName').item.jsonfor other nodes.
Best-Practices:
- [ALWAYS] Use
$('NodeName')for cross-node data;$jsononly accesses current node input. - [ALWAYS] Escape quotes in JSON strings or use template literals to prevent invalid JSON.
- [NEVER] Assume
.itemworks in all contexts; pinned data testing requires explicit accessors.
[5][INTEGRATIONS]
Dictum: Node type selection determines integration capability.
Guidance:
Trigger Selection— Webhook for external calls, scheduleTrigger for periodic; choose based on initiation source.AI Tool Visibility— Sub-workflow tools requiredescriptionparameter; agent uses it for tool selection reasoning.Code Language— Use"pythonNative"for Python;"python"is deprecated.Error Propagation— UsestopAndErrornode for controlled failures; triggers designated error workflow.MCP Client—mcpClientstandalone node connects to external MCP servers; discovers tools dynamically viaai_toolconnection. Supports OAuth 2.1.Guardrails—guardrailsnode enforces AI output safety with configurable rules and actions.HITL— Human-in-the-loop approval for AI agent tool calls; agent pauses execution until human approves.Output Parser—outputParserStructuredjsonSchema must be static; expressions in schema are ignored silently.Batch Processing— UsesplitInBatchesfor large datasets to prevent memory exhaustion; process in chunks.
Best-Practices:
- [ALWAYS] Set
responseMode: "lastNode"for webhook→response patterns; ensures output reaches caller. - [ALWAYS] Include
descriptionon HTTP nodes used as AI tools; undocumented tools are invisible to agent. - [ALWAYS] Include unique
webhookIdper workflow to prevent path collisions across workflows.
[6][RAG]
Dictum: RAG pipelines ground LLM responses in domain-specific knowledge.
Guidance:
Vector Store Selection— Simple for development; PGVector/Pinecone/Qdrant for production persistence.Embedding Consistency— Same embedding model required for insert and query; mismatch causes semantic drift.Chunk Strategy— Recursive Character splitter recommended; splits Markdown/HTML/code before character fallback.Memory vs Chains— Only agents support memory; chains are stateless single-turn processors.Retriever Modes— MultiQuery for complex questions; Contextual Compression for noise reduction.
Best-Practices:
- [ALWAYS] Match embedding model between document insert and query operations.
- [ALWAYS] Use
ai_memoryconnection type for memory nodes;mainsilently fails. - [NEVER] Use Simple Vector Store in production; data lost on restart, global user access.
[7][VALIDATION]
Dictum: Pre-export validation prevents n8n import failures.
Script:
uv run .claude/skills/n8n-builder/scripts/validate-workflow.py workflow.json
uv run .claude/skills/n8n-builder/scripts/validate-workflow.py workflow.json --strict
Checks (12 automated):
root_required— name, nodes, connections presentnode_id_unique/node_name_unique— no duplicatesnode_id_uuid— valid UUID formatconn_targets_exist— connection targets reference existing nodesconn_ai_type_match— AI connection key matches type propertysettings_exec_order_ai— LangChain workflows requireexecutionOrder: "v1"settings_caller_policy/node_on_error— enum value validation
Guidance:
API Deployment— Use POST then PUT pattern; single POST may ignore settings due to API bug.Performance—saveExecutionProgress: truetriggers DB I/O per node; disable for high-throughput (>1000 RPM).Source Control— StripinstanceIdwhen sharing; credential files contain stubs only, not secrets.
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?