Delegate work to subagents
Sometimes one agent should not do everything itself. A coordinator that researches three suppliers in parallel, or one that needs a specialist identity for a legal question, is better served by handing pieces of the work to other registered agents and assembling the results.
Enable delegation on the coordinating agent and be explicit about what it may launch:
[sub_agents]
enabled = true
max_concurrent = 3
max_iterations = 8
max_budget_usd = 1.00
timeout_secs = 300
allowed_agents = ["researcher", "analyst"]Delegation multiplies cost and latency, so max_budget_usd and timeout_secs keep a
coordinator from running long or spending heavily while an external service hangs.
Keep allowed_agents explicit in production. An open-ended delegate list means the blast radius
of a confused coordinator is every agent you have.
Designing the pieces
Give each delegated agent one focused responsibility and a response format the coordinator can actually consume. A subagent that returns three paragraphs of prose when the coordinator needed a list of names has technically succeeded and practically failed. Set a budget, and use timeouts for agents that call external services.
Keep allowed_agents explicit in production. It is empty by default, and an empty list
means no restriction: the coordinator may delegate to any agent in the deployment except
itself. Listing agents is what narrows it.
Delegation runs as two turns. The coordinator calls spawn_agent to start children and
its turn ends; when they finish, a second run wakes it to call collect_agents and fold the
results into its answer. That shape is why a coordinator's first reply can look like it stopped
early - it did, and the continuation is what finishes the job.
Subagents or a workflow?
This decision comes down to who chooses the order.
| Order decided by | Survives a restart | Reach for it when | |
|---|---|---|---|
| Subagents | The model, during the run | No - it is one agent run | The work is exploratory and the shape is not known in advance |
| Workflow | You, when you author the graph | Yes, durably | The sequence and dependencies must be deterministic |
An open-ended instruction like researching whatever is needed about a company is subagent work. A defined sequence like fetching the filing, extracting the figures, having two analysts review, then merging is a workflow.
Next
- Build workflows - when the sequence must be deterministic and durable.
- Research agent walkthrough - parallel investigation, end to end.
- - every field and its default.