If Node - Conditional Branching in ConvyAI Agentic Flow
Overview
The If node evaluates a logical condition - simple or compound - and routes the flow to one of two exclusive exits: true if the condition is fully satisfied, false otherwise. The logical operator (AND/OR) is global and applies uniformly to all conditions in the node.
For scenarios requiring more than two output paths or parallel branch activation, use the Router node instead.
Positioning
The If node has one input and two exits: true and false. Exactly one output is activated per execution. If nodes can be cascaded to build multi-level decision trees.
Conditions and operators
One or more conditions can be defined. All conditions are evaluated using the same global logical operator:
- AND - all conditions must be true for the
truebranch to activate. - OR - at least one condition must be true for the
truebranch to activate.
Operators by data type
| Data type | Available operators |
|---|---|
| String | equals, not equals, exists, does not exist, is empty, is not empty, starts with, ends with, contains, regex |
| Number | equals, not equals, greater than, less than, greater than or equal, less than or equal, exists, does not exist |
| Boolean | exists, does not exist, true, false |
| Object | exists, does not exist, is empty, is not empty |
| Array | exists, does not exist, is empty, is not empty, length equals, length not equals, length greater than, length less than |
Exits
| Branch | Activated when |
|---|---|
true | The condition (or compound expression) evaluates to true. |
false | The condition evaluates to false. |
Exactly one branch is activated per run.
Output
The If node does not produce its own output data. It passes through the output of the last non-conditional node upstream. In cascaded If nodes, the passthrough data corresponds to the first non-conditional node in the upstream chain.
Error behavior
If a condition contains an incompatible configuration (value type inconsistent with the variable type, or a non-existent variable), the flow execution terminates with an error.
Key concepts
| Term | Definition |
|---|---|
| Global logical operator | AND or OR, applied uniformly to all conditions in the If node. |