bot.py runs the pipeline, flow.yaml is the graph, and handlers.py is the Python the graph names. The programmatic ones are a single file, and each is in Python for a specific reason.
Declarative
Start here.hello_world exists in both forms, so the two can be read side by side.
Hello World
The smallest possible flow: two nodes and one tool. Read this first.
Food Ordering
The full-featured flow: branching between pizza and sushi, a pre-action, a
global function, and transition-only entries.
Restaurant Reservation
A branch table keyed on a tool’s result, and the shim pattern: flow-agnostic
business logic under a thin tool that reports its outcome as a
status
field.Patient Intake
Data-capture tools, a branch on a boolean result, and session facts such as
the practice and patient names read from state.
Insurance Quote
Prompts built from computed values: the handlers store each quote in state,
the results node reads it with a placeholder, and adjusting the coverage
re-enters the node with the new figures.
Podcast Interview
A node that transitions back to itself.
Clinic Appointments
A subflow: the steps that verify a caller are written once and run by two
nodes, one returning to booking and the other to cancelling.
Programmatic
Each of these is in Python because something about it needs code. See when to write a flow in code.Hello World in Code
The smallest possible flow, in code; the pair of the declarative
hello_world.Food Ordering in Code
The food-ordering flow in code, showing node and edge functions; the base
for the schema variant below.
Advanced Function Schemas
The same flow with
FlowsFunctionSchemas: an enum on the pizza size and
type and a numeric range on the sushi count, which a direct function can
only hint at in prose.Warm Transfer
A flow driven by transport events: the bot transfers the caller to a human
agent, briefs the agent while the caller hears hold music from a parallel
pipeline, then drops out (DailyTransport only).
Multi-Worker Handoff
A flow living inside a worker: a structured reservation worker hands off to
and from a free-form
LLMWorker router over the bus, sharing one
conversation context.LLM Switching
Switching between LLM providers during a conversation; the flow is
incidental to the
LLMSwitcher.