The Supervisor-Worker Pattern: One Strong Model Plans, Cheaper Models Execute

TL;DR: In the supervisor-worker pattern, also called plan-and-execute, a capable model breaks a task into small, self-contained steps and cheaper models carry them out. A cheap evaluator checks each result, and failed steps retry on a stronger model. It cuts cost on repetitive multi-step work and makes each step more reliable. It adds overhead to short tasks and to work that needs continuous reasoning, so use it where steps can be specified plainly.
The supervisor-worker pattern splits an agent's job in two. A strong model does the thinking: it reads the goal, breaks it into steps, sets what "done" means for each one and decides which model handles it. Cheaper, faster models do the work: extract, format, classify, summarize. Information flows down from the supervisor and results flow back up. Workers never talk to each other.
The same idea goes by plan-and-execute, and Qurtoo had an article under each name. This is the merged version. For a short definition, see supervisor-worker pattern in the glossary; for a full build with cost tracking, see the supervisor-worker playbook.
Why it saves money
Most tokens in a multi-step workflow go to execution, not planning. If the planner writes a short plan and the workers handle the long, repetitive steps, most of your token volume runs on the cheapest model that can do each step. The gap between a provider's top and bottom tiers is large, so the savings can be too. Check your provider's current price list before you estimate, since prices change.
Research backs the direction. BudgetMLAgent ran cheap or free models as workers, cascaded to a stronger paid model only when they failed, and occasionally asked an "expert" model for help with planning. Against a single-agent setup on the strongest model, it cut cost per run by 94.2% and raised average success from 22.72% to 32.95% on the MLAgentBench tasks (Gandhi et al., arXiv 2411.07464).
Why it's more reliable
Steps in a chain multiply. At 98% success per step, 20 steps succeed together about 66.8% of the time (0.98 to the 20th power). At 95% over 10 steps it's about 59.9%. Narrow steps with clear inputs and outputs have higher per-step success, and that compounds.
Structure matters as much as step size. A study from Google Research, Google DeepMind and MIT found that independent agents with no coordinator amplified errors 17.2 times, while a centralized coordinator held that to 4.4 times by acting as a validation point (Kim et al., arXiv 2512.08296). The same paper found that under a fixed budget, per-agent reasoning capacity becomes too thin beyond 3 or 4 agents, which is a good reason to cap how many workers one supervisor runs at once.
Anthropic's research system uses this topology: a lead agent plans and hands pieces to parallel subagents. With Claude Opus 4 leading and Claude Sonnet 4 subagents, it outperformed single-agent Claude Opus 4 by 90.2% on Anthropic's internal research eval. Anthropic also found that upgrading the model gave a larger gain than doubling the token budget (Anthropic, multi-agent research system). Put the strongest model where the decisions are.
The supervisor prompt
The supervisor's prompt is where your most expensive tokens go, so it carries the most weight.
The Prompt:
You are a task supervisor. Break the user's request into subtasks
that worker agents can run.
For each subtask, output a JSON object with:
- "task_id": a sequential integer
- "instruction": a complete instruction for a worker. The worker has
NO context beyond this instruction, so include every piece of data
and every constraint it needs.
- "tier": "small" for extraction, formatting, classification and
simple generation; "medium" for tasks that need judgment or
synthesis. Never assign "large".
- "depends_on": task_ids that must finish first, or [] if none.
- "acceptance_criteria": how to check the output is correct.
Rules:
- Prefer independent tasks over long sequential chains.
- Never create more than 6 subtasks. If 1 or 2 will do, use 1 or 2.
- If one call can handle the whole request, return one subtask.
- Never combine two separate operations in one subtask.
Output only a valid JSON array.
User request: {user_request}
Why This Works: Each subtask forces three decisions: what to do, which tier does it, and what done looks like. The self-containment rule is the one that matters most, because a worker with partial context guesses. The cap on subtasks keeps coordination overhead down.
Expected Output:
[
{"task_id": 1, "instruction": "Extract every company name, founding year and headquarters city from the text below. Return a JSON array of objects with keys company, founded, hq. Text: ...", "tier": "small", "depends_on": [], "acceptance_criteria": "Valid JSON array; every object has all three keys; years as YYYY."},
{"task_id": 2, "instruction": "Using the data below, write a 200-word summary of how these companies are positioned. Data: ...", "tier": "medium", "depends_on": [1], "acceptance_criteria": "Under 250 words; cites specific data points."}
]
The worker and evaluator prompts
The Prompt (worker system prompt):
You are a worker agent. Do the task exactly as described, with no
preamble or commentary.
If you can't complete it with the information given, reply:
{"status": "failed", "reason": "<specific reason>"}
Otherwise reply:
{"status": "complete", "result": <your output>}
Why This Works: The worker has a two-outcome contract. A failure comes back as a clear signal the loop can act on, not as a partial answer that looks like success.
The Prompt (evaluator):
You are a quality checker. Decide whether this output meets the
criteria.
Task: {instruction}
Acceptance criteria: {acceptance_criteria}
Output to check:
{worker_output}
Reply with JSON: {"pass": true or false, "issues": ["specific problems"]}
Why This Works: Checking an output against a written spec is an easier job than producing it, so a small model can do it cheaply. Running it after every step stops one bad result from feeding the next step.
The orchestration loop
The loop resolves dependencies, runs independent tasks in parallel and retries failed small-tier tasks on the medium tier. Model IDs come from configuration so you can change them without touching code.
import json, os
from concurrent.futures import ThreadPoolExecutor, as_completed
import anthropic
client = anthropic.Anthropic()
# Set these to current model IDs from your provider's models page.
TIERS = {
"small": os.environ["WORKER_MODEL_SMALL"],
"medium": os.environ["WORKER_MODEL_MEDIUM"],
}
PLANNER_MODEL = os.environ["PLANNER_MODEL"]
SUPERVISOR_PROMPT = "..." # the supervisor prompt above, without its last line
WORKER_PROMPT = "..." # the worker system prompt above
def call(model, system, text, max_tokens=4096):
r = client.messages.create(model=model, max_tokens=max_tokens, system=system,
messages=[{"role": "user", "content": text}])
# Models with thinking on by default return a thinking block before the text.
reply = next((b.text for b in r.content if b.type == "text"), None)
if reply is None:
raise RuntimeError(f"No text in response (stop_reason={r.stop_reason})")
return json.loads(reply)
def plan(request):
return call(PLANNER_MODEL, SUPERVISOR_PROMPT, request, 8192)
def execute(task, results):
text = task["instruction"]
for dep in task["depends_on"]:
text += f"\n\nResult of task {dep}: {results[dep]['result']}"
out = call(TIERS[task["tier"]], WORKER_PROMPT, text)
if out["status"] == "failed" and task["tier"] == "small":
return execute({**task, "tier": "medium"}, results) # cascade once
if out["status"] == "failed":
raise RuntimeError(out["reason"])
return {**out, "task_id": task["task_id"]}
def run(request):
pending = {t["task_id"]: t for t in plan(request)}
results = {}
while pending:
ready = [t for t in pending.values() if all(d in results for d in t["depends_on"])]
if not ready:
raise RuntimeError("No runnable tasks: check depends_on for cycles")
with ThreadPoolExecutor(max_workers=len(ready)) as pool:
for f in as_completed([pool.submit(execute, t, results) for t in ready]):
r = f.result()
results[r["task_id"]] = r
del pending[r["task_id"]]
return results
Add the evaluator call inside execute before returning, and send repeated failures back to the supervisor to re-plan.
Don't economize on the planner
Some teams try to save money by planning on the cheapest model too. Vague plans produce vague steps, workers fail, retries pile up, and the total goes up instead of down. The Anthropic finding above points the same way: the model upgrade bought more than extra tokens did. Spend on the planner and save on the workers.
Cache plans for repeat work
If many requests share a shape, store the plans that worked as templates and reuse them. Agentic Plan Caching extracts plan templates from finished runs and adapts them to new requests with a small model. It cut cost by 50.31% on average across five agent workloads, and latency by 27.28% in its latency test while maintaining performance (Zhang et al., arXiv 2506.14852).
The Prompt:
Compare this request with the cached plan templates. Return the
template_id of a match, or "no_match".
It's a match only when the request type is the same, the subtasks
would be the same in number and kind, and only the data values differ.
Templates: {templates_json}
Request: {user_request}
Why This Works: Matching is a classification task a small model handles well. On a match you skip the planning call entirely.
When not to use it
Use the pattern when the workflow has several steps, each step can be specified with a clear input and output, and you run it often enough that the planning prompt pays for itself. Keep a single capable model when the task needs continuous reasoning across steps, such as debugging one tricky error or writing long-form prose, or when it's only one or two steps.
Watch total volume too. Anthropic reported that its multi-agent system used about 15 times more tokens than chat (Anthropic), and Gartner predicts over 40% of agentic AI projects will be canceled by the end of 2027, citing cost among the reasons (Gartner). Measure your own workload before you commit. For how workers should pass state back, see agent handoff protocols, and for the routing prompt behind a single conductor, see the conductor prompt. More is in the Agentic pillar.
Frequently asked questions
What is the supervisor-worker pattern?
It's an agent design where one model (the supervisor) breaks a task into steps and assigns them, and other models (the workers) carry out the steps and report back. Workers don't talk to each other, so all coordination runs through the supervisor.
Is plan-and-execute the same as supervisor-worker?
They describe the same core idea: plan once with a capable model, then run the steps with simpler ones. "Plan-and-execute" usually stresses the up-front plan, and "supervisor-worker" stresses the hierarchy and the review of each worker's result.
Which model should do the planning?
Your most capable model. The plan decides whether every later step succeeds, and Anthropic found a model upgrade gave a larger gain than doubling the token budget (Anthropic).
How many worker agents should one supervisor run?
Few. Under a fixed budget, the Google-led scaling study found per-agent reasoning capacity gets too thin beyond 3 to 4 agents (arXiv 2512.08296). Start with the smallest number that covers the independent parts of the task.
Terms in this article
From the library
Rather have someone set it up for you?
That's a fair call. LTFI, the agentic business operating system from Kief Studio, can set up the work these guides describe and run it with you. No website yet? Kief Studio will build you one for free.

