Router Component
Last updated: Mar 2026
Overview
The Router component is a multi-branch decision node that directs your workflow along different paths based on conditions or AI criteria. Unlike the Decision Point (which only supports TRUE/FALSE outcomes), the Router supports up to 10 named branches, giving you fine-grained control over workflow routing.
Routers also support destinations— any branch can redirect to a specific step in the workflow (forward or backward), enabling iterative loops without a dedicated while loop.
How It Works
Input Arrives
Data flows into the Router from upstream steps via connections or inputs.
Branches Evaluated
In Deterministicmode, each branch's condition is checked in order until one matches. In AI (LLM)mode, an AI model evaluates each branch's natural language criteria and picks the best match.
Branch Selected
The matching branch is activated. Downstream steps connected to that branch will execute; steps connected to other branches are skipped.
Optional Destination
If the selected branch has a destination, execution continues at that step instead of continuing normally. This enables loops and dynamic flow control.
Evaluation Modes
Deterministic Mode
Each branch defines a condition (e.g., “input equals 'urgent'”). Branches are evaluated in order, and the first match wins. If no branch matches, the default branch is used (if configured), otherwise the step fails.
This is the fastest and cheapest option — no AI calls are made. Use it when your routing logic can be expressed as simple value comparisons.
AI (LLM) Mode
Each branch defines natural language criteria (e.g., “The user is asking about billing or invoices”). An AI model reads all the criteria and selects the best-matching branch, along with a confidence score and reasoning.
Use this when routing requires understanding context, semantics, or nuance that simple string matching can't capture.
Choosing a mode
Start with Deterministic mode for straightforward value-based routing. Switch to AI mode when you find yourself writing complex regex patterns or when the routing decision depends on meaning rather than exact values.Configuration
Adding a Router
Drag the Router component from the Decision section of the component library onto your canvas. Click Configure to open the configuration panel.
Branches
Every Router starts with 2 branches. You can add up to 10. Each branch has:
- Label— A human-readable name shown on the canvas
- ID— A unique identifier used in connections and templates (auto-generated from the label, but editable)
- Condition (Deterministic) or Criteria(AI) — The matching logic for this branch
- Destination(optional) — A step to redirect to when this branch is selected
Default Branch (Deterministic)
In Deterministic mode, you can designate one branch as the default. If none of the conditions match, the default branch is selected. If no default is set and nothing matches, the step fails.
Connecting Branches
Each branch appears as a colored dot on the right side of the Router node. Drag from a branch dot to the target step to create a conditional connection. The downstream step will only execute when that specific branch is selected.
Compound Conditions
In Deterministic mode, each branch can have multiple conditions combined with AND or OR logic. This lets you create sophisticated routing rules without needing AI mode.
Adding Multiple Conditions
Every branch starts with a single condition. To add more, click the + Add condition button below the condition row. The branch automatically switches to compound mode with a logic selector.
AND Logic
When set to AND, all conditions must match for the branch to be selected. Use this when multiple criteria must be true at the same time.
Example: Urgent VIP Ticket
Logic: AND
1. Priority equals“urgent”
2. Customer type equals“vip”
3. Ticket age less than 24 (hours)
The branch matches only when all three conditions are true.
OR Logic
When set to OR, the branch is selected if any condition matches. Use this when multiple different situations should lead to the same branch.
Example: Needs Attention
Logic: OR
1. Sentiment equals“angry”
2. Priority equals“urgent”
3. Escalated equals“true”
The branch matches if any one of these conditions is true.
Removing Conditions
Each condition row in compound mode has an X button to remove it. If you remove conditions until only one remains, the branch automatically switches back to simple mode.
When to use compound vs. AI mode
Use compound conditions when your routing logic can be expressed as concrete value checks (e.g., priority equals urgent AND type equals bug). Use AI mode when the decision depends on understanding natural language or complex context.Destinations & Loops
Any branch can specify a destination— a step to redirect to when that branch is selected. This is powerful for creating iterative loops:
Example: Quality Gate Loop
1. A “Write Essay” step generates content
2. A Router evaluates quality with two branches:
• Pass— continues normally
• Needs Revision— redirects back to “Write Essay”
3. The loop repeats until quality passes or the jump limit is reached
Max Revisions
To prevent infinite loops, every Router has a Max Revisionssetting (default: 10, range: 1–50). Once this limit is reached, the loop stops and execution continues normally from the Router.
Avoid infinite loops
Always set a reasonable jump limit. If your loop needs more than 10 iterations, consider whether the upstream step's instructions need improvement rather than simply increasing the limit.Use Cases
Customer Intent Routing
Classify incoming messages as billing, support, sales, or general inquiries and route each to a specialized response workflow.
Priority Triage
Route tasks by urgency level (urgent, high, medium, low) using deterministic conditions on a classification field from an earlier step.
Quality Gate Iteration
Use AI mode to evaluate whether generated content meets quality criteria. If not, loop back to the generation step with feedback for revision.
Multi-Language Routing
Detect the language of incoming text and route to language-specific processing pipelines.
Best Practices
- Order matters in Deterministic mode— Branches are evaluated top to bottom. Place the most specific conditions first and the broadest last.
- Always set a default branch in Deterministic mode to handle unexpected values gracefully.
- Keep branch criteria clear and distinct in AI mode. Overlapping criteria can confuse the model and reduce confidence scores.
- Use deterministic mode for speed— No AI call means faster execution and zero token costs.
- Use a fast model for AI routing (e.g., Claude Haiku or GPT-5 Mini). The Router only needs to classify, not generate long outputs.
- Name your branches clearly— Labels appear on the canvas and in execution logs, making workflows easier to debug.