productinterview.tools
MenuClose

LLM Orchestration and Routing: Workflows, Routers and Fallbacks

Workflows vs agents, routing and fallbacks.

Core3 lessons5 questions

What this module covers

  • The common ways to combine several model calls into one feature
  • Routing requests to the right model or path, and falling back when something fails
  • Choosing between a fixed workflow and an agent
Orchestration and routing

Unlocks

None

Why it matters, by role

  • Forward Deployed EngineerForward Deployed Engineer. An engineer embedded with customers who scopes, builds and ships AI solutions into production. Read the full explanation: customer systems are usually workflows with an agent in the middle.
  • AI Platform PMProduct Manager. Decides what a product should do, for whom, and why. Read the full explanation: orchestration features are part of agent frameworks and platforms.
  • AI Product Engineer: you'll build these pipelines.
  • Applied AI PM: orchestration choices shape cost, speed and reliability.

Lessons

  1. Workflow patterns
  2. Routing and fallbacks
  3. Workflow or agent?

Workflow patterns

Most AI features combine several model calls in a fixed structure:

Pattern How it works Example
Chain Each step's output feeds the next Extract facts → draft summary → check the draft
Router A first step classifies the request and sends it down the right path Billing questions to one prompt, technical ones to another
Parallel Several calls run at once and results combine Check one document against five policies simultaneously
Orchestrator–workers One call breaks the task down; others handle the pieces Plan a report's sections, write each, then assemble
Evaluator–optimiser One call drafts, another critiques, repeat Draft, check against a rubric, revise

Each extra call adds cost and latency, and another place to fail. Use the simplest structure that meets the quality bar.

Routing and fallbacks

Routing sends each request where it's best handled:

  • By task: different prompts, tools or data for different request types.
  • By difficulty: a small, cheap model for easy cases, a stronger model for hard ones.
  • By risk: sensitive requests to a stricter path or a person.

A router is itself a classifier, so evaluate it: a misrouted request gets the wrong treatment however good the downstream path is.

Fallbacks keep the feature working when a step fails: retry with a backoff, switch to a backup model or provider, return a simpler non-AI result, or hand off to a person. Decide the fallback for each step at design time, not during an outage.

Workflow or agent?

Workflow Agent
Who decides the steps Your code The model
Best for Predictable tasks with known steps Open-ended tasks where the steps vary
Cost and speed Lower, predictable Higher, variable
Testing Easier: test each step Harder: paths vary run to run

Start with a workflow. Move to an agent only when the steps genuinely can't be known in advance, and even then, keep the agent inside a workflow with clear limits.

Questions

Rubric

Dimension Weak Passable Strong
Patterns One big prompt or an agent for everything Knows chains and routers Picks the simplest fitting pattern and explains its cost
Routing Ignores it Routes by task Routes by task, difficulty and risk, and evaluates the router
Fallbacks None Retries A fallback per step, decided at design time
Agent choice Defaults to agents Knows the difference Workflow first; agent only where steps can't be known

Next modules