Overview
Every frame processor in Pipecat — including all services, transports, and custom processors — inherits fromFrameProcessor and exposes a set of events for error handling and frame monitoring. These events are synchronous, meaning handlers run inline and must execute quickly to avoid blocking the pipeline.
Events Summary
Error Handling
on_error
Fired when an error occurs in this processor. This is called before theErrorFrame is pushed upstream through the pipeline, giving you an opportunity to handle errors at the processor level.
The
ErrorFrame provides:
error(str): The error messageexception(Exception | None): The underlying exception, if anyfatal(bool): Whether this is a fatal error that will cancel the pipelineprocessor(FrameProcessor | None): The processor that originated the error
Since
on_error is synchronous, the handler runs before the error frame
propagates upstream. Keep your handler fast — use it for logging or setting
flags, not for I/O operations.Example: Error handling across multiple processors
Frame Processing Hooks
These events let you observe frames as they flow through a processor. They’re useful for debugging, logging, or lightweight monitoring.on_before_process_frame
Fired immediately before a frame is processed by this processor’sprocess_frame() method.
on_after_process_frame
Fired immediately after a frame has been processed by this processor’sprocess_frame() method.
on_before_push_frame
Fired immediately before a frame is pushed to the next processor in the pipeline.on_after_push_frame
Fired immediately after a frame has been pushed to the next processor in the pipeline.Related
- Events - Overview of all events in Pipecat
- PipelineWorker - Pipeline lifecycle events
- Observer Pattern - Non-intrusive pipeline monitoring