flow diagram bots

Flow Diagram bots allow an administrator to design the logic of a bot by drawing an intuitive diagram.

flow logic

Each box (node) in the diagram is a state, which corresponds to a chatbot message. Given the current box and the user’s response message, one of the outgoing links (edges) is followed, based on the condition assigned to each link.

The conditions are evaluated from top down, until the first satisfying condition is found. If no condition is satisfied, the Default link is followed (top link in above image) if there is one, else the execution stays in the current box, and the same message is displayed to the user.

chat boxes

There are several types of boxes, like Yes/No, Multiple Choice (left box in above figure), Message (right boxes in above figure) and Date-Time, named after the type of user information they are made to capture.

Note that for some boxes (like Message and Flag Condition) no input is expected from the user, that is, the flow moves to the next box immediately.

Each box is backed by an AI Natural Language Understanding (NLU) module that extracts the necessary information. For example, the Date box extract date and time from the user input. Assuming it is 1/7/2019 and the user enters “I can come tomorrow at 10 am” the Date box will extract date=1/8/2019 and time=10:00 am. Hence, if the box has condition “datetime after 1/8/2019 9:00 am” this condition will be matched.

“has any value” condition

A special type of condition is the “has any value” which is satisfied if the system is able to extract the right type of data; for example, as shown below, phone_number has any value, when the user’s message contains a phone number.

advanced features

variables

The user information extracted at a box can be used in subsequent boxes. In the example below, if the user types “my phone is 949-3428289” the next message will be “You entered phone number 949-3428289”.

A special type of variables are the user profile variables. These variables always start with “user_” and access fields (like email or first name) of the profile of the user who is chatting with a chatbot. The following table lists the available user profile variables.

If you try to save a value to a user variable that is not listed in this table (e.g., user_companyname), this variable will automatically be added to the profile of the user.

In the above figure, you may replace “phone1” by “userphone” in both the left pane of the Phone box and the message on the right (that is, use {user_phone}).

A key difference of the user profile variables from the regular variables is that they persist across chatbots for the same user, whereas the regular variables are only valid during the execution of a single chatbot session.

schedules, flags and AGENT QUEUE

Schedule and flags may be assigned to a user whose chat reaches a particular box. For example, in the below figure, when the user receives the message “You want to buy home insurance”, Flag homeinsuranceflag is assigned to the user, as well as schedule pattern wellnessBotDemo. For more information on scheduling chatbots click here and for Flags click here.

Customer Relation Management System Integration

For Zendesk integration go here.

Others are coming soon.

 

EXAMPLES

Get name of user and use it in subsequent message.

As shown below, you can use a Text Matching box, delete the default condition (or leave it if for example you want to check if the name of the user is “John”) and save the extracted data in a variable, with name “name” in below figure. Then, use {name} in a subsequent box (note that it does not have to a directly connected box, but any box connected through a path of links to the Text Matching box).

You can also use Text Matching box in the same way for any other information you want to extract that does not have a specialized box such as Money or Date.

Create Personality questionnaire

Suppose you want to create a chatbot that asks users 2 questions and based on their answers it displays their personality type.

The questions are: (1) Are you happy? (2) Do you like hiking?

The answers to both questions can be (a) Very much; (b) A little; (c) No, which receive scores 2, 1, 0 respectively. Hence, if a user answers “Very much” to the first question and “No” to the second, the total score would be 2+0=2.

Suppose that if total score is greater than 2, we say that this person is “Optimistic”, if score between 1 and 2 we say this person is “Neutral” and else “Pessimistic”.

Now let’s build the bot!

First, go to create new Flow Diagram bot. Drag a “Scored Questionnaire” box, click on “Add/Edit questions”, and enter your questions and answers as below.

Then, connect three Message boxes as below to form your conditions.

If you want to store the total score of the questionnaire in the user profile, say in field user_qscore1, set the “save as” variable as below:

collect lead information

Suppose you create a bot to ask people to provide their email or phone number to contact them.

Create a new Flow Diagram bot as follows. First, add a Multiple Choice box:

Then connect a Phone and an Email box as follows:

And finally, add confirmation messages. As shown below, you have to copy the “save as” variable name from the Phone box and paste it inside curly braces ({…}) in the Message box, and the same goes for the Email box.

If you want to save the phone number in the user profile (to use in future chats), then you should change both the “save as” variable and the Message box, from Phone2 to user_phone.