Agentic Workflow Patterns
The five composable workflow patterns seen in production, ordered by increasing complexity. Each wires The Augmented LLM calls through predefined code paths (they are workflows, not agents — see Workflows vs Agents). They are building blocks to shape and combine, not a prescriptive menu.
- Prompt chaining — decompose a task into a fixed sequence of steps, each call consuming the prior output; add programmatic gates between steps to keep it on track. Use when the task cleanly decomposes into fixed subtasks; trades latency for accuracy by making each call easier. (E.g. write copy → translate; outline → check → draft.)
- Routing — classify an input and dispatch it to a specialized follow-up. Use when distinct categories are better handled separately and classification is accurate (by LLM or classifier). Enables separation of concerns and specialized prompts; also routes easy queries to cheaper models and hard ones to stronger models.
- Parallelization — run calls simultaneously and aggregate. Two variants: sectioning (independent subtasks in parallel — e.g. one model answers while another screens for guardrails) and voting (same task run multiple times for diverse outputs — e.g. several prompts flag a code vulnerability, or vote thresholds balance false-positive/negative). Use when subtasks parallelize for speed, or multiple perspectives raise confidence.
- Orchestrator-workers — a central LLM dynamically breaks a task into subtasks, delegates to workers, and synthesizes results. Use when you can't predict the subtasks up front (e.g. how many files a coding change touches). The key difference from parallelization is that subtasks are determined by the orchestrator at runtime, not pre-defined.
- Evaluator-optimizer — one call generates, another evaluates and gives feedback in a loop. Use when you have clear evaluation criteria and iterative refinement adds measurable value — specifically when a human's articulated feedback would demonstrably improve the response and an LLM can supply that feedback. (E.g. literary translation; multi-round search where the evaluator decides if more searching is warranted.)
Claims
- Prompt chaining trades latency for accuracy by decomposing into fixed subtasks with gates between them. best practice — context: tasks that cleanly split into a fixed sequence; the latency cost is only worth it when each subtask is genuinely easier.
- Route inputs to specialized handlers when categories are distinct and classification is reliable. best practice — context: mixed input streams where optimizing one type degrades another; contingent on accurate classification being achievable.
- For complex tasks with multiple considerations, one LLM call per consideration beats one call doing everything. best practice — context: multi-aspect tasks (e.g. separate guardrail vs. core response); focused attention per aspect is what buys the gain.
- Orchestrator-workers differs from parallelization by determining subtasks at runtime, not in advance. observation — the flexibility (dynamic decomposition) is the whole distinction between the two topologically similar patterns.
- Evaluator-optimizer fits when criteria are clear and articulated feedback demonstrably improves output. best practice — context: iterative-refinement tasks; the two fit-signals (human feedback helps; an LLM can give that feedback) are the gating conditions.
- These patterns are composable building blocks, not prescriptive recipes — combine and customize per use case. principle — durable: the value is in fitting the pattern to the task, measured and iterated, never in adopting a canonical stack.
- The evaluator-optimizer loop can be packaged as a named, reusable artifact ("a loop") rather than re-derived each time. observation — an independent source (Forward Future's Loop Library) treats generate→evaluate→refine as a shareable object with a fixed anatomy and stop conditions; see Agent Loop.
- Orchestrator-workers can be given a native runtime substrate
— a shared task graph with dependency edges and per-task ownership —
rather than being wired ad-hoc in a prompt.
observation — a second source
(IndyDevDan's walkthrough of Claude Code's Task System) shows the
orchestrator delegating to a builder/validator team whose tasks block
and unblock each other via explicit
blocks/blockedByedges; see Agent Task Graph. - Chaining and routing compose cleanly into a real product
workflow with a gate before acceptance.
observation — a second source
(Buildable) wires Plan (classify/route the prompt to an archetype) →
Design → Generate → Review, where
reviewis the programmatic gate and the steps are interchangeable but the chain is the recommended path; a concrete instance of prompt-chaining-with-gates plus routing combined, per Eval-Driven Development's gate.
Related
- Workflows vs Agents — all five are workflows (predefined paths); an agent is the step beyond, where the LLM itself directs the process.
- The Augmented LLM — every node in these patterns is an augmented LLM call.
- Agentic Simplicity — reach for the simplest pattern that works; escalate only when it demonstrably helps.
- Eval-Driven Development — evaluator-optimizer is the eval flywheel collapsed into an inference-time loop: generate → evaluate → refine.
- LLM-as-Judge — the "evaluator" call and parallelization's "voting" variant are LLM-as-judge applied online (feedback loops and vote thresholds).
- Agent Loop — the evaluator-optimizer pattern made a bounded, reusable artifact.
- Agent Task Graph — orchestrator-workers with a native task-dependency runtime (Claude Code's Task System) instead of an ad-hoc orchestration prompt.
- Distillate: Building Effective Agents.
- Distillate: Forward-Future/loopy — a catalog and skill for bounded, reusable agent loops.
- Distillate: Claude Code Task System: Orchestrating a Team of Agents Through a Task Graph.
- Distillate: Buildable — A Local, Build-Verified App-Builder Brain for Coding Agents — Plan → Design → Generate → Review as routing + prompt-chaining with a real review gate.
- Distillate: Anthropic's
Claude Cookbooks — the canonical recipe index — first-party runnable
recipes for these patterns (
patterns/agents/, the Claude Agent SDK notebooks).
Linked from
- Agent Loop
- Agent Task Graph
- Agentic Simplicity
- Agentic UI Testing
- Anthropic's Claude Cookbooks — the canonical recipe index
- The Augmented LLM
- Bounded Fan-Out
- Building Effective Agents
- Claude Code Task System: Orchestrating a Team of Agents Through a Task Graph
- Do THIS Before You Lose Access to Fable 5 — war-game the missions, keep the blueprints
- Eval-Driven Development
- Finally. Agent Loops Clearly Explained. — loop engineering, decoded for the rest of us
- Forward-Future/loopy — a catalog and skill for bounded, reusable agent loops
- How Claude Is Creating a New Generation of Millionaires
- Layered Agentic Architecture
- LLM-as-Judge
- Make Fable 5 80% Cheaper (& Other Usage Cheat Codes) — five levers for spending a premium model less
- Model-Tier Routing
- My 4-Layer Claude Code + Playwright CLI Skill (Agentic Browser Automation & UI Testing)
- Repeated-Sampling Scaling
- Reusable Workflow Library
- Buildable — A Local, Build-Verified App-Builder Brain for Coding Agents
- Text-Space Optimization
- Workflows vs Agents