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.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.
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 that call transition functions from the prompt instead of relying on built-in conditions.
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
Flow configuration
Each flow includes aflow_config.yaml file that defines the flow itself.
Fields
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
Default steps can also include any of the step settings below.
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
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.
Unlike default steps, they don’t define conditions or extracted_entities — instead they transition by calling transition functions from the prompt.
Fields
Advanced steps can also include any of the step settings below.
Step settings
Both default and advanced steps can override project-level ASR, DTMF, VAD, barge-in, and LLM behavior for a single turn. Each settings block below is optional and sits at the top level of the step file — omit a block to inherit the project-level setting.ASR biasing
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
Steps can also define DTMF behavior, including:inter_digit_timeoutmax_digitsend_keycollect_while_agent_speakingis_pii
ASR override
Override the speech recognition provider or model for this step.VAD
Tune voice activity detection — how the platform decides the caller has started and stopped speaking.Barge-in
Control whether the caller can interrupt the agent on this step.LLM
Override the model or its reasoning effort for a single step.Clearing a settings block
Removing a block from the step file clears that override on the next push — but only forasr, vad, barge_in, and llm. asr_biasing and dtmf_config deep-merge into their platform-side values instead, so to turn those off set is_enabled: false rather than deleting the block.
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
- must have a name that is unique across the whole project, not just within their own flow — a duplicate name in a different flow causes a build error
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
Validation
- A step
namemust be unique within its flow, across step types. - A condition
namemust be 1 to 50 characters and unique within its step. - A condition’s
child_stepmust be a step in the same flow. inter_digit_timeoutandmax_digits(DTMF configuration) cannot be negative.vad_startandvad_end(VAD) must be finite and non-negative —poly validaterejects a negative or infinite value.
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
A flow function that does not advance the flow
Flow functions must always advance the flow. A function that returns without changing step or flow leaves the agent sitting in the same logical place with no clear next state.Mixing conv.exit_flow() with navigation
Do not create a dedicated “Anything else?” step just to wrap up a flow. When the flow is finished, exit it and return the closing prompt there.
Calling conv.exit_flow() and then also navigating does not do both — the navigation overrides the exit:
end_turn=False while waiting for a reply
end_turn=False should only be used when the agent speaks and then immediately performs another action in the same turn, without waiting for input.
Others
- encoding branching logic in prompts rather than Python
- using internal IDs instead of resource names
- putting too much deterministic logic into LLM-driven steps
- reading entity values with
conv.entitieswhere a prompt reference would do — use{{entity:entity_name}}directly in the step prompt
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.
Resource architecture
Where facts belong in rules and topics versus logic in Python — the broader pattern behind the prompts-vs-code mistake above.
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.
