Action Types
pre_actionsexecute immediately when transitioning to a new node, before the LLM inference begins.post_actionsexecute after the LLM inference completes and any TTS has finished speaking.
Built-in Actions
Pipecat Flows includes several ready-to-use actions for common scenarios:tts_say
Speak a phrase immediately (useful for “please wait” messages):end_conversation
Gracefully terminate the conversation:function
Execute a custom function at the specified timing:Custom Actions
You can define your own actions to handle specific business logic or integrations. In most cases, consider using a function action first, as it executes at the expected time in the pipeline. Register custom action handlers usingregister_action():
Action Timing
The execution order ensures predictable behavior:- Pre-actions run first upon node entry (in the order they are defined)
- LLM inference processes the node’s messages and functions
- TTS speaks the LLM’s response
- Post-actions run after TTS completes (in the order they are defined)