Choose Reliable Orchestration Patterns
Match deterministic workflows, model-directed routing, manager patterns, parallel work, and review loops to the uncertainty and control needs of a task.
By the end
You will be able to
- Choose between direct execution, deterministic workflow, manager, handoff, parallel, and evaluator patterns.
- Keep routing, budgets, shared state, and terminal conditions observable.
- Use concurrency only for independent work and reconcile partial failure deterministically.
- Distinguish portable orchestration concepts from provider-specific framework features.
Use the simplest control structure that fits the uncertainty
A direct model call or fixed sequence is easier to test than an open-ended agent. Add model-directed routing only when the next step depends on semantic judgment that deterministic code cannot express economically.
Write down why each agent boundary exists. Specialization should reduce prompt conflict, permission breadth, or evaluation ambiguity enough to justify extra latency, cost, state transfer, and failure modes.
Keep known control flow in code
Sequential workflows fit ordered dependencies. Parallel workflows fit independent branches. Bounded loops fit iterative improvement with a measurable exit. Conditional routes fit decisions based on validated state.
Google ADK describes sequential, loop, and parallel workflow agents as deterministic execution patterns. The same portable idea applies outside ADK: application code owns the graph while models perform bounded nodes.
intake -> classify
classify -> {direct | specialist | human}
specialist -> verify
verify -> {accept | revise once | escalate}
Every edge records input version, output version, decision, and budget.Decide who retains control
In a manager pattern, one agent owns the user-facing result and invokes specialists as tools. This centralizes synthesis, guardrails, and budget control. It also makes the manager a bottleneck and requires it to evaluate specialist output.
In a handoff pattern, a router transfers control to a specialist. This narrows active instructions and lets the specialist interact directly, but the handoff contract must preserve user intent, trusted facts, permissions, unresolved questions, and return conditions.
Parallelize independence, then make the join explicit
Run branches concurrently only when they do not mutate the same state, depend on each other's results, or consume a shared scarce limit in an unsafe way. Give each branch its own scope, budget, idempotency keys, and evidence contract.
The join must define required versus optional branches, timeout behavior, conflicting evidence, retry ownership, cancellation, and partial-result policy. Do not let whichever branch finishes last silently become the answer.
Trace the graph and bound every edge
Record a run ID, parent and child span, active agent, route reason, input and output contract versions, tool calls, approvals, token or cost budget, retries, and terminal state. Keep sensitive content out of telemetry while retaining useful hashes and references.
Provider frameworks expose different primitives: Anthropic discusses workflow and agent patterns, OpenAI documents managers and handoffs, and Google ADK provides workflow and collaborative structures. Treat those as implementation options and test the same product-level invariants across them.
Practice activity
Design and simulate an orchestration graph
- Choose a real task and compare direct, deterministic workflow, manager, and handoff designs using quality, risk, latency, cost, and debuggability.
- Create the smallest justified graph with typed node inputs, outputs, budgets, permissions, retry limits, and terminal states.
- Add one parallel branch only if independence is proven, then define its join, timeout, cancellation, conflict, and partial-failure policies.
- Simulate normal completion, a bad route, conflicting branch evidence, specialist timeout, repeated revision, and human escalation.
What to produce
- A pattern decision record and versioned orchestration graph with explicit contracts on every edge.
- Six trace records showing routes, budgets, failures, joins, and deterministic terminal states.
Reflect before continuing
Which proposed agent became unnecessary after the control-flow decision was made explicit?
Evidence
Sources and verification
- Building effective agentsAnthropic · verified 2026-07-25
- Agent orchestrationOpenAI · verified 2026-07-25
- Template agent workflowsGoogle · verified 2026-07-25
Knowledge check
Make it stick.
Choose the strongest answer for each question. Your attempts become part of your device-local transcript.