n8n-expression-syntax

Validate and correct n8n expression syntax for webhook data access.

Updated Feb 24, 2026
One-click install
npx skills add https://github.com/iTzFaisal/n8n-mcp-skills --skill n8n-expression-syntax-itzfaisal
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: n8n-expression-syntax
Source: https://github.com/iTzFaisal/n8n-mcp-skills/tree/main/.opencode/skills/n8n-expression-syntax
Command: npx skills add https://github.com/iTzFaisal/n8n-mcp-skills --skill n8n-expression-syntax-itzfaisal

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This Skill helps users write correct n8n expressions, troubleshoot errors, and understand the nuances of accessing data within workflows, especially webhook data.

Core Features & Use Cases

  • Correct Syntax Guidance: Learn the proper format for n8n expressions ({{ }}).
  • Data Access: Understand how to use $json, $node, $now, and $env variables.
  • Webhook Data Handling: Master the critical pattern of accessing webhook data via $json.body.
  • Error Troubleshooting: Identify and fix common expression mistakes.
  • Use Case: When building an n8n workflow that receives data from a webhook, you need to correctly reference fields like {{$json.body.email}} instead of {{$json.email}} to avoid errors. This skill teaches you exactly that.

Quick Start

Use the n8n expression syntax skill to learn how to correctly access data from a webhook payload.

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 data in n8n expressions without getting an error?

Access webhook data in n8n expressions by referencing the nested payload structure using `{{$json.body.field_name}}`. Directly calling `{{$json.field_name}}` fails because webhook payloads are wrapped inside the `body` object, so you must explicitly traverse `body` to retrieve values correctly.

What is the correct syntax for n8n expressions when referencing workflow variables?

The correct syntax for n8n expressions requires wrapping variables in double curly braces `{{ }}`. You can reference workflow data using variables like `$json`, `$node`, `$now` for timestamps, and `$env` for environment variables to dynamically inject values into node parameters.

Why does my n8n expression return undefined when I try to map $json data?

Your n8n expression returns undefined when the data structure does not match your reference path. If you are working with webhook data, you must access fields via `$json.body` instead of `$json` directly, ensuring the expression path matches the incoming JSON payload structure.

Can I use environment variables directly inside n8n expression syntax?

Yes, you can use environment variables inside n8n expression syntax by wrapping them in `{{$env.VARIABLE_NAME}}`. This allows you to securely inject credentials and configuration values into your workflow without hardcoding sensitive data directly into the node parameters.

What are the common limitations and pitfalls when writing n8n expressions?

Common limitations of n8n expressions include failing to use `{{ }}` braces, incorrectly accessing webhook payloads via `$json` instead of `$json.body`, and referencing undefined `$node` names. Understanding these structural constraints is essential to avoid workflow execution errors.