Skip to main content

Overview

Pipecat provides an event system that lets you hook into lifecycle changes across the framework — pipeline state transitions, service connections, transport activity, conversation turns, errors, and more. Events are available on most Pipecat objects (anything that inherits from BaseObject). You register handlers using the @event_handler decorator, and Pipecat calls them automatically when things happen.

Registering Event Handlers

Use the @event_handler decorator on the object that emits the event:
The first parameter is always the object that emitted the event. Additional parameters depend on the specific event. You can also register handlers without the decorator:
Handlers can be either async or synchronous functions — Pipecat detects which and calls them appropriately.

Multiple Handlers

You can register multiple handlers for the same event. They’re called in the order they were registered. For an asynchronous event each handler runs in its own task, so a handler that awaits doesn’t hold up the next one:

Synchronous vs Asynchronous Events

Events are either synchronous or asynchronous, depending on how the component registered them internally:
  • Synchronous events (sync=True) run the handler inline — the caller waits for the handler to complete before continuing. These are used for events that must complete immediately, such as frame processing hooks and error handling. Synchronous event handlers should execute fast to avoid blocking the pipeline.
  • Asynchronous events (default) run the handler in a background asyncio.Task. The caller continues immediately. These are used for events where you might do I/O, logging, or other work that shouldn’t block the pipeline.
You don’t need to choose — the sync/async behavior is determined by the component, not by your handler. Your handler can be an async def or a regular def regardless.

Events Reference

The table below lists all events available in Pipecat, grouped by component. Click through to the linked documentation for full details including handler signatures and usage examples.

Pipeline

Events on PipelineWorker.

Frame Processor

Events on every FrameProcessor. Since all services and processors, including a transport’s input() and output(), inherit from FrameProcessor, these events are available on any processor in your pipeline. The transport object itself is not a FrameProcessor and doesn’t emit them.

Turn Management

Events on context aggregators from LLMContextAggregatorPair.

STT Services

Events on STT service instances. Available on WebSocket-based STT services, though DeepgramSTTService, SarvamSTTService, and SpeechmaticsSTTService don’t emit all three. See Service Events for details. Some STT services have additional events: Deepgram Flux STT: Speechmatics STT: Sarvam STT (SarvamSTTService with vad_signals=True in its settings):

TTS Services

Events on TTS service instances. Available on all WebSocket-based TTS services. See Service Events for details.

LLM Services

Events on LLM service instances. See Service Events for details. OpenAI Realtime / Grok Realtime:

Daily Transport

Events on DailyTransport instances.

LiveKit Transport

Events on LiveKitTransport instances.

WebSocket Transports

Events on WebSocket transport instances. WebSocketServerTransport: FastAPIWebsocketTransport: WebSocketClientTransport:

Other Transports

SmallWebRTCTransport: HeyGenTransport / TavusTransport:

Utilities

ContextSummarizer: ServiceSwitcherStrategy (switcher.strategy on a ServiceSwitcher): AudioBufferProcessor: RTVIProcessor:

Observers

TurnTrackingObserver: UserBotLatencyObserver:

Extensions

VoicemailDetector: IVRNavigator: