Overview
The Condition Node evaluates expressions against workflow context variables and routes execution to different branches based on the results. It is the primary mechanism for adding if/else logic to your workflows, enabling dynamic behavior that adapts to user input, LLM output, or any other runtime data. Each Condition Node supports multiple branches with independent evaluation rules, plus a default fallback branch for cases where no condition matches.Configuration
| Parameter | Type | Description |
|---|---|---|
branches | ConditionNodeBranch[] | Ordered list of branches to evaluate |
branches[].name | string | Branch identifier, used as the output handle name |
branches[].conditions | array | List of conditions that must ALL be true for this branch (AND logic) |
default_output | string | Name of the default branch when no conditions match |
Branch Evaluation
Branches are evaluated in order, top to bottom. The first branch whose conditions all evaluate totrue is selected, and execution continues along that branch’s output edge. If no branch matches, the default_output branch is used.
Evaluation Order
Comparison Operators
The Condition Node supports a comprehensive set of comparison operators:Value Comparisons
| Operator | Description | Example |
|---|---|---|
eq | Equal to | {{status}} eq "active" |
neq | Not equal to | {{status}} neq "deleted" |
gt | Greater than | {{score}} gt 90 |
gte | Greater than or equal to | {{score}} gte 80 |
lt | Less than | {{count}} lt 10 |
lte | Less than or equal to | {{count}} lte 100 |
String Operators
| Operator | Description | Example |
|---|---|---|
contains | String contains substring | {{message}} contains "urgent" |
not_contains | String does not contain substring | {{message}} not_contains "spam" |
starts_with | String starts with prefix | {{email}} starts_with "admin" |
ends_with | String ends with suffix | {{file}} ends_with ".pdf" |
regex | Matches regular expression | {{input}} regex "^[0-9]{3}-[0-9]{4}$" |
Existence Operators
| Operator | Description | Example |
|---|---|---|
is_empty | Value is null, undefined, or empty string | {{notes}} is_empty |
is_not_empty | Value exists and is non-empty | {{user_id}} is_not_empty |
in | Value is in a list | {{lang}} in ["en", "ko", "ja"] |
not_in | Value is not in a list | {{role}} not_in ["banned", "suspended"] |
Multiple Conditions (AND Logic)
When a branch has multiple conditions, all conditions must be true for the branch to match. This provides AND logic within a single branch.For OR logic, create separate branches for each alternative condition. Since branches are evaluated independently, any matching branch will be selected.
Custom Expressions
For complex conditions that cannot be expressed with simple operators, use theexpression type to write custom evaluation logic:
len, in), and boolean combinators (and, or, not).
Output Handles
Each branch in the Condition Node creates a separate output handle in the visual editor. You connect different downstream nodes to each handle to define the execution path for each condition. In the visual editor, the output handles appear as labeled connection points on the right side of the node. Drag edges from each handle to the appropriate downstream node.Example: Language Router
Route user messages to different AI Agent nodes based on detected language:Best Practices
Always configure a default branch
Always configure a default branch
Even if you think all cases are covered, include a
default_output branch. Unexpected values or edge cases will route to the default instead of causing a workflow failure.Order branches from most specific to most general
Order branches from most specific to most general
Since branches are evaluated in order, put narrow conditions first. A catch-all condition at the top will shadow everything below it.
Use Variable Nodes to precompute complex values
Use Variable Nodes to precompute complex values
Instead of writing complex expressions inside condition branches, use a Variable Node upstream to compute a simple boolean or category value, then branch on that value in the Condition Node.
Limit branch count for readability
Limit branch count for readability
Workflows with more than 5-6 branches on a single Condition Node become hard to follow. Consider chaining multiple Condition Nodes or using an Intent Classifier for many-way routing.