Set Variable Node
Compute named values from static input, fields, or expressions and store them on the automation
Last updated 8 Oct 2026
The Set Variable node computes one or more named values and stores them on the automation run. Each assignment can be a static value, a field pulled from the data, an aggregate over all rows, or a computed expression. By default the node passes its input records through unchanged.
When to Use
Use Set Variable to capture run-level values — a row count, a max or sum over the dataset, the first row's ID, or a computed flag — that you want to compute once and reference later. For per-record field reshaping, use Transform instead.
Configuration
| Field | Type | Description |
|---|---|---|
assignments | array | List of variable assignments (see below) |
passThrough | boolean | Pass input records through unchanged (default: true) |
Assignment Properties
| Property | Type | Description |
|---|---|---|
name | string | Variable name. Must start with a letter or underscore |
source | static | field | expression | count | first | last | How the value is derived |
value | string | Static value (required when source is static) |
field | string | Field to read (required when source is field, first, or last) |
expression | string | Expression to evaluate (required when source is expression) |
Sources
- static — a fixed value entered at design time.
- field — the value of
fieldacross rows: the single value if every row agrees, otherwise the array of values. - count — the number of input rows.
- first / last — the
fieldvalue from the first or last row (or the whole row if no field is given). - expression — a computed expression (see below).
Expressions
The expression source uses the automation expression engine (${ … }):
${count} → row count
${sum:revenue} → sum of a numeric field
${avg:score} → average of a field
${first.id} → first row's id
${now.format('yyyy-MM-dd')} → formatted current date
${revenue * 1.1} → arithmetic
${tier === 'gold' ? 'A' : 'B'} → conditional
${node["Upload"].count} → reference another node's output
Example
Capture run-level context:
assignments:
- name: rowCount
source: count
- name: totalRevenue
source: expression
expression: "${sum:revenue}"
- name: campaignName
source: static
value: "Spring Outreach 2026"
passThrough: true
Notes
- Assignments are stored on the automation run's variable context and are also reported in run metadata.
- With
passThrough: true(the default) the node emits its input records unchanged; set it tofalseto emit nothing. - An expression that fails to evaluate resolves to
nulland logs a warning rather than failing the run. - To reference computed values in a downstream node, use the same
${ … }expression syntax — including${node["NodeName"].field}to read another node's output.
Related articles
Still stuck? Browse the FAQ or contact us.