Documentation Index
Fetch the complete documentation index at: https://docs.pipecat.ai/llms.txt
Use this file to discover all available pages before exploring further.
Overview
WorkerRunner runs agents to completion and acts as the host for a multi-agent session. It owns the shared WorkerBus and WorkerRegistry that back the whole session, and responds to bus messages for lifecycle coordination.
PipelineRunner is a deprecated alias for WorkerRunner; existing code that
uses it keeps working but should migrate to WorkerRunner.add_workers() attaches it to the runner’s bus and registry, so agents do not take a bus in their constructor.
Configuration
Unique name for this runner. Defaults to a UUID-based name. Must be unique
across all runners in a distributed setup.
The
WorkerBus instance. Creates
an AsyncQueueBus if not
provided.Whether to automatically handle SIGINT signals for graceful shutdown.
Whether to automatically handle SIGTERM signals for graceful shutdown.
Whether to force garbage collection after the main worker completes.
Event loop to use. If
None, uses the current running loop.Properties
bus
registry
Methods
add_workers
run(). When called after run() has started, each agent starts immediately; otherwise agents are queued and started during run setup.
| Parameter | Type | Description |
|---|---|---|
*workers | BaseWorker | One or more agents to add |
run
auto_end=True), the runner ends once every root agent has finished. For long-lived hosts that add and remove agents over many sessions, pass auto_end=False so the runner does not exit when no agents are left.
| Parameter | Type | Default | Description |
|---|---|---|---|
worker | BaseWorker | None | None | Optional agent to run. Deprecated — register with add_workers() before calling run() instead. |
auto_end | bool | True | When True, the runner ends once every root agent has finished. When False, it blocks until end() or cancel() is called. |
end
| Parameter | Type | Default | Description |
|---|---|---|---|
reason | str | None | None | Human-readable reason for ending |
cancel
| Parameter | Type | Default | Description |
|---|---|---|---|
reason | str | None | None | Human-readable reason for cancelling |
Event Handlers
| Event | Description |
|---|---|
on_ready | Fired after the runner has finished setup and any added agents have started |
on_error | Fired when starting an added agent fails |