Orchestrator-Workers
Some requests are simply too big or too varied for one AI agent to handle well on its own. You want to divide the work across focused specialists — without turning yourself into a project manager who has to split every task, chase updates, and stitch mismatched answers back together.
Orchestrator-Workers gives a multi-part request a single point of ownership. One lead agent takes responsibility for the whole outcome, delegates bounded subtasks to worker agents in parallel, and makes sure the finished pieces actually agree before handing you one coherent result. Reach for it whenever a request naturally splits into specialized parts that still have to fit together at the end.
Party, Request
Why splitting work alone isn't enough
When a single agent session runs out of context or tries to juggle too many specialties at once — whether across engineering, research synthesis, report writing, data pipelines, or operations — dividing the request across parallel workers is an obvious move. Each worker gets a smaller, clearer brief and finishes faster.
The catch shows up when the pieces come back. Because each worker operates in isolation on only its own slice, every worker can faithfully satisfy its own brief while the combined output still fails as a whole: pieces contradict each other, duplicate responsibility, leave gaps at the seam, or quietly rely on different assumptions. If an orchestrator merely fans out subtasks and relays each worker's completion back to the requester, nobody owns whether the pieces actually fit together.
Orchestrator-Workers treats putting the pieces together as first-class work, not an afterthought. It rests on three structural rules enforced by the system rather than left to prompt reminders:
- One Lead agent owns the whole request end to end and is the sole voice reporting back to the requester.
- Combining the pieces is planned upfront. When splitting the request into subtasks, the lead creates an explicit integration job at the same time — defining how the finished parts will be combined, reconciled, or verified together.
- The Hub enforces completion in code. The request cannot be reported finished until every subtask and the integration job are complete.
Why plan the integration job before workers even start? Naming how the pieces will be combined or checked at split time — while the full picture is still in one head — forces shared assumptions (which pricing tier, which field name, which interface) into the open before isolated workers have a chance to diverge.
Architecture and participants
You do not need exotic infrastructure to run this pattern. Think of the
Hub as a durable state store and rule checker — like a
small state machine sitting between agents — and each Job
as a tracked task ticket with one owner. Exactly one Lead agent
owns the Request for the Requester;
workers never answer the requester directly, and the hub enforces completion rules in code
so a lead cannot wave past an open integration job.
Party,
Request, and Job
records and rejects any state transition that violates ownership or integration
invariants.
Execution flow
Toggle between the normal flow — where finished subtasks fit together on the first integration pass — and the repair loop — where the hub blocks premature completion and forces a targeted fix before the requester is ever interrupted.
The lead declares the integration job at split time before dispatching workers. Once every subtask finishes and the integration job combines and verifies the whole output, the hub accepts completion and delivers one result to the requester.
Same steps 1–6 as normal flow; begins after workers finish their subtasks in isolation.
If the lead tries to close early, the hub rejects the request with
integration_job_not_done. Running the integration job
exposes the seam conflict, keeps the request open, dispatches a targeted repair
subtask, and re-runs integration before delivering one verified result.
Optional Checker: In either flow, the Lead agent may run the integration job directly (shown above) or delegate it to an independent Checker — the hub enforces the exact same completion gate either way.
Concrete examples
The pattern itself does not depend on code, repositories, or unit tests. Any multi-part request where isolated subtasks can succeed locally while contradicting or colliding across boundaries follows the exact same structure.
Example 1 — Cloud database research brief
No code or unit tests- Request
- Compare two cloud databases in a one-page brief.
- Split
-
Subtask 1 (pricing research →
Worker 1), Subtask 2 (limits & performance research →Worker 2), and Integration job (combine and reconcile both sections into one brief →Lead agent). - Seam failure
-
Both workers write accurate sections on their own, but
Worker 1covered the Enterprise tier whileWorker 2covered the Free tier. Put together as-is, the brief contradicts itself on pricing, throughput, and limits. - Resolution
- The integration job catches the tier mismatch before the requester ever sees the draft, dispatches a quick follow-up subtask to align both sections on the same tier, re-combines the brief, and delivers one coherent report.
Example 2 — Account settings timezone field
Simple API + UI- Request
- Add a timezone selector to account settings.
- Split
-
Subtask 1 (backend API endpoint →
Worker 1), Subtask 2 (frontend settings form →Worker 2), and Integration job (save a timezone through the UI and read it back from the API →Lead agentor optionalChecker). - Seam failure
-
Both pieces look clean in isolation, yet the API expects
time_zone("America/Los_Angeles") while the form sendstimezone("-08:00"). Wired together, saving silently drops the user's choice. - Resolution
- The integration job catches the field name and format mismatch, keeps the request open, dispatches a targeted repair subtask to align the form with the API contract, re-runs the save-and-read check, and delivers one working feature.
What this pattern is NOT — Independent batch checks
Negative example- Request
- Run the same lint check across 20 unrelated files, or fix a small copy typo in one document.
- Why skip it
- In the 20-file batch, every file is completely independent — there is no shared seam to reconcile, so plain parallel workers finish faster with less coordination tax. And for a small single-session edit, one focused agent finishes cleanly without splitting at all.
When to use and when to skip
Use Orchestrator-Workers when
- The request spans two or more subsystems, research tracks, documents, or repositories with a shared seam or assumption boundary between them.
- Specialists benefit from isolated context windows so neither worker gets drowned in the other's details.
- The requester wants one accountable summary and proof that the combined output holds together.
- Parallelism meaningfully cuts wall-clock time while a lead coordinates shared contracts.
Skip it when
- One focused agent can complete and verify the entire request in a single context window without handoff overhead.
- The subtasks are genuinely independent items with no shared assumptions, state, or integration boundary (file separate requests instead).
- The work is an open-ended exploration spike where you do not yet know the right decomposition.
- Coordination latency exceeds the time saved by running subtasks in parallel.
Data model and hub invariants
Orchestrator-Workers introduces two durable tables — parties
and requests — and references jobs
(defined in detail by Durable Job). Keeping integration_job_id
as a nullable foreign key on requests allows single-subtask
requests to stay lightweight while making multi-subtask integration structurally enforceable.
Request holds one requester, one lead, and an optional
pointer to its integration Job. Cardinality markers
follow the catalog convention (1,
1?, 1+,
n).
Table: parties
| Column | Postgres type | Nullability | Notes |
|---|---|---|---|
| id | uuid | NOT NULL, PK | Stable identifier referenced across all hub records. |
| kind | text | NOT NULL | CHECK (kind IN ('human', 'agent', 'system')). |
| display_name | text | NOT NULL | Human-readable name shown in status views and audit trails. |
| created_at | timestamptz | NOT NULL | Defaults to now(). |
Table: requests
| Column | Postgres type | Nullability | Notes |
|---|---|---|---|
| id | uuid | NOT NULL, PK | Unique request identifier. |
| requester_id | uuid | NOT NULL, FK | References parties(id); human or upstream owner. |
| lead_id | uuid | NOT NULL, FK | References parties(id); single accountable orchestrator. |
| integration_job_id | uuid | NULLABLE, FK | References jobs(id); required once split into multiple subtasks. |
| status | text | NOT NULL | CHECK (status IN ('open', 'finished', 'canceled')). |
| goal | text | NOT NULL | Concise goal statement anchored to the requester's intent. |
| finished_at | timestamptz | NULLABLE | Set atomically when status transitions to finished. |
Six hub invariants
-
01Every request has exactly one lead Database constraint
requests.lead_idisNOT NULLwith a foreign key toparties(id), preventing unowned requests or diffuse multi-lead ambiguity. -
02Integration job belongs to the same request Database constraint
A composite foreign key
(id, integration_job_id)referencingjobs(request_id, id)guarantees a lead cannot satisfy a request by pointing at a completed job from an unrelated request. -
03Finished timestamp matches finished status Database constraint
A
CHECKconstraint enforces(status = 'finished') = (finished_at IS NOT NULL)so derived boards and SLA metrics never see half-closed rows. -
04Only the lead may split or close a request Hub guard
Both
splitandreport_finishedcheckactor_id == request.lead_id. Workers finish their assigned subtasks but cannot prematurely declare the parent request done. -
05Every job finish requires evidence from its assignee Hub guard
finish_jobverifies that the caller matchesjob.assignee_idand supplies a non-empty evidence reference (synthesized report, replay output, diff, or verification artifact — whatever proves the job's outcome) before marking the job passed. -
06Multi-subtask completion requires completed subtasks and integration Hub guard
When a request has more than one subtask job,
report_finishedrejects closure withintegration_job_not_doneunless the linked integration job is present and in statepassed.
Reference implementation
The same minimal hub state machine in Lean, TypeScript, Python, and Elixir. Notice how little code is required once the invariants live in hub transitions instead of prompt wording.
-- Hub guards for Orchestrator-Workers (enforced in code, never in prompts)
import Std.Data.HashMap
open Std (HashMap)
inductive JobRole where
| subtask | integration
deriving Repr, BEq
inductive JobStatus where
| pending | passed | failed
deriving Repr, BEq
inductive RequestStatus where
| «open» | finished -- «» lets a keyword like `open` be used as a name
deriving Repr, BEq
structure Request where
id : String
requesterId : String
leadId : String
status : RequestStatus := .open
integrationJobId : Option String := none
deriving Repr
structure Job where
id : String
requestId : String
assigneeId : String
role : JobRole
status : JobStatus := .pending
evidenceRef : Option String := none
deriving Repr
inductive HubError where
| unknownRequest | unknownJob
| onlyLeadMaySplit | atLeastOneSubtaskRequired
| onlyLeadMayAddRepairJob | requestNotOpen
| onlyAssigneeMayFinishJob | evidenceRequired
| onlyLeadMayReportFinished | subtaskJobsIncomplete | integrationJobNotDone
deriving Repr, BEq
-- The hub is plain data; every guard returns a new hub or an error.
structure Hub where
requests : HashMap String Request := {}
jobs : HashMap String Job := {}
namespace Hub
def mustGetRequest (hub : Hub) (id : String) : Except HubError Request :=
match hub.requests.get? id with
| some req => pure req
| none => throw .unknownRequest
-- `subtasks` and `integration` are (jobId, assigneeId) pairs.
def split (hub : Hub) (requestId actorId : String)
(subtasks : List (String × String)) (integration : String × String) :
Except HubError Hub := do
let req ← hub.mustGetRequest requestId
unless req.leadId == actorId do throw .onlyLeadMaySplit
if subtasks.isEmpty then throw .atLeastOneSubtaskRequired
let jobs := subtasks.foldl (init := hub.jobs) fun jobs (id, assigneeId) =>
jobs.insert id { id, requestId, assigneeId, role := .subtask }
let (intId, intAssignee) := integration
let jobs := jobs.insert intId
{ id := intId, requestId, assigneeId := intAssignee, role := .integration }
let req := { req with integrationJobId := some intId }
pure { hub with requests := hub.requests.insert requestId req, jobs }
def addRepairJob (hub : Hub) (requestId actorId jobId assigneeId : String) :
Except HubError Hub := do
let req ← hub.mustGetRequest requestId
unless req.leadId == actorId do throw .onlyLeadMayAddRepairJob
unless req.status == .open do throw .requestNotOpen
let jobs := hub.jobs.insert jobId { id := jobId, requestId, assigneeId, role := .subtask }
-- A repair invalidates the integration check: it must run again.
let jobs := match req.integrationJobId with
| some intId => jobs.modify intId fun check =>
{ check with status := .pending, evidenceRef := none }
| none => jobs
pure { hub with jobs }
def finishJob (hub : Hub) (jobId actorId : String) (passed : Bool) (evidenceRef : String) :
Except HubError Hub := do
let some job := hub.jobs.get? jobId | throw .unknownJob
unless job.assigneeId == actorId do throw .onlyAssigneeMayFinishJob
if evidenceRef.trimAscii.isEmpty then throw .evidenceRequired
let status := if passed then JobStatus.passed else .failed
let job := { job with status, evidenceRef := some evidenceRef }
pure { hub with jobs := hub.jobs.insert jobId job }
def reportFinished (hub : Hub) (requestId actorId : String) :
Except HubError (Request × Hub) := do
let req ← hub.mustGetRequest requestId
unless req.leadId == actorId do throw .onlyLeadMayReportFinished
-- `(·.requestId == requestId)` is shorthand for `fun j => j.requestId == requestId`.
let allJobs := hub.jobs.values.filter (·.requestId == requestId)
let subtaskJobs := allJobs.filter (·.role == .subtask)
if subtaskJobs.any (·.status != .passed) then throw .subtaskJobsIncomplete
if subtaskJobs.length > 1 then
-- `>>=` chains the two lookups: no integration id, or no such job, gives `none`.
match req.integrationJobId >>= hub.jobs.get? with
| some check => unless check.status == .passed do throw .integrationJobNotDone
| none => throw .integrationJobNotDone
let req := { req with status := .finished }
pure (req, { hub with requests := hub.requests.insert requestId req })
end Hub
-- Invariant: a lead can never finish a request that the hub doesn't know.
theorem reportFinished_unknown (id actor : String) :
({} : Hub).reportFinished id actor = throw .unknownRequest := by
simp [Hub.reportFinished, Hub.mustGetRequest]; rfl
// Hub guards for Orchestrator-Workers (enforced in code, never in prompts)
type JobRole = "subtask" | "integration";
type JobStatus = "pending" | "passed" | "failed";
interface Request {
id: string;
requesterId: string;
leadId: string;
status: "open" | "finished";
integrationJobId: string | null;
}
interface Job {
id: string;
requestId: string;
assigneeId: string;
role: JobRole;
status: JobStatus;
evidenceRef: string | null;
}
class Hub {
private requests = new Map<string, Request>();
private jobs = new Map<string, Job>();
split(
requestId: string,
actorId: string,
subtasks: Array<{ id: string; assigneeId: string }>,
integration: { id: string; assigneeId: string }
): void {
const req = this.mustGetRequest(requestId);
if (req.leadId !== actorId) throw new Error("only_lead_may_split");
if (subtasks.length === 0) throw new Error("at_least_one_subtask_required");
for (const s of subtasks) {
this.jobs.set(s.id, {
id: s.id, requestId, assigneeId: s.assigneeId,
role: "subtask", status: "pending", evidenceRef: null
});
}
this.jobs.set(integration.id, {
id: integration.id, requestId, assigneeId: integration.assigneeId,
role: "integration", status: "pending", evidenceRef: null
});
req.integrationJobId = integration.id;
}
addRepairJob(requestId: string, actorId: string, jobId: string, assigneeId: string): void {
const req = this.mustGetRequest(requestId);
if (req.leadId !== actorId) throw new Error("only_lead_may_add_repair_job");
if (req.status !== "open") throw new Error("request_not_open");
this.jobs.set(jobId, {
id: jobId, requestId, assigneeId,
role: "subtask", status: "pending", evidenceRef: null
});
if (req.integrationJobId) {
const check = this.jobs.get(req.integrationJobId);
if (check) {
check.status = "pending";
check.evidenceRef = null;
}
}
}
finishJob(jobId: string, actorId: string, passed: boolean, evidenceRef: string): void {
const job = this.jobs.get(jobId);
if (!job) throw new Error("unknown_job");
if (job.assigneeId !== actorId) throw new Error("only_assignee_may_finish_job");
if (!evidenceRef.trim()) throw new Error("evidence_required");
job.status = passed ? "passed" : "failed";
job.evidenceRef = evidenceRef;
}
reportFinished(requestId: string, actorId: string): Request {
const req = this.mustGetRequest(requestId);
if (req.leadId !== actorId) throw new Error("only_lead_may_report_finished");
const allJobs = [...this.jobs.values()].filter((j) => j.requestId === requestId);
const subtaskJobs = allJobs.filter((j) => j.role === "subtask");
if (subtaskJobs.some((j) => j.status !== "passed")) {
throw new Error("subtask_jobs_incomplete");
}
if (subtaskJobs.length > 1) {
const check = req.integrationJobId ? this.jobs.get(req.integrationJobId) : null;
if (!check || check.status !== "passed") {
throw new Error("integration_job_not_done");
}
}
req.status = "finished";
return req;
}
private mustGetRequest(id: string): Request {
const req = this.requests.get(id);
if (!req) throw new Error("unknown_request");
return req;
}
}
# Hub guards for Orchestrator-Workers (enforced in code, never in prompts)
from dataclasses import dataclass
from typing import Literal, Optional
@dataclass
class Request:
id: str
requester_id: str
lead_id: str
status: Literal["open", "finished"] = "open"
integration_job_id: Optional[str] = None
@dataclass
class Job:
id: str
request_id: str
assignee_id: str
role: Literal["subtask", "integration"]
status: Literal["pending", "passed", "failed"] = "pending"
evidence_ref: Optional[str] = None
class HubError(Exception):
pass
class Hub:
def __init__(self) -> None:
self.requests: dict[str, Request] = {}
self.jobs: dict[str, Job] = {}
def split(
self,
request_id: str,
actor_id: str,
subtasks: list[tuple[str, str]],
integration: tuple[str, str],
) -> None:
req = self._get_request(request_id)
if req.lead_id != actor_id:
raise HubError("only_lead_may_split")
if not subtasks:
raise HubError("at_least_one_subtask_required")
for job_id, assignee_id in subtasks:
self.jobs[job_id] = Job(job_id, request_id, assignee_id, role="subtask")
int_id, int_assignee = integration
self.jobs[int_id] = Job(int_id, request_id, int_assignee, role="integration")
req.integration_job_id = int_id
def add_repair_job(
self, request_id: str, actor_id: str, job_id: str, assignee_id: str
) -> None:
req = self._get_request(request_id)
if req.lead_id != actor_id:
raise HubError("only_lead_may_add_repair_job")
if req.status != "open":
raise HubError("request_not_open")
self.jobs[job_id] = Job(job_id, request_id, assignee_id, role="subtask")
if req.integration_job_id and req.integration_job_id in self.jobs:
check = self.jobs[req.integration_job_id]
check.status = "pending"
check.evidence_ref = None
def finish_job(
self, job_id: str, actor_id: str, passed: bool, evidence_ref: str
) -> None:
job = self.jobs.get(job_id)
if job is None:
raise HubError("unknown_job")
if job.assignee_id != actor_id:
raise HubError("only_assignee_may_finish_job")
if not evidence_ref.strip():
raise HubError("evidence_required")
job.status = "passed" if passed else "failed"
job.evidence_ref = evidence_ref
def report_finished(self, request_id: str, actor_id: str) -> Request:
req = self._get_request(request_id)
if req.lead_id != actor_id:
raise HubError("only_lead_may_report_finished")
req_jobs = [j for j in self.jobs.values() if j.request_id == request_id]
subtask_jobs = [j for j in req_jobs if j.role == "subtask"]
if any(j.status != "passed" for j in subtask_jobs):
raise HubError("subtask_jobs_incomplete")
if len(subtask_jobs) > 1:
check = self.jobs.get(req.integration_job_id or "")
if check is None or check.status != "passed":
raise HubError("integration_job_not_done")
req.status = "finished"
return req
def _get_request(self, request_id: str) -> Request:
req = self.requests.get(request_id)
if req is None:
raise HubError("unknown_request")
return req
# Hub guards for Orchestrator-Workers (pure functional core)
defmodule Hub do
defstruct requests: %{}, jobs: %{}
def split(%Hub{} = hub, req_id, actor_id, subtasks, {int_id, int_assignee}) do
with {:ok, req} <- fetch_request(hub, req_id),
true <- req.lead_id == actor_id || {:error, :only_lead_may_split},
true <- subtasks != [] || {:error, :at_least_one_subtask_required} do
subtask_jobs =
Map.new(subtasks, fn {id, assignee} ->
{id, %{id: id, request_id: req_id, assignee_id: assignee, role: :subtask, status: :pending, evidence: nil}}
end)
int_job = %{
id: int_id, request_id: req_id, assignee_id: int_assignee,
role: :integration, status: :pending, evidence: nil
}
updated_req = %{req | integration_job_id: int_id}
{:ok,
%{
hub
| requests: Map.put(hub.requests, req_id, updated_req),
jobs: hub.jobs |> Map.merge(subtask_jobs) |> Map.put(int_id, int_job)
}}
end
end
def add_repair_job(%Hub{} = hub, req_id, actor_id, job_id, assignee_id) do
with {:ok, req} <- fetch_request(hub, req_id),
true <- req.lead_id == actor_id || {:error, :only_lead_may_add_repair_job},
true <- req.status == :open || {:error, :request_not_open} do
repair = %{
id: job_id, request_id: req_id, assignee_id: assignee_id,
role: :subtask, status: :pending, evidence: nil
}
jobs =
hub.jobs
|> Map.put(job_id, repair)
|> reset_integration_job(req.integration_job_id)
{:ok, %{hub | jobs: jobs}}
end
end
defp reset_integration_job(jobs, nil), do: jobs
defp reset_integration_job(jobs, int_id) do
Map.update(jobs, int_id, nil, fn check -> %{check | status: :pending, evidence: nil} end)
end
def finish_job(%Hub{} = hub, job_id, actor_id, passed?, evidence) do
with {:ok, job} <- Map.fetch(hub.jobs, job_id) |> or_error(:unknown_job),
true <- job.assignee_id == actor_id || {:error, :only_assignee_may_finish_job},
true <- String.trim(evidence) != "" || {:error, :evidence_required} do
status = if passed?, do: :passed, else: :failed
updated = %{job | status: status, evidence: evidence}
{:ok, %{hub | jobs: Map.put(hub.jobs, job_id, updated)}}
end
end
def report_finished(%Hub{} = hub, req_id, actor_id) do
with {:ok, req} <- fetch_request(hub, req_id),
true <- req.lead_id == actor_id || {:error, :only_lead_may_report_finished},
:ok <- check_subtasks_and_integration(hub, req) do
finished = %{req | status: :finished}
{:ok, finished, %{hub | requests: Map.put(hub.requests, req_id, finished)}}
end
end
defp check_subtasks_and_integration(hub, req) do
subtasks =
hub.jobs
|> Map.values()
|> Enum.filter(&(&1.request_id == req.id and &1.role == :subtask))
cond do
Enum.any?(subtasks, &(&1.status != :passed)) ->
{:error, :subtask_jobs_incomplete}
length(subtasks) > 1 ->
case Map.get(hub.jobs, req.integration_job_id) do
%{status: :passed} -> :ok
_ -> {:error, :integration_job_not_done}
end
true ->
:ok
end
end
defp fetch_request(hub, id), do: hub.requests |> Map.fetch(id) |> or_error(:unknown_request)
defp or_error({:ok, val}, _err), do: {:ok, val}
defp or_error(:error, err), do: {:error, err}
end
Failure and repair trace
Walking Example 2 (account settings timezone field) through these guards
shows the exact moment the hub blocks premature completion with
integration_job_not_done and forces the repair loop:
1. hub.split(req_1, lead_1,
subtasks: [job_settings_api -> worker_1, job_settings_ui -> worker_2],
integration: job_combined_check -> checker_1)
-> ok (subtasks created; request.integration_job_id = job_combined_check)
2. hub.finishJob(job_settings_api, worker_1, passed: true, evidence: "api.diff")
hub.finishJob(job_settings_ui, worker_2, passed: true, evidence: "ui.diff")
-> ok (both subtask jobs passed; job_combined_check still pending)
3. hub.reportFinished(req_1, lead_1)
-> error: integration_job_not_done (job_combined_check is still "pending")
4. hub.finishJob(job_combined_check, checker_1, passed: false,
evidence: "UI sends timezone=-08:00; API expects time_zone=America/Los_Angeles")
-> recorded failure (req_1 stays open; requester is not interrupted)
5. hub.addRepairJob(req_1, lead_1, job_ui_align_field, worker_2)
hub.finishJob(job_ui_align_field, worker_2, passed: true, evidence: "fix.diff")
hub.finishJob(job_combined_check, checker_1, passed: true,
evidence: "saved America/Los_Angeles in UI and read it back from API")
-> ok (all subtasks and integration job passed)
6. hub.reportFinished(req_1, lead_1)
-> ok (req_1 marked finished; one verified result delivered to requester)
Tradeoffs and practical guidance
Orchestrator-Workers trades a modest coordination tax for predictable whole-request quality. Before adopting it on a workflow, weigh three honest costs:
- Lead bottleneck: every decomposition, shared assumption, and repair routes through one lead agent. Keep the lead's prompt and context lean so it orchestrates instead of doing heavy subtask execution itself.
- Upfront specification effort: defining a concrete integration job at split time takes discipline. If the lead writes a vague check ("make sure everything looks fine"), the gate loses its teeth.
- Extra token and latency budget: running subtask jobs plus an integration job costs more than a single-agent pass. Reserve it for work where seam risk is real.
Practical implementation notes
- Define the integration criteria at split time: decide what proves the combined output holds together (such as aligned tier assumptions across a research brief, or saving a timezone in the UI and reading it back from the API) before workers start, while the full picture is still in the lead's head.
-
Use an independent checker for high-risk seams: assign the integration
job to a fresh Checker party rather than reusing
Worker 1orWorker 2, avoiding shared blind spots. - Freeze shared assumptions and contracts upfront: when subtasks share a scope, definition, schema, or API boundary, put that contract in the split briefing (or sequence Subtask 2 after Subtask 1's checkpoint) instead of letting isolated workers guess.
-
Enforce in hub code, not prompts: telling a lead "always verify the
combined result before finishing" fails under context pressure; rejecting
report_finishedwithintegration_job_not_doneholds every time. - Bound recursion depth: cap delegation at two levels (lead to worker, or at most worker to read-only scout) so runaway fan-out cannot exhaust budgets or obscure accountability.
Known uses and related patterns
- Anthropic Orchestrator-Workers & multi-agent research system: Anthropic's Building Effective Agents defines orchestrator-workers for tasks whose subtasks cannot be statically predicted, and their multi-agent research system uses a lead agent coordinating parallel search subagents before synthesizing one answer.
- LangGraph Supervisor: models a central supervisor graph node routing state to specialized worker subgraphs and inspecting returned state before emitting a final response.
- Claude Code subagents: delegates bounded exploration or implementation tasks to isolated subagent contexts while the primary session retains user communication and final verification.
- Volgenic: coordinates multi-agent work with a lead agent dispatching isolated workers, backed by durable hub records and independent review checks before delivering a final result.
- Contrast with Hohpe & Woolf's Scatter-Gather: classic enterprise messaging Scatter-Gather broadcasts one message to fixed recipients and aggregates replies mechanically. Orchestrator-Workers dynamically invents the decomposition, handles iterative repair when pieces clash, and gates completion on an explicit integration job.
Related patterns
- Request Spec — defines the acceptance criteria the lead turns into subtask briefs and the integration job.
- Durable Job — gives every subtask job and integration job attempts and checkpoints so worker crashes do not reset the request.
- Context Handoff — packages the briefing each worker receives at start instead of forwarding raw lead transcripts.
- Resource Lease — prevents parallel workers from editing overlapping files, branches, or shared resources concurrently.
- Policy Gate & Evidence-Backed Completion — generalize the integration job into formal findings, claims, and transition gates.