Variables & Conditions
Learn how to store, manipulate, and use data in your workflows.
Variables
Variables store information collected during conversations. Use them to personalize responses and make decisions.
Creating Variables
Variables are automatically created when you:
- Use a Collect Input node (stores the user’s response)
- Use a Set Variable node
- Receive data from an API Call response
Variable Syntax
Reference variables using double curly braces:
Hello {{user.name}}! Your order {{order.id}} has been confirmed.Built-in Variables
These variables are always available:
| Variable | Description |
|---|---|
{{user.id}} | Unique user identifier |
{{user.name}} | User’s name (if provided) |
{{user.email}} | User’s email (if provided) |
{{conversation.id}} | Current conversation ID |
{{message.text}} | Latest user message |
Custom Variables
Create your own variables to store:
- User inputs from Collect Input nodes
- API response data
- Calculated values from Set Variable nodes
Example workflow variables:
{{customer_email}}— collected via Collect Input{{selected_plan}}— from Quick Replies selection{{api_response}}— from API Call result
Conditions
Conditions let you branch your workflow based on variable values.
Comparison Operators
| Operator | Description | Example |
|---|---|---|
equals | Exact match | {{status}} equals "active" |
not equals | Not matching | {{plan}} not equals "free" |
contains | Substring match | {{message}} contains "help" |
greater than | Numeric comparison | {{amount}} greater than 100 |
less than | Numeric comparison | {{quantity}} less than 5 |
exists | Has a value | {{email}} exists |
not exists | No value | {{phone}} not exists |
Using Conditions
In a Condition node:
- Add one or more conditions
- Each condition creates a branch
- The first matching condition’s branch is followed
- Always include a default branch for unmatched cases
Condition Examples
Route by user plan:
{{plan}} equals "premium" → Premium support flow
{{plan}} equals "free" → Basic support flow
Default → General flowCheck if email provided:
{{user.email}} exists → Personalized greeting
Default → Ask for emailNumeric comparison:
{{cart_total}} greater than 100 → Offer free shipping
Default → Standard checkoutBest Practices
- Use descriptive names:
customer_emailinstead ofe - Validate input: Use validation in Collect Input nodes
- Handle edge cases: Always include default branches
- Test thoroughly: Check all condition branches work correctly
Last updated on