Skip to main content
cesteralDocs
FAQContact

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

FieldTypeDescription
assignmentsarrayList of variable assignments (see below)
passThroughbooleanPass input records through unchanged (default: true)

Assignment Properties

PropertyTypeDescription
namestringVariable name. Must start with a letter or underscore
sourcestatic | field | expression | count | first | lastHow the value is derived
valuestringStatic value (required when source is static)
fieldstringField to read (required when source is field, first, or last)
expressionstringExpression to evaluate (required when source is expression)

Sources

  • static — a fixed value entered at design time.
  • field — the value of field across rows: the single value if every row agrees, otherwise the array of values.
  • count — the number of input rows.
  • first / last — the field value 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 to false to emit nothing.
  • An expression that fails to evaluate resolves to null and 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.