🇪🇸 Español 🇬🇧 English 🇧🇷 Português

Node: Set Variable

How to use the Set Variable node to store and update temporary data while a workflow runs.

Jul 11, 2026

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 If node 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 Delay node 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.

Was this helpful?

Related articles