Software Engineeringunpacked

Prompt chaining, routing, parallelization and more: agentic workflow patterns explained

Prompt chaining splits one job into a fixed sequence of focused LLM calls, each working on the output of the previous one, with checks in code between steps. It is the simplest of five workflow patterns Anthropic describes; the others are routing, parallelization, orchestrator-workers and evaluator-optimizer. Pick the simplest one that works, and use a full agent only when the steps can't be known in advance.

Workflows vs agents

Anthropic's "Building effective agents" draws one line first. Workflows are systems "orchestrated through predefined code paths". Agents are systems where "LLMs dynamically direct their own processes and tool usage". Both are useful; the advice is to find "the simplest solution possible, and only increasing complexity when needed".

Every pattern below is built from one block: an LLM augmented with retrieval, tools and memory. They differ in who decides the sequence, your code or the model.

Prompt chaining

"Decomposes a task into a sequence of steps, where each LLM call processes the output of the previous one."

Instead of one prompt that extracts, checks and writes all at once, run three focused calls, and put a gate in code between them. A damage-report pipeline for a bike-rental shop:

  1. Extract the booking ID, part and description from the customer email into JSON.
  2. Gate in code: does the booking exist? Is the part one of the known values? If not, stop and flag the email.
  3. Classify severity from the extracted fields only.
  4. Draft the reply to the customer from the classified report.

Each call does one easier job, so each is more accurate, and the gate catches errors before they reach the next step. Use it when the task splits cleanly into fixed subtasks and you are willing to trade latency for accuracy. Today's models handle much multi-step reasoning in one call, so chain when you want to inspect, validate or reuse what happens between steps, not by habit.

Routing

"Classifies an input and directs it to a specialized followup task."

One cheap classification call sends each request to the right place: refund questions to a prompt with the refund policy, damage reports to the extraction chain, simple questions to a smaller, faster model. Use it when there are distinct categories better handled separately, and when you want to avoid running an expensive path for every request.

Parallelization: sectioning and voting

Use it when independent parts can run in parallel for speed, or when several attempts give more confidence.

Orchestrator-workers

"A central LLM dynamically breaks down tasks, delegates them to worker LLMs, and synthesizes their results."

The difference from sectioning is that the subtasks aren't known in advance: the orchestrator decides them. Use it when you can't predict which subtasks a request needs, such as research across an unknown number of sources. This is the basis of multi-agent systems, built with subagents.

Evaluator-optimizer

"One LLM call generates a response while another provides evaluation and feedback in a loop."

A writer drafts, an evaluator grades against explicit criteria and returns feedback, and the writer revises. Use it when there are clear evaluation criteria and iteration measurably improves the result. Cap the rounds and hand off to a person if the criteria still fail.

Choosing a pattern

If… Use
The steps are fixed and known Prompt chaining
Inputs fall into distinct categories Routing
Parts are independent, or you want several opinions Parallelization
The subtasks depend on the input Orchestrator-workers
Quality improves with critique against criteria Evaluator-optimizer
The path itself must be discovered step by step An agent with an agentic loop

The three principles Anthropic ends on apply to all of them: keep the design simple, make the planning steps visible, and invest in the agent-computer interface, meaning clear tool documentation and testing.

Workflow patterns on the Claude Certified Architect exam

Chapter 3 of our CCAR-F study plan covers these. Domain 1 tests task decomposition (task 1.6) and multi-step workflows with enforcement and handoff (task 1.4), and Domain 4 adds multi-pass review architectures (task 4.6). The usual trap: reaching for an autonomous agent when a fixed chain with a gate in code would be simpler, cheaper and easier to test.

More in all articles.

Sources: Building effective agents (Anthropic); Prompting best practices; Claude Certified Architect Foundations exam guide v1.0, task statements 1.4, 1.6 and 4.6.

FAQ

What is prompt chaining?

Breaking a task into a sequence of steps where each LLM call processes the output of the previous one, with programmatic checks on the intermediate results. It trades a little latency for accuracy, because each call does one easier job.

When should I use prompt chaining?

When the task can be cleanly decomposed into fixed subtasks, for example extract, then check, then write, and you want to inspect or validate the result between steps.

What is the difference between a workflow and an agent?

In a workflow, LLMs and tools follow code paths you defined in advance. In an agent, the model directs its own process and tool use, deciding the next step from what it has seen.

What is LLM routing?

Classifying an input and sending it to a specialized follow-up: a different prompt, tool set or model. It helps when distinct categories of requests are better handled separately.