Skip to main content

Variable node

Variable

The Variable node sets a run-scoped value that downstream nodes can read. Use it for anything that needs to be computed once and referenced many times: a timestamp, a batch id, a threshold value read from a config source.

When to use

  • A downstream substitution or expression needs a single-value input that isn't on the row ({{ exec.runId }}, {{ exec.batchTimestamp }}).
  • You want to compute a value once (at run start) and reference it in many later nodes.
  • The value is shared across all rows for the run.

Ports

PortDirectionKindNotes
inindataOptional. When rows flow in, the expression can reference row columns.
outoutdataPass-through of the input rows.
erroroutcontrolFires on expression eval errors.
notifyoutcontrolNotification policy port.

Configuration

  • Name. The variable name (kebab / camel / snake — whatever fits your reference style downstream). No dots.
  • Value or expression. Literal, an expression via evalTransformExpr, or a row-derived value (row.customerId when input rows are present).
  • Scope.
    • once (default) — evaluate at run start; the value persists for the whole run.
    • per_row — evaluate per row; downstream sees the row-specific value.

Runtime behaviour

  • once scope: the executor evaluates the expression on the first pass and stores it in ctx.execVars. Downstream VAR("name") calls read from that map.
  • per_row scope: the value is stored in ctx.execVarsPerRow[nodeId] (or similar) so downstream can pick up per-row.
  • Multi-source guard: if a Variable node is reachable from multiple sources, the runtime rejects parallel dispatch and falls back to serial to avoid race conditions.

Failure modes

  • Duplicate name. The later Variable overwrites the earlier one; use unique names.
  • Multi-source with parallel dispatch. Rejected upfront; documented in the multi-source workflows runbook.