n8n-expression-syntax

Validate and teach n8n expression syntax with {{ }} patterns and core variables.

45|20|Updated Aug 31, 2024
One-click install
npx skills add https://github.com/richardadonnell/Upwork-Job-Scraper --skill n8n-expression-syntax-richardadonnell
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: n8n-expression-syntax
Source: https://github.com/richardadonnell/Upwork-Job-Scraper/tree/main/.agents/skills/n8n-expression-syntax
Command: npx skills add https://github.com/richardadonnell/Upwork-Job-Scraper --skill n8n-expression-syntax-richardadonnell

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps users write correct n8n expressions, preventing common errors like incorrect webhook data access or syntax mistakes, ensuring smooth workflow automation.

Core Features & Use Cases

  • Expression Validation: Understand and apply the correct {{ }} syntax for dynamic content.
  • Data Access Guidance: Learn how to correctly access webhook data (under .body), node outputs, and environment variables.
  • Error Prevention: Avoid 15 common mistakes with clear explanations and fixes.
  • Use Case: When configuring a webhook node in n8n, you need to extract a user's email address. This Skill guides you to use {{$json.body.email}} instead of the incorrect {{$json.email}}, preventing data access errors.

Quick Start

Use the n8n expression syntax skill to correctly access the 'name' field from webhook data.

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 correctly?

To access webhook data correctly in n8n expressions, reference the payload under the body object using {{$json.body.email}} instead of the incorrect {{$json.email}} pattern to prevent data access errors.

What is the correct syntax for n8n expressions when using dynamic variables?

The correct syntax for n8n expressions wraps dynamic variables in double curly braces like {{$json}} or {{$now}}, ensuring the workflow engine parses your dynamic content without syntax errors.

Why does my n8n workflow expression return undefined or fail?

Your n8n workflow expression fails when using incorrect syntax or accessing non-existent top-level fields, which can be fixed by validating expression patterns and using core variables like $json and $node correctly.

What is the difference between n8n expression syntax and Code node syntax?

n8n expression syntax uses {{ }} patterns to inject dynamic variables into node fields, while Code node syntax requires writing full JavaScript to manipulate data arrays and objects directly.

Can I use environment variables in n8n workflow expressions?

Yes, you can access environment variables in n8n workflow expressions using the {{$env}} variable pattern, allowing you to securely inject external configuration values into your automation workflows.

How do I reference output from a previous node in an n8n expression?

To reference output from a previous node in an n8n expression, use the {{$node}} variable combined with the node name and desired field, or use {{$json}} to access the incoming data directly.