Skip to main content

Router Node - Multi-Branch Conditional Routing in ConvyAI Agentic Flow

Overview​

The Router node evaluates a set of independent conditions, each associated with its own branch. Unlike the If node, multiple conditions can be true simultaneously - activating parallel branches. A configurable flag allows switching to first-match mode, where evaluation stops at the first true condition.

Positioning​

The Router node has one input and one exit per condition. In default mode, multiple exits can be active simultaneously. In first-match mode, at most one exit is activated per execution.

Conditions and exits​

Each condition has a dedicated branch. The default label for each branch is condition-{counter} and can be customized. The order of conditions is configurable via drag&drop in the configuration panel.

The operators supported by type are the same as in the If node.

Evaluation modes​

ModeBehavior
Default (flag off)All conditions are evaluated independently. Every true condition activates its branch; multiple branches can run in parallel.
First-match (flag on)Conditions are evaluated in the configured order. Only the first true condition activates its branch; subsequent conditions are ignored.

Output​

The Router node does not produce its own output data. It passes through the output of the last non-conditional node upstream. In cascaded Router 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.

If vs Router​

IfRouter
ExitsExactly 2 (true / false)One per condition
Simultaneous branch activationNoYes (default mode)
First-match modeN/AAvailable via flag
Use caseBinary decisionMulti-criteria routing

Key concepts​

TermDefinition
First-match modeRouter behavior where only the first true condition (in configured order) activates its branch.