Skip to main content
Image
Available on all channels. The Set Variable block does not render anything to the user.
The Set Variable blocks lets you set a value into a variable. Useful when you are performing mathematical operations in your chatbot flow.

Using the Set Variable block

Use the Set variable block when you need to:
  • Set a default value
  • Reset a variable
  • Store a value for later use
  • Set a flag for a condition
  • Update a counter
  • Modify an existing value
  • Prepare a value for an API request
  • Set multiple variables at once
1

Add the block

Drag the Set variable block onto the canvas and connect it to the next block in your flow.
2

Select a variable

Under Variable, select the variable you want to update.
3

Enter a value

Under Value, enter the value that you want to assign to the selected variable.The value can be a static value, another variable, or an expression where supported.
Use Set variable when the value is determined by the flow. Use Collect input when the value needs to come from the user, and Set AI when the value needs to be generated using AI.

Configurations

Variable

Select the variable that you want to update. For example:
The selected variable is updated with the value configured in the Value field.

Value

Specify the value that you want to assign to the selected variable.
Assign a fixed value.

Operations

Use operations to modify a value before assigning it to a variable. For example, increment a counter:
Or concatenate text values:
The operations available depend on the variable type and the options supported in the Set variable configuration.

Multiple assignments

Use multiple assignments when you need to update several variables in the same block. For example:
This is useful when you need to initialize or reset multiple variables at the same point in the flow.

Some examples

Here are some examples on the use of Set variable block. Set a default value: to assign a default value to a variable.
The customer_type variable can then be used later in the flow. Reset counter: to initialize or reset a counter.
You can later increment the counter when required:
The updated value can then be used in a condition to control the flow. Set a flag: Use a variable as a flag to control the flow.
A later Condition block can check the value of is_verified and route the flow accordingly. Prepare a value for an API request: to prepare a value before making an API request.
The customer_type variable can then be used in the request payload or parameters of a subsequent API call.

Output paths

The Set variable block has a single output path. After the variables are assigned, the flow continues to the next connected block.
Last modified on October 22, 2026