Pattern essence
Routing Agent is a pattern in which an agent chooses which other agent or tool should execute a task.
When to use: when you first need to choose the best executor or tool for a specific task.
Instead of executing everything on its own, it:
- analyzes the task
- determines who can execute it
- delegates it to the appropriate agent

Problem
Imagine there are several specialists in the system:
UI Agentfor frontend tasksFinance Agentfor financial calculationsCode Agentfor technical changes
The user sends different requests, but without a routing step, they are assigned not by specialization, but to a "random" executor.
The problem is not that the agents are weak, but that the system cannot consistently choose the right executor.
As a result:
- a specialized request goes to the wrong agent
- quality drops due to loss of specialization
- time increases because of extra attempts "outside the domain"
- the route becomes unpredictable
That is the problem: without a controlled routing step, even a simple task can be handled by the "wrong" agent and produce a weak result.
Solution
Routing adds a separate executor-selection stage before execution.
Analogy: it is like a dispatcher in a service center. The dispatcher does not do the repair, but decides which specialist should receive the request. That is exactly what reduces mistakes and unnecessary reassignments.
Key principle: first the correct executor choice, then task delegation.
The Router does not do the work itself. Its role is to control the route:
- Analyze: classify the request
- Decide: choose an agent by
routing-rules - Delegate: pass the task to the executor
- Re-route (Fallback, if needed): switch executor on
mismatchor error
The diagram below shows the basic route: choose one executor and pass the task to it.
This gives:
- higher accuracy through specialization
- fewer extra steps and lower latency
- a transparent route for debugging and control
- lower risk of executor-selection mistakes
Works well if:
- there are clear classification rules
- agent roles do not overlap chaotically
- a fallback route is defined
- the routing step (router) is not bypassed directly by the user or worker logic
Even if the model "wants" to pass the task to the first available agent, the routing-policy is what fixes who must actually execute it.
How it works
The Router does not execute the task itself.
It only delegates to a specialized agent, which executes the subtask through its own loop: Reasoning (Think) -> Action (Act) -> Observation (Observe).
Full flow description: Analyze β Decide β Delegate
Analyze
The Router identifies task type, domain, and required specialization.
Decide
The system chooses the most suitable executor by routing-policy and confidence.
Delegate
The task is passed to the selected agent, and the Router controls the route in case of mismatch/error.
In code it looks like this
agent = route(goal) # Router classifies the goal and chooses a specialized executor.
result = agent.run(goal) # Execution is done by the selected agent, not the Router.
return result
How it looks during execution
Goal: "How much tax should be paid from freelance income?"
Analyze: finance task
Decide: choose Finance Agent
Route confidence: 0.92 (finance)
Delegate: system passes the task to Finance Agent
Observe: Finance Agent returns the calculation
Goal: "Change the button color on the landing page"
Analyze: frontend task
Decide: choose UI Agent
Route confidence: 0.89 (ui)
Delegate: system passes the task to UI Agent
Observe: UI Agent returns the updated component
The Router only chooses the executor and delegates the task.
Result quality depends on how correct this choice is.
Full Routing agent example
When it fits - and when it does not
Fits
| Situation | Why this pattern fits | |
|---|---|---|
| β | Tasks differ by type or complexity | The Router chooses an executor for a specific task type instead of sending everything to one agent. |
| β | There are specialized agents for different tasks | Routing lets you use the strengths of each agent. |
| β | Execution accuracy is important | The right executor choice reduces mistakes and reruns. |
Does not fit
| Situation | Why this pattern does not fit | |
|---|---|---|
| β | All tasks are of the same type | An extra route-selection step brings no value if the executor is always the same. |
| β | There is only one agent in the system | Routing duplicates a direct call and only makes the pipeline more complex. |
| β | Routing does not affect the result | If output quality does not change based on executor choice, this layer is unnecessary. |
Because Routing adds an extra processing step. If tasks do not differ, it only slows execution down.
When to use Routing among other patterns
Use Routing when the key is to choose correctly whom to delegate the request to.
Quick test:
- if you need to "identify the best executor" -> Routing
- if you need to "run a task through clear steps" -> Orchestrator Agent
Comparison with other patterns and examples
Quick cheat sheet:
| If the task looks like this... | Use |
|---|---|
| You need to choose one best executor | Routing Agent |
| There is a sequence of steps and order matters | Orchestrator Agent |
| You need a policy-check before final output | Supervisor Agent |
| Several agents must arrive at one conclusion | Multi-Agent Collaboration |
Examples:
Routing: "Customer asks for a refund - send to Billing, not Sales".
Orchestrator: "Prepare the release: first changelog, then QA, then deploy".
Supervisor: "Before sending an email, check policies, compliance, and prohibited promises".
Multi-Agent Collaboration: "Marketing, Legal, and Product must agree on one final promo text".
How to combine with other patterns
- Routing + Task Decomposition - first split the task into parts, then Routing sends each part to the right agent.
- Routing + Orchestrator - Routing chooses the executor, while Orchestrator coordinates parallel tasks and their dependencies.
- Routing + Supervisor - Supervisor checks whether executor choice matches policies and risk level.
In short
Routing Agent:
- Analyzes the task
- Chooses an appropriate agent
- Delegates it for execution
Pros and Cons
Pros
quickly sends a task to the right agent
removes unnecessary steps
improves response time
makes it easy to add new routes
Cons
a routing mistake sends the task to the wrong place
routing rules must be maintained
complex cases require exceptions
FAQ
Q: Can the Router execute the task itself?
A: No. It only determines who should execute it.
Q: Is Routing needed if there is only one agent?
A: No. In that case, it adds an unnecessary step.
Q: Can the route be changed during execution?
A: Yes. If the selected agent cannot execute the task or returns an error, the Router can pass it to another agent.
What next
Routing lets you choose the right agent.
But what if tasks need to run in parallel?