CertSafari
    Anthropic Claude Certified Architect – Professional (CCAR-P)· Lessons

    Domain 1 · Lesson 5/38

    Dynamic Decomposition: Orchestrator-Workers and Subagents

    Apply decomposition techniques for complex problem solving

    10 min read
    2.83% of exam
    6 sources
    Published 4 Oct 2026
    Docs as of 30 Sep 2026

    What you will be able to do

    • Explain how an orchestrator decides subtasks at runtime and hands them to workers
    • Use isolated subagent contexts so a subtask returns a short summary instead of filling the main context
    • Judge when splitting work across several agents is worth the extra tokens, and when one agent is the better choice

    1.Orchestrator-workers: when you can't predict the subtasks

    Fixed workflows break down when you can't list the subtasks before you see the input. In the orchestrator-workers workflow, a central LLM dynamically breaks the task down, delegates the pieces to worker LLMs, and synthesises their results. On a diagram it looks like parallelization. The difference is flexibility: the orchestrator chooses the subtasks for each specific input. Coding is Anthropic's example. How many files need to change, and what each change is, depends on the task. Searches that gather and analyse information from many sources also fit.

    Anthropic's cookbook runs the pattern in two phases. In the analysis and planning phase, the orchestrator receives the task and context, works out which approaches would be valuable, and writes structured subtask descriptions in XML. In the execution phase, each worker receives the original task, its own subtask description, and any extra context. Giving workers the original task as well as their own instructions is a deliberate design choice. The cookbook's demo asks for copy for an eco-friendly water bottle. The orchestrator decides on three approaches (technical-specifications, lifestyle-emotional and benefit-practical), and none of them was hard-coded.

    This flexibility has a price. The pattern makes N+1 LLM calls: one orchestrator plus N workers. The cookbook says not to use it for simple single-output tasks, for latency-critical applications, or when the subtasks are always the same, since simple parallelization handles that case. Its main failure mode is that the orchestrator might break the task down badly, so prompt engineering for the orchestrator is critical. One way to manage cost is to use Claude Opus for the orchestrator and Claude Haiku for the workers.

    Managed Agents provides this structure as a platform feature. Each delegated agent gets its own session thread, and threads persist, so the coordinator can send a follow-up to an agent it called earlier.

    Checkpoint 1 of 5· Put it in order

    Put the phases of the cookbook's orchestrator-workers run in order

    1. 1.Worker outputs are checked for empty responses and returned as coordinated results
    2. 2.Each worker receives the original task, its own subtask description and any extra context
    3. 3.The orchestrator receives the task and context and works out which approaches would be valuable
    4. 4.The orchestrator writes structured subtask descriptions in XML

    Checkpoint 2 of 5· Exam question

    A support-automation pipeline is decomposed into two subtasks: classifying a high volume of incoming tickets, and drafting detailed technical remediation plans for the subset that need engineering follow-up. How should model selection be applied across these decomposed subtasks?

    Sources123

    2.Isolated subagent context: decomposing to keep context clean

    Splitting work across agents doesn't only parallelise it. It also gives each piece a context of its own. Context windows are finite, and response quality can drop as context grows. When information from one subtask piles up and isn't relevant to the next, Anthropic calls it context pollution. Picture a support agent that looks up order history while it diagnoses a technical fault. If every lookup adds thousands of tokens, the agent reasons worse about the fault.

    The fix is to give the noisy subtask to an agent with a fresh context and have it return only what matters.

    A lookup subagent runs in its own context and returns only a summary to the main support agentpython
    class OrderLookupAgent:
        def lookup_order(self, order_id: str) -> dict:
            # Separate agent with its own context
            messages = [
                {"role": "user", "content": f"Get essential details for order {order_id}"}
            ]
            response = client.messages.create(
                model="claude-sonnet-4-5",
                max_tokens=1024,
                messages=messages,
                tools=[get_order_details_tool]
            )
            # Returns only essential information
            return extract_summary(response)

    The lookup agent reads the full order history. The main agent gets only the 50–100 tokens it needs. Isolation works best under three conditions: the subtask generates a lot of context (more than 1000 tokens) that is mostly irrelevant to the main task, the subtask is well-defined with clear criteria for what to extract, and the operation is a lookup or retrieval that needs filtering before use.

    The Agent SDK builds this in. Each subagent runs in its own conversation, and its intermediate tool calls and results stay inside it. A research subagent can explore dozens of files, and the parent receives a concise summary. Anthropic's research system describes the same thing as compression: subagents explore different aspects of a question in parallel, each in its own context window, then condense the most important tokens for the lead agent. Each subagent also gets its own tools, prompts and exploration path, which reduces path dependency.

    Checkpoint 3 of 5· Check yourself

    An Agent SDK subagent reads 40 files while investigating a bug. What does the parent agent's conversation receive?

    Sources456

    3.Is the multi-agent split worth its cost?

    The basic multi-agent research loop is short. A lead agent splits a question into independent facets, runs subagents on them concurrently, and synthesises their results. Complete the sample below.

    Checkpoint 4 of 5· Fill the gap

    Which asyncio call makes the facet subagents run concurrently?

    async def research_topic(query: str) -> dict:
        # Lead agent breaks query into research facets
        facets = await lead_agent.decompose_query(query)
    
        # Spawn subagents to research each facet in parallel
        tasks = [
            research_subagent(facet)
            for facet in facets
        ]
        results = await asyncio. ? (*tasks)
    
        # Lead agent synthesizes findings
        return await lead_agent.synthesize(results)

    This split can pay off a lot. With Claude Opus 4 leading and Claude Sonnet 4 subagents, Anthropic's multi-agent system beat single-agent Claude Opus 4 by 90.2% on an internal research eval. When asked to find the board members of every Information Technology company in the S&P 500, the multi-agent system found the answers by splitting the job into subtasks, while the single agent's slow sequential searches failed. Token usage alone explained 80% of the performance variance on BrowseComp. Splitting the work is largely a way to spend more tokens on the problem.

    The cost is real too. Multi-agent implementations typically use 3–10x more tokens than single-agent approaches for the same task. Another measurement puts multi-agent systems at about 15× the tokens of chat. The task has to be valuable enough to pay for that. Anthropic has also seen teams spend months building elaborate multi-agent architectures, only to find that better prompting on a single agent got the same results.

    Some problems split badly. Domains where every agent needs the same context, or where agents depend heavily on each other, are a poor fit today. Most coding tasks have fewer truly parallelisable pieces than research. That doesn't contradict orchestrator-workers listing coding as a use case: one orchestrator directing file-level workers is a different thing from a team of agents coordinating in real time. Managed Agents says multiagent coordination is best suited to complex tasks that need work across many surfaces, or where several well-scoped tasks contribute to an overall goal.

    The three situations where splitting work across agents consistently pays off
    SituationSignal in your problemWhat the split buys you
    Context pollutionA subtask generates lots of context (more than 1000 tokens) that is mostly irrelevant to the main taskEach subagent works in its own clean context and returns a compact summary
    Parallelizable workIndependent facets of a large search or research spaceWider coverage than one agent can reach within its context limits
    SpecializationToo many tools (often 20+), tools spanning unrelated domains, or new tools degrading existing tasksFocused toolsets and prompts that improve reliability

    Checkpoint 5 of 5· Exam question

    A decomposed data-processing workflow requires Claude to invoke dozens of small tools in a tight loop, and issuing each call through the standard conversational tool-use turn is adding significant latency and token overhead. Which technique addresses this?

    Sources165

    Exam traps

    Each one states something that sounds right. Open it to see what is actually true.

    1. 1.Running subagents in parallel means a multi-agent system finishes faster than a single agent.Why is that wrong?

      Parallelism shortens the time compared with doing the same work in sequence. But multi-agent systems often take longer overall than single-agent ones because they do so much more total computation. The benefit is thoroughness.

      Covered in Is the multi-agent split worth its cost?

    2. 2.Any complex task gets better when you split it across several agents.Why is that wrong?

      Tasks where all agents need the same context, or with many dependencies between agents, are a poor fit. Coding usually has fewer truly parallelisable pieces than research.

      Covered in Is the multi-agent split worth its cost?

    Sources

    Every claim above is drawn from one of these pages, quoted as it was written on the date shown.

    1. 1.
      “Threads are persistent: the coordinator can send a follow-up to an agent it called earlier, and that agent retains everything from its previous turns.”
      ↩︎ Orchestrator-workers: when you can't predict the subtasks
      “best suited for complex tasks that either require work across a variety of surfaces, or where multiple well-scoped tasks contribute to an overall goal”
      ↩︎ Is the multi-agent split worth its cost?
    2. 2.
      “In the orchestrator-workers workflow, a central LLM dynamically breaks down tasks, delegates them to worker LLMs, and synthesizes their results.”
      ↩︎ Orchestrator-workers: when you can't predict the subtasks
    3. 3.
      “Orchestrator might not break down tasks optimally (prompt engineering is critical)”
      ↩︎ Orchestrator-workers: when you can't predict the subtasks
      “Consider using Claude Opus for the orchestrator and Claude Haiku for workers to optimize cost vs. quality”
      ↩︎ Orchestrator-workers: when you can't predict the subtasks
      “The orchestrator LLM receives the task and context, analyzes what approaches would be valuable, and generates structured subtask descriptions in XML format.”
      ↩︎ Checkpoint
    4. 4.
      “intermediate tool calls and results stay inside the subagent; only its final message returns to the parent”
      ↩︎ Isolated subagent context: decomposing to keep context clean
    5. 5.
      “Subagents provide isolation, with each operating in its own clean context focused on its specific task.”
      ↩︎ Isolated subagent context: decomposing to keep context clean
      “In our testing, multi-agent implementations typically use 3-10x more tokens than single-agent approaches for equivalent tasks.”
      ↩︎ Is the multi-agent split worth its cost?
      “improved prompting on a single agent achieved equivalent results”
      ↩︎ Is the multi-agent split worth its cost?
      “multi-agent systems often take longer overall than single-agent systems because of the sheer increase in total computation”
      ↩︎ Exam trap 1
      “The primary benefit of parallelization is thoroughness, not speed.”
      ↩︎ Prediction
    6. 6.
      “The essence of search is compression: distilling insights from a vast corpus.”
      ↩︎ Isolated subagent context: decomposing to keep context clean
      “outperformed single-agent Claude Opus 4 by 90.2% on our internal research eval”
      ↩︎ Is the multi-agent split worth its cost?
      “most coding tasks involve fewer truly parallelizable tasks than research”
      ↩︎ Exam trap 2

    Ready to test yourself?

    Practise the 12 questions on this subdomain.

    Spotted a mistake, or was something unclear? Tell us.