n8n Skill
You are an expert at building production-grade n8n workflow automations, custom nodes, and integrations.
Read the detailed reference files in ${CLAUDE_SKILL_DIR} for comprehensive patterns:
workflow-reference.md — Workflow design, triggers, flow control, error handling, expressions, data transformation
custom-nodes-reference.md — Building custom nodes with TypeScript, declarative vs programmatic, credentials, testing
api-reference.md — n8n REST API for programmatic workflow management, execution control, credential operations
Setup Checklist
Self-Hosted (Docker)
docker run -it --rm --name n8n -p 5678:5678 -v n8n_data:/home/node/.n8n docker.n8n.io/n8nio/n8n
Custom Node Development
npx n8n-node-dev new # scaffold a new node
npm link # link node to local n8n
n8n start # start with custom nodes loaded
npm (Global)
npm install n8n -g
n8n start
Core Patterns
Workflow JSON Structure
{
"name": "My Workflow",
"nodes": [
{
"parameters": {},
"id": "unique-id",
"name": "Webhook",
"type": "n8n-nodes-base.webhook",
"typeVersion": 2,
"position": [250, 300]
}
],
"connections": {
"Webhook": {
"main": [[{ "node": "Next Node", "type": "main", "index": 0 }]]
}
},
"settings": { "executionOrder": "v1" }
}
Common Trigger Types
| Trigger |
Use Case |
n8n-nodes-base.webhook |
HTTP requests, API endpoints |
n8n-nodes-base.scheduleTrigger |
Cron-based recurring tasks |
n8n-nodes-base.formTrigger |
User form submissions |
n8n-nodes-base.emailReadImap |
Incoming emails |
n8n-nodes-base.workflowTrigger |
Called by other workflows |
Expression Syntax
{{ $json.fieldName }} // current node data
{{ $input.first().json.field }} // first input item
{{ $('NodeName').first().json.field }} // data from specific node
{{ $now.toFormat('yyyy-MM-dd') }} // Luxon date formatting
{{ $if($json.age > 18, "adult", "minor") }} // conditional
{{ $jmespath($json, "items[?price > `100`]") }} // JMESPath query
Error Handling Pattern
{
"nodes": [
{
"name": "Main Task",
"type": "n8n-nodes-base.httpRequest",
"onError": "continueErrorOutput",
"retryOnFail": true,
"maxTries": 3,
"waitBetweenTries": 1000
}
]
}
Code Node (JavaScript)
// In a Code node — process all items
const results = [];
for (const item of $input.all()) {
results.push({
json: {
processed: item.json.name.toUpperCase(),
timestamp: new Date().toISOString(),
}
});
}
return results;
Code Node (Python)
# In a Code node — process all items
results = []
for item in _input.all():
results.append({
"json": {
"processed": item.json["name"].upper(),
"timestamp": str(datetime.now()),
}
})
return results
Critical Rules
- Every workflow needs a trigger node — webhooks, schedules, form triggers, or app triggers start execution
- Items are arrays — each node receives and outputs arrays of items; always handle multiple items
- Use expressions over Code nodes — expressions are faster and easier to maintain; use Code only for complex logic
- Set
executionOrder: "v1" — ensures predictable node execution order in new workflows
- Error workflows are separate — configure a dedicated error workflow in workflow settings to catch failures
- Credentials are encrypted at rest — never hardcode secrets in node parameters; use n8n's credential system
- Webhook paths must be unique — duplicate paths cause routing conflicts
- Binary data needs explicit handling — use "Move Binary Data" node to convert between binary and JSON
- Test with manual execution first — always test workflows manually before activating for production
- Pin data for development — use pinned data on nodes to test downstream logic without re-triggering
- Sub-workflows for reuse — extract shared logic into sub-workflows called via Execute Workflow node
- Respect rate limits — use the SplitInBatches node and wait nodes when calling rate-limited APIs
Key Node Categories
| Category |
Nodes |
| Flow |
IF, Switch, Merge, SplitInBatches, Loop Over Items |
| Transform |
Set, Code, HTML Extract, Markdown, XML, Date & Time |
| Data |
HTTP Request, GraphQL, FTP, RSS, Read/Write Files |
| Developer |
Webhook, Execute Command, Execute Workflow, Function |
| AI |
AI Agent, Text Classifier, Summarization Chain, Vector Store |
Use $ARGUMENTS to understand what the user wants to build. Read the reference files for detailed patterns before writing code.
1---2name: n8n3description: Build n8n workflow automations, custom nodes, and integrations. Use when the user wants to create n8n workflows, build custom n8n nodes, write n8n expressions, configure n8n triggers, handle n8n errors, set up webhook automations, or work with n8n's API. Triggers on mentions of n8n, workflow automation with n8n, or imports from n8n-workflow.4argument-hint: [description of workflow or node to build]5risk: safe6metadata:7 source: https://skillmd.com/skills/kursku/n8n8---910# n8n Skill1112You are an expert at building production-grade n8n workflow automations, custom nodes, and integrations.1314Read the detailed reference files in `${CLAUDE_SKILL_DIR}` for comprehensive patterns:1516- `workflow-reference.md` — Workflow design, triggers, flow control, error handling, expressions, data transformation17- `custom-nodes-reference.md` — Building custom nodes with TypeScript, declarative vs programmatic, credentials, testing18- `api-reference.md` — n8n REST API for programmatic workflow management, execution control, credential operations1920## Setup Checklist2122### Self-Hosted (Docker)23```bash24docker run -it --rm --name n8n -p 5678:5678 -v n8n_data:/home/node/.n8n docker.n8n.io/n8nio/n8n25```2627### Custom Node Development28```bash29npx n8n-node-dev new # scaffold a new node30npm link # link node to local n8n31n8n start # start with custom nodes loaded32```3334### npm (Global)35```bash36npm install n8n -g37n8n start38```3940## Core Patterns4142### Workflow JSON Structure43```json44{45 "name": "My Workflow",46 "nodes": [47 {48 "parameters": {},49 "id": "unique-id",50 "name": "Webhook",51 "type": "n8n-nodes-base.webhook",52 "typeVersion": 2,53 "position": [250, 300]54 }55 ],56 "connections": {57 "Webhook": {58 "main": [[{ "node": "Next Node", "type": "main", "index": 0 }]]59 }60 },61 "settings": { "executionOrder": "v1" }62}63```6465### Common Trigger Types66| Trigger | Use Case |67|---------|----------|68| `n8n-nodes-base.webhook` | HTTP requests, API endpoints |69| `n8n-nodes-base.scheduleTrigger` | Cron-based recurring tasks |70| `n8n-nodes-base.formTrigger` | User form submissions |71| `n8n-nodes-base.emailReadImap` | Incoming emails |72| `n8n-nodes-base.workflowTrigger` | Called by other workflows |7374### Expression Syntax75```76{{ $json.fieldName }} // current node data77{{ $input.first().json.field }} // first input item78{{ $('NodeName').first().json.field }} // data from specific node79{{ $now.toFormat('yyyy-MM-dd') }} // Luxon date formatting80{{ $if($json.age > 18, "adult", "minor") }} // conditional81{{ $jmespath($json, "items[?price > `100`]") }} // JMESPath query82```8384### Error Handling Pattern85```json86{87 "nodes": [88 {89 "name": "Main Task",90 "type": "n8n-nodes-base.httpRequest",91 "onError": "continueErrorOutput",92 "retryOnFail": true,93 "maxTries": 3,94 "waitBetweenTries": 100095 }96 ]97}98```99100### Code Node (JavaScript)101```javascript102// In a Code node — process all items103const results = [];104for (const item of $input.all()) {105 results.push({106 json: {107 processed: item.json.name.toUpperCase(),108 timestamp: new Date().toISOString(),109 }110 });111}112return results;113```114115### Code Node (Python)116```python117# In a Code node — process all items118results = []119for item in _input.all():120 results.append({121 "json": {122 "processed": item.json["name"].upper(),123 "timestamp": str(datetime.now()),124 }125 })126return results127```128129## Critical Rules1301311. **Every workflow needs a trigger node** — webhooks, schedules, form triggers, or app triggers start execution1322. **Items are arrays** — each node receives and outputs arrays of items; always handle multiple items1333. **Use expressions over Code nodes** — expressions are faster and easier to maintain; use Code only for complex logic1344. **Set `executionOrder: "v1"`** — ensures predictable node execution order in new workflows1355. **Error workflows are separate** — configure a dedicated error workflow in workflow settings to catch failures1366. **Credentials are encrypted at rest** — never hardcode secrets in node parameters; use n8n's credential system1377. **Webhook paths must be unique** — duplicate paths cause routing conflicts1388. **Binary data needs explicit handling** — use "Move Binary Data" node to convert between binary and JSON1399. **Test with manual execution first** — always test workflows manually before activating for production14010. **Pin data for development** — use pinned data on nodes to test downstream logic without re-triggering14111. **Sub-workflows for reuse** — extract shared logic into sub-workflows called via Execute Workflow node14212. **Respect rate limits** — use the SplitInBatches node and wait nodes when calling rate-limited APIs143144## Key Node Categories145146| Category | Nodes |147|----------|-------|148| **Flow** | IF, Switch, Merge, SplitInBatches, Loop Over Items |149| **Transform** | Set, Code, HTML Extract, Markdown, XML, Date & Time |150| **Data** | HTTP Request, GraphQL, FTP, RSS, Read/Write Files |151| **Developer** | Webhook, Execute Command, Execute Workflow, Function |152| **AI** | AI Agent, Text Classifier, Summarization Chain, Vector Store |153154Use `$ARGUMENTS` to understand what the user wants to build. Read the reference files for detailed patterns before writing code.