Skip to main content
工作流应用

Conditional Logic Node

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.
In the condition group configuration area, use the dropdown labeled When the following XX conditions are met to specify the logical relationship among conditions within the group:
OptionDescriptionExample
AllAll 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.
AnyAt 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:
FieldDescription
VariableSpecifies the variable to evaluate. Supports session variables, upstream node outputs, and built-in variables.
Comparison OperatorDefines 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 ValueSpecifies 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 TypeQuantityNaming FormatDescription
Condition Group Branch1 or more<Group Name> IFEach condition group maps to one IF branch—for example, Weather Query IF, Calculation Issue IF.
Default Branch1Default ELSEFallback branch executed when none of the condition groups are satisfied.

Common Use Cases

Paired NodesDescription
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 NodesDifferent 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

Must every branch connect to a downstream node?

No. As long as a branch is never triggered, leaving it unconnected to any downstream node will not break workflow execution. This pattern is suitable for cases where the node serves only as a filter, gate, or interceptor—with no further processing required.