The Conditional Logic Node enables conditional branching—when variables meet specified criteria, the workflow follows the corresponding downstream path.
Usage Example
The Intent Classification Node intelligently identifies user intent and automatically routes requests to appropriate processing branches. For example, in an intelligent customer service scenario, user queries about product inquiries, after-sales support, or complaints/suggestions are routed respectively to specialized large language model (LLM) nodes for targeted handling.
Adding the Node
Method 1: Add via the + Button
-
Hover your mouse over any node on the canvas (e.g., the Start node). A
+button appears automatically on its right side. -
Click the
+button and select Conditional Logic from the pop-up node list. The node is added to the canvas and automatically connected to the upstream node.
Method 2: Drag from the Node Library
- In the left-hand node library, locate and select Conditional Logic.
- Drag the node onto the canvas at your desired position, then drag a connection line from the edge of an upstream node to the Conditional Logic node.
Core Configuration
Condition Groups
A condition group is the fundamental unit of conditional logic. Each group corresponds to one branch. Multiple condition groups operate under an OR relationship—any group whose conditions are satisfied will trigger its associated branch.
- Click the node to open its configuration panel, then click Add Condition Group at the bottom of the panel.
- A new condition group is added to the list with a default name such as “New Condition Group 1”, “New Condition Group 2”, etc. The node on the canvas updates in real time to reflect the newly added branch.
| Option | Description | Example |
|---|---|---|
| All | All conditions in the group must be satisfied. | To provide VIP-exclusive weather services, both "weather" and "membership_level = VIP" must be present in the variables. |
| Any | At least one condition in the group must be satisfied. | To detect weather-related intents, the user’s input may vary. The variable only needs to contain "weather", "temperature", or "temp"—any one suffices. |
Condition Configuration
A condition defines a rule for evaluating whether a variable meets certain criteria. Each condition group can contain multiple conditions. Every condition includes the following configurable fields:
| Field | Description |
|---|---|
| Variable | Specifies the variable to evaluate. Supports session variables, upstream node outputs, and built-in variables. |
| Comparison Operator | Defines how the variable is evaluated. Supported operators include: equals, not equals, contains, does not contain, is empty, is not empty, length equals, length greater than, length less than, length greater than or equal to, length less than or equal to. Usage recommendations: - For keyword matching: use contains or does not contain. - For exact matching: use equals or not equals. - For existence checks: use is empty or is not empty. - For string-length validation: use length-based operators. |
| Comparison Value | Specifies the target value for comparison. Supports direct input or variable references. |
Node Outputs
The Conditional Logic Node does not output data variables usable by downstream nodes. Instead, it controls workflow routing based on evaluation results—directing execution down different branches.
| Branch Type | Quantity | Naming Format | Description |
|---|---|---|---|
| Condition Group Branch | 1 or more | <Group Name> IF | Each condition group maps to one IF branch—for example, Weather Query IF, Calculation Issue IF. |
| Default Branch | 1 | Default ELSE | Fallback branch executed when none of the condition groups are satisfied. |
Common Use Cases
| Paired Nodes | Description |
|---|---|
| Input → Conditional Logic Node → Multiple LLM Nodes (Text/Image Generation) | The Conditional Logic Node routes requests to different LLM nodes based on upstream output. |
| Conditional Logic Node → Multiple MCP/Plugin Nodes | Different plugin capabilities are invoked depending on the conditional evaluation result. |
| Conditional Logic Node → Variable Processing Node (Aggregation & Grouping Mode) | After multiple branches of the Conditional Logic Node, use the Variable Processing Node’s Aggregation & Grouping mode to automatically select and output valid values generated by the executed branch—preventing null-value errors downstream. |
Frequently Asked Questions
Can I have only an ELSE branch?
Yes. If no conditional logic is needed, you may delete all custom condition groups. The node retains its default ELSE branch, and all inputs will follow that path. This is useful for temporarily disabling all conditional logic.
Can a condition group connect to multiple downstream nodes?
Yes. Each IF branch (corresponding to a condition group) and the ELSE branch can connect to multiple downstream nodes.
Common scenarios include:
- Triggering multiple parallel operations simultaneously
- Performing multi-step processing within a single branch
- Embedding sub-workflows inside a branch