Add multi-worker handoff example combining Flows with the worker framework#280
Merged
Conversation
…ework Adds examples/multi_worker_handoff.py demonstrating how Pipecat Flows composes with Pipecat's multi-worker framework. A free-form LLMWorker router hands off to and from a structured Flows reservation worker over the bus, sharing a single conversation context. The reservation worker is built as a plain PipelineWorker with a FlowManager wired onto it and the flow (re)initialized from its on_activated event handler. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
markbackman
approved these changes
Jun 5, 2026
markbackman
left a comment
Contributor
There was a problem hiding this comment.
LGTM! Thanks for making this update 🙌
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a new example,
examples/multi_worker_handoff.py, demonstrating how Pipecat Flows composes with Pipecat's multi-worker framework (the worker model introduced with Pipecat 1.3.0). It ports the idea from the now-archivedpipecat-subagentsFlowsAgentexample onto the native worker API.Three workers share a single bus:
LLMContext; bridges user/assistant frames onto the bus viaBusBridgeProcessor. It runs no LLM itself.LLMWorkerfor open-ended chit-chat, with@tooltransfer_to_reservation/end_conversation.transfer_to_routerescape hatch at every node.Only one worker is active at a time; hand-offs (via
activate_worker(..., deactivate_self=True)) are seamless. All workers speak into the main worker's sharedcontext_aggregator.The reservation worker is built by
build_reservation_worker(...)returning a plainPipelineWorker(same style as thesensor-controllerexample) — no subclass. AFlowManageris wired onto the worker and the flow is initialized/resumed from the worker'son_activatedevent handler.