Skip to main content
Spawn & Announce lets a parent agent delegate work to sub-agents without blocking — fire tasks in parallel and collect results via callbacks or the event bus.
The user delegates parallel work; the parent spawns sub-agents and keeps running without blocking.

Quick Start

1

Simple Spawn with Callback

Fire-and-forget pattern with immediate feedback.
2

Parallel Fan-out Pattern

Spawn multiple sub-agents, do other work, then collect results.

How It Works

The spawn-announce pattern uses an event-driven architecture to coordinate between parent and sub-agents.

Choosing Your Pattern

Different use cases require different coordination patterns.

Common Patterns

Fire-and-Forget with Callback

Best for immediate processing of sub-agent results.

Parallel Fan-out with Join

Scale work across multiple sub-agents, then combine results.

Event-Driven Coordination

React to sub-agent events without callbacks.

Configuration

spawn_sub_agent Parameters

announce_completion Parameters

wait_for_completions Parameters


Async Usage

For async code, use the async variants with proper event-driven waiting.

Best Practices

Prevent indefinite waiting by setting reasonable timeout values.
Inside async def functions, use aspawn_sub_agent and await_for_completions.
Completion callbacks should be lightweight to avoid blocking the event loop.
Attach metadata to track spawned sub-agents back to your domain context.

Subagent Delegation

Core multi-agent coordination

Event Bus

Event-driven architecture