Build Guide: Check Chatbot Pathway
Quick links in this article:
This article will outline exact steps for creating a ‘Check Chatbot Pathway’ flow, as part of an automation journey. Refer to Building A Chatbot: Flows for more information.
Set Status: Responded
Navigate to the builder, open the action library, and insert an Update Interaction
action. Click Preset Data, identify the Status field on your domain and set it to Responded (or an equivalent in your domain).
Status fields can be configured with a variety of options to meet your needs: Interaction State vs Status Fields
Check Pathway Value
Next, add a Decision action. This action is going to check your Chatbot Pathway
custom data field to see if it has a value.
To do that, click Explore when building your condition and search for ‘Interaction Data’. This will reveal all of the custom data fields on your domain - identify and insert your Chatbot Pathway
field.
Change the condition operation to Has Value
, then relabel the branches and action name to make your flow easier to follow!
Next, on your Has Value
branch you need to check if the value is Reset, so you can assign a new pathway as required on your Anything Else loop later.
To do that, you’ll need to add another Decision
action on the Has Value
branch of your first Decision
. You’re going to set the condition against the same Chatbot Pathway field, but this time the operation will be Equals and the value you’re looking for will be Reset.
As before, be sure to give everything an appropriate label to help you read through your flow.
Check Customer Selection
We’ll be coming back to the Reset paths shortly, but for now, we need to return our attention to the No Value
parent branch. When this flow detects No Value in your Chatbot Pathway field, that means the customer has been presented with the welcome options, and we need to identify their selection. To do that, we need one more Decision
action!
Go ahead and insert one, then set up the first branch like this:
Echo.Body
(Message) Equals X
.
X
should be an exact match for one of the quick reply buttons your opening message! Such as ‘Returns’ or ‘Tracking’ etc. You’ll be creating a branch for each option.
Click the X to close the first branch, then + Add
another - it’ll be preset to the same values as the first branch, to save a bit of time. You’ll need one branch for each of the quick reply buttons you added to your welcome message.
It’s important to copy the label of your buttons exactly into the condition, to ensure a match.
When all of your branches/quick reply buttons have been accounted for, click Submit!
Reconnect Reset Path
Next, you’ll need to rejoin the Reset path from that earlier Decision
to this Check Selection Decision
- click and drag the path to reconnect it.
Assign Pathway Values
That’s a lot of the hard work done! Next you need to add a simple Update Interaction
action to the bottom of each of those pathways. In that action, select Preset Data, find the Chatbot Pathway
custom field and set it to the relevant pathway.
Once that’s done, hit Submit - then reopen the action. The ‘Copy Action’ button is now available, which is handy for saving you some clicks if you have lots of branches to cover! So let’s click that. Close the action, open the action library, and ‘Paste previously copied action’ onto the next branch. This time, just update the selection and the action name! Repeat for each branch.
Error Handling
When you’ve done all of your pathways, you should have the ‘No criteria met’ path left open. This path will be met when the customer’s response doesn’t match any of the buttons you’re checking for in your Decision
action, so you’ll need to resend the buttons and ask the customer to click one.
We’re going to use an error message like this:
Oops! I'm just a chatbot. Please select a button below.
To do that, add a new Send Autoresponse
action, add your error message wording and then attach your quick reply buttons just like you did on the starter flow. Ensure they’re an exact match!
When you’ve added it, you’ll also need to set the Stop action to Stop Processing.
Whenever you add a Send Autoresponse
action, you should stop processing flows until the customer clicks a button or responds.
The Completed Flow
Once done, review your flow. It should look like ours below!
You don’t need to, but you can delete that extra ‘Stop’ action at the top - it was placed there when you reconnected the Reset branch to a different Decision instead of it’s original Stop.
When you’re happy click File>Save then File>Publish, and attach the flow to your Response Received event - be sure to place it after the Check Automation State flow.