The Crisp Bot plugin can be handy if you need to route the user to relevant operators to handle a support chat. For instance, in some cases an user would like to chat with sales while in others they would like to speak with technical support. This article guides you on creating a simple department routing bot.

Bot response flow

Here's the flow and how you would like the bot to behave:

An user sends a message over your Crisp chatbox;
The bot detects that the conversation is new (ie. it is the first message from the user in this conversation);
The bot sends over buttons in a message, letting the user choose between Sales and Technical (2 buttons);
Once the user clicked on a button (ie. made their choice), a predefined operator is assigned to the conversation using Crisp routing feature;
A message is sent to the user to acknowledge routing to the chosen department;
IMPORTANT: the bot stops the scenario there, using an exit block (this prevents the scenario to fire over and over again if the user sends more messages);

Bot scenario setup

The general bot flow is as follows:

Event Block: "User Message Matches" to match pattern: * (ie. any message);
Condition Block: "Conversation Is New" to ensure buttons are only sent over for a new conversation;
Action Block: "Send Message" to send 2 buttons that can be clicked by user (either sales or tech);

Then you have 2 child branches (visible in the bot flow screenshot below):

Event Block: "Message Action" with "Button Click" type that matches: sales (left branch) or tech (right branch);
Action Block: "Assign Operator" to an operator of your choice (eg. different if sales or tech was matched);
Action Block: "Send Message" to acknowledge that the user message was routed to the requested department;
Exit Block: "Stop Scenario" to ensure the buttons are not sent over and over again in the same conversation;

To detect user department choice, we need to branch on 2 event blocks: one for sales, one for tech. This way you can perform different actions based on user choice.

The flow as configured in the Bot plugin:

Bot flow

Block configuration details

You can find below the configuration details of each block for this bot. You may use this configuration as a reference to how you can configure your own bot:

Block #1 setup (Line #2 of flow)

Block #2 setup (Line #3 of flow)

Block #3 setup (Line #4 of flow)

Block #4 setup (Line #5 of flow); Left branch

Block #5 setup (Line #6 of flow); Left branch

Block #6 setup (Line #7 of flow); Left branch

Result in chatbox

"Et voilà!"
Was this article helpful?
Thank you!