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 Valid value” condition

A special type of condition is the “has valid 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.

validvalue.jpg

Advanced Features

variables (Fields)

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.

Another special type of variables are business variables. You can think of business variables as global parameters that you can use in your bots and set them from a central location. For example, suppose that in several places in the bot you need to refer to the price of a cleaning service. You can define business variable business_cleaningprice in SETTINGS→Company→Business Variables, as shown below.

Then, reference this business variable in the bot as shown below. When you change the value of a business variable in SETTINGS→Company→Business Variables, the bot is updated automatically, without having to redeploy it.

Special variables: All chatbots can use the built-in variables CurrentTime and CurrentDate. As shown below, we can display these variables by inserting them into curly brackets within a message box.

The CurrentTime and CurrentDate variables can also be used to compare another variable. In the picture shown below, we prompt the user to enter a date and then use the Field Condition box to compare the user-entered date with the current date. CurrentDate can also be used in the Summation box to set another date variable to say CurrentDate+4 days.


schedules, flags and AGENT QUEUE

Schedules (including schedule patterns and schedule flows) 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.

Similarly, at any box, you can place a user in the “Talk to Agent” Queue.

Jump to other bots

You can use the Jump to Another Bot box to continue the flow on another bot.

Process Payments

See how you can process payments in a chatbot.

Customer Relation Management System Integration

We support integration with Zendesk, Hubspot or Salesforce.

Calendar Integration

To have users make appointments without leaving the chatbots, use SmartBot360’s calendar capabilities.

Catch-All: Improve Flow Bot Responsiveness

See how you can use an FAQ bot to catch unexpected user questions.

 

Examples

Get name of user and use it in subsequent message.

As shown below, you can use a Save Field or User Profile Field box to collect and save the first name of an end user. For that, you select “User profile field” from the first dropdown, which means that the collected information will be stored in the end user profile. In the second dropdown, you can select one of the existing user profile fields, or create a new one (e.g. ‘patientconcern”).

If you want to store this information in a chatbot field, but not in the end user profile, select “Non-user profile field”. Non-user profile fields are not accessible from other chats of the same user.

Note that Save Field or User Profile Field box should be used to collect user input that does match any of the special entity extraction boxes (Email, Location, Date, Time, Number), as is the case of first name or patient concern mentioned above. For the supported entities, using the special extraction boxes is better, as it allows extracting the entity from a longer user input, for example, extract number “12” from input “I want to buy 12 items” in the case of the Number box.

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” field 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 the “save as” field should be user_phone (instead of Phone2 ).


Best Practices and Tips

Enter meaningful “Save As” field names to bot boxes

In boxes that collect user input, specify a meaningful “save as” field name, as shown in the picture below. Here, we use the name user_concern which saves the user input to the user profile (due to the “user_” prefix) as in this example we view this input as more important. Otherwise, we would just use concern as the field name. Selecting meaningful field names will help generate meaningful reports in the ANALYTICS page (export to CSV) or view the user profile in the right panel of the CHATS page.

Disable free text input when the bot cannot process it

In the below picture, if the user does not pick one of the three quickreplies, the bot will respond “Sorry I didn’t get it” as there is no handling for the Default path (no arrow from the Default blue circle below). Hence, in this case it is a good idea to check the “Disable chatbot textbox” option shown below to force the user to click one of the three choices (quickreplies).

If a catch-all list of FAQs is specified for the bot to handle unknown user input, then it may be fine to leave the checkbox unchecked.