
Creating and managing transitions
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.
Naming functions
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.- Good:
save_postcode
,check_availability
,confirm_email
- Avoid:
goto_next_step
,continue_flow
,start_confirmation
Managing transition functions

- 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.
Duplicating a transition will auto-generate a unique name. You can then update the logic or connect it to different steps.
Example: conditional transition logic
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:
- Avoid cutting or dragging transition function code between steps.
- Instead, copy the code, paste it into the new step, then delete the original.
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- Renaming a Step will update the flow editor — but not your function logic
Best practices
- Step IDs are case-sensitive — so
"CollectName"
is not the same as"collectname"
. - Keep transition functions focused, with one job and one output.
- Use action- or intent-based names like
check_user_verified
,handle_no_availability
. - Avoid vague or structural names like
goto_step_two
orcontinue_flow
— they confuse the LLM and make flows harder to debug. - Transition functions are only visible to the LLM if referenced in the current step.
- They are attached to the current flow, so they are not shared globally. They will not show up in the functions tab.
- Use them to encapsulate branching logic and control step sequencing — not to generate agent responses.
Never chain multiple function calls in a single step. This will always increase the failure rate, and it makes flow behavior unpredictable.
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.
Recognising global functions in flows
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.
