Skip to main content

Overview

Every frame processor in Pipecat — including all services, transports, and custom processors — inherits from FrameProcessor 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 the ErrorFrame is pushed upstream through the pipeline, giving you an opportunity to handle errors at the processor level.
Parameters: The ErrorFrame provides:
  • error (str): The error message
  • exception (Exception | None): The underlying exception, if any
  • category (ErrorCategory | None): What kind of failure it was, e.g. AUTHENTICATION or SERVER
  • processor (FrameProcessor | None): The processor that originated the error. Its is_usable already reflects this error, so reading it here tells you whether the processor is finished or merely had a bad moment
  • fatal (bool): Deprecated in v1.8.0, removed in 2.0.0. Check processor.is_usable instead
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.

on_usable_changed

Fired when the processor’s ability to do its job changes, in either direction — when an error leaves it unable to work, and again when set_usable(True) brings it back.
Parameters: See Error Handling for what makes a processor unusable and what the pipeline does about it.

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’s process_frame() method.
Parameters:

on_after_process_frame

Fired immediately after a frame has been processed by this processor’s process_frame() method.
Parameters:

on_before_push_frame

Fired immediately before a frame is pushed to the next processor in the pipeline.
Parameters:

on_after_push_frame

Fired immediately after a frame has been pushed to the next processor in the pipeline.
Parameters:
All frame processing events are synchronous — handlers block the pipeline until they complete. Avoid any I/O, await calls to external services, or other slow operations in these handlers. Use them only for fast operations like logging, counting, or setting flags.