n8n-expression-syntax
What it does
This tool helps you write and fix special codes (called 'expressions') that n8n uses to make your automated workflows smarter. It ensures the syntax is correct so data can be used where you need it.
When to use it
- βWhen writing code to use data from a previous step in another.
- βWhen you get an error about expression syntax.
- βWhen trying to use information from webhooks or other nodes.
Skill link
https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/n8n-expression-syntax/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agentβs skills folder.
Example of what to ask your AI
βFix this expression to get the user's name: {{ $json.body.userName }}β
5 new skills a week. 1 minute to read.
How it works
The tool checks if your special code follows n8n's rules. If there are common mistakes, it suggests fixes so you can use data correctly in your workflows.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
n8n Expression Syntax
Expert guide for writing correct n8n expressions in workflows.
Detailed Guide
Read the detailed guide before executing this skill. It retains the complete procedure and reference material. Treat its safety, prerequisites, and validation requirements as mandatory. For focused work, load the relevant sections; for end-to-end work, read the guide completely.
When to Use
- You need to write or debug n8n expressions using
{{ ... }}syntax. - The task involves
$json,$node, webhook payloads, or expression-related workflow errors. - You want syntax-correct dynamic values inside n8n nodes and parameters.
When NOT to Use Expressions
β Code Nodes
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();
β Webhook Paths
// β WRONG
path: "{{$json.user_id}}/webhook"
// β
CORRECT
path: "user-webhook" // Static paths only
β Credential Fields
// β WRONG
apiKey: "={{$env.API_KEY}}"
// β
CORRECT
Use n8n credential system, not expressions
Working Examples
For real workflow examples, see EXAMPLES.md
Example 1: Webhook to Slack
Webhook receives:
{
"body": {
"name": "John Doe",
"email": "john@example.com",
"message": "Hello!"
}
}
In Slack node text field:
New form submission!
Name: {{$json.body.name}}
Email: {{$json.body.email}}
Message: {{$json.body.message}}
Example 2: HTTP Request to Email
HTTP Request returns:
{
"data": {
"items": [
{"name": "Product 1", "price": 29.99}
]
}
}
In Email node (reference HTTP Request):
Product: {{$node["HTTP Request"].json.data.items[0].name}}
Price: ${{$node["HTTP Request"].json.data.items[0].price}}
Example 3: Format Timestamp
// Current date
{{$now.toFormat('yyyy-MM-dd')}}
// Result: 2025-10-20
// Time
{{$now.toFormat('HH:mm:ss')}}
// Result: 14:30:45
// Full datetime
{{$now.toFormat('yyyy-MM-dd HH:mm')}}
// Result: 2025-10-20 14:30
Limitations
- Use this skill only when the task clearly matches the scope described above.
- Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
- Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.
FAQ
What are 'expressions' in n8n?
They are short codes that use special syntax (like {{ ... }}) to fetch and use data from other parts of your automated workflow.
When should I NOT use this tool?
Do not use it for writing code directly in 'Code Nodes', fixed webhook paths, or credential fields. The syntax is different or not allowed in those cases.
How do I use data from a previous step?
You use the syntax {{ $node["Node Name"].json["field"] }} to access data from a previous node, or {{ $json["field"] }} for data received directly.
Details
Original description by the author
Validate n8n expression syntax and fix common errors. Use when writing n8n expressions, using {{}} syntax, accessing $json/$node variables, troubleshooting expression errors, or working with webhook data in workflows.
Popularity
- GitHub stars
- 48k
- Ranking position
- #5272
- License
- MIT
- Updated
- 10/15/2026
Comments
- β¦
More skills from this repository
00-andruia-consultant
48kHelps your agent start or improve AI projects. It analyzes code, suggests tools, and creates action plans in Spanish.
007
48kLets your agent perform security audits and threat modeling. It's useful for protecting projects against attacks and vulnerabilities.
10-andruia-skill-smith
48kHelps your agent create or improve AI tools. It defines how tools work, writes documentation, and validates the structure.
20-andruia-niche-intelligence
48kLets your agent create a summary about a specific industry. It's useful for understanding the context, rules, usage patterns, and risks of a project, using reliable sources.
Similar skills
diffs
394kLets your agent produce a real, shareable diff of edits as a viewer link or image file, instead of a hand-written summary.
coding-agent
394kHelps your agent hand a larger coding job to Codex, Claude Code, or OpenCode as a background worker, then check on its progress.
gh-issues
394kHelps your agent find GitHub issues, pick the ones to work on, and open pull requests with fixes, including follow-up on review comments.