From 2517aca18a9d6ae342cf39421a33d3655e67cdae Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sat, 30 May 2026 00:18:27 +0000 Subject: [PATCH] docs: update for pipecat-flows PR #277 (worker migration) Update FlowManager documentation to reflect the migration from PipelineTask to PipelineWorker introduced in pipecat-flows PR #277. Changes: - Add `worker` parameter to FlowManager (replaces `task`) - Mark `task` parameter as deprecated - Add `worker` property documentation - Mark `task` property as deprecated with backward compatibility note - Update all code examples to use `worker` instead of `task` - Update WorkerRunner usage in quickstart (add_workers + run pattern) Files updated: - api-reference/pipecat-flows/flow-manager.mdx - pipecat-flows/guides/state-management.mdx - pipecat-flows/guides/quickstart.mdx --- api-reference/pipecat-flows/flow-manager.mdx | 39 +++++++++++++++----- pipecat-flows/guides/quickstart.mdx | 7 ++-- pipecat-flows/guides/state-management.mdx | 4 +- 3 files changed, 36 insertions(+), 14 deletions(-) diff --git a/api-reference/pipecat-flows/flow-manager.mdx b/api-reference/pipecat-flows/flow-manager.mdx index 1c352d68..1552d38f 100644 --- a/api-reference/pipecat-flows/flow-manager.mdx +++ b/api-reference/pipecat-flows/flow-manager.mdx @@ -11,8 +11,16 @@ description: "Core orchestration class for managing conversation flows" All parameters are keyword-only. - - Pipeline task instance used for queueing frames into the pipeline. + + Pipeline worker instance used for queueing frames into the pipeline. + + + + **Deprecated:** Use `worker` instead. This parameter is deprecated and will be + removed in a future release. + +Pipeline worker instance used for queueing frames into the pipeline. + @@ -103,22 +111,35 @@ async def my_handler(args, flow_manager): await setup_secure_session(flow_manager) ``` -### task +### worker ```python -flow_manager.task -> PipelineWorker +flow_manager.worker -> PipelineWorker ``` -The pipeline task instance used for frame queueing. Use this for advanced flow control such as queuing custom frames. +The pipeline worker instance used for frame queueing. Use this for advanced flow control such as queuing custom frames. ```python async def my_handler(args, flow_manager): from pipecat.frames.frames import TTSUpdateSettingsFrame - await flow_manager.task.queue_frame( + await flow_manager.worker.queue_frame( TTSUpdateSettingsFrame(settings={"voice": "new-voice-id"}) ) ``` +### task + + + **Deprecated:** Use `worker` instead. This property is deprecated and will be + removed in a future release. + + +```python +flow_manager.task -> PipelineWorker +``` + +Alias for `worker`. Maintained for backward compatibility. + ## Methods ### initialize @@ -136,7 +157,7 @@ Initialize the flow manager. Must be called before any node transitions can occu **Raises:** `FlowInitializationError` if initialization fails. ```python -flow_manager = FlowManager(task=task, llm=llm, context_aggregator=context_aggregator) +flow_manager = FlowManager(worker=worker, llm=llm, context_aggregator=context_aggregator) await flow_manager.initialize(initial_node=create_initial_node()) ``` @@ -228,7 +249,7 @@ async def create_initial_node() -> NodeConfig: } flow_manager = FlowManager( - task=task, + worker=worker, llm=llm, context_aggregator=context_aggregator, transport=transport, @@ -250,7 +271,7 @@ transfer_function = FlowsFunctionSchema( ) flow_manager = FlowManager( - task=task, + worker=worker, llm=llm, context_aggregator=context_aggregator, global_functions=[transfer_function], diff --git a/pipecat-flows/guides/quickstart.mdx b/pipecat-flows/guides/quickstart.mdx index 84807c15..9b8b7d78 100644 --- a/pipecat-flows/guides/quickstart.mdx +++ b/pipecat-flows/guides/quickstart.mdx @@ -132,11 +132,11 @@ async def run_bot(transport: BaseTransport, runner_args: RunnerArguments): ] ) - task = PipelineWorker(pipeline) + worker = PipelineWorker(pipeline) # Initialize flow manager flow_manager = FlowManager( - task=task, + worker=worker, llm=llm, context_aggregator=context_aggregator, transport=transport, @@ -147,7 +147,8 @@ async def run_bot(transport: BaseTransport, runner_args: RunnerArguments): await flow_manager.initialize(create_initial_node()) runner = WorkerRunner(handle_sigint=runner_args.handle_sigint) - await runner.run(task) + await runner.add_workers(worker) + await runner.run() ``` That's it! When a user connects, the bot greets them, asks for their favorite color, records the answer, thanks them, and ends the conversation. diff --git a/pipecat-flows/guides/state-management.mdx b/pipecat-flows/guides/state-management.mdx index efcbbc55..1b88e2e4 100644 --- a/pipecat-flows/guides/state-management.mdx +++ b/pipecat-flows/guides/state-management.mdx @@ -11,7 +11,7 @@ First, create the FlowManager: ```python flow_manager = FlowManager( - task=task, # PipelineWorker + worker=worker, # PipelineWorker llm=llm, # LLMService context_aggregator=context_aggregator, # Context aggregator transport=transport, # Transport @@ -52,7 +52,7 @@ Pipecat Flows supports defining functions that are available across all nodes in ```python flow_manager = FlowManager( - task=task, + worker=worker, llm=llm, context_aggregator=context_aggregator, transport=transport,