> For the complete documentation index, see [llms.txt](https://en.help.firstline.cc/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://en.help.firstline.cc/feature/ai-agent/learn-about-ai-agent-handoff-conversation-scripts.md).

# Learn about AI agent handoff conversation scripts

Learn which needs are best handled by Fancy AI agents, which situations are better handed off to conversation scripts, and how service continues after the script is completed.

**Fancy is responsible for understanding customer needs, while conversation scripts handle services that require fixed steps.** Using both together allows customers to ask questions naturally while maintaining consistency in the service process.

For example, if a customer says, “I want to return an item,” Fancy can recognize that this is a request, then hand the conversation to the “Return Request” script to collect the order details and reason for return in sequence.

## When is it appropriate to hand off to a conversation script?

| Customer need                                                                      | Recommended approach                                                          |
| ---------------------------------------------------------------------------------- | ----------------------------------------------------------------------------- |
| Product information, return/exchange policies, and general service questions       | Fancy looks up the company knowledge and answers.                             |
| Business hours, whether open                                                       | Fancy provides the answer according to the business hours set by the company. |
| Follow-up questions, need for additional explanation                               | Fancy continues the conversation.                                             |
| Tasks that require fixed steps, such as return requests and member profile changes | Hand off to the corresponding conversation script.                            |
| Need to query orders or collect information according to an existing process       | Hand off to the corresponding conversation script.                            |
| Must be approved by staff or further confirmed                                     | Transfer to a live customer service agent.                                    |

{% hint style="info" %}
**Not every question needs to switch scripts.** If a customer is only asking about the return period, Fancy can answer first; when the customer clearly says, “I want to make a return,” hand it to the request script instead, which usually better meets the user's needs.
{% endhint %}

## Common use cases

### Return request

**Customer:**“The clothes don’t fit, and I want to return them.”

1. Fancy understands that the customer wants to make a return.
2. According to the routing settings, hand off to the “Return Request” conversation script.
3. The script confirms the order number, item, and reason for return in sequence.
4. After collecting the information, provide follow-up guidance according to company rules, and transfer to a live agent if needed.

### Order status inquiry

**Customer:**“Why hasn’t my order arrived yet?”

Fancy can hand requests that require checking actual order data to the “Order Inquiry” script, which obtains the information according to the company’s configured method and then replies to the customer. If no result is found, the AI should not guess the delivery status on its own.

### Member profile service

**Customer:**“I want to change my member information.”

Fancy first understands the request, then the member service script guides the customer to confirm the necessary information and handling steps. When identity verification or sensitive data is involved, existing company rules should still be followed.

## How do I set the handoff conditions?

{% stepper %}
{% step %}

### Prepare the conversation script

First create the conversation script you want to use, and make sure it is enabled and can complete the relevant steps normally.
{% endstep %}

{% step %}

### Open Fancy's “Routing”

In **AI Agent → Routing** add a new setting and fill in the name and applicable scenarios.
{% endstep %}

{% step %}

### Choose the action to perform

Select **Switch conversation script**, then specify the script to hand off to.

The condition can be written as: “When the customer explicitly requests a return or exchange, rather than just asking about the policy, switch to the return/exchange request script.”
{% endstep %}

{% step %}

### Save and test chat

Test with different phrasings, such as “How long is the return period?” and “I want to request a return,” to confirm that Fancy can choose the appropriate handling method based on the actual need.
{% endstep %}
{% endstepper %}

{% hint style="info" %}
Routing is determined by Fancy based on the customer's words, so it is recommended to clearly describe the applicable scenarios and test common alternative phrasings.
{% endhint %}

## After the conversation script finishes, will Fancy automatically take over?

**Not necessarily.** This depends on what action the script ends with.

| Script handling method                         | What the customer will experience                                                                                                                                                     |
| ---------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Normally completes the flow**                | After the script is completed, Fancy will take back the conversation, but**will not reply immediately**; Fancy will continue assisting only when the customer sends the next message. |
| **Return to AI agent**                         | Let the original Fancy continue processing immediately, such as providing additional explanation or asking whether the customer still needs help.                                     |
| **Transfer to live customer service**          | Hand it over to a customer service representative; Fancy will not continue replying at this time.                                                                                     |
| **When an unmatchable message is encountered** | If the script already has another handling method set, it will be followed first; otherwise, the original Fancy will continue assisting.                                              |

{% hint style="warning" %}
**“Finish script” and “Return to AI agent” are not the same.** After normal completion, Fancy will wait for the customer to message again before continuing to reply; using “Return to AI agent” will cause Fancy to continue immediately. If the script is explicitly set to end the conversation or transfer to a human, Fancy will not take over. Please test the chat first to confirm the actual result.
{% endhint %}

## Avoid repeated handoffs

To prevent customers from being repeatedly handed off to the same conversation script, Fancy limits some repeated handoff cases. If a process has already been completed, Fancy may not start that process again.

If you want customers to be able to use the same process repeatedly, please check the related settings and test it through “Test chat.”

## Can conversation scripts also use the AI response feature?

Yes. The conversation script's built-in **AI response agent** can help answer questions at specific steps; for example, in an after-sales service script, it can provide explanations about product warranties or return policies.

But unlike the one created in the **AI Agent** and the standalone Fancy created in the management page, its purpose and configuration are different. If you want Fancy to handle customer reception and then switch to fixed processes as needed, please use Fancy's **routing** feature.

For detailed steps, please refer to [How can Fancy work with conversation scripts?](https://help.firstline.cc/feature/ai-agent/start-ai-agent-from-scenario).
