Part 4 · Engineering Patterns for Reliable Agents

Five Workflow Patterns

Prompt Chaining / Routing / Parallelization / Orchestrator-Workers / Evaluator-Optimizer

THE QUESTION THIS PAGE ANSWERS

ANSWER FIRST

What is the key idea behind “Five Workflow Patterns”?

Prompt Chaining / Routing / Parallelization / Orchestrator-Workers / Evaluator-Optimizer

DECISION RULE

Make the claim earn its place. Use this page as a decision aid, not a definition to memorize. Connect the idea to one real task, one observable result, and one failure that would change your mind.

TRY NEXT

Write one question you could answer with evidence after trying this idea.

WATCH FOR

A conclusion that sounds complete but leaves the key assumption untested.

Pattern 1
1
Prompt Chaining
Prompt Chain
Break a large task into multiple sequential steps, where each step's output becomes the next step's input. Each step is an independent LLM call focused on doing one thing well. Quality gates (programmatic checks) can be inserted between steps — only passing results move forward.
Input
LLM Step 1
Gate
LLM Step 2
Output
When to Use
The task naturally decomposes into fixed sequential steps; quality checks are needed at intermediate stages; accuracy is worth the added latency.
Real example: Generate marketing copy (Step 1) → Translate to target language (Step 2) → Format for specific platform (Step 3). Gate: verify Step 1 output contains required brand keywords.
Pattern 2
2
Routing
Router
First classify the input, then route it to a specialized processing branch. Each branch can have its own Prompt, model, or tool configuration. Core value: separation of concerns — each branch handles only one type of input.
Input
Classifier
Branch A
Branch B
Branch C
When to Use
Inputs vary widely and require entirely different processing logic by type; cost optimization is needed (cheap models for simple queries, powerful models for complex ones).
Real example: Customer service system: simple FAQs use Haiku (fast and cheap), refund issues use Sonnet + order tools, technical faults use Sonnet + log queries. One classifier picks the route, achieving the optimal cost/quality balance.
Pattern 3
3
Parallelization
Parallelism
Run multiple LLM calls simultaneously and aggregate results. Two sub-modes:
Sectioning: Split a task into independent subtasks, process in parallel, then merge.
Voting: Run the same task with the same Prompt multiple times, take the majority/best result.
Input
LLM A
LLM B
LLM C
Aggregate
Output
When to Use
Subtasks have no dependencies; speed improvement is needed (parallel beats sequential); confidence needs boosting (repeated voting reduces randomness).
Real example – Sectioning: In code review, one LLM checks security vulnerabilities, one checks performance, one checks style; results are merged.
Real example – Voting: In content moderation, the same text is sent to 3 LLMs to judge whether it violates policy; the majority vote is the final decision.
Pattern 4
4
Orchestrator-Workers
Orchestrator–Workers
A central LLM (the orchestrator) dynamically decomposes tasks and assigns them to multiple worker LLMs. Unlike Parallelization, subtasks are determined at runtime by the orchestrator — nothing is predefined in code. This is the Workflow pattern closest to an Agent.
Input
Orchestrator LLM
Worker 1
Worker 2
Worker N...
Merge
When to Use
Subtasks cannot be predicted in advance (must be decided dynamically based on input); involves parallel operations on multiple files or resources.
Real example: Code change request "add i18n support to the project." The orchestrator analyzes the codebase and dynamically decides: Worker 1 updates Button component, Worker 2 updates Header, Worker 3 creates language files. Different requests produce different numbers and types of Workers.
Pattern 5
5
Evaluator-Optimizer
Evaluator–Optimizer
One LLM is responsible for generating, another for evaluating. They form an iterative loop: the generator refines its output based on the evaluator's feedback until the evaluator is satisfied or the iteration limit is reached.
Input
Generator LLM
Evaluator LLM
Output
Dashed box = iterative loop until criteria are met
When to Use
Clear quality evaluation criteria exist; iterative improvement significantly raises output quality; a single generation rarely meets the bar.
Real example: Literary translation: the generator produces an initial draft; the evaluator checks faithfulness, fluency, and style consistency, giving specific revision notes; the generator improves. After 2–3 iterations, the final translation is output. Quality improves with every iteration.
Try It: Scheduler Simulator
Click the buttons above to see data-flow animations for each pattern
Summary
All Five Patterns at a Glance
Pattern Core Idea Typical Use Case Complexity
Prompt Chaining Sequential chaining, step by step Copywriting pipeline Low
Routing Classification-based routing, specialized handling Intelligent customer service routing Low
Parallelization Parallel processing, aggregated results Multi-dimensional code review Medium
Orchestrator-Workers Dynamic decomposition, distributed execution Cross-file code modifications Medium-High
Evaluator-Optimizer Generate-evaluate, iterative refinement High-quality translation Medium
"Start with simple prompts, optimize them with comprehensive evaluation, and add multi-step agentic systems only when simpler solutions fall short."
Don't chase the most complex pattern — chase the most appropriate one. Start with the simplest Prompt Chaining, and only upgrade to a more complex pattern when you've confirmed the simpler approach isn't enough. For every layer of complexity you add, ask yourself: is the benefit worth the added latency, cost, and debugging overhead?

How “Pattern 1” becomes executable

“Prompt Chaining / Routing / Parallelization / Orchestrator-Workers / Evaluator-Optimizer” is not about a magic phrase. It is about giving the model enough information to know who the work is for, what must be done, and what counts as acceptable.

Background sets direction; constraints set the boundary

“Prompt Chaining / Routing / Parallelization / Orchestrator-Workers / Evaluator-Optimizer” shows why a useful request separates the task, audience, source material, output format, and constraints. Without background, the model guesses. Without acceptance criteria, fluent text is not evidence that the task is complete.

More words do not guarantee a better result

Turn “Prompt Chaining / Routing / Parallelization / Orchestrator-Workers / Evaluator-Optimizer” into a small experiment: change only one of background, requirements, or constraints while keeping the rest fixed, then observe which layer actually changes the output.

From “Pattern 1” to “Pattern 2”

“Pattern 1” grounds the problem in “1 Prompt Chaining Prompt Chain Break a large task into multiple sequential steps , where each step's output becomes the next step's input. Each step is an independent LLM call focused on doing one thing well. Q…”. “Pattern 2” then moves it toward “2 Routing Router First classify the input , then route it to a specialized processing branch. Each branch can have its own Prompt, model, or tool configuration. Core value: separation of concerns — each branch…”. Together, they show that the lesson is not just a conclusion to remember, but a claim with conditions.

Carry the judgment into the next situation

Build a request layer by layer: task and audience first, material and output rules next, constraints and acceptance checks last. Change one layer at a time so you know what actually helped.

  • “Pattern 1”: 1 Prompt Chaining Prompt Chain Break a large task into multiple sequential steps , where each step's output becomes the next step's input. Each step is an independent LLM call focused on doing one thing well. Q…
  • “Pattern 2”: 2 Routing Router First classify the input , then route it to a specialized processing branch. Each branch can have its own Prompt, model, or tool configuration. Core value: separation of concerns — each branch…
  • “Try It: Scheduler Simulator”: Prompt Chaining Routing Parallelization Orchestrator Evaluator Click the buttons above to see data-flow animations for each pattern Summary All Five Patterns at a Glance Pattern Core Idea Typical Use Case Compl…

The final “Try It: Scheduler Simulator” brings the discussion to “Prompt Chaining Routing Parallelization Orchestrator Evaluator Click the buttons above to see data-flow animations for each pattern Summary All Five Patterns at a Glance Pattern Core Idea Typical Use Case Compl…”. The useful thing to carry forward is knowing which judgments must be revisited when input, scale, or risk changes.

Mark as learned Your reading progress updates automatically
← PreviousNext →

Keep reading

The next useful article in the thread.

ARTICLE DISCUSSION

Leave one useful thought here.

Keep the idea that clicked, the question that stayed open, or a small note for the next learner.

Discussing Five Workflow Patterns Engineering Patterns for Reliable Agents
3discussionsArticle discussion · synced with the Circle
View in the learning circle
AM
Asha MorganContent editor
INSIGHTField note

I turned one judgment from this article into a small experiment I could run today. Knowing what to observe next is more useful than simply remembering the conclusion.

ARTICLE DISCUSSION7 helpful
LH
Lin HarperIndie developer
INSIGHTInsight

After reading this, I first looked for the conditions behind the idea instead of copying the method into a project. That order made the later trade-offs much clearer.

ARTICLE DISCUSSION5 helpful
KM
Kiki MooreProduct operations
QUESTIONQuestion

When this judgment reaches real work, which constraint should be added first? I am curious which step matters most between reading and the first practical attempt.

ARTICLE DISCUSSION4 helpful