Variable node
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
| Port | Direction | Kind | Notes |
|---|---|---|---|
in | in | data | Optional. When rows flow in, the expression can reference row columns. |
out | out | data | Pass-through of the input rows. |
error | out | control | Fires on expression eval errors. |
notify | out | control | Notification 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.customerIdwhen 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
oncescope: the executor evaluates the expression on the first pass and stores it inctx.execVars. DownstreamVAR("name")calls read from that map.per_rowscope: the value is stored inctx.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.