Variables are the values your flows read and write: the name a customer gives, the product they pick, an order number from an app, or a store address that stays the same in every flow. You put a variable into messages and step fields through its placeholder, and when the flow runs the value replaces the placeholder. You manage variables in one place on Bot flows › Variables.
Variable types
| Type | What it’s for |
|---|---|
| Flow only | What it’s forUsed only in the chosen flow; each chat carries its own value. For answers the customer gives in this flow. |
| Per contact | What it’s forUsed in every flow; the value is stored per contact. For remembering in one flow what you learned in another. |
| Constant | What it’s forThe same value in every flow, such as the store address or support hours. |
| On contact card | What it’s forWorks like per contact, and the value also shows on the contact card. |
| Secret | What it’s forStored encrypted and never shown again; only resolved in the Send HTTP request step. For API keys and passwords. |
| System | What it’s forFilled during the chat and can’t be edited. For example {{var_system.user_input}} is the customer’s last message, {{var_system.user_name}} their name, {{var_system.channel}} the channel and {{var_system.date}} today’s date. |
| Test | What it’s forThe output of steps you tested in the editor; you don’t create these yourself. |
Add a variable
- On Variables, select Add variable.
- Choose the Type.
- Enter a Name (for example “Order number”). The short name and placeholder are made from it and can’t be changed later.
- For Flow only, pick the flow in Flow.
- Choose the Data type (Text, Number or JSON) and, if you like, a Default value. It’s used until the flow sets a value. For Secret, you get a Secret value field instead.
- Select Save variable.
You can also create a variable from inside the editor: in a step’s Save result field (Save the reply in question steps), select New variable, type its name and select Create. A variable created this way belongs to that flow only.
Use a variable
- The placeholder is made of the variable’s type and short name: a flow-only variable named “Order number” becomes
{{var_local.order-number}}. The variable’s page shows the exact form in the Placeholder box. - In message and step fields, the Insert variable button lists variables by type and adds the placeholder of the one you pick.
- Question steps write the customer’s answer, and other steps write their result (such as a ChatGPT reply or a row found in a sheet), to the variable you choose.
- In Condition and Router steps, you compare a variable with a value to branch the flow.
The variable’s page
Click a variable in the list to open its page:
- Placeholder: what you write in messages.
- Default value: change it and select Save value. A number variable needs a number, and a JSON variable needs valid JSON.
- Secret value: the stored value isn’t shown; enter a new one and select Replace secret value.
- Flows using it: flows that use the variable in their draft or live version.
- Delete variable: deletes the variable and the values stored on contacts. This can’t be undone.