Agent Studio Router: AI and Conditional Routing in Sparkforge
Drag the Router node onto the canvas, pick AI Router (intent-based), Conditional Router (variable + operator + value), or No Condition (always-on), connect each output to a node, and test before publishing.
Agent Studio Router controls how an agent moves between nodes based on conversation context or logic. It supports three modes that can be mixed across an agent flow or inside Sequential Nodes.
The three routing modes
- AI Router — natural-language intent decides the path.
- Conditional Router — saved variables and logic rules pick the path.
- No Condition — always continues to the next connected node.
Why use Router
- Branch on what users mean, not just exact keywords.
- Use captured variables for explicit, rule-based paths.
- Combine AI, conditional, and always-on routing in one agent.
- Add decision points inside Sequential Nodes without breaking a linear flow.
AI Router
Best when the next step depends on what the user means in natural language. The AI reads the user's last message and matches it to one of the intents you defined.
Use AI Router when:
- Users phrase the same idea different ways.
- You want to branch on interest, sentiment, or conversational intent.
- The path comes from natural language, not a stored value.
Example intents:
- User wants to invest in silver
- User does not want to invest in silver
Conditional Router
Best when the route depends on a value already captured by an earlier node, tool, form field, or choice.
Use Conditional Router when:
- You have a saved variable to evaluate.
- The route depends on a fixed value like Yes, No, positive, or negative.
- You need explicit rule-based branching.
Conditional routes use Variable, Operator, and Value:
- Variable:
{{runtime.userChoice_eyro}} - Operator:
equals (EQ) - Value:
Yes
No Condition
An always-on route. Use it when the next node should always run after the current one — a simple bridge between steps that have already collected what they need.
Router inside Sequential Nodes
Sequential Nodes run a mostly linear flow. Drop a Router inside one when the sequence needs an AI- or logic-based decision before continuing. This is useful when:
- A sequence needs a decision point before the next step.
- A user's answer should redirect them to different outcomes.
- You want structured flow with dynamic routing.
Configure a Router
- From the left navigation, click AI Agents and open the Agent Studio tab.
- Create a new agent or open an existing one.
- Add a trigger such as Chat Message or Form Submitted.
- Add an AI Agent and configure it.
- From the Flow Control panel on the left, drag the Router node onto the canvas.
- The Edit Router panel opens. Choose AI Router or Conditional Router under Router Type.
- Configure:
- AI Router — add intents that determine each path.
- Conditional Router — add conditions with variable, operator, and value. Choose AND or OR for multi-rule logic.
- No Condition — toggle on so the route always continues.
- Enter a clear Label for each branch — it shows on the connection in the graph.
- Connect each route output to the correct destination node.
- Save Router settings.
- Test each path in the conversation tester.
- Save, Publish, and Deploy the workflow.
Example flow
An agent asks the user about silver prices and uses Web Search to provide info.
- The agent asks if the user wants to invest.
- An AI Router evaluates the response: invest path goes forward, no-invest path routes to a thank-you node.
- The next node captures the user's email.
- A No Condition route advances to a confirmation step.
- A Single Choice node asks whether to proceed.
- A Conditional Router checks the saved answer: Yes goes to the proceed path, No goes to a different outcome.
Best practices
- Use AI Router when responses vary in wording but share intent.
- Use Conditional Router when the value is already captured.
- Use No Condition when the flow should always continue.
- Label each branch clearly.
- Test every route before publishing.
- Always wire a fallback or default path so conversations don't dead-end.
Frequently Asked Questions
What's the difference between AI Router and Conditional Router?
When should I use No Condition?
Can Router run inside Sequential Nodes?
What happens if no intent or condition matches?
Does Router add extra AI cost?
Do I need to train intents for AI Router?
How do I debug a misrouted path?
Was this article helpful?
Thanks for the feedback.