Variables let your workflows carry data between steps, loops, and branches. They handle things that are hard or impossible to do with step outputs alone. Use them to count items, accumulate lists, build up text, track state across conditional paths, or pass a value from one part of a workflow to another.
Every step in a workflow produces an output. Downstream steps can read those outputs directly using the variable selector ('{{'). For most workflows, such as "when a ticket is created, send a comment using the ticket's title", step outputs are enough, and you don't need a variable at all.
You need a variable when one of these is true:
Looping over a list and collecting something from each iteration: Each loop iteration overwrites the previous output. A variable persists across iterations.
Using If/Else or Router branches and needing a value after the branches merge: Outputs from a branch are not visible outside that branch. A variable set inside the branch is.
Counting something (how many tickets matched, how many retries happened): Step outputs can't be incremented. A variable can.
Building up a string: A variable with Append or Concatenate lets you add to it step by step.
If none of the above apply, stick to step outputs. They're simpler and don't need initialization.
Variables in Workflow Builder use two Control nodes:
Initialize Variable: Declares a variable: gives it a name, a type, and an optional starting value.
Set Variable: Updates an existing variable. It can overwrite it, increment it, append to it, or concatenate onto it.
Note:
Initialize Variable lives in the Controls section, and Set Variable lives in the Actions section of the node library.
A variable exists from the point it's initialized until the workflow run ends. Any step downstream of the Initialize Variable node can read or write it.
Drop an Initialize Variable node anywhere after your trigger. It doesn't take a runtime input. It just reserves the variable so later steps can use it.
Name: A unique name within this workflow. Use descriptive names like total_matching_tickets, customer_emails, summary_text.
Type: Text, Number (int/double), Boolean, Array, or a richer object type.
Multiple values: Toggle on to make it an array (list) of the chosen type.
Initial value (optional): The value the variable starts with. For counters, use 0. For accumulators, leave it unset or start with an empty string or list.
Variable names must be unique within a workflow. Creating two variables with the same name fails validation.
Types are fixed once declared. A Text variable can't be assigned a number later.
Initial value is optional. A variable with no initial value starts as empty (null, "", or [] depending on type).
Initialize early. Put Initialize Variable right after the trigger so every downstream step can see it.
One node, many variables. A single Initialize Variable node can declare multiple variables. You don't need one node per variable.
Name for intent, not type. running_total is better than number_var1.
Use Set Variable to update a variable's value during the run. The node picks the operation automatically based on the variable's type.
Set Value (default, any variable type): Overwrites the variable with the new value.
Increment (Number variables): Adds a number to the current value. Use negative numbers to decrement.
Append (Array variables): Adds the new value to the end of the array. If the incoming value is itself an array, its elements are spread into the array.
Concatenate (Text variables): Joins the new string onto the end of the current value.
The operation dropdown only shows options that are valid for the variable's type. For example, Increment doesn't appear on a text variable.
Variable: The variable to update. The list includes every variable initialized by any upstream Initialize Variable node.
Operation: One of Set Value, Increment, Append, or Concatenate (see above). Defaults to Set Value.
Value: The value to set, add, append, or concatenate. Can be a literal, a reference to a step output, or a reference to another variable.
If the variable was initialized without a starting value:
Increment starts from 0 and sets the variable to the increment amount.
Append starts with an empty array and adds the first element.
Concatenate starts with the first string.
So you can usually skip the initial value and still safely use Increment, Append, or Concatenate.
Once a variable is initialized, it shows up in the variable selector (the {{ shortcut, or the Insert variable button) of every step downstream of the Initialize Variable node.
Two ways to insert a variable:
Click Insert variable in any field's menu, and pick your variable from the Variables section.
Type '{{ ' in any text field and select the variable from the dropdown.
Any text field (comment bodies, URLs, HTTP bodies, AI prompts, email subjects).
Any condition's left or right side in an If/Else or Router.
Any input field on any node, as long as the variable's type matches the field's expected type.
A variable is only visible to steps that run after the Initialize Variable node.
A variable is visible to all branches (If/Else, Router) downstream of the Initialize Variable node. Branches can read it and write to it.