What is a Flow?
AFlow is a directed graph: nodes (states) connected by edges (transitions), with metadata at each node (prompts, tool references, slot definitions). It’s the static definition of what your dialog can do.
The DialogMachine executes the flow at runtime - one turn() at a time.
Building from a prompt
The fastest way to get started.create_dialog_flow makes one LLM call and generates the graph for you.
- Describe the goal and each step in plain language
- Mention what data you need to collect (slots)
- Describe any branching logic (“if they decline, escalate to an agent”)
Building by hand
For precise control over graph structure, construct nodes and edges directly:Saving and loading
Flows support JSON and YAML formats — commit them to source control alongside your code.React Flow editor support
Flows exported from the React Flow visual editor (camelCase JSON) are automatically detected and normalized:Multiple flows with FlowSet
AFlowSet holds several named flows. Use it when a conversation may branch across distinct sub-flows (e.g. main flow → escalation, billing, or FAQ).