Skip to main content

Variable node

Variable

What it does​

The Variable node sets one or more variables for the current run. Later nodes read them in templates, such as file paths and text fields, and in expressions in Transform, Filter and Router nodes. Rows pass through the node unchanged.

When to use​

  • A value is computed once and used in many places: a run id, a file name, a date stamp, a threshold.
  • A file path or message needs a value that is not on the row.
  • A value read from the first row of a reference source is used by every later row.

Configure​

Select the node and open Configure Variables. Each row under Assignments is one variable. Press Add variable to add a row.

Save and Done stay unavailable while a required setting is missing. Cancel discards the changes made since the dialog opened or was last saved. A message confirms each save.

ColumnMeaning
KeyThe variable name. Letters, digits, _, . and -; spaces become _.
Typestring, number, boolean, date, json or secret. The value is converted to this type.
Modeliteral stores the text as typed. expr evaluates an expression, such as SYS('execution.id'). Click the button to switch.
Value / ExpressionThe literal value or the expression. An expression can read columns of the first incoming row.
Set1x sets the variable the first time the node runs and keeps it for the rest of the run. per row sets it again each time rows pass through the node.

Reading a variable

WhereSyntax
Templates (paths, text fields)/in/{{var.exec.sftp_file}}
Expressions (Transform, Filter, Router)VAR("exec.sftp_file")

vars.exec.* is accepted as an alias for var.exec.*.

Ports​

PortDirectionKindNotes
inindataOptional. Rows an expression can read from.
outoutdataThe input rows, unchanged.
erroroutcontrolReceives the input rows when the node fails.

Examples​

Name an export file after the run. Start > Variable with Key export_name, Mode expr, Value CONCAT("export_", SYS("execution.id")). A later Load node writes to /out/{{var.exec.export_name}}.csv.

A threshold for a Filter. Variable with Key min_amount, Type number, Mode literal, Value 500. A Filter downstream in Expression mode keeps rows where GT(amount, VAR("exec.min_amount")) is true.

Troubleshooting​

SymptomCauseWhat to do
A template shows an empty valueThe key is misspelled, or the reading node ran before the Variable node.Check the key, and place the Variable node upstream of the node that reads it.
A variable keeps its first valueSet is 1x.Choose per row.
A key is ignoredThe key starts with a digit or holds other characters.Start the key with a letter or _.
Several Sources run one at a timeA Variable node is reachable from more than one Source, so they run in sequence to keep the value consistent.No action needed.