Control
Pipeline Control Frames
Frame types for controlling pipeline execution and flow in Pipecat
StartFrame
Initiates pipeline processing and sets up initial conditions.
Properties
clock
BaseClock
requiredClock instance for pipeline timing
allow_interruptions
bool
default: "false"Whether to allow user interruptions during processing
enable_metrics
bool
default: "false"Whether to collect performance metrics
enable_usage_metrics
bool
default: "false"Whether to collect usage metrics
report_only_initial_ttfb
bool
default: "false"Whether to report only initial time-to-first-byte metrics
EndFrame
Signals normal pipeline termination.
CancelFrame
Signals immediate pipeline termination.
EndTaskFrame
Requests graceful pipeline closure.
CancelTaskFrame
Requests immediate pipeline termination.
StopTaskFrame
Signals that a pipeline task should be stopped while keeping processors in a running state.
Usage Examples
Pipeline Initialization
Graceful Shutdown
Emergency Stop
Pipeline State Management
Frame Flow
Notes
- StartFrame must be the first frame in a pipeline
- EndFrame ensures all queued frames are processed before shutdown
- CancelFrame immediately stops all processing
- StopTaskFrame stops the pipeline task while keeping processors running
- Control frames are processed in order (unlike system frames)
- Metrics collection affects performance and should be enabled selectively