Summary: ◀▼
Use the legacy Branch by condition step to route AI agent conversations based on variable values, such as a customer’s location or membership status. Combine conditions with AND/OR logic, including nested conditions up to three levels deep. You can configure up to six branches; the first matching branch runs, and an Else branch is required. This feature is scheduled for removal in 2027.
This article includes the following sections:
Branch by condition step basics
When you add a new Branch by condition step to your answer flow, the following settings are included:
- Name that identifies the step on the canvas.
-
Two default branches
that must be configured before the answer
flow can be published:
- If this: If the branch's conditions are met, the conversation follows the branch's steps
- Else: If the conversation doesn't match the conditions of any other branch, the conversation follows this branch's steps
Branch by condition can have up to six branches, including the Else branch. The Else branch is required and cannot be removed from the step. You can add up to four additional branches, to a maximum of six branches.
To add an additional branch, click Add branch and configure the following settings for each branch:
- Name that describes the condition for the branch. This name appears as the branch name on the canvas.
-
Condition
that includes the following elements:
- Variable: The data that will be evaluated to see if the condition is met.
- Operator: How the data from the variable and value are compared. Includes is, is not, contains, and does not contain.
- Value: Value expected for the condition specified by the operator.
See Condition elements for more information.
You can combine conditions for a branch using the AND/OR drop-down. For example, the following branch checks whether a user is located in Australia or the United States.

A conversation can only follow one branch. Branches are evaluated in the order they are included in the step. End users that meet the criteria of more than one branch will be sent down the first branch with matched criteria, from top to bottom in the step's configuration panel or left to right on the canvas. Branches can be reordered by dragging the condition panes on the canvas.
Condition elements
About variables
In a condition, a variable's value is compared to a static value. Variables are added to the condition using a drop-down menu.
For more information about variable types and creating variables, see Using variables to personalize AI agent answers.About operators
The operator determines how the variable's data is compared to the value. Operators are added to a condition using a drop-down menu.
The following operators are available. All operator matching is case-insensitive.
| When I’m using the conditional step in bot builder… | Available operators |
|---|---|
| I want to be able to evaluate data stored as a number |
Operators for Zendesk known use cases for evaluating numbers:
|
| I want to be able to evaluate data stored as a string |
Operators for Zendesk known use cases for evaluating strings:
|
About values
A value is static data that's compared to a variable.
It represents the expected data for a variable. For example, in a condition that
checks whether a customer's
membership_statusis "platinum",
"platinum" is the value.
Customer variables collected during an Ask for details step require a corresponding custom
ticket field. For customer variables using a drop-down ticket field, use the
associated tag as the value for a condition. For example, the
membership_statusdrop-down field accepts a "Platinum level"
value with a related "platinum_level" tag. To check whether the customer has a
platinum membership status, use "platinum_level" as the value in the condition.
Nested conditions
A nested condition is a condition that contains two or more conditions inside it. You can use nested conditions to build complex logic that relies on multiple conditions. They are especially useful when combining conditions using both AND and OR.
- The user has a “platinum” membership status AND
- The user is located in one of the following countries:
- Australia OR
- The United States

You can only nest conditions up to three levels deep. Each level, including the top level, can contain up to six conditions.
Article Q&A
Click to view
What should I know about the availability of Branch by condition?
Branch by condition became legacy on February 2, 2025, and is scheduled to be removed from the product in 2027. The article points to an announcement for important dates and migration guidance.
How do I set up branches, and which branch does a conversation follow?
Add conditions using a variable, operator, and value. The required Else branch handles conversations that don't match another branch. You can have up to six branches total, including Else, and the If and Else branches must be configured before you publish the answer flow. A conversation follows only one branch: the first matching branch in the configured order. You can reorder branches by dragging their condition panes on the canvas.
Which operators can I use to evaluate numbers or strings?
For numbers, you can use equal to or greater than, equal to or less than, greater than, less than, equal to, and not equal to. For strings, you can use is, is not, contains, does not contain, starts with, and ends with. Operator matching is case-insensitive.
How do I choose a variable and value for a condition?
Variables can contain data collected in an Ask for Details or Make API call step, or messaging authentication metadata. A condition compares a variable with a static value. Customer variables collected in Ask for Details need a corresponding custom ticket field; for a drop-down ticket field, use the associated tag as the condition value. The Authenticated status variable uses a boolean drop-down and is available for branching only if you created a messaging key for JWT authentication.
How deeply can I nest conditions, and how many conditions can each level contain?
You can nest conditions up to three levels deep. Each level, including the top level, can contain up to six conditions. Nested conditions are useful for combining AND and OR logic.