NodeConfig
Configuration for a single node in a conversation flow.task_messages is the only required field.
List of message dicts defining the current node’s objectives. These tell the
LLM what to do in this conversation state.
Identifier for the node. Useful for debug logging. If not provided, a UUID is
generated automatically.
List of message dicts defining the bot’s role and personality. These persist
across nodes when using the
APPEND context strategy and are placed before
task messages in the context.List of function definitions available in this node. Accepts provider-specific
dict format,
FlowsFunctionSchema objects, or
direct functions. See Function
Types.Actions to execute before LLM inference when transitioning to this node. See
ActionConfig.
Actions to execute after LLM inference when transitioning to this node. If
respond_immediately is False, post-actions are deferred until after the
first LLM response in this node. See ActionConfig.Strategy for managing conversation context when transitioning to this node.
Overrides the default strategy set on
FlowManager. See
ContextStrategyConfig.
Whether to trigger LLM inference immediately upon entering the node. Set to
False when you want to wait for user input before the LLM responds (e.g., after
a tts_say pre-action that asks a question).FlowsFunctionSchema
Dataclass for defining function call schemas with Flows-specific properties. Provides a uniform way to define functions that works across all LLM providers.Name of the function. This is used to identify the function in LLM tool calls.
Description of what the function does. The LLM uses this to decide when to
call the function.
Dictionary defining the function’s parameters using JSON Schema format.
List of required parameter names from
properties.Function handler to process the function call. Can be a legacy handler
(args) or modern handler (args, flow_manager). The handler should return a
FlowResult or a
ConsolidatedFunctionResult tuple.Whether to cancel this function call when the user interrupts. Set to
False
for long-running operations that should complete even if the user speaks.Methods
to_function_schema
FunctionSchema for use with LLMs. Strips Flows-specific fields (handler, cancel_on_interruption).
Example
ActionConfig
TypedDict for configuring actions that execute during node transitions.Action type identifier. Must match a registered action handler. Built-in types
are
"tts_say", "end_conversation", and "function".Action handler function. Required for custom action types if not previously
registered via
FlowManager.register_action().
Can be a legacy handler (action) or modern handler (action, flow_manager).Text content used by
tts_say and optionally by end_conversation (as a
goodbye message).Additional fields are allowed and passed through to the handler. For example, a
"notify_slack" action could include "channel" and "text" fields.Built-in Action Types
| Type | Description | Required Fields |
|---|---|---|
tts_say | Speak text using the pipeline’s TTS service | text |
end_conversation | End the conversation, optionally speaking a goodbye message | text (optional) |
function | Execute a function inline in the pipeline | handler |
Example
ContextStrategy
Enum defining strategies for managing conversation context during node transitions.| Value | Description |
|---|---|
APPEND | Append new messages to existing context. This is the default behavior. |
RESET | Reset context with new messages only. Previous conversation history is discarded. |
RESET_WITH_SUMMARY | Reset context but include an LLM-generated summary of the previous conversation. Requires summary_prompt in ContextStrategyConfig. |
ContextStrategyConfig
Dataclass for configuring context management behavior.The context management strategy to use. See
ContextStrategy.
Prompt text for generating a conversation summary. Required when using
RESET_WITH_SUMMARY. The LLM uses this prompt to summarize the conversation
before resetting context.ValueError if summary_prompt is not provided when using RESET_WITH_SUMMARY.
Example
flows_direct_function Decorator
Decorator that attaches metadata to a Pipecat direct function for use in Flows.| Parameter | Type | Default | Description |
|---|---|---|---|
cancel_on_interruption | bool | True | Whether to cancel the function call when the user interrupts. |
flow_manager: FlowManager, and all other parameters become the function’s properties. The docstring provides the function description and parameter descriptions (Google-style).
Direct functions must return a ConsolidatedFunctionResult tuple.
Example
functions list:
FlowsDirectFunction
Protocol defining the interface for direct functions. Any async callable matching this signature can be used as a direct function in node configurations.Type Aliases
FlowResult
status field indicates the outcome. The optional error field contains an error message if execution failed. Additional fields are allowed and passed through to the LLM.
FlowArgs
ConsolidatedFunctionResult
- First element: The function result (or
Nonefor transition-only functions) - Second element: The next node as a
NodeConfig, orNonefor node functions
FlowFunctionHandler
FlowManager instance.