n8n Expressions Explained: The Complete Guide to Dynamic Data (2025)

Static workflows only get you so far. The moment you want a node to use data from an earlier step — a name, a date, a calculated value — you need expressions. They're the single most important n8n skill to learn, and once the syntax clicks, everything else gets easier. Here's the practical guide.

What n8n expressions actually are

An expression is a small piece of JavaScript that n8n evaluates at runtime, wrapped in double curly braces: {{ }}. Anywhere you see a field with the 'expression' toggle, you can drop one in to pull live data instead of typing a fixed value.

The most common use is referencing another node's output. n8n exposes previous data through helpers like $json (the current item's data) and $('Node Name').item.json.fieldName (data from a specific earlier node). If you can read those two patterns, you can wire almost any workflow together.

The syntax you'll use every day

A handful of patterns cover most real work. Access a field on the incoming item: {{ $json.email }}. Pull from a named node: {{ $('Webhook').item.json.body.name }}. Combine text: {{ 'Hi ' + $json.firstName + ', welcome!' }}. Provide a fallback when data might be missing: {{ $json.company || 'there' }}.

Dates trip everyone up, so learn these early. n8n ships the Luxon library, so you can write {{ $now.toFormat('yyyy-MM-dd') }} for today's date or {{ $now.plus({days: 7}).toISO() }} to schedule something a week out. That one pattern powers reminders, follow-ups, and expiry logic across countless workflows.

Don't want to write expressions from scratch?

An AI workflow builder that turns plain English into ready-to-import n8n JSON — expressions included.

Get the n8n template on Gumroad →

Common patterns and gotchas

String cleanup is constant in automation. {{ $json.email.trim().toLowerCase() }} normalizes messy input; {{ $json.phone.replace(/[^0-9]/g, '') }} strips a phone number to digits. For conditionals inside a field, a ternary is your friend: {{ $json.score > 80 ? 'hot' : 'nurture' }}.

The biggest gotcha is referencing a field that doesn't exist, which throws an error and stops the run. Guard against it with || fallbacks or optional chaining (?.), and use the expression editor's live preview — it shows the evaluated result as you type, so you catch mistakes before you ever execute the workflow.

Final thoughts

Expressions are the difference between rigid, one-off automations and workflows that adapt to real data. Learn the handful of patterns above — node references, dates, string cleanup, and conditionals — and you'll be able to build almost anything n8n can express.

Ready to automate? Skip the build.

This exact workflow is packaged, documented, and ready to import into your n8n instance.

Get the n8n template on Gumroad →