title: "Orchestration Patterns" last_updated: 2026-03-21 status: experimental difficulty: advanced prerequisites: [08-agent-teams, 09-headless-and-ci-cd]

Orchestration Patterns

Coming in V3. This module is scaffolded with an outline.

Core Question

What are the architecture options for coordinating multiple agents?

Module Outline

Concepts

  1. The orchestration spectrum — From simple sequential tasks to complex multi-agent systems. Most developers need the simpler end; know when to reach for the complex end.

  2. Pattern catalog:

    • Pipeline: Agent A → Agent B → Agent C (sequential, each transforms output)
    • Fan-Out/Fan-In: Parent dispatches N agents, collects results, synthesizes
    • Hierarchy: Lead agent delegates to specialist sub-agents
    • Swarm: Multiple autonomous agents with shared goals, minimal coordination
    • Event-Driven: Agents triggered by external events (webhooks, file changes, schedules)
  3. Choosing the right pattern — Decision framework based on: task independence, coordination needs, error tolerance, cost budget.

  4. Orchestration infrastructure — Scripts, SDKs, and frameworks for building agent orchestration beyond the CLI.

  5. State management — How to maintain shared state across agents: files, databases, structured artifacts.

  6. Error handling at scale — When one agent in a 10-agent pipeline fails: retry, skip, rollback, escalate.

  7. Cost optimization — Strategies for reducing token usage in multi-agent systems without sacrificing quality.

Tool-Specific Content

  • Claude Code: Claude Agent SDK, custom orchestration scripts, headless pipelines
  • Codex CLI: OpenAI Agents SDK, multi-instance patterns

Exercises

  1. Implement each pattern from the catalog on a real project task
  2. Build an orchestration script that coordinates 3+ agents
  3. Add error handling and recovery to a multi-agent workflow
  4. Benchmark: compare patterns on the same complex task