Flows choreograph multi-step processes. At any given moment, the model only sees the current step’s prompt and tools.
A good flow keeps each step focused on a single task. Use Python for branching, validation, and routing logic, and use prompts for conversational behavior.What flows are for
Flows are best used when the agent needs to move through a structured process such as:- collecting information in a defined order
- confirming details before taking action
- calling APIs or deterministic logic at specific points
- handling success, failure, and retry paths explicitly
Default steps
LLM-driven steps for collecting information and transitioning based on conditions.
Advanced steps
Steps with more control over ASR, DTMF, and callable transition functions.
Function steps
Deterministic Python steps for routing, validation, and API calls.
Entering a flow
A flow can be entered in several ways.From code
Via a returned transition
Within a flow
File structure
Flows live under theflows/ directory.
name field, converted to lowercase snake_case. A flow named Booking Flow must live in flows/booking_flow/. If the directory name does not match, the ADK will not recognize the flow.
Flow configuration
Each flow includes aflow_config.yaml file that defines the flow itself.
Fields
| Field | Required | Description |
|---|---|---|
name | No | Human-readable flow name |
description | Yes | What the flow does |
start_step | Yes | The step to enter when the flow starts |
Example
Step types
A step represents the agent’s current position in the flow. There are three step types:- default steps
- advanced steps
- function steps
Default steps
Default steps live insteps/*.yaml.
These steps use LLM logic to process information and transition based on configured conditions. They cannot call transition functions from their prompt.
ASR biasing is automatically configured based on the entities requested in the step.
Fields
| Field | Description |
|---|---|
step_type | Must be default_step |
name | Human-readable step name |
conditions | Conditions that control transitions |
extracted_entities | Entities to collect in the step |
prompt | Prompt shown to the model |
Prompt behavior
Default step prompts may use entity references such as:Conditions
Conditions define how the agent transitions out of a default step. A condition can:- go to another step
- exit the flow
Condition fields
| Field | Description |
|---|---|
condition_type | step_condition or exit_flow_condition |
description | When this condition applies |
child_step | Next step, only for step_condition |
required_entities | Entities that must be collected before the condition can trigger |
child_step rules
Use the correct step identifier depending on target type:
- Default step or advanced step: use the step’s
name - Function step: use the Python filename without
.py
Advanced steps
Advanced steps also live insteps/*.yaml.
These steps support additional controls such as:
- custom ASR tuning
- DTMF collection rules
- transition function calls from the prompt
Fields
| Field | Description |
|---|---|
step_type | Must be advanced_step |
name | Human-readable step name |
asr_biasing | ASR tuning for the turn |
dtmf_config | DTMF collection settings |
prompt | Prompt shown to the model |
ASR biasing
Advanced steps can tune ASR toward specific kinds of user input. Supported ASR biasing fields include:alphanumericname_spellingnumericparty_sizeprecise_daterelative_datesingle_numbertimeyes_noaddresscustom_keywords
DTMF configuration
Advanced steps can also define DTMF behavior, including:inter_digit_timeoutmax_digitsend_keycollect_while_agent_speakingis_pii
Step prompt design
Prompts should be used for:- collecting input
- presenting information
- shaping the conversational turn
- comparisons
- conditionals
- routing
- state-driven decisions
Prompt tips
- use markdown headers to structure instructions
- keep one clear purpose per step
- include validation and edge cases where needed
- use voice-friendly phrasing for spoken interactions
- make transitions explicit
Function steps
Function steps live infunction_steps/*.py.
These are deterministic Python steps. They execute directly, with no model interpretation. Use them for:
- API calls
- validation
- state updates
- explicit routing
Signature
Important rules
Function steps:- cannot define extra parameters
- cannot use
@func_description - must control flow explicitly
flow.goto_step(...)conv.exit_flow()
Common uses
Validation
Check whether collected input is valid before the flow continues.
Routing
Move to the correct step based on deterministic logic.
External calls
Call APIs and store the results in state.
Error handling
Send the flow to an error step with a useful context string.
Transition functions
Transition functions live infunctions/*.py inside a flow.
They can be called from advanced-step prompts and are referenced using:
- may define custom parameters
- may have a description shown to the model
- can be called by the model within the same flow
Best practices
- keep one clear purpose per step
- start with a simple linear path, then add branching
- use confirmation steps before function steps that change state
- add explicit error and failure paths
- use meaningful step names
- test the full path from entry to exit
Common mistakes
- leaving a flow function without advancing the flow
- encoding branching logic in prompts
- using internal IDs instead of resource names
- putting too much deterministic logic into LLM-driven steps
- mixing
conv.exit_flow()with additional navigation - using
end_turn=Falsewhen the user is actually expected to reply
Design principles
- start with a single path
- add branching only where needed
- use function steps for deterministic logic
- use prompts for conversational behavior
- make every transition explicit
Related pages
Functions
Learn how global functions, transition functions, and function steps differ.
Topics
See how topics trigger flow entry via
conv.goto_flow in their actions.Entities
See how structured data collection fits into flow steps and conditions.
Return values reference (platform)
All supported function return shapes used in flow transitions — utterance, hangup, goto_flow, and combined dicts.
Conversation object reference (platform)
Full reference for
conv.goto_flow, conv.exit_flow, flow.goto_step, and all other flow navigation methods.
