|
1 | 1 | --- |
2 | 2 | title: Multi-agent orchestration |
3 | | -description: >- |
4 | | - Coordinate parent and child agents across local and cloud runs. Spawn, |
5 | | - message, and subscribe to lifecycle events to build supervisor/worker, |
6 | | - fan-out, critic, DAG, and swarm patterns. |
| 3 | +description: Coordinate parent and child agents across local and cloud runs to build supervisor/worker, fan-out, critic, DAG, and swarm workflows on the Oz Platform. |
7 | 4 | sidebar: |
8 | 5 | label: "Orchestration" |
9 | 6 | --- |
10 | 7 |
|
11 | | -Multi-agent orchestration lets one agent spawn and coordinate other agents to parallelize work, delegate specialized tasks, or check each other's output. Every primitive — spawning a child, sending a message, subscribing to lifecycle events — is exposed as a public REST endpoint on the [Oz Platform](/agent-platform/cloud-agents/platform/), so the same patterns work from the Warp app, the [Oz CLI](/reference/cli/), and any system that can call the [Oz API](/reference/api-and-sdk/). |
| 8 | +Multi-agent orchestration lets one agent spawn and coordinate other agents to parallelize work, delegate specialized tasks, or check each other's output. The same parent/child model works from the Warp app, the [Oz CLI](/reference/cli/), and any system that can call the [Oz API](/reference/api-and-sdk/) — orchestration is built on the same run, conversation, and artifact primitives as any other [Oz Platform](/agent-platform/cloud-agents/platform/) run. |
12 | 9 |
|
13 | 10 | This page covers the orchestration model and the patterns it supports. For how to start an orchestrated run, see [Running orchestrated agents](/agent-platform/cloud-agents/orchestration/multi-agent-runs/). |
14 | 11 |
|
15 | 12 | ## The parent/child model |
16 | 13 |
|
17 | 14 | An orchestrated workflow always has one **parent agent** and one or more **child agents**. |
18 | 15 |
|
19 | | -* **Parent agent** - the agent that decides what work needs to be done, spawns child agents, and (optionally) merges their results. The parent is just an Oz agent; any Oz agent can become a parent the first time it spawns a child. |
20 | | -* **Child agent** - an Oz agent spawned by a parent with its own prompt, environment, and (optionally) a different model or harness. A child can spawn its own children, so orchestrations are arbitrarily deep. |
| 16 | +* **Parent agent** — the agent that decides what work needs to be done, spawns child agents, and (optionally) merges their results. Any Oz agent can become a parent the first time it spawns a child. |
| 17 | +* **Child agent** — an Oz agent spawned by a parent with its own prompt, environment, and (optionally) a different model or harness. A child can spawn its own children, so orchestrations are arbitrarily deep. |
21 | 18 |
|
22 | | -The parent and child each have an independent **run** with its own lifecycle, transcript, and credit usage. The child run records its parent in `parent_run_id` so the management view, API, and web app can render the hierarchy. |
| 19 | +The parent and child each have an independent **run** with its own lifecycle, transcript, conversation, and credit usage. Each child run records its parent's run ID so the management view, API, and web app can render the hierarchy. |
23 | 20 |
|
24 | 21 | ### Where each side can run |
25 | 22 |
|
26 | 23 | The parent and child don't have to run in the same place. Orchestration supports four combinations: |
27 | 24 |
|
28 | | -* **Local → local** - A [Warp Agent](/agent-platform/local-agents/overview/) conversation in the desktop app spawns child Warp Agent conversations on the same machine. Useful for dogfooding orchestration patterns without spinning up cloud infrastructure. |
29 | | -* **Local → cloud** - A local parent spawns one or more cloud children that run in [environments](/agent-platform/cloud-agents/environments/) on Warp-hosted or self-hosted infrastructure. The parent can keep working while children execute in parallel. |
30 | | -* **Cloud → cloud** - A cloud parent spawns cloud children. This is the canonical pattern for review swarms, large fan-outs, and any orchestration triggered from Slack, Linear, a schedule, or the API. |
31 | | -* **Cloud → local** - Less common, but supported when a cloud parent needs to hand off a task to a local Warp Agent for human-in-the-loop review. |
| 25 | +* **Local → local** — a [Warp Agent](/agent-platform/local-agents/overview/) conversation in the desktop app spawns child Warp Agent conversations on the same machine. Useful for trying orchestration patterns without spinning up cloud infrastructure. |
| 26 | +* **Local → cloud** — a local parent spawns one or more cloud children that run in [environments](/agent-platform/cloud-agents/environments/) on Warp-hosted or self-hosted infrastructure. The parent keeps working while children execute in parallel. |
| 27 | +* **Cloud → cloud** — a cloud parent spawns cloud children. This is the canonical pattern for review swarms, large fan-outs, and any orchestration triggered from Slack, Linear, a schedule, or the API. |
| 28 | +* **Cloud → local** — less common, but supported when a cloud parent needs to hand off a task to a local Warp Agent for human-in-the-loop review. |
32 | 29 |
|
33 | | -Children can also use a different [harness](/agent-platform/cli-agents/overview/) than the parent. A parent Warp Agent can spawn Claude Code or Codex children, and vice versa. |
| 30 | +Children can also use a different harness than the parent. A parent running with the default Oz harness can spawn children that run with [Claude Code](/agent-platform/cli-agents/claude-code/) or [Codex](/agent-platform/cli-agents/codex/), and vice versa. |
34 | 31 |
|
35 | 32 | ## Lifecycle events |
36 | 33 |
|
37 | | -Each run emits lifecycle events that the parent (or any subscriber) can react to. The server records every event in an append-only log; the parent receives events in real time over SSE and can also poll the event log for catch-up. |
| 34 | +Each run emits lifecycle events as it progresses. The parent observes these events to decide what to do next — keep waiting, send a follow-up, spawn a replacement, or finish. |
38 | 35 |
|
39 | 36 | The supported event types are: |
40 | 37 |
|
41 | | -* **`run_in_progress`** - the run started executing (or restarted after being paused or blocked). |
42 | | -* **`run_succeeded`** - the run completed successfully. |
43 | | -* **`run_failed`** - the run hit a terminal failure. |
44 | | -* **`run_errored`** - the run encountered an error during startup or execution. Includes a `stage` (`startup` or `runtime`) and an error reason on the event payload. |
45 | | -* **`run_blocked`** - the run is waiting on a user action (for example, command approval, permission request, or `ask_user_question`). |
46 | | -* **`run_cancelled`** - the run was cancelled before reaching a terminal state. |
| 38 | +* **`run_in_progress`** — the run started executing (or restarted after being paused or blocked). |
| 39 | +* **`run_succeeded`** — the run completed successfully. |
| 40 | +* **`run_failed`** — the run hit a terminal failure. |
| 41 | +* **`run_errored`** — the run encountered an error during startup or execution. |
| 42 | +* **`run_blocked`** — the run is waiting on a user action (for example, command approval or a permission request). |
| 43 | +* **`run_cancelled`** — the run was cancelled before reaching a terminal state. |
47 | 44 |
|
48 | | -The parent's harness sees these events as inputs and decides what to do next: keep waiting, send a follow-up message, spawn a replacement, or finish. |
| 45 | +Observe lifecycle events in any of these surfaces: |
49 | 46 |
|
50 | | -:::note |
51 | | -Lifecycle subscription is opt-in per child. When the parent calls the spawn tool, it passes an optional `lifecycle_subscription` list that filters which event types the parent wants to receive. Omit it to subscribe to all event types. |
52 | | -::: |
| 47 | +* **The parent's transcript** — the parent agent receives child events as it runs and reflects them in its own conversation. |
| 48 | +* **The management view and the Oz web app** — child rows show their current state and update as events arrive. |
| 49 | +* **The Oz API** — `GET /agent/runs/{runId}` returns the latest state of any run, and `GET /agent/runs?ancestor_run_id=PARENT_RUN_ID` lists every descendant in one call. |
53 | 50 |
|
54 | 51 | ## Messaging between agents |
55 | 52 |
|
56 | | -The parent and children communicate through a per-run inbox. Messages have a sender run, one or more recipient runs, a subject, and a body. |
| 53 | +The parent and children can exchange short, durable messages — handoffs, status updates, and final results — without piping full transcripts around. Each run has its own message inbox. |
57 | 54 |
|
58 | | -* The sender writes to `POST /agent/messages` with `to`, `subject`, `body`, and `sender_run_id`. |
59 | | -* The recipient sees the message in its inbox; the parent receives a `MessagesReceivedFromAgents` input the next time it runs. |
60 | | -* Messages are durable. A child that wakes up after the parent sent a message still receives the inbox contents. |
| 55 | +* The sender names one or more recipient runs, a subject, and a body. |
| 56 | +* The recipient sees the message the next time it runs. Messages persist, so a child that wakes up after the parent sent a message still receives the inbox contents. |
| 57 | +* The sender must have edit access to both its own run and every recipient run. |
61 | 58 |
|
62 | | -Messages are intentionally lightweight — they are not streamed transcripts. Use them for handoffs, status updates, and final results, not for piping a full conversation back to the parent. |
| 59 | +Messages are intentionally lightweight. Use them for coordination signals; use the parent's prompt to the child and the child's final output for the work itself. |
63 | 60 |
|
64 | 61 | ## Common patterns |
65 | 62 |
|
@@ -87,26 +84,26 @@ The parent encodes a directed acyclic graph of subtasks where some nodes depend |
87 | 84 |
|
88 | 85 | ### Swarm |
89 | 86 |
|
90 | | -A flat group of peer agents discover each other through the messaging API and coordinate without a strict hierarchy. The parent acts more like a coordinator than a supervisor. Use sparingly — swarms are powerful but harder to debug than hierarchical patterns. |
| 87 | +A flat group of peer agents discover each other through messaging and coordinate without a strict hierarchy. The parent acts more like a coordinator than a supervisor. Use sparingly — swarms are powerful but harder to debug than hierarchical patterns. |
91 | 88 |
|
92 | 89 | ## Approval mode |
93 | 90 |
|
94 | | -When an agent runs in `orchestrate` mode (set by the `/orchestrate` slash command or the API's `mode: orchestrate` field), the agent **proposes** an orchestration plan and waits for approval before spawning any children. This gives you a chance to review the breakdown — number of children, prompts, environments, parallelism — before paying for it. Once you approve, the parent starts spawning children. |
| 91 | +When an agent runs in `orchestrate` mode (set by the `/orchestrate` slash command or the API's `mode: orchestrate` field), the agent **proposes** an orchestration plan and waits for approval before spawning any children. Use this to review the breakdown — number of children, prompts, environments, parallelism — before paying for it. Once you approve, the parent starts spawning children. |
95 | 92 |
|
96 | | -`orchestrate` mode is distinct from `plan` mode. A plan-mode agent produces a written plan for *itself* to execute. An orchestrate-mode agent produces a plan for itself plus a fleet of children. |
| 93 | +`orchestrate` mode is distinct from `plan` mode. A `plan`-mode agent produces a written plan for *itself* to execute. An `orchestrate`-mode agent produces a plan for itself plus a fleet of children. |
97 | 94 |
|
98 | 95 | ## Observability |
99 | 96 |
|
100 | | -Because every parent and child is a normal Oz run, all existing observability surfaces work without changes: |
| 97 | +Because every parent and child is a normal Oz run, the existing observability surfaces work without changes: |
101 | 98 |
|
102 | | -* **[Managing cloud agents](/agent-platform/cloud-agents/managing-cloud-agents/)** - parent and child rows appear in the management view with the parent rendered above its children. |
103 | | -* **[Oz web app](/agent-platform/cloud-agents/oz-web-app/)** - the Runs page renders the hierarchy and lets you open any run's transcript. |
104 | | -* **[Oz API](/reference/api-and-sdk/)** - `GET /agent/runs?parent_run_id=...` lists a parent's children; `GET /agent/runs/{runId}` returns `parent_run_id` on each run. |
105 | | -* **[Agent notifications](/agent-platform/capabilities/agent-notifications/)** - lifecycle and message events from children show up in the parent's notification mailbox. |
| 99 | +* **[Managing cloud agents](/agent-platform/cloud-agents/managing-cloud-agents/)** — parent and child rows appear in the management view with the parent rendered above its children. |
| 100 | +* **[Oz web app](/agent-platform/cloud-agents/oz-web-app/)** — the Runs page renders the hierarchy and lets you open any run's transcript. |
| 101 | +* **[Oz API](/reference/api-and-sdk/)** — `GET /agent/runs?ancestor_run_id=PARENT_RUN_ID` lists every descendant of a parent; `GET /agent/runs/{runId}` returns the run's state, `parent_run_id`, `conversation_id`, and produced artifacts. |
| 102 | +* **[Agent notifications](/agent-platform/capabilities/agent-notifications/)** — lifecycle events and messages from children show up in the parent's notification mailbox. |
106 | 103 |
|
107 | 104 | ## Related pages |
108 | 105 |
|
109 | | -* [Running orchestrated agents](/agent-platform/cloud-agents/orchestration/multi-agent-runs/) - how to start an orchestrated run from the CLI, slash command, web app, or API |
110 | | -* [Oz API and SDK](/reference/api-and-sdk/) - REST endpoints for messages, events, and runs |
111 | | -* [Cloud agents overview](/agent-platform/cloud-agents/overview/) - what a cloud agent run is and how it fits into the Oz Platform |
112 | | -* [Deployment patterns](/agent-platform/cloud-agents/deployment-patterns/) - higher-level deployment models that orchestration composes with |
| 106 | +* [Running orchestrated agents](/agent-platform/cloud-agents/orchestration/multi-agent-runs/) — how to start an orchestrated run from the CLI, slash command, web app, or API. |
| 107 | +* [Oz API and SDK](/reference/api-and-sdk/) — REST endpoints for runs, conversations, and artifacts. |
| 108 | +* [Cloud agents overview](/agent-platform/cloud-agents/overview/) — what a cloud agent run is and how it fits into the Oz Platform. |
| 109 | +* [Deployment patterns](/agent-platform/cloud-agents/deployment-patterns/) — higher-level deployment models that orchestration composes with. |
0 commit comments