n8n-agents
Design n8n AI agents the right way. Use when building or editing any @n8n/n8n-nodes-langchain.* AI node โ an AI Agent, LLM chain,โฆ
Validate n8n expression syntax and fix common errors. Use when writing n8n expressions, using {{}} syntax, accessing $json/$node variables, troubleshooting expression errors, mapping data between nodes, or referencing webhook data in workflows. Use this skill whenever
Claude Code
$ npx -y skills add czlonkowski/n8n-mcp --skill n8n-expression-syntax --agent claude-code
Codex
$ npx skills add czlonkowski/n8n-mcp --skill n8n-expression-syntax -a codex -y
Cursor
$ npx skills add czlonkowski/n8n-mcp --skill n8n-expression-syntax -a cursor -y
Gemini CLI
$ npx skills add czlonkowski/n8n-mcp --skill n8n-expression-syntax -a gemini-cli -y
GitHub Copilot
$ npx skills add czlonkowski/n8n-mcp --skill n8n-expression-syntax -a github-copilot -y
OpenCode
$ npx skills add czlonkowski/n8n-mcp --skill n8n-expression-syntax -a opencode -y
Windsurf
$ npx skills add czlonkowski/n8n-mcp --skill n8n-expression-syntax -a windsurf -y
name: n8n-expression-syntax
description: Validate n8n expression syntax and fix common errors. Use when writing n8n expressions, using {{}} syntax, accessing $json/$node variables, troubleshooting expression errors, mapping data between nodes, or referencing webhook data in workflows. Use this skill whenever configuring node fields that reference data from previous nodes โ expressions are how n8n passes data between nodes, and getting the syntax wrong is the most common source of workflow errors. Also use when asked whether a complex expression hurts performance.Expert guide for writing correct n8n expressions in workflows.
---
All dynamic content in n8n uses **double curly braces**:
{{expression}}**Examples**:
โ
{{$json.email}}
โ
{{$json.body.name}}
โ
{{$node["HTTP Request"].json.data}}
โ $json.email (no braces - treated as literal text)
โ {$json.email} (single braces - invalid)---
Access data from the current node:
{{$json.fieldName}}
{{$json['field with spaces']}}
{{$json.nested.property}}
{{$json.items[0].name}}Access data from any previous node:
{{$node["Node Name"].json.fieldName}}
{{$node["HTTP Request"].json.data}}
{{$node["Webhook"].json.body.email}}**Important**:
Access current date/time:
{{$now}}
{{$now.toFormat('yyyy-MM-dd')}}
{{$now.toFormat('HH:mm:ss')}}
{{$now.plus({days: 7})}}Access environment variables:
{{$env.API_KEY}}
{{$env.DATABASE_URL}}**Warning**: Some n8n instances have `N8N_BLOCK_ENV_ACCESS_IN_NODE` enabled, which blocks `$env` access entirely. If `$env` returns errors, use alternative approaches:
Read instance variables set in the n8n UI or with `n8n_manage_variables`:
{{$vars.API_BASE_URL}}/users
{{$vars.SLACK_CHANNEL}}Values are always strings and read-only at runtime. A missing variable resolves to `undefined` without an error (`{{$vars.API_BASE_URL}}/users` becomes `undefined/users`), so confirm the key with `n8n_manage_variables` (`list`) before using it. Variables need an n8n license that includes them (not the free Community edition). A project variable is visible only to workflows in that project. Variables are visible to every user in their scope, so keep secrets in credentials.
---
**Most Common Mistake**: Webhook data is **NOT** at the root!
{
"headers": {...},
"params": {...},
"query": {...},
"body": { // โ ๏ธ USER DATA IS HERE!
"name": "John",
"email": "john@example.com",
"message": "Hello"
}
}โ WRONG: {{$json.name}}
โ WRONG: {{$json.email}}
โ
CORRECT: {{$json.body.name}}
โ
CORRECT: {{$json.body.email}}
โ
CORRECT: {{$json.body.message}}**Why**: Webhook node wraps incoming data under `.body` property to preserve headers, params, and query parameters.
---
// Simple nesting
{{$json.user.email}}
// Array access
{{$json.data[0].name}}
{{$json.items[0].id}}
// Bracket notation for spaces
{{$json['field name']}}
{{$json['user data']['first name']}}// Node without spaces
{{$node["Set"].json.value}}
// Node with spaces (common!)
{{$node["HTTP Request"].json.data}}
{{$node["Respond to Webhook"].json.message}}
// Webhook node
{{$node["Webhook"].json.body.email}}// Concatenation (automatic)
Hello {{$json.body.name}}!
// In URLs
https://api.example.com/users/{{$json.body.user_id}}
// In object properties
{
"name": "={{$json.body.name}}",
"email": "={{$json.body.email}}"
}---
Code nodes use **direct JavaScript access**, NOT expressions!
// โ WRONG in Code node
const email = '={{$json.email}}';
const name = '{{$json.body.name}}';
// โ
CORRECT in Code node
const email = $json.email;
const name = $json.body.name;
// Or using Code node API
const email = $input.item.json.email;
const allItems = $input.all();// โ WRONG
path: "{{$json.user_id}}/webhook"
// โ
CORRECT
path: "user-webhook" // Static paths only// โ WRONG
apiKey: "={{$env.API_KEY}}"
// โ
CORRECT
Use n8n credential system, not expressions---
Before you add a node โ or write any code โ to transform data, walk this order and stop at the first that fits:
1. **The service's own node** does it in its own fields: a CRM node's field slots, the Slack node's Blocks field, a Data Table insert's per-column slots. HTTP Request only when no node covers the operation. 2. **A native node for the job.** Filter, IF / Switch, Summarize, Aggregate, Split Out, Merge, Compare Datasets, Remove Duplicates, Sort + Limit, Date & Time, XML / HTML / Extract From File, HTTP Request pagination, Crypto. The job-to-node table in `using-n8n-mcp-skills` maps jobs to nodes; their configs are in `n8n-node-configuration` โ NATIVE_NODES.md. 3. **A short expression** (`{{ ... }}`) inside that node's field. Property access, method chains (`.map().filter().join()`), a ternary, string building, Luxon date math, the helper functions below โ "take A, produce B" in one expression, without intermediate variables.
n8n-MCP is an open-source MCP server that lets Claude, ChatGPT, Cursor, and other AI assistants operate n8n: read failed executions, edit workflows in place, validate and test them, manage credentials, and build new workflows.
Design n8n AI agents the right way. Use when building or editing any @n8n/n8n-nodes-langchain.* AI node โ an AI Agent, LLM chain,โฆ
Handle files and binary data in n8n correctly. Use when working with files, images, PDFs, attachments, uploads or downloads,โฆ
Write JavaScript code in n8n Code nodes. Use when writing JavaScript in n8n, using $input/$json/$node syntax, making HTTPโฆ
Write Python code in n8n Code nodes. Use when writing Python in n8n, using _input/_json/_node syntax, working with standardโฆ
Write JavaScript or Python for the n8n Custom Code Tool (@n8n/n8n-nodes-langchain.toolCode) โ the AI-agent-callable tool, NOT theโฆ
Wire n8n error handling so failures are loud, structured, and recoverable. Use when building any webhook/API workflow, aโฆ
Use when the user needs to run GitNexus CLI commands like analyze/index a repo, check status, clean the index, generate a wiki,โฆ
Query and invoke tools on MCP servers using fastmcp list and fastmcp call. Use when you need to discover what tools a serverโฆ
ๅฐ็บขไนฆๅ ๅฎนๅๅธๆ่ฝใๆฏๆไธค็งๅๅธๆจกๅผ๏ผ(1) ไธไผ ๅพๆๆจกๅผ - ๅพ็+็ญๆ๏ผ(2) ๅ้ฟๆๆจกๅผ - ้ฟ็ฏๆ็ซ +ๆ็ๆจกๆฟใ ๆฏๆไธค็ง่พๅ ฅๆนๅผ๏ผ็จๆทๆไพๅฎๆดๅ ๅฎนๅๅพ็/ๅพ็URL๏ผ็ดๆฅๅๅธ๏ผๆๆไพ็ฝ้กตURL๏ผ่ชๅจๆๅๅ ๅฎนๅๅพ็ใโฆ