Node: Set Variable
How to use the Set Variable node to store and update temporary data while a workflow runs.
The Set Variable node stores one or more values in the workflow's context so later nodes can reuse them with {{$name}}. It's how a workflow keeps "memory" during a run — counting retries, saving a previous node's result, or building a message before sending it.
When to use it
- Save a calculated value (e.g. a discount) to reuse across several nodes.
- Keep a retry counter alongside an
Ifnode to break out of a loop. - Build dynamic messages by combining variables from different steps.
Configuration
Each row under "Assignments" has three fields:
- Name: the variable's name (without the
$sign — the system adds it automatically). - Value: the value to store. It accepts variables from other nodes, e.g.
{{$contact.name}}. - Operation:
- Set (default): overwrites the current value.
- Append: concatenates the new value onto the existing one (as text).
- Increment: adds the given value to the current number. If the value field is left empty, it adds 1 — perfect for retry counters.
You can add several rows in the same node to set multiple variables at once.
Example
A workflow retries an AI agent up to 3 times. On each pass, add a Set Variable node named attempts, operation Increment, empty value. A later If node breaks the loop once {{$attempts}} reaches 3.
Tips
- Variables set here survive even after a
Delaynode or a workflow pause/resume. - Use short, descriptive names:
attempts,discount,detected_language.
Troubleshooting
If a later node can't see the variable, check the name is spelled exactly the same (no stray spaces) and that the Set Variable node actually ran earlier on the same path.
Related articles
-
Build your first workflow
Omnifox workflows automate your operation: a trigger starts the automation and action nodes do the work. Build a welcome message in minutes.
-
Workflow triggers catalog
Learn which events can start a workflow automatically in Omnifox.
-
Action nodes available in workflows
Discover the actions a workflow can run automatically.
-
Conditions and branching (if/then) in a workflow
Make your flows take decisions and follow different paths based on each contact data.
-
Ready-to-use workflow templates
Start your automations in minutes from prebuilt flows you can customize.