B2 · Routing

Family: Workflows

A classifier sorts each request into a category and sends it to the specialised handler.

Principle

A classifier, an LLM or not, categorises the input and routes it to a specialised handler: a prompt, a tool, a model or an agent. Each handler stays simple and can be optimised on its own.

The problem it solves

A one-size-fits-all prompt handles very different requests poorly, and costs a lot if every request goes to the largest model.

When to use it

  • Requests fall into distinct categories that can be spotted on arrival (customer support by intent).
  • You want to send simple cases to a cheaper model and keep the large model for hard cases.

When to avoid it

  • The right category only emerges mid-conversation: use a handoff between agents instead (E4).

Common pitfalls

The anti-patterns that misuse this pattern, best established first. Each sheet describes the symptoms, the public incidents and the remedies.

Framing and choice of level

All anti-patterns

Synonyms by vendor

  • Routing (Anthropic, AWS, A. Gulli)
  • Router (LangChain, Hugging Face)
  • Coordinator/Dispatcher (Google ADK)
  • Dispatcher (Microsoft)
  • Structured output routing (OpenAI Agents SDK)

Neighbouring patterns

Sources

Content reviewed on 2026-10-02

Pattern catalogue