Use this reservation confirmation flow as an example.
Cmd/Ctrl + C
and Cmd/Ctrl + V
in the Flow Editor.This flow handles a real-world reservation confirmation scenario. It highlights:
To help identify some of the key parts of a flow step, the start step is annotated. Click a lettered heading to go to the relevant section.
The flow name appears at the top of the editor and identifies the current flow — in this case, reservation confirmation
.
It also acts as a breadcrumb, allowing you to return to the list of all flows. This is useful when working across multiple projects or agents.
This shows the current step: Collect confirmation code
. The 🏁 icon indicates it’s the start step of the flow.
Each step contains:
Inside the step prompt, the LLM is told to call save_confirmation_code
if the user provides a valid input.
This example uses both the conversation and flow objects:
Transition functions are inserted using /
and appear as underlined blocks in the prompt editor.
See the transition function page for more details.
Clicking the . icon below the prompt lets you:
This is useful for branching logic but avoid chaining multiple goto_step()
calls inside a single function. Always return
after calling goto_step
.
This step has ASR biasing set to Alphanumeric, improving recognition of spoken confirmation codes like “B–4–Z–Q–9”.
You can enable other biasing types as needed, including:
See the ASR biasing page for more details.
At the bottom of the Flow Editor:
Transition functions created here are scoped to the flow unless declared globally.
The agent collects the user’s first and last name using separate steps, each with its own prompt and transition logic.
save_first_name
, save_last_name
) and proceeds.Each step uses few-shot prompting to improve recognition of tricky formats:
ASR biasing is set to Name spelling in the “Collect last name” step to improve recognition of spelled-out inputs.
The agent attempts to match the user’s provided details against active reservations.
confirmation code
, first name
, and last name
against entries in the $reservations
list.confirm_reservation
function and moves forward.transfer_call
with the following parameters:
destination="RESERVATIONS"
reason="RESERVATION_NOT_FOUND"
utterance="Right, let me put you through to someone who can help. Just a moment."
This is a standard validation step using dynamic values and conditional logic.
return
after flow.goto_step()
to prevent silent overridesgoto_step_4
) — use intent-based names like match_reservation
or retry_lookup
Voice transcription (ASR) often produces unstructured date strings like twenty seventh of june twenty twenty five
, which can be hard to parse — especially if you’re enforcing a strict format like DD/MM/YYYY
.
Instead of checking the date format in the step prompt or rejecting invalid inputs immediately:
This avoids issues where STT fails to cleanly separate day, month, and year — especially in multi-lingual or noisy environments.
Example context (LLM parameter):
The user will say a date. You must extract the intended date and convert it to DD MM YYYY format. If they use a different format, rewrite it before returning.
This code uses Python’s try statement to attempt splitting the date into day, month, and year. If the input isn’t in the expected format, it prompts the user to try again.
Use this reservation confirmation flow as an example.
Cmd/Ctrl + C
and Cmd/Ctrl + V
in the Flow Editor.This flow handles a real-world reservation confirmation scenario. It highlights:
To help identify some of the key parts of a flow step, the start step is annotated. Click a lettered heading to go to the relevant section.
The flow name appears at the top of the editor and identifies the current flow — in this case, reservation confirmation
.
It also acts as a breadcrumb, allowing you to return to the list of all flows. This is useful when working across multiple projects or agents.
This shows the current step: Collect confirmation code
. The 🏁 icon indicates it’s the start step of the flow.
Each step contains:
Inside the step prompt, the LLM is told to call save_confirmation_code
if the user provides a valid input.
This example uses both the conversation and flow objects:
Transition functions are inserted using /
and appear as underlined blocks in the prompt editor.
See the transition function page for more details.
Clicking the . icon below the prompt lets you:
This is useful for branching logic but avoid chaining multiple goto_step()
calls inside a single function. Always return
after calling goto_step
.
This step has ASR biasing set to Alphanumeric, improving recognition of spoken confirmation codes like “B–4–Z–Q–9”.
You can enable other biasing types as needed, including:
See the ASR biasing page for more details.
At the bottom of the Flow Editor:
Transition functions created here are scoped to the flow unless declared globally.
The agent collects the user’s first and last name using separate steps, each with its own prompt and transition logic.
save_first_name
, save_last_name
) and proceeds.Each step uses few-shot prompting to improve recognition of tricky formats:
ASR biasing is set to Name spelling in the “Collect last name” step to improve recognition of spelled-out inputs.
The agent attempts to match the user’s provided details against active reservations.
confirmation code
, first name
, and last name
against entries in the $reservations
list.confirm_reservation
function and moves forward.transfer_call
with the following parameters:
destination="RESERVATIONS"
reason="RESERVATION_NOT_FOUND"
utterance="Right, let me put you through to someone who can help. Just a moment."
This is a standard validation step using dynamic values and conditional logic.
return
after flow.goto_step()
to prevent silent overridesgoto_step_4
) — use intent-based names like match_reservation
or retry_lookup
Voice transcription (ASR) often produces unstructured date strings like twenty seventh of june twenty twenty five
, which can be hard to parse — especially if you’re enforcing a strict format like DD/MM/YYYY
.
Instead of checking the date format in the step prompt or rejecting invalid inputs immediately:
This avoids issues where STT fails to cleanly separate day, month, and year — especially in multi-lingual or noisy environments.
Example context (LLM parameter):
The user will say a date. You must extract the intended date and convert it to DD MM YYYY format. If they use a different format, rewrite it before returning.
This code uses Python’s try statement to attempt splitting the date into day, month, and year. If the input isn’t in the expected format, it prompts the user to try again.