Skip to content
Skillpedia
General coding48k · #3658

n8n-expression-syntax

Lets you validate and fix errors in n8n expression syntax. It accesses variables and webhook data. Useful for ensuring your expressions work correctly.

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.

Example of what to ask your AI

“Fix this expression to get the user's name: {{ $json.body.userName }}”

Want more? Open the sections below.

How to use

The easiest way: copy the message below and paste it into Claude, ChatGPT, Cursor or any AI. It reads the skill and follows the instructions.

Skill link

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/n8n-expression-syntax/SKILL.md

Ready-to-paste message

Use this skill to help me: https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/n8n-expression-syntax/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
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.

Installation

Easiest way: copy the skill link and paste it into Claude, ChatGPT or Cursor asking it to follow the instructions.

In the terminal (Claude Code, Codex, Cursor), in your project folder:

npx skills add sickn33/agentic-awesome-skills --skill n8n-expression-syntax

Or download just the file:

curl -L https://raw.githubusercontent.com/sickn33/agentic-awesome-skills/main/plugins/agentic-awesome-skills-claude/skills/n8n-expression-syntax/SKILL.md -o SKILL.md
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.

repo: sickn33/agentic-awesome-skills

Popularity

GitHub stars
48k
Ranking position
#3658
License
MIT
Updated
10/15/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills