# Transition to Twilio Studio

> \[!WARNING]
>
> AI Assistants is a [Twilio Alpha](https://twilioalpha.com) project that's in **Developer Preview**.
>
> View the [current limitations](/docs/alpha/ai-assistants/pricing-and-limits) for details about feature limits during developer preview.

There might be situations in which you no longer want your AI Assistant to handle a conversation and instead want it to rely on a more deterministic path using a [Twilio Studio Flow](/docs/studio). In this guide, you will learn how to have your AI Assistant transition a conversation to Studio.

## Prerequisites

This Assistant handoff requires your conversation to flow through [Twilio Conversations](/docs/conversations). Follow the guide for using [AI Assistants with Twilio Conversations](/docs/alpha/ai-assistants/code-samples/channel-conversations) before moving on here.

## Set up your Studio Flow

You will need a [Studio Flow that is configured for the **Incoming Conversation** trigger](/docs/studio/tutorials/using-conversations-with-studio). From here, you can use any Studio Widget that is compatible with Conversations.

![Beginning of a Studio flow where the Incoming Conversation trigger flows into a welcome widget.](https://docs-resources.prod.twilio.com/04e7eef714be8fb04002909ac933c2ea9c9efc9fcc5f94a0aa4b3b707f1fea61.png)

Make sure to deploy your Studio Flow and copy the Flow SID.

## Configure your handoff Tool in your AI Assistant

If you followed the [AI Assistants with Twilio Conversations](/docs/alpha/ai-assistants/code-samples/channel-conversations) guide, one of the [Twilio Functions](/docs/serverless/functions-assets) that you deployed was a Studio Handover tool.

To use this webhook as an Assistant Tool, you will need your Functions domain from the deployment. If you can't find your Functions domain, head to the [Twilio Console](https://console.twilio.com/us1/develop/functions/services) and click on **Service Details** next to your `ai-assistants-samples` service. You can find the domain in the **Environments** section.

Once you have both your Flow SID and your Functions domain, you can go into your [AI Assistant in the Twilio Console](https://console.twilio.com/us1/develop/ai-assistants/assistants) and create a new Tool with the following configuration:

| Field       | Example Configuration                                                                          | Notes                                                                                             |
| ----------- | ---------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- |
| Name        | Studio Handover                                                                                | You can modify this if you have multiple handovers.                                               |
| Description | You MUST use this if a customer is asking for a refund.                                        | Use this description to tell the AI Assistant when to use the tool.                               |
| Input       | <pre lang="typescript"><code>\{}</code></pre>                                                  |                                                                                                   |
| Method      | `POST`                                                                                         |                                                                                                   |
| URL         | `https://<your-functions-domain>.twil.io/tools/studio-handover?flowSid=<your-studio-flow-sid>` | Make sure to replace `<your-functions-domain>` and `<your-studio-flow-sid>` with your own values. |

This Tool reroutes the conversation from your Assistant to Studio, but does not forward the last message from the Assistant to the Studio Flow. Instead, the Tool responds with `Conversation handed over`, which might prompt the Assistant to say something like "I handed this conversation over". If you want to manipulate this message, you can pass a different message into the **URL** configuration using the `successMessage` query parameter.

## Learn more

You've now learned how to configure an Assistant to hand off a conversation to a Twilio Studio Flow. See more tutorials below:

* [Learn how to add an AI Assistant to your React application](/docs/alpha/ai-assistants/code-samples/react)
* [Learn how to have your AI Assistant transition a conversation to a Flex agent](/docs/alpha/ai-assistants/code-samples/transition-flex)
