D365 Omnichannel: Bot Variables in Workstream Classifications and Routing Rules

In the D365 omnichannel, Microsoft Copilot studio bots can be integrated into the chat channel. Bot can first respond to the customer's request and when required the chat can be transferred to a human agent for further conversations. During the conversation, there may be scenarios where customer inputs are collected, which can be useful when routing the conversation to the human agent.


There is a requirement that the chat should be routed to the agent based on the country.

During the conversation, the bot can get the country from the customer, save it as a custom variable, and pass it to the omnichannel during the conversation hand-off.

Example of a context variable in the bot

Context variable

In the Bot topic, the Transfer conversation node has a property where the bot context variables can be set to be passed to the omnichannel as shown below.

Note. Set variables as global variables in the bot if the transfer conversation and the context variables are in different topics.

Transfer Conversation

In the D365 omnichannel workstream, the required context variables from Bot should be created with the same name under the context variables section as shown below.

Note. Only text and number data types are supported.

Text and number data types

Now, these variables can be used in the workstream classification and routing rules conditions as shown below.

Context item value