Build Guide: Assign Agent
Quick links in this article:
This article will outline exact steps for creating an ‘Assign Agent’ flow, as part of a chatbot automation journey. Refer to Building A Chatbot: Flows for more information.
Check Current Pathway
Navigate to the builder and start by giving your flow a name, then hitting File>Save. You’ll be able to keep saving your flow as you progress, to avoid losing progress.
Much like the Pathway: X flows, you’ll need to start out by adding a Decision
as your first action. This is going to check if the current value for Chatbot Pathway
custom field matches Pass Agent
.
Check Opening Hours
The next action we need to add is Check Opening Hours
- this will check the schedule set for the team you’ve mapped to this chat account and allow you to split the flow accordingly.
Out Of Hours
On the No criteria met branch of your Check Opening Hours
action, the schedule has determined the current time is outside your scheduled hours i.e. no agents are working right now. How you decide to handle this is up to you! You could:
Advise the customer to get back in touch in hours and close the chat OR
Send a fallback form to the customer, and assign it to an email queue for pickup in the morning
We’re going to go with option 1 in this case. We want to send a series of messages like this:
Chatbot: Unfortunately, live chat is currently unavailable. Our opening hours are 8am - 8pm, 7 days a week. Please pop back online during these times to reach an agent.
[2 second delay]
Chatbot: This chat will close automatically in a few seconds.
[5 second delay]
[Chat Ended]
First, add a Send Autoresponse
action with the first message, and add a 2 second delay.
Delays between autoresponses are recommended, to create a more naturalistic feel for the customer and to give them time to read each message.
Then add a second Send Autoresponse
action with the next message, this time with a 5 second delay. We can then add the Close Conversation
action immediately after it.
This will close the chat, but not the interaction, which is still stored in your queues.
We finally need to close the interaction itself, using an Update Interaction
action. Set your Status
custom field to Closed, and Chatbot Journey Step
to Complete.
In Hours
If the Check Opening Hours
action determines it is currently within your schedule, we want to do the following instead:
Send an autoresponse to the customer, to let them know they’re being queued
Update the
Chatbot Journey Step
to CompleteChange the interaction state to
Queued
First, add a new Send Autoresponse
action with your message to the customer. We’re going to use: I'm going to assign this chat to an agent for you - please hold for a few moments.
Consider adding a delay to this message - assigernation can be extremely quick in Gnatta if there is availability in the team, so a 2 to 5 second delay can help customer’s keep up and give them chance to read their messages.
Follow this action with an Update Interaction
, to set the Chatbot Journey Step
to Complete.
Finally, add a Set Queued State
action - this will do two things:
Your interaction will be queued to reach an agent on the queue it is currently assigned to - as soon as a member of the team on that queue is available, it’ll be assigned
Because of your Check Automation State flow, the chatbot flows will no longer be triggered when the customer sends a message in the chat
Save and Publish
Hit File>Save and File>Publish, then attach your new flow to your Response Received
event then head to your test environment to see how it looks on the front end!
Ensure this flow is placed below your Pathway: X flows, so that it always runs after them.