Skip to main content

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

Bus messages are the communication primitives for the multi-agent framework. They are organized into two priority levels:
  • Data messages (BusDataMessage): Normal-priority messages for routine communication.
  • System messages (BusSystemMessage): High-priority messages that preempt normal messages in subscriber queues (e.g. cancel, errors).
Some messages also implement BusLocalMessage, meaning they stay on the local bus and are never forwarded to remote buses.
from pipecat.bus import (
    BusActivateWorkerMessage,
    BusDeactivateWorkerMessage,
    BusEndMessage,
    BusCancelMessage,
    # ... etc
)

Base Types

TypeParentDescription
BusMessage-Base class carrying source and target metadata
BusLocalMessage-Mixin: message stays on the local bus only
BusDataMessageBusMessageNormal-priority bus message (FIFO)
BusSystemMessageBusMessageHigh-priority bus message

Common Fields

All messages inherit these fields from BusMessage:
FieldTypeDefaultDescription
sourcestrName of the agent or component that sent this message
targetstr | NoneNoneName of the intended recipient, or None for broadcast

Frame Transport

TypePriorityDescription
BusFrameMessageDataWraps a Pipecat Frame for transport over the bus

BusFrameMessage

FieldTypeDefaultDescription
sourcestrSending agent name
targetstr | NoneNoneRecipient agent name
frameFrameThe Pipecat frame to transport
directionFrameDirectionDirection the frame should travel in the recipient’s pipeline
bridgestr | NoneNoneBridge name for routing in multi-bridge setups

Pipeline Commands

TypePriorityDescription
BusTTSSpeakMessageDataAsks a PipelineWorker to speak text via its TTS

BusTTSSpeakMessage

FieldTypeDefaultDescription
sourcestrSending agent name
targetstr | NoneNoneRecipient agent name
textstrThe text to be spoken
append_to_contextbool | NoneNoneWhether the spoken text should be appended to the context

Agent Lifecycle

TypePriorityLocalDescription
BusActivateWorkerMessageDataNoTells a targeted agent to become active
BusDeactivateWorkerMessageDataNoTells a targeted agent to become inactive
BusEndMessageDataNoRequest a graceful end of the session
BusEndWorkerMessageDataNoTells a targeted agent to end its pipeline
BusCancelMessageSystemNoRequest a hard cancel of the session
BusCancelWorkerMessageSystemNoTells a targeted agent to cancel its pipeline

BusActivateWorkerMessage

FieldTypeDefaultDescription
sourcestrSending agent name
targetstr | NoneNoneAgent to activate
argsdict | NoneNoneActivation arguments forwarded to on_activated

BusEndMessage / BusEndWorkerMessage

FieldTypeDefaultDescription
sourcestrSending agent name
targetstr | NoneNoneRecipient agent name
reasonstr | NoneNoneHuman-readable reason for ending

BusCancelMessage / BusCancelWorkerMessage

FieldTypeDefaultDescription
sourcestrSending agent name
targetstr | NoneNoneRecipient agent name
reasonstr | NoneNoneHuman-readable reason for cancellation

Registry & Errors

TypePriorityLocalDescription
BusAddWorkerMessageSystemYesRequest to add an agent to the local runner
BusWorkerRegistryMessageSystemNoSnapshot of agents managed by a runner
BusWorkerReadyMessageDataNoAnnounces that an agent is ready
BusWorkerErrorMessageSystemNoReports an error from a root agent
BusWorkerLocalErrorMessageSystemYesReports an error from a child agent to its parent

BusAddWorkerMessage

FieldTypeDefaultDescription
sourcestrSending agent name
targetstr | NoneNoneRecipient name
workerBaseWorkerThe agent instance to add (in-memory)

BusWorkerRegistryMessage

FieldTypeDefaultDescription
sourcestrSending runner name
runnerstrName of the runner that owns these agents
workerslist[WorkerRegistryEntry]List of agent entries with their state

BusWorkerReadyMessage

FieldTypeDefaultDescription
sourcestrAgent name
runnerstrName of the runner managing this agent
parentstr | NoneNoneName of the parent agent, or None for root agents
activeboolFalseWhether the agent started active
bridgedboolFalseWhether the agent is bridged
started_atfloat | NoneNoneUnix timestamp when the agent became ready

BusWorkerErrorMessage / BusWorkerLocalErrorMessage

FieldTypeDescription
sourcestrAgent name
errorstrDescription of the error

Job Messages

TypePriorityDescription
BusJobRequestMessageDataRequests a worker agent to start work
BusJobResponseMessageDataResponse from a worker agent
BusJobResponseUrgentMessageSystemHigh-priority response from a worker agent
BusJobUpdateMessageDataProgress update from a worker agent
BusJobUpdateUrgentMessageSystemHigh-priority progress update
BusJobUpdateRequestMessageDataRequest a progress update from a worker agent
BusJobCancelMessageSystemCancel a running job

BusJobRequestMessage

FieldTypeDefaultDescription
sourcestrRequester agent name
targetstr | NoneNoneWorker agent name
job_idstrUnique job identifier
job_namestr | NoneNoneJob name for routing to named @job handlers
payloaddict | NoneNoneStructured data describing the work

BusJobResponseMessage / BusJobResponseUrgentMessage

FieldTypeDefaultDescription
sourcestrWorker agent name
targetstr | NoneNoneRequester agent name
job_idstrThe job identifier
statusJobStatusCompletion status
responsedict | NoneNoneResult data

BusJobUpdateMessage / BusJobUpdateUrgentMessage

FieldTypeDefaultDescription
sourcestrWorker agent name
targetstr | NoneNoneRequester agent name
job_idstrThe job identifier
updatedict | NoneNoneProgress data

BusJobUpdateRequestMessage

FieldTypeDefaultDescription
sourcestrRequester agent name
targetstr | NoneNoneWorker agent name
job_idstrThe job identifier

BusJobCancelMessage

FieldTypeDefaultDescription
sourcestrRequester agent name
targetstr | NoneNoneWorker agent name
job_idstrThe job identifier
reasonstr | NoneNoneHuman-readable reason for cancellation

Job Streaming

TypePriorityDescription
BusJobStreamStartMessageDataSignals the start of a streaming job response
BusJobStreamDataMessageDataA chunk of streaming job data
BusJobStreamEndMessageDataSignals the end of a streaming job response

BusJobStreamStartMessage / BusJobStreamDataMessage / BusJobStreamEndMessage

FieldTypeDefaultDescription
sourcestrWorker agent name
targetstr | NoneNoneRequester agent name
job_idstrThe job identifier
datadict | NoneNoneStream metadata (start), chunk payload (data), or final metadata (end)

UI Messages

These carriers are the on-the-bus shape of the UI Worker protocol, exchanged between a UIWorker and the PipelineWorker that owns the transport. They are not the on-the-wire format the client sees — that is the RTVI User Interface protocol. When RTVI is enabled, PipelineWorker translates between the two: its on_ui_message handler republishes inbound client messages onto the bus, and its on_bus_message handler turns outbound carriers into RTVI frames. They live in the bus layer (rather than alongside UIWorker) because both PipelineWorker (in pipecat.pipeline) and UIWorker (in pipecat.workers) reference them, and pipeline must not import from workers. All subclass BusUIDataMessage.
TypeDirectionDescription
BusUIEventMessageclient → workerA UI event from the client; dispatched to @ui_event(name) handlers
BusUICommandMessageworker → clientA UI command; translated to RTVIUICommandFrame
BusUIJobGroupStartedMessageworker → clientA user-facing job group was dispatched (kind = "group_started")
BusUIJobUpdateMessageworker → clientPer-worker progress for a user-facing job group (kind = "job_update")
BusUIJobCompletedMessageworker → clientA worker in the group completed (kind = "job_completed")
BusUIJobGroupCompletedMessageworker → clientThe job group completed (kind = "group_completed")

BusUIEventMessage

| Field | Type | Default | Description | | ------------ | ----- | ------- | -------------------------------- | -------------------------- | | source | str | | Publisher name | | target | str | None | None | Target worker name, or all | | event_name | str | "" | App-defined event name | | payload | Any | None | App-defined payload (schemaless) |

BusUICommandMessage

| Field | Type | Default | Description | | -------------- | ----- | ------- | ------------------------------ | -------------- | | source | str | | Publishing worker name | | target | str | None | None | Target, or all | | command_name | str | "" | App-defined command name | | payload | Any | None | Command payload (a plain dict) |

BusUIJobGroupStartedMessage

| Field | Type | Default | Description | | ------------- | ---------- | ------- | ------------------------------------------- | ------------------------------------------- | | job_id | str | "" | Shared job-group identifier | | workers | list[str] | None | None | Names of the workers the work was sent to | | label | str | None | None | Optional human-readable label for the group | | cancellable | bool | True | Whether the client may request cancellation | | at | int | 0 | Epoch milliseconds when the group started |

BusUIJobUpdateMessage

FieldTypeDefaultDescription
job_idstr""The shared job-group identifier
worker_namestr""The worker that produced the update
dataAnyNoneThe worker’s update payload, verbatim
atint0Epoch milliseconds when the update was sent

BusUIJobCompletedMessage

FieldTypeDefaultDescription
job_idstr""The shared job-group identifier
worker_namestr""The worker that produced the response
statusstr""Completion status (JobStatus value)
responseAnyNoneThe worker’s response payload
atint0Epoch milliseconds when received

BusUIJobGroupCompletedMessage

FieldTypeDefaultDescription
job_idstr""The shared job-group identifier
atint0Epoch milliseconds when the group ended