Skip to Content
ProductsAI ChatbotBuildWorkflowNodesIf Else

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:

  1. The If condition is checked first.
  2. If the If condition is true, its connected path runs.
  3. If the If condition is false, the Workflow checks the next Else if condition.
  4. Else if conditions are checked in the order they appear.
  5. 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 Support

If 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 / Else

For 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:

  1. Open the Workflow canvas.
  2. Find If / Else under Logic.
  3. Add the node.
  4. Connect the previous node to If / Else.
  5. Configure the conditions.
  6. Connect each condition handle to the appropriate next node.

Example:

Start ↓ User Feedback ↓ If / Else ├── Billing → Agent ├── Pricing → Agent └── Else → End

The 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:

Billing

The 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: Fallback

The 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 answers

Use 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

ValueDescription
{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 Agent

Suppose User Feedback has these options:

LabelValue
BillingBILLING
PricingPRICING

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 / Else

You 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.

ConfigurationCanvas
Define the If conditionConnect the If branch
Add Else if conditionsConnect each Else if branch
Define condition labelsBranch labels appear on the handles
Define expressionsChoose where each branch continues
No Else configurationConnect the Else branch as the fallback

For example:

If / Else ├── Billing → Billing Agent ├── Pricing → Pricing Agent └── Else → End

Common 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:

RequirementNode
Ask the user a questionUser Feedback
Search stored documentsKnowledge Base
Generate an AI responseAgent
Choose between Knowledge BasesAuto Orchestrator
Create conditional pathsIf / Else
Stop a Workflow pathEnd

If / Else at a Glance

OptionPurpose
IfFirst condition checked by the Workflow
Else ifAdditional conditions checked in order
ElseFallback path when no condition matches
Condition LabelName displayed on the branch handle
ExpressionCondition 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.