Creates or updates named workflow variables that persist across all subsequent steps in the run. Unlike step outputs โ which are written once and never change โ variables can be set and overwritten multiple times during a single execution.
set_variableEvery step in a workflow produces output data, but that output is immutable: once written, it cannot be changed. Variables work differently. A variable is a named piece of data that any step can write and any later step can read. You can initialise a variable to zero, increment it inside a loop, and read the final value after the loop ends โ all using separate nodes.
The Set Variable node lets you define one or more variables in a single step. Each variable
has a name, a type, and a value. The value can be a static literal or a
{{ variable }} reference that pulls from a previous step's output.
{{ fetch.output.status }})
is always the data returned by that exact step and never changes. A variable (e.g.
{{ my_counter }}) is a shared slot that can be overwritten as many times as
needed. Use variables for values that evolve during execution.
The Set Variable node accepts an array of variable definitions. Add as many as you need in a single node rather than stacking multiple Set Variable nodes.
| Sub-field | Status | Description |
|---|---|---|
| Name | Required | The variable name. Use lowercase letters and underscores (e.g. email_count). The variable is then referenced throughout the workflow as {{ email_count }}. |
| Type | Required |
The data type of the variable. Choose one of:string โ textnumber โ integer or decimalboolean โ true or falsearray โ a list of valuesobject โ a key-value map
|
| Value | Required | The initial value. Can be a static literal or a {{ variable }} reference pointing to a previous step's output. For type number, entering 0 initialises a counter. For type array, entering [] creates an empty list. |
All variables set by this node are available immediately in subsequent steps. Access them directly by name, without a step key prefix:
You are looping over a list of orders and want to count how many are above a certain value.
init_vars) before the
Loop node. Define one variable:
{{ loop_step.current_item.total }} is greater than 100.
high_value_count by 1.