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.

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:

  1. Connect two steps If no transition exists, linking two steps will prompt you to create one.

  2. Name your transition You’ll be asked to name the new transition function. Clear, intent-based names improve flow readability and LLM alignment.

  3. Handle name conflicts If the name is already in use, the UI will show an error. Rename the function before proceeding.

  4. 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

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.

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:

def check_user_verified(conv: Conversation, flow: Flow):
    if conv.state.user_verified:
        flow.goto_step("Account details")
    else:
        flow.goto_step("Verify identity")
    return

Always use return at the end of your transition function. Omitting it can lead to unexpected behavior.

Best practices

  • 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 or continue_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.

save_user_input()
check_availability()
flow.goto_step("Next")

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.

Global functions will also have profile items in the functions tab.