As bots aren’t perfect, we allow the transfer of a conversation to an agent.
To configure the transfer, you must provide the
session parameters and then the
onFinish, which are optional, but recommended.
queueId is the id of the queue where you want to transfer the conversation. If a queue with that id doesn't exist, it will transfer the chat into a random open queue.
onFinish allows you to specify a payload or a path in order to trigger the action that the bot will follow after the conversation with the agent has finished.
Here’s a simple example of how to transfer the conversation to a queue with ID
HUBTYPE_DESK_QUEUE_ID. Once the human agent has solved the case, the bot will receive the payload
endConversation which will trigger the action
Note: The conversation is transferred to Hubtype Desk, so the
queueId must be the id of a queue inside Hubtype Desk. Contact us if you need to integrate with another CRM.
You can find the
HUBTYPE_DESK_QUEUE_ID by checking the URL
Edit Queue tab.
Note: If you run
withAgentId with the agent ID or
withAgentEmail with the agent's Hubtype Desk e-mail, without passing a queue parameter, the handoff is automatically done to the first queue assigned to the agent.
You can get an array of all the open queues in Hubtype Desk with the simple Botonic function
Note: Both features are only available when the bot is deployed. When you are in development mode (
botonic serve command), you can press the button 'Continue' in order to emulate the resolution of a case.
Each time a Human Handoff is done a new case will be created in Hubtype's Desk.
When creating a new case you can autoassign this case to a specific agent using
getAvailableAgents as shown below.
You can also send relevant information to Hubtype Desk by specifying the optional parameter with
caseInfocan contain, as an example, the name of the action where the user gets stuck. It will be displayed in the case details section in Hubtype Desk.
notecan be used to leave a message for other agents who don't have constancy of the case.
Human Handoff Example
To set up human handoff, you can use the Botonic library. You can select the relevant example with a very simple use case where a user is transferred to a human agent through the chatbot. The conversation is then displayed as a new case on Hubtype Desk.
In the example below, a route in
src/routes.js that triggers the handoff when a user types "handoff" is set up:
Then, in our
src/actions/transfer-agent.js file, we need to call the
humanHandoff method inside
Additionally, we check if the 'Customer Support' queue is open:
Note: Remember that the full features for
humanHandOff are only available when the bot is deployed!
Here is the list of the different handoff options available.
|ID or name of the queue where the conversation is transferred.||queueNameOrId||string|
|Specify a payload or a path to trigger the action that the bot will follow after the conversation with the agent has finished.||path||string|
|Leave a message for other agents to know more about the case.||note||string|
|Give details about the case.||caseInfo||string|
|Hidie agent's ID and name.||shadowing||boolean|
Note: None of these options are required, as by default, a simple HandOff will be performed to the first queue based on the ID sorted order.
Methods to Request Agent's Information
Get the list of all the open queues.
|queues||session||Name of the queues|
Get the list of all the agents who can attend a case by queue.
|agents||session, queueId||List of the agents' emails and ID of the queues|
Get extra information from the agents, sorted by the number of cases that are attending in Hubtype Desk. When creating a new case, it enables the case autoassignment to a specific agent.
|agents||session||Agent's information such as email address, number of cases attending, status (available or not) and last message sent|
Get the agent's vacation information to know their availability.
|vacation_ranges||session, agentParams (only ID or Email)||Agent's vacation start and end dates (timestamp)|