AI Engineer Agentic Track: The Complete Agent & MCP

Day 2 - Agentic AI Design Patterns: Chaining, Routing, Orchestrator

Beginner 15 minutes
Rupinder Singh
6 views
Anthropic’s five workflow design patterns — prompt chaining, routing, parallelization, orchestrator-worker, evaluator-optimizer — and the open-ended agent loop they contrast with.

Week 1 · Day 2 · Lecture 10. Anthropic's "Building Effective Agents" doesn't stop at defining workflows and agents — it gives five concrete design patterns for workflows, and one shape for agents. This lecture walks through all six.

An important caveat before we start: these patterns are indicative, not prescriptive. Unlike the mature design-pattern vocabulary of traditional software engineering, these are just useful shapes to provoke thinking — you won't always reach for "this pattern for this problem." You'll see elements of several patterns mixed together in real systems, including the ones built later in this course.

The five workflow patterns

1. Prompt chaining

Decompose a bigger task into fixed sub-tasks, and chain LLM calls together so the output of one feeds the input of the next. An optional "gate" — a piece of your own code, not an LLM — can check the intermediate output before it continues.

prompt chaining

You already did this on Day 1: your first two chained OpenAI calls in lecture 1.8 are exactly this pattern. Prompt chaining is also very often a smaller ingredient inside the bigger patterns below.

2. Routing

Use an LLM (an "LLM router") to look at an input and decide which specialized downstream LLM should handle it — for example, a support assistant that first classifies a question as technical, business, or other, then routes it to an LLM prompted specifically for that category.

routing

The point is separation of concerns: a single LLM call trying to be great at everything is often worse than a router plus several narrowly-specialized calls.

3. Parallelization

Plain code (not an LLM) breaks a problem into independent pieces, farms them out to multiple LLM calls that run concurrently, then plain code aggregates the results.

parallelization

Both the "Coordinator" and the "Aggregator" here are your own code — that's the detail to notice, because pattern 4 looks almost identical but isn't.

4. Orchestrator-worker

Complex tasks are broken down dynamically and then combined. This looks like parallelization, but the Orchestrator and Synthesizer boxes are LLM calls, not code: an LLM decides how to split the task into pieces, and another LLM call decides how to combine the results.

orchestrator worker

This is a good reminder that "workflow" doesn't mean "no LLM makes decisions" — the orchestrator LLM is very much controlling what happens, just within a predefined code path (call the orchestrator, then some worker LLMs, then the synthesizer). That predefined shape is exactly what keeps it a workflow rather than an open-ended agent.

5. Evaluator-optimizer

One LLM (the generator) produces a solution; a second LLM (the evaluator) judges it and either accepts it or rejects it with feedback, sending it back to the generator for another attempt.

evaluator optimizer

You'll often hear this called "LLM as a judge" — that's the more common name for the same idea, and it's the fifth and last of Anthropic's workflow patterns.

By contrast: agents

Where all five patterns above have a predefined path through the system, an agent is open-ended: there's a feedback loop, and no fixed path. An LLM call takes input (from a human, or from the state so far), can act on an environment, gets feedback from that action, and loops — continuing until it decides the goal is reached and stops.

agents contrast

Notice how closely this foreshadows the working definition from the previous lecture: an LLM with tools in a loop to achieve a goal. This diagram from Anthropic and that definition are describing the same thing.

What you should now understand

  • Anthropic's five workflow patterns: prompt chaining, routing, parallelization, orchestrator-worker, and evaluator-optimizer (a.k.a. "LLM as a judge").
  • The difference between parallelization and orchestrator-worker is subtle but important: who decides the breakdown and combination — your code, or an LLM?
  • An LLM can still be "in control" of a workflow (as in orchestrator-worker) without the system becoming an open-ended agent — what matters is whether the code path is predefined.
  • Agents, by contrast, have no fixed path: a loop of LLM call → action → environment feedback → repeat, until the goal is met.
  • Don't treat these six shapes as rigid rules to memorize — they're a shared vocabulary you'll recognize (often mixed together) as you build through the rest of this course.

Resource links

Next

Lecture 1.11 — Agentic AI Risks, Guardrails, Evals and Traps to Avoid — wraps up Day 2, including the promised answer to "how do I decide whether I need one LLM call, or a router with multiple calls?"