Configure handoff to Dynamics 365 Customer Service

Important

Power Virtual Agents capabilities and features are now part of Microsoft Copilot Studio following significant investments in generative AI and enhanced integrations across Microsoft Copilot.

Some articles and screenshots may refer to Power Virtual Agents while we update documentation and training content.

When your customers need to speak with a human agent, your copilot can seamlessly hand off the conversation. With the omnichannel capabilities of the Chat Add-in for Dynamics 365 Customer Service, you can connect both voice (in Classic chatbots) and text (messaging) conversations.

Note

Connecting to Dynamics 365 Customer Service Omnichannel for voice capabilities is available to Microsoft Copilot Studio classic chatbots only at this moment. This feature is coming soon to all other copilots.

When your copilot hands off a conversation, it shares the full history of the conversation and all variables collected in the interaction. Your Omnichannel for Customer Service routes incoming escalations to the right queue, and a live agent can seamlessly resume the conversation. For more information about how to use handoff in copilot conversations, see Hand off to a live agent.

You can also enable single sign-on (SSO) to allow copilots to sign users in if they're logged in to the page where the copilot is deployed. For more information, see Configure single sign-on and Pass authentication token to copilot during single sign-on in live chat.

Prerequisites

Warning

Microsoft Copilot Studio copilots with names that are longer than 30 characters will fail to connect when you follow the instructions in this article. Ensure your copilot's name contains less than 30 characters before you proceed.

Connect your copilot to Omnichannel for Customer Service

  1. In Microsoft Copilot Studio, edit your copilot. In the navigation menu, select Settings, Customer engagement hub, and then select the Omnichannel tile.

    The bot management Agent transfers page.

  2. Select Connect.

    • Note that the OmniChannel installation must be in the same environment as the copilot.
    • If you're using Application Lifecycle Management (ALM), you may see a message that we can't determine if Omnichannel for Customer Service integration is enabled for the environment. For more information, see Bots with ALM.
  3. Click View in Omnichannel to continue configuring the bot connection in Omnichannel for Customer Service.

Important

To test the copilot on your custom website, you must use the embed code that's specified in the chat widget you set up in Omnichannel for Customer Service. If you use the embed code from Microsoft Copilot Studio, handoff won't work. For more information, see Embed chat widget in your website or portal.

Copilots with Application Lifecycle Management

Suppose you've set up Application Lifecycle Management (ALM) for your bots, and are exporting and importing copilots between development (unmanaged) and test or production (managed) environments. In that case, you might see a message that we can't determine if Omnichannel for Customer Service integration is enabled for the environment.

Message that we can't determine if this copilot has omnichannel capabilities enabled or disabled.

If the copilot you exported has omnichannel capabilities enabled, you can ignore this message. The bot will still work properly. The message will disappear after you export the latest version of your bot from your development environment and then import it into a targeted test or production environment with managed bots.

If you continue to see the message after you export and import the latest version of your managed copilot, make sure to remove any unmanaged layers:

  1. Sign in to Power Apps and select the managed copilot's environment.

  2. In the navigation menu, select Solutions, and then select the solution that contains the copilot with the unmanaged layer.

  3. Next to the copilot component in the solution, select More commands (), and then select See solution layers.

    Selecting solution layers in Power Apps.

  4. Select the unmanaged layer, and then select Remove unmanaged layer.

    Remove unmanaged layer in Power Apps.

If your copilot doesn't have omnichannel capabilities enabled, the message will always show.

Configure inactivity timeout to close conversation

Dynamics 365 Customer Service expects a conversation to end after a period of inactivity. This feature is important to ensure the supervisor view displays the correct ongoing conversations and manages agent loads and metrics correctly. When you create a copilot from Dynamics 365 Customer Service, the default bot content includes two topics: Session Timeout Reminder and Session Timeout. These topics use the Inactivity trigger to first remind the user, and then close the conversation after a set inactivity timeout value, which can be configured in the topic. But if you create the copilot from the Microsoft Copilot Studio portal, those topics aren't included in the copilot. To create them, follow the steps below:

Create a Session Timeout topic

  1. From the left navigation, select Topics.

  2. From the top bar, select New topic and From blank.

  3. Hover the trigger Phrases and select the Change trigger icon.

    Change topic's trigger

  4. Select Inactivity from the list.

  5. Select Edit in the Trigger node to configure the inactivity duration.

    Configure inactivity trigger

  6. Select a Value from the dropdown, or enter an arbitrary value (in seconds) using a Formula entry. This value is the amount of inactive time it takes for the topic to trigger.

  7. Select which channel it applies to by using the Condition option. For OmniChannel, click on Select a variable under the Condition block, select the System tab, and Activity.Channel.

    Change inactivity trigger condition

  8. Select Omnichannel from the dropdown.

  9. Finally, add a message, and at the end, add an End Conversation node so the conversation ends. Click on the (+) sign, select Topic management, and then select End conversation.

Finally, save and publish your copilot.

Manage your copilot's omnichannel capabilities

Select Settings, Agent transfers, and then select the Omnichannel tile. Here you can disconnect your copilot and find the link to go to the Omnichannel for Customer Service admin center to view the connection details.

Disconnect your copilot from Omnichannel for Customer Service or disable the connection

If you select Disconnect, the application user that represents the copilot in your Omnichannel for Customer Service instance is disabled. Your copilot effectively disconnects from the Omnichannel for Customer Service environment and stops receiving any traffic from your Omnichannel for Customer Service instance.

To add your copilot back, you need to connect it again, starting at Step 2.

Known limitations

See limitations when using Microsoft Copilot Studio with the Chat Add-in for Dynamics 365 Customer Service.

The following extensions aren't required to hand off to Omnichannel for Customer Service, but they provide copilot authors with a better experience by providing extra variables and actions.

Install Omnichannel Power Virtual Agent extension.