Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

Conditional and AI routing

Routing sends a workflow along different paths according to its input. Use conditional routing for explicit rules. Use AI routing when a model must interpret the request before choosing a path.

Connect the routing paths

Inspect the paths connected to the routing node.

Paths connected to the routing node

Each path should lead to the processing and output appropriate for that condition.

Route with explicit conditions

In If/Else, select the comparison operator and enter its comparison value.

If Else comparison operator and value

Use AND, OR, or additional branches when the rule requires more than one condition.

Insert the source value with the reference picker.

Source reference used by a condition

Keep the value being checked separate from the fixed value it is compared against.

Check both condition outcomes

Run an input that matches the condition and inspect the selected branch.

Matching condition and selected branch

The other branch should be skipped for that execution.

Run an input that does not match and inspect the ELSE path.

Nonmatching condition and ELSE path

This confirms what happens when the main condition is false.

Route by the meaning of a request

For meaning-based routing, set the AI Routing Input Query and describe each category.

AI Routing query and category descriptions

Distinct descriptions help the model choose between paths with different purposes.

Submit a request whose meaning fits one category even if it does not contain an exact keyword.

Meaning-based request and chosen path

Inspect the chosen path to check the classification.

Review additional requests, including ambiguous ones.

Additional classification requests and routing results

AI classification can vary, so make the category boundaries clear and inspect unexpected choices.

Important behavior

Use If/Else when a condition can be expressed as a rule. Use AI Routing when the request must be interpreted.

Overlapping category descriptions can lead to unexpected AI routing. Make each category’s purpose distinct.

Last updated

Was this helpful?