
N8n Expression Syntax
Write and validate n8n `{{}}` expressions so nodes correctly pass JSON, webhook bodies, and cross-node references without silent literal-string bugs.
Overview
n8n Expression Syntax is an agent skill for the Build phase that validates and fixes n8n `{{}}` expressions for `$json`, `$node`, and webhook data mapping between workflow nodes.
Install
npx skills add https://github.com/czlonkowski/n8n-skills --skill n8n-expression-syntaxWhat is this skill?
- Documents correct `{{expression}}` double-brace format vs invalid single-brace or bare `$json` literals
- Covers `$json`, quoted `$node["Name"]` references, `$now`, and nested property access patterns
- Targets troubleshooting when node fields reference prior HTTP Request or Webhook outputs
- Explains case-sensitive exact node names required for cross-node data mapping
- Use whenever configuring dynamic node fields that pass data between workflow steps
Adoption & trust: 3.6k installs on skills.sh; 5.3k GitHub stars; 3/3 security scanners passed (skills.sh audits).
What problem does it solve?
Your n8n workflow breaks because node fields use wrong brace syntax, wrong node names, or literals instead of expressions when passing data forward.
Who is it for?
Indie builders wiring webhooks and API chains in n8n who hit expression validation errors or empty mappings between nodes.
Skip if: Teams that need full workflow architecture, credential rotation policy, or non-n8n orchestration—this skill is syntax and variable reference only.
When should I use this skill?
Writing n8n expressions, using {{}} syntax, $json/$node variables, troubleshooting expression errors, or mapping webhook and prior-node data in workflows.
What do I get? / Deliverables
Node parameters resolve live JSON from the current step and named upstream nodes so automations pass the correct fields into HTTP, set, and transform nodes.
- Corrected expression snippets for node fields
- Validated variable paths from $json and $node references
Recommended Skills
Journey fit
Build → integrations is where n8n workflows are wired; expression syntax is the glue between HTTP, webhooks, and downstream nodes. Expressions map data between automation nodes—the most common failure class when connecting APIs and triggers in n8n.
How it compares
Reference cheat sheet for n8n templating, not a hosted MCP server or workflow generator that deploys flows for you.
Common Questions / FAQ
Who is n8n-expression-syntax for?
Solo builders and tiny teams using n8n to connect SaaS APIs, webhooks, and internal scripts who need correct expression syntax under pressure.
When should I use n8n-expression-syntax?
During Build integrations while configuring node fields, debugging `{{}}` errors, mapping `$json` from webhooks, or referencing `$node["HTTP Request"]` outputs between steps.
Is n8n-expression-syntax safe to install?
The skill is documentation-style guidance; confirm trust via the Security Audits panel on this page and avoid embedding live secrets inside expressions logged in shared workflows.
SKILL.md
READMESKILL.md - N8n Expression Syntax
# n8n Expression Syntax Expert guide for writing correct n8n expressions in workflows. --- ## Expression Format 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) ``` --- ## Core Variables ### $json - Current Node Output Access data from the current node: ```javascript {{$json.fieldName}} {{$json['field with spaces']}} {{$json.nested.property}} {{$json.items[0].name}} ``` ### $node - Reference Other Nodes Access data from any previous node: ```javascript {{$node["Node Name"].json.fieldName}} {{$node["HTTP Request"].json.data}} {{$node["Webhook"].json.body.email}} ``` **Important**: - Node names **must** be in quotes - Node names are **case-sensitive** - Must match exact node name from workflow ### $now - Current Timestamp Access current date/time: ```javascript {{$now}} {{$now.toFormat('yyyy-MM-dd')}} {{$now.toFormat('HH:mm:ss')}} {{$now.plus({days: 7})}} ``` ### $env - Environment Variables Access environment variables: ```javascript {{$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: - Store values in credentials instead - Use a Set node with manually entered values - Pass values through webhook query parameters --- ## 🚨 CRITICAL: Webhook Data Structure **Most Common Mistake**: Webhook data is **NOT** at the root! ### Webhook Node Output Structure ```javascript { "headers": {...}, "params": {...}, "query": {...}, "body": { // ⚠️ USER DATA IS HERE! "name": "John", "email": "john@example.com", "message": "Hello" } } ``` ### Correct Webhook Data Access ```javascript ❌ 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. --- ## Common Patterns ### Access Nested Fields ```javascript // 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']}} ``` ### Reference Other Nodes ```javascript // 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}} ``` ### Combine Variables ```javascript // 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}}" } ``` --- ## When NOT to Use Expressions ### ❌ Code Nodes Code nodes use **direct JavaScript access**, NOT expressions! ```javascript // ❌ 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(); ``` ### ❌ Webhook Paths ```javascript // ❌ WRONG path: "{{$json.user_id}}/webhook" // ✅ COR