n8n-expression-syntax

Explain n8n expression syntax for variables like $json and $node.

Updated Feb 26, 2026
One-click install
npx skills add https://github.com/pessini/aria --skill n8n-expression-syntax-pessini
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: n8n-expression-syntax
Source: https://github.com/pessini/aria/tree/main/backend/agents/n8n_agent/skills/n8n-expression-syntax
Command: npx skills add https://github.com/pessini/aria --skill n8n-expression-syntax-pessini

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) and scripts (resource) components.

What problem does it solve?

This Skill helps users write correct n8n expressions, preventing common errors like incorrect webhook data access, syntax mistakes, and confusion between expression syntax and code node JavaScript.

Core Features & Use Cases

  • Syntax Validation: Understand and apply the correct {{ }} syntax for dynamic values.
  • Variable Usage: Learn to use $json, $node, $now, and $env variables effectively.
  • Webhook Data Handling: Correctly access data sent via webhooks, understanding the .body structure.
  • Use Case: When building an n8n workflow that receives data from a webhook and needs to use a field from that webhook's payload in a subsequent node (e.g., sending a personalized email), this Skill ensures you correctly reference {{$json.body.fieldName}} instead of the common mistake {{$json.fieldName}}.

Quick Start

Use the n8n-expression-syntax skill to learn how to correctly reference webhook data in an n8n workflow.

Frequently Asked Questions about n8n-expression-syntax

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I access webhook payload data in n8n expressions?

To access webhook payload data in n8n expressions, reference the field using {{$json.body.fieldName}}. A common mistake is using {{$json.fieldName}} directly, which fails because webhook data is nested inside the body structure of the incoming JSON data.

What is the difference between n8n expression syntax and code node JavaScript?

n8n expression syntax uses double curly braces {{ }} to inject dynamic values directly into node parameters, whereas code node JavaScript allows writing standalone scripts. Confusing the two leads to syntax errors when attempting to run complex logic inline within standard workflow nodes.

How do I use variables like $json, $node, $now, and $env in n8n workflows?

Use variables like $json, $node, $now, and $env in n8n workflows by wrapping them in curly braces such as {{$now}}. These core variables allow you to reference incoming data, previous node outputs, current timestamps, and environment variables respectively for dynamic content generation.

Why is my n8n expression not working when referencing another node's data?

n8n expressions fail when referencing another node's data if the node name is incorrect or the output structure is misunderstood. Validate node referencing by ensuring the target node has executed successfully and using the correct $node['NodeName'].json syntax to access its payload.

Can I use n8n expressions to dynamically generate content for automated emails?

Yes, you can use n8n expressions to dynamically generate content for automated emails by inserting variables like {{$json.body.email}} into node parameters. This ensures personalized data from previous workflow steps, such as webhook payloads, is accurately passed to email sending nodes.

Do I need to write custom JavaScript to manipulate webhook data in n8n?

You do not need to write custom JavaScript to manipulate webhook data in n8n if the transformation is simple. Expression syntax handles basic dynamic data access and string interpolation directly within node fields, preventing the need for a separate code node for straightforward variable replacements.