If / Else
The If / Else node allows a Workflow to choose which path to follow based on a condition.
Use it when your Workflow needs to make a decision based on information collected or produced by a previous node.
For example, you can ask a user to select a department with User Feedback, then use If / Else to send the conversation to the appropriate path.
Add the If / Else node from the Logic section of the node list.
The If / Else node only decides which path runs next. It does not ask the user a question, search a Knowledge Base, or generate an AI response.
How If / Else Works
When a message reaches the If / Else node, the Workflow evaluates the configured conditions in order.
The evaluation works as follows:
- The If condition is checked first.
- If the If condition is true, its connected path runs.
- If the If condition is false, the Workflow checks the next Else if condition.
- Else if conditions are checked in the order they appear.
- If none of the conditions are true, the Else path runs.
Only one path runs for each execution.
For example:
Start
↓
User Feedback
↓
If / Else
├── Billing → Billing Agent
├── Pricing → Pricing Agent
└── Else → General SupportIf the user selects Billing, only the Billing path runs. The other paths are ignored.
When to Use If / Else
Use If / Else when the Workflow needs to make a decision based on a previous result.
Common examples include:
- Routing users based on their selected department.
- Handling different user choices.
- Checking whether a previous node succeeded or failed.
- Sending different responses based on an Agent result.
- Creating different paths based on Knowledge Base or other node output.
A common setup is:
Start → User Feedback → If / ElseFor example, ask:
What do you need help with?Then create conditions for:
- Billing
- Pricing
- General support
Add and Connect If / Else
To add an If / Else node:
- Open the Workflow canvas.
- Find If / Else under Logic.
- Add the node.
- Connect the previous node to If / Else.
- Configure the conditions.
- Connect each condition handle to the appropriate next node.
Example:
Start
↓
User Feedback
↓
If / Else
├── Billing → Agent
├── Pricing → Agent
└── Else → EndThe If / Else node has one incoming connection.
Each condition on the right side has its own outgoing handle.
Configure If / Else
Select the If / Else node to open its configuration.
When the node is not configured, it shows Add.
After configuration, the node displays a summary of the configured conditions. Select View / Edit to update them.
The configuration dialog contains:
- If
- Else if conditions
The Else branch does not have configuration fields. It is automatically available as the fallback branch on the canvas.
If Condition
The If condition is the first condition checked by the Workflow.
The If condition contains two fields:
Condition Label
The Condition Label is the name displayed on the branch handle on the canvas.
For example:
BillingThe label is for identifying the branch and is not shown to the end user.
The Condition Label is required.
Expression
The Expression defines the condition that must evaluate to true or false.
For example:
{user_answer} == 'BILLING'The Expression is required.
Type
/inside the Expression field to insert available values and operators.
Else If
Use Else if when you need to check additional conditions after the first If condition.
For example:
If: {user_answer} == 'BILLING'
Else if: {user_answer} == 'PRICING'
Else: FallbackThe Workflow checks the Else if conditions in the order they appear.
To add another condition, select + Add Else If Block.
Each Else if block contains:
- Condition Label
- Expression
You can remove an Else if condition when it is no longer needed.
The Else if condition is checked only when all conditions above it are false.
Else
The Else branch is the fallback path.
It runs when none of the configured If or Else if conditions are true.
The Else branch does not have an Expression because it represents every remaining case.
For example:
If: {user_answer} == 'BILLING'
Else if: {user_answer} == 'PRICING'
Else: All other answersUse Else when you want to make sure unmatched cases have a defined path.
Expressions
An Expression compares a value from a previous step with a value you expect.
For example:
{user_answer} == 'BILLING'Text values should be enclosed in quotes.
Available Values
| Value | Description |
|---|---|
{previous_output} | Result produced by the node immediately before If / Else |
{previous_status} | Status of the previous node, such as success or failure |
{user_answer} | Answer provided through User Feedback |
{user_question} | Question asked by the User Feedback node |
{user_answer_list} | List of selected answers |
input.{field} | A field from an Agent Output Schema |
Operators
You can use / in the Expression field to insert supported values and operators.
Comparison operators
==!=>>=<<=
Logic operators
&&||?
Expression Examples
Route Based on User Feedback
If the user selects Billing:
{user_answer} == 'BILLING'If the user selects Pricing:
{user_answer} == 'PRICING'Match Multiple Choices
You can use || when more than one value should use the same path:
{user_answer} == 'BILLING' || {user_answer} == 'INVOICES'This condition is true when the answer is either BILLING or INVOICES.
Check Previous Node Status
You can also route based on whether the previous node succeeded or failed.
For example:
{previous_status} == 'failed'This can send failed executions to a recovery or fallback path.
To check for a successful result:
{previous_status} == 'success'User Feedback and If / Else
One of the most common uses of If / Else is with User Feedback.
For example:
Start
↓
User Feedback
↓
If / Else
├── Billing → Billing Agent
├── Pricing → Pricing Agent
└── Else → General AgentSuppose User Feedback has these options:
| Label | Value |
|---|---|
| Billing | BILLING |
| Pricing | PRICING |
Your conditions should compare against the Value, not the Label.
For example:
{user_answer} == 'BILLING'not:
{user_answer} == 'Billing'The condition must match the option Value exactly.
Using If / Else After Other Nodes
If / Else can also be used after an Agent or Knowledge Base when you need to evaluate the result of that node.
For example:
Start → Agent → If / ElseYou can use {previous_output} to evaluate the result produced by the previous node.
You can also use {previous_status} when you need to route based on whether the previous node succeeded or failed.
Configuration vs Canvas
The conditions are configured in the If / Else settings, while the destination of each branch is configured directly on the canvas.
| Configuration | Canvas |
|---|---|
| Define the If condition | Connect the If branch |
| Add Else if conditions | Connect each Else if branch |
| Define condition labels | Branch labels appear on the handles |
| Define expressions | Choose where each branch continues |
| No Else configuration | Connect the Else branch as the fallback |
For example:
If / Else
├── Billing → Billing Agent
├── Pricing → Pricing Agent
└── Else → EndCommon Mistakes
Comparing the Label Instead of the Value
If a User Feedback option has:
- Label: Billing
- Value: BILLING
the condition should use:
{user_answer} == 'BILLING'not:
{user_answer} == 'Billing'Forgetting to Connect a Branch
Creating a condition does not automatically connect it to another node.
Make sure every branch you want to use is connected to the appropriate next node.
Leaving Else Unconnected
If no If or Else if condition matches and the Else branch is not connected, there is no connected fallback path for that case.
Connect Else to a suitable node such as an Agent or End when you need a fallback.
Overlapping Conditions
Avoid creating conditions where an earlier condition already matches the same value as a later Else if.
For example:
If: {user_answer} == 'BILLING'
Else if: {user_answer} == 'BILLING'The Else if condition will never be reached because the If condition already matches.
What the If / Else Node Does Not Do
The If / Else node does not:
- Ask the user a question.
- Generate an AI response.
- Search a Knowledge Base.
- Choose between Knowledge Bases.
- Collect User Feedback.
- End the Workflow.
Use the appropriate node for each task:
| Requirement | Node |
|---|---|
| Ask the user a question | User Feedback |
| Search stored documents | Knowledge Base |
| Generate an AI response | Agent |
| Choose between Knowledge Bases | Auto Orchestrator |
| Create conditional paths | If / Else |
| Stop a Workflow path | End |
If / Else at a Glance
| Option | Purpose |
|---|---|
| If | First condition checked by the Workflow |
| Else if | Additional conditions checked in order |
| Else | Fallback path when no condition matches |
| Condition Label | Name displayed on the branch handle |
| Expression | Condition that evaluates to true or false |
{user_answer} | User Feedback answer used for routing |
{previous_output} | Result from the previous node |
{previous_status} | Success or failure status of the previous node |
/ | Inserts available values and operators into an Expression |
Use If / Else when your Workflow needs to make a decision. Configure the conditions first, then connect each branch to the node that should handle that case.