Skip to main content

Update Variable Node

The Set Variable node saves information so you can use it later in your workflow. Think of it like writing something down on a sticky note so you don’t forget it.

When to Use

  • Remember something - Save an AI response to use in multiple places
  • Collect results - Build a list of results as you loop through items
  • Track progress - Keep track of counts or status
  • Give things names - Create easy-to-remember names for complex data
  • Save between runs - Some variables can persist even after the workflow ends
  • Save different things based on conditions - Store different values depending on what happened

Example: Store Processing Results

Save LLM analysis results for use in multiple downstream nodes:
1

Analyze with LLM

Use an LLM node to analyze incoming data and return structured results.
2

Store the results

Add a Set Variable node:
  • Variable name: analysisResults
  • Value: {{llm_1.response}}
  • Scope: execution
3

Use in multiple places

Reference {{set_variable_1.value}} in subsequent nodes:
  • Send to CRM
  • Include in Slack notification
  • Add to spreadsheet
Why this helps:
  • Cleaner references: {{set_variable_1.value.score}} vs {{llm_1.response.score}}
  • Parse JSON once, use everywhere
  • Clear documentation of what data means

Example: Accumulate Loop Results

Collect results from each loop iteration:
├── Set Variable (processedItems = [], initialize empty array)
├── Loop (over incoming items)
│   ├── LLM (process each item)
│   └── Set Variable (processedItems, append {{llm_1.response}})
└── External API (Slack: Post summary of {{set_variable_1.value.length}} items)
Configuration for accumulation:
  • Variable name: processedItems
  • Value: {{llm_1.response}}
  • Operation: append
Each iteration adds to the array.

Example: Persistent Counter

Track how many times a workflow has run: Configuration:
  • Variable name: runCount
  • Value: 1
  • Operation: increment
  • Scope: application (persists between runs)
Access the count: {{set_variable_1.value}} Use this for:
  • Rate limiting
  • Usage tracking
  • Triggering actions after N runs

Example: Conditional Storage

Store different values based on conditions:
├── LLM (analyze email sentiment)
├── Condition (sentiment == "negative")
│   ├── Met: Set Variable (priority = "high")
│   └── Unmet: Set Variable (priority = "normal")
├── Merge
└── External API (create ticket with priority = {{set_variable_1.value}})
Both branches set the same variable name, and Merge waits for whichever branch executes.

Two Ways to Save Variables

During This Run Only (Default)

Most variables only exist while your workflow is running:
Run 1: Save counter = 5
Run 2: counter doesn't exist (starts fresh again)
Good for:
  • Temporary calculations
  • Storing results while working
  • Most everyday use cases

Remember Between Runs

Some variables can be remembered even after the workflow ends:
Run 1: Save totalProcessed = 100
Run 2: Add 1 to totalProcessed → 101
Run 3: Read totalProcessed → 101
Good for:
  • Counting things over time
  • Remembering when something last happened
  • Settings that rarely change
Persistent variables are shared between all runs. If your workflow runs multiple times at once, they might conflict. Use “during this run only” when possible.

Operations

Set (Replace)

Replace the entire value:
Before: items = ["a", "b"]
Set: items = ["x", "y", "z"]
After: items = ["x", "y", "z"]

Append (Arrays)

Add an item to an existing array:
Before: items = ["a", "b"]
Append: "c"
After: items = ["a", "b", "c"]

Increment (Numbers)

Add to an existing number:
Before: count = 5
Increment: 3
After: count = 8
Works with negative values for decrementing.

Merge (Objects)

Combine objects, with new values overwriting:
Before: config = {host: "old", port: 80}
Merge: {host: "new", timeout: 30}
After: config = {host: "new", port: 80, timeout: 30}

Accessing Variables

From the Same Run

Use the Set Variable node’s output:
{{set_variable_1.value}}
{{set_variable_1.value.propertyName}}

Application Variables

Application-scoped variables can be referenced by name:
{{variables.runCount}}
{{variables.lastProcessedId}}

Tips

Initialize variables at the start of your workflow before loops or conditional branches. This ensures the variable exists regardless of which path executes.
Use descriptive variable names that explain the data’s purpose: qualifiedLeads is better than data1.
Store structured objects rather than multiple individual variables when data is related:
{
  "customer": {
    "name": "...",
    "email": "...",
    "tier": "..."
  }
}
Don’t use Set Variable inside a loop if you just need the final result. Each iteration overwrites the previous value. Use append to collect all results.

Settings

name
string
default:"Set Variable"
What to call this node (shown on the canvas).
key
string
default:"set_variable_1"
A short code to reference this node’s value.
variableName
string
required
What to call the variable. Use clear names like customerEmail or totalAmount.
value
any
required
What to save. Can be typed directly, or pulled from a previous node.
scope
string
default:"execution"
How long to keep the variable:
  • execution - Only during this run (default, use this most of the time)
  • application - Remember it even after the workflow ends
operation
string
default:"set"
What to do with the value:
  • set - Replace whatever was there before
  • append - Add to an existing list
  • increment - Add to an existing number
  • merge - Combine with an existing object

Outputs

value
any
The value that was stored.
previousValue
any
The previous value (useful for tracking changes).
variableName
string
The name of the variable that was set.