Configure handoff to Dynamics 365 Customer Service

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

Note

Connect to Dynamics 365 Customer Service with a voice-enabled agent. For more information, see Use interactive voice response in your agents.

When your agent hands off a conversation, it shares the full history of the conversation and all variables collected in the interaction. Your Dynamics 365 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 agent conversations, see Hand off to a live agent.

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

Prerequisites

Warning

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

Connect your agent to Dynamics 365 Customer Service

  1. In Copilot Studio, open your agent, and go to the Channels page.

  2. Under Customer engagement hub, select the Dynamics 365 Customer Service tile.

  3. Select Connect.

    Note

    • The Dynamics 365 Customer Service package installation must be in the same environment as the agent.
    • If you're using Application Lifecycle Management (ALM), you might see a message that we can't determine if Dynamics 365 Customer Service integration is enabled for the environment. For more information, see Agents with Application Lifecycle Management.
  4. Select View in Omnichannel to continue configuring the agent connection in Dynamics 365 Customer Service.

Important

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

Agents with Application Lifecycle Management

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

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

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

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

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

  3. Next to the agent 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 agent doesn't have Dynamics 365 capabilities enabled, the message is always displayed.

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 an agent from Dynamics 365 Customer Service, the default agent 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 agent from the Copilot Studio portal, those topics aren't included in the agent. To create them, proceed as follows.

Create a Session Timeout topic

  1. Go to the Topics page.

  2. Select Add a 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.

  6. Select the desired duration value from the list. Alternatively, use the Formula option and enter a value in seconds. This value is the amount of inactive time it takes for the topic to trigger.

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

  8. Select Omnichannel from the dropdown.

  9. Finally, add a message, and at the end, add an End conversation node so the conversation ends. Select the Add node icon , point to Topic management, and then select End conversation.

  10. Save and publish your agent.

Manage your agent's Dynamics 365 capabilities

  1. Go to the Channels page.

  2. Under Customer engagement hub, select the Dynamics 365 Customer Service tile.

    Here you can disconnect your agent and find the link to go to the Dynamics 365 Customer Service admin center to view the connection details.

Disconnect your agent from Dynamics 365 Customer Service or disable the connection

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

To add your agent back, you must connect it again.

Known limitations

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

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

Install Dynamics 365 Copilot Studio extension.