Skip to main content

Expressions

Expressions let a node field use dynamic values: the output of earlier nodes, the trigger payload, workflow variables, secrets, the current time, and more. They are written in JavaScript and wrapped in double curly braces:

Hello {{ $trigger.body.firstName }}, your order {{ $nodes['Create Order'].id }} is confirmed.

Insert data without writing expressions​

You rarely have to type an expression yourself. In any text field of a step:

  1. Click + Data at the end of the field, or type {{.
  2. The data picker lists the steps that run before this one, closest first, with their fields and a sample value from the last run (or pinned data). Steps that haven't run yet show the fields their output will have. Variables, secrets and the current date, time and run are listed too.
  3. Type to search across all fields and sample values, use ↑ / ↓ to move, → / ← to open and close a group and Enter to insert. Esc closes the picker.

The field shows the inserted data as a chip such as Get rows › rows › item 1 › email. Behind it is the same expression you could have typed ({{ $nodes['Get rows'].rows[0].email }}); hover a chip to see its last value and expression, click it to pick another field, or press × to remove it. Lists show the fields of their first item (item 1).

To write an expression by hand (calculations, helpers), click (Edit as expression) next to the field; click it again to go back to the simple view. You can also drag a field from the node panel's Input pane onto a field.

Long-text fields (a message or email body, an AI prompt, a webhook response) are multi-line: Enter adds a line break, Ctrl / ⌘ + Enter applies the step’s changes, and the field grows to about ten lines, then scrolls (drag its corner to make it taller). Line breaks are kept exactly as you type them, in the preview and in the run. In one-line fields Enter does nothing, and pasted line breaks become spaces.

Templates and single expressions​

Template. Text with one or more {{ }} blocks. Each block is evaluated and inserted into the text, and the result is always a string:

https://api.example.com/users/{{ $nodes['Get User'].id }}/orders?since={{ $today.toISODate() }}

Single expression. The whole field is one {{ }} block (surrounding spaces are fine). The result keeps its type: a number stays a number, an object stays an object, an array stays an array, a file stays a file. Use this when a field expects something other than text, such as a JSON body, a list or a file:

{{ $nodes['Fetch Orders'].body.items }}

When a value is inserted into text:

ValueInserted as
String, number, booleanAs is: Total: {{ 2 * 21 }} → Total: 42
Object or arrayJSON: User: {{ $nodes.A.user }} → User: {"id":7,"tags":["x","y"]}
Date ($now, $dt(...))ISO 8601 timestamp
null or undefinedEmpty text: [{{ null }}] → []

What you can use​

RootWhat it holds
$nodes['Node name']Output of an earlier node
$status['Node name']Whether an earlier node succeeded
$triggerThe payload that started the run
$varsWorkflow variables
$secretsProject secrets
$inputsInputs of a sub-workflow or building block
$execution, $workflowThe current run and workflow
$now, $todayThe current time, and midnight today (UTC)
$itemThe current element in a Transform array mapping

Plus helper functions: $dt, $jmespath, $if, $ifEmpty, $min, $max, $sum, $uniq and $groupBy.

See Context variables and Helper functions for details.

Writing expressions in the editor​

Fields that accept expressions offer several ways to build them:

  • Pick a value. Open the expression picker to browse earlier steps' fields, variables, secrets and helpers, and click one to insert it. Inserted expressions appear as chips; click a chip to change it.
  • Drag to map. Drag a field from the Input pane of the node panel onto a parameter to insert the matching expression.
  • Type with autocomplete. In the code editor, typing $ suggests the available roots and helpers, and $nodes[' suggests node names. Hover a name to see its description.
  • Preview. The editor evaluates the expression with the real engine and shows the result and its type, or the error with its line and column.
  • Generate with AI. Click the wand icon (Generate expression with AI), describe what you need, for example "the customer email from the webhook, lower-cased", and insert the result.

Errors​

Expressions are checked in the editor and again when you publish. The editor reports:

  • Syntax errors, with the position, for example Expression '{{ 1 + * 2 }}' in field 'url' on node 'HTTP Request' is not valid JavaScript (line 1, column …): SyntaxError: …
  • Unknown roots, for example a typo like $node instead of $nodes.
  • Unknown node names in $nodes['…'] or $status['…'].

If an expression fails while the workflow runs (for example reading a property of undefined), the node fails with the JavaScript error, such as a TypeError, and the line and column where it happened. You can handle that like any other node error: see Error handling.

Limits​

Each expression runs in its own sandboxed JavaScript engine (Jint). Nothing is shared between evaluations, and there is no access to the network, the file system or timers.

LimitValue
Memory16 MB
Run time2 seconds
Recursion depth64
Statements1,000,000

An expression that exceeds a limit fails with a message such as Expression timed out. These are the limits on Blokkio Cloud.

For longer logic, use a Code node.

Next steps​