Important Limitations
Before diving into configuration, understand what spawn can and cannot do: Current constraints:- Single workflow target: Spawn only supports
builtin://agentas the target workflow. You cannot spawn arbitrary custom workflows. - Preset selection only: The spawned workflow must be configured via a preset. You cannot pass arbitrary parameters or override individual settings.
- Self-contained tasks: The spawned workflow runs in its own thread with its own context. It cannot access the parent’s conversation history or tool results directly—it only receives the prompt you provide.
- Results arrive later, not inline: Because spawn is asynchronous, the parent cannot treat a spawn call as a value it can use in the same turn. It must be written to continue working and react to the result when it lands.
How Spawn Works
When an agent calls the spawn tool:- New thread created: The spawned workflow gets its own conversation thread, completely separate from the parent.
- Preset applied: The selected preset configures the child agent’s model, temperature, tools, and system prompt.
- Handle returned immediately: The spawn call settles right away with a handle identifying the child agent. The parent’s turn is not held open waiting for the child.
- Task executed in the background: The child workflow runs until completion, following the same agent loop pattern as any other agent workflow, while the parent keeps working.
- Result delivered later: When the child finishes, its final response reaches the parent as a message it reacts to on a subsequent turn, prefixed with the preset name for clarity.
spawn_status to check on it (passing wait: true to block until it finishes, when the parent truly cannot proceed without the answer) or spawn_send to give it new instructions mid-flight.
Configuring Spawn
Spawn availability is controlled by thespawn_presets input in workflows that use the agent loop. This input determines which presets appear as options in the spawn tool.
The spawn_presets Input
In the built-in agent workflow,spawn_presets is configured as a multi-select enum:
- Empty selection disables spawn: If no presets are selected, the spawn tool does not appear in the agent’s toolset.
- Default includes common presets: By default, agents can spawn general, researcher, and reviewer sub-workflows.
- Enum values must be valid presets: Each value must correspond to a preset that exists, built-in or custom.
Tool Filter Syntax
Behind the scenes, spawn configuration flows through the tool filter system. The spawn filter syntax is:spawn() CEL function:
spawn() function takes a workflow reference and a list of presets, returning the spawn filter spec string. If the presets list is empty, it returns an empty string, disabling spawn.
Disabling Spawn
To disable spawn entirely: Via UI: Deselect all presets in thespawn_presets parameter.
Via workflow configuration: Omit the spawn filter or use empty presets:
Spawn Tool Parameters
When an agent has access to spawn, the tool accepts these parameters:Basic Example
Resuming a Previous Agent
If a spawned agent was previously used, you can resume its conversation:Running in a Worktree
For tasks that modify files, you can isolate changes in a worktree:Use Cases
Research Before Implementation
Spawn a researcher to investigate before making changes:Specialized Code Review
Get focused feedback from a specialist:Breaking Down Complex Tasks
Delegate subtasks to specialists:Parallel Independent Tasks
Because spawn never blocks, independent work should be started together rather than one at a time:What Gets Returned
The spawn call itself returns a handle for the new agent. The child’s final response is delivered separately, once it finishes, prefixed to indicate the source:is_error flag.
Best Practices
Start independent work together: Spawn does not block, so batching every independent unit into one turn costs no more than spawning one. Hold a spawn back only when it genuinely consumes another agent’s output. Write detailed prompts: The spawned workflow only knows what you tell it. Include context about what you are trying to accomplish, what you have already learned, and what specific questions need answering. Do not idle while children run: The parent is free during a fan-out. Use that time to prepare the next brief, read files, or start more units — not to poll. Choose appropriate presets: Match the task to the specialist. Use researcher for investigation, reviewer for quality feedback, refactor for systematic changes. Handle results appropriately: The spawn result is just information. The parent agent should interpret the findings and decide what to do next. Do not over-delegate: Simple tasks do not need spawn. Use spawn when the task benefits from a specialist’s focused attention or when you want isolation between concerns. Consider worktrees for modifications: When spawning workflows that will modify files, consider using worktrees to isolate changes until you are ready to merge them.Related Topics
- Presets - Understanding the presets that configure spawned workflows
- Worktrees & Workspaces - Isolating file changes in separate working directories
- Multi-Agent Patterns - Broader patterns for coordinating multiple agents