Theme
Set Variable Node
The Set Variable node assigns a value to a session variable. The variable is then available to all subsequent nodes in the flow. This is the most direct way to store, transform, or initialize data during a conversation.
When to Use
- You need to store a piece of data for use later in the flow (e.g., a greeting, a flag, a counter).
- You want to transform or reformat a value from one variable into another.
- You need to initialize a variable before a loop or condition check.
- You want to copy or combine values from multiple variables.
Configuration
| Property | Description | Default |
|---|---|---|
| Variable Name | The name of the variable to set (e.g., greeting, retry_count, is_authenticated). | Empty |
| Value Type | How the value is determined: static, expression, or from_variable. | static |
| Value | The value to assign. Interpretation depends on the value type. | Empty |
Set Variable node config panel showing variable name input, value type dropdown with static/expression/from_variable options, and the value field
Value Types
Static
A literal value. The variable is set to exactly what you type.
Variable: greeting
Value Type: static
Value: Welcome to Acme Support!Expression
A template string that can reference other variables using {{variable}} syntax.
Variable: welcome_message
Value Type: expression
Value: Hello {{user_name}}, welcome back to {{company_name}}!Expressions also support dot notation for nested properties:
Variable: order_status
Value Type: expression
Value: {{order_details.status}}From Variable
Copies the value of another variable directly.
Variable: backup_email
Value Type: from_variable
Value: user_emailCommon Use Cases
Setting a Flag
Use a boolean-like variable to track state:
Variable: is_verified
Value: trueThen check it later with a Condition node.
Initializing a Counter
Set a counter before a loop:
Variable: attempt_count
Value: 0Storing Extracted Data
After an API Call, extract and rename a field:
Variable: customer_name
Value Type: expression
Value: {{api_response.data.customer.full_name}}Building a Summary
Combine multiple variables into a single string for handoff context:
Variable: context_summary
Value Type: expression
Value: Customer: {{user_name}}, Account: {{account_number}}, Issue: {{issue_description}}TIP
Use clear, descriptive variable names. Prefer order_status over os, and retry_count over rc. Other team members (and your future self) will thank you when reading the flow.
Variable Lifetime
Variables set by this node persist for the duration of the conversation session. They are:
- Available to all subsequent nodes in the current flow.
- Preserved when execution moves to another flow via the Go to Flow node.
- Discarded when the conversation ends (timeout, explicit end, or handoff completion).
WARNING
Do not store sensitive data like passwords or full credit card numbers in session variables. They appear in conversation transcripts and debug logs. Use the platform's secure input features for PII collection.
Handles
| Handle | Direction | Description |
|---|---|---|
| Input | In | Receives execution from the previous node |
| Output | Out | Continues to the next node after the variable is set |
