Transition functions are tied to each flow
Transition functions are tied to a specific flow. They should not be confused with global functions, which can be used across flows, in the global rules, and in the knowledge base.
To view and manage transition functions, click the Flow functions button in the bottom-right corner of the Flow Editor. This opens a searchable modal showing all transition functions associated with the current flow.
Use transition functions to control how your agent moves from one step to another, using the open-code Python fields that you can find in other transition items around Agent Studio.
Here’s how you can create a new transition function:
Connect two steps If no transition exists, linking two steps will prompt you to create one.
Name your transition You’ll be asked to name the new transition function. Clear, intent-based names improve flow readability and LLM alignment.
Handle name conflicts If the name is already in use, the UI will show an error. Rename the function before proceeding.
View usage references After creation, the UI shows how many times the transition function is referenced in prompts.
Function names directly shape how the LLM behaves — and what it might say. Stick to names that reflect the user’s intent, not the flow structure. Always name from the user’s perspective, rather than that of your AI agent.
save_postcode
, check_availability
, confirm_email
goto_next_step
, continue_flow
, start_confirmation
You can manage transition functions in two ways:
From a step Open the step’s context menu and select an existing transition or create a new one.
From the Flow Functions modal Use the modal to view, rename, delete, or connect transitions to steps.
A transition function typically checks state and moves to the appropriate step:
Always use return
at the end of your transition function. Omitting it can lead to unexpected behavior.
Broken transitions after editing?
If you’re moving transition code between steps, be careful:
This ensures any flow.goto_step("Step Name")
call still refers to a real, valid Step.
Transition logic can break silently if the destination step name is renamed or deleted elsewhere in the flow.
Also remember:
flow.goto_step(...)
is case-sensitive"CollectName"
is not the same as "collectname"
.check_user_verified
, handle_no_availability
.goto_step_two
or continue_flow
— they confuse the LLM and make flows harder to debug.Never chain multiple function calls in a single step. This will always increase the failure rate, and it makes flow behavior unpredictable.
Never chain multiple function calls in a single step. This will always increase the failure rate, and it makes flow behavior unpredictable.
Keep individual step logic consolidated into one function wherever possible.
If your transition function needs to trigger user-facing output, return a message string at the end. Otherwise, let the agent respond from the step prompt.
Global functions are distinguished in flow steps by the function symbol . They can also be edited in the flow editor, but keep in mind this will affect all iterations of that function across Agent Studio.
Global functions will also have profile items in the functions tab.
Transition functions are tied to each flow
Transition functions are tied to a specific flow. They should not be confused with global functions, which can be used across flows, in the global rules, and in the knowledge base.
To view and manage transition functions, click the Flow functions button in the bottom-right corner of the Flow Editor. This opens a searchable modal showing all transition functions associated with the current flow.
Use transition functions to control how your agent moves from one step to another, using the open-code Python fields that you can find in other transition items around Agent Studio.
Here’s how you can create a new transition function:
Connect two steps If no transition exists, linking two steps will prompt you to create one.
Name your transition You’ll be asked to name the new transition function. Clear, intent-based names improve flow readability and LLM alignment.
Handle name conflicts If the name is already in use, the UI will show an error. Rename the function before proceeding.
View usage references After creation, the UI shows how many times the transition function is referenced in prompts.
Function names directly shape how the LLM behaves — and what it might say. Stick to names that reflect the user’s intent, not the flow structure. Always name from the user’s perspective, rather than that of your AI agent.
save_postcode
, check_availability
, confirm_email
goto_next_step
, continue_flow
, start_confirmation
You can manage transition functions in two ways:
From a step Open the step’s context menu and select an existing transition or create a new one.
From the Flow Functions modal Use the modal to view, rename, delete, or connect transitions to steps.
A transition function typically checks state and moves to the appropriate step:
Always use return
at the end of your transition function. Omitting it can lead to unexpected behavior.
Broken transitions after editing?
If you’re moving transition code between steps, be careful:
This ensures any flow.goto_step("Step Name")
call still refers to a real, valid Step.
Transition logic can break silently if the destination step name is renamed or deleted elsewhere in the flow.
Also remember:
flow.goto_step(...)
is case-sensitive"CollectName"
is not the same as "collectname"
.check_user_verified
, handle_no_availability
.goto_step_two
or continue_flow
— they confuse the LLM and make flows harder to debug.Never chain multiple function calls in a single step. This will always increase the failure rate, and it makes flow behavior unpredictable.
Never chain multiple function calls in a single step. This will always increase the failure rate, and it makes flow behavior unpredictable.
Keep individual step logic consolidated into one function wherever possible.
If your transition function needs to trigger user-facing output, return a message string at the end. Otherwise, let the agent respond from the step prompt.
Global functions are distinguished in flow steps by the function symbol . They can also be edited in the flow editor, but keep in mind this will affect all iterations of that function across Agent Studio.
Global functions will also have profile items in the functions tab.