n8n-expressions

Generate n8n expression guidance for JavaScript-based {{...}} logic and node references.

421|46|Updated Apr 20, 2026
One-click install
npx skills add https://github.com/n8n-io/skills --skill n8n-expressions
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: n8n-expressions
Source: https://github.com/n8n-io/skills/tree/main/skills/n8n-expressions
Command: npx skills add https://github.com/n8n-io/skills --skill n8n-expressions

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

n8n expression errors and brittle data references waste time by producing wrong or non-deterministic results when workflows branch, refactor, or clear item context.

Core Features & Use Cases

  • Node-name references over $json: Use $('Node Name').item.json.field to keep data stable across refactors, branching, and context-clearing nodes.
  • Safe, maintainable expression patterns: Prefer Luxon for date math, inline expressions in consumers instead of extra nodes, and format multi-line logic with comments.
  • Correct iteration behavior: Use executeOnce appropriately when leveraging $source.all().map/filter/reduce aggregations inside expressions.
  • Type-safe returning with ={{ ... }}: Ensure objects/arrays/booleans/numbers aren’t accidentally treated as strings when fields require structured types.

Quick Start

Ask for expressions that reference upstream nodes by name, use Luxon for date operations, and avoid $json in branched workflows so the result remains correct after refactors.

Frequently Asked Questions about n8n-expressions

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

FAQPage Schema
How do I reference data from previous nodes in n8n expressions without breaking during refactors?

To write stable n8n expressions, use node-name references like $('Node Name').item.json.field instead of $json. This ensures cross-node value access remains correct when workflows branch, refactor, or clear item context.

What is the best way to handle date math and formatting in n8n workflows?

The best way to handle date math in n8n workflows is using Luxon operations inside your expressions. Inline Luxon date logic directly in consumer nodes to avoid adding extra processing nodes and maintain workflow reliability.

Why does my n8n expression return a string when I expect an object, array, or number?

Your n8n expression returns a string because fields requiring structured types need proper typing. Use the ={{ ... }} syntax to ensure objects, arrays, booleans, and numbers aren't accidentally treated as strings.

How do I aggregate data from multiple items in an n8n expression using $source.all()?

To aggregate data with $source.all().map/filter/reduce in n8n expressions, use executeOnce appropriately. This ensures correct iteration behavior and prevents non-deterministic results when leveraging $input.all() or $('Node').all() aggregations.

When should I avoid using $json in n8n workflow expressions?

You should avoid using $json in branched n8n workflows or before context-clearing nodes. Relying on $json produces brittle data references; use $('Node Name').item.json instead to keep data access stable across branching.