Configure Omnichannel for Customer Service

Completed

When you connected the copilot to the Omnichannel for Customer Service environment, a virtual agent user was automatically created. Conversations can be transferred to a virtual agent or any other agent. You need to configure Omnichannel for Customer Service to understand when to route conversations to the copilot. This is done in the Customer Service admin center application.

Control how conversations are routed

Omnichannel for Customer Service uses workstreams to route conversations to the appropriate queues so the conversations can be distributed to agents. Most often, you want incoming conversations on a workstream to first be routed to a virtual agent. If needed the virtual agent can hand off the conversation to a live agent to handle any scenarios beyond the copilot's ability. You can configure this behavior directly on the workstream record associated with the channel. For example, if you want to route an incoming live chat conversation coming from your portal to an agent first, you must configure the copilot settings on the live chat workstream.

  1. In the Customer Service admin center application, select Workstreams.

  2. Open the workstream that you want to add the copilot to.

  3. In the Copilot section, select the Add copilot button and select the virtual agent that you want to use.

Screenshot of the Virtual Agent capacity setting.

Capture the conversation context

When a Microsoft Copilot Studio bot facilitates a handoff to another system, it automatically includes variables that the other system can consume to better understand the context of the conversation. When Omnichannel for Customer Service receives the conversation, it can review these context variables and decide what to do next.

Microsoft Copilot Studio includes the context variables when it transfers a conversation to an agent, as shown in the following table.

Context Purpose Example
va_Scope Helps route escalations to a live agent "bot"
va_LastTopic Helps route escalations to a live agent and helps prompt a live agent "Return items"
va_Topics Helps prompt a live agent [ "Greetings", "Store Hours", "Return Item" ]
va_LastPhrases Helps route escalation to a live agent and helps prompt a live agent "Can I return my item"
va_Phrases Helps prompt a live agent ["Hi", "When does store open", "Can I return my item" ]
va_ConversationId Helps uniquely identify a bot conversation GUID
va_AgentMessage Helps prompt a live agent "Got a gift from: HandoffTest"
va_BotId Helps identify the bot that is handing off a conversation GUID
va_Language Helps route escalation to a live agent "en-us"
All user-defined topic variables Helps prompt a live agent @StoreLocation = "Bellevue"

The work stream needs to include any context variables that were created during setup for the bot to handle the customer queries appropriately. For example, if you want to use the va_Scope variable to help identify if it's coming from a bot or a live person, you need to add a context variable called va_Scope to the workstream. This parameter needs to be defined for all copilot variables that are used, including variables that were created during the writing process.

Context variable name matches Microsoft Copilot Studio bot variable name.

For more information, see context variables.

Configure routing rules

After you define the context variables that were used by the work stream, routing rules need to be created to send the conversation to the correct queue. Routing rules include a condition and a destination queue. When an item comes in, the routing rules are tested against the item in the order that they're defined in the application. When a rule condition is true, the item is routed to the destination queue. Any remaining rules don't run because a match was found. When you're working with bots, conditions can be built by using context variables such as va_Scope.

When Microsoft Copilot Studio sends a conversation to an agent, it automatically sets the va_Scope context variable to copilot. If the conversation isn't escalated from a copilot, the va_Scope context variable is empty. By using this information, you can determine what to do with a conversation.

Conditions determine if conversation was initiated by a bot or a live person.

For example, if the value of the va_Scope context variable equals copilot, you know that the conversation is coming from a Microsoft Copilot Studio copilot and should be routed to a human queue. If the va_Scope context variable doesn't contain data, it should be automatically sent to the bot queue.

To dive deeper into work distribution in Omnichannel for Customer Service, see Omnichannel for Customer Service.

For more information on queues, see queues.