Docs
Sign in

Set Variable

Set Variable saves a value under a name so that other nodes can read it later.

Screenshot to add: The Set Variable settings panel with Variable name, Value expression and Scope.

When to use it

Use it when a value is needed several steps later, or in more than one place, and you do not want to wire it through every node in between.

Settings

FieldWhat it doesNotes
Variable nameName of the workflow variable to setPlaceholder my_variable
Value expressionThe value to saveA Jinja2 expression. Placeholder {{ _prev_output.field_name }}
ScopeHow far the variable reachesWorkflow (persists across nodes) (default) or Node (local to this execution)

Inputs and outputs

  • One input at the top and one output at the bottom.
  • Read the value with Get Variable, using the same name.

Example

Illustrative. Set Variable name to customer_id and Value expression to {{ _prev_output.id }}. A later Get Variable node reads customer_id.

Tips

  • Use clear names. The variable name is how you find the value again.
  • Keep Scope on Workflow if another node needs the value.