Channels
Products
Transactional SMS-messaging
Support and marketing in most popular messaging apps
SMS
Instagram
Messenger
Use Cases
Omnichannel messaging
FAQ Bots
Live support
Creating Scenarios in Fromni. Chatbots Builder
This instruction is available in the following languages
Russian
A scenario is a module that allows you to configure chains of incoming and outgoing messages that will be automatically sent through channels (messengers) to your customers.
Creating a scenario
  1. Go to Scenarios —> My Scenarios and click Create Scenario
2. Write the name of the scenario. Check the box next to Campaign scenario if you want to initiate this scenario yourself, for example, a mass messaging (more about scenario types).
3. After clicking the Next button, a window will open, as shown in the screenshot below (this is the option if you checked the “Campaign” scenario type):
·       the “Scenario” tab, which contains the workspace (1), the menu for adding bot actions (2), actions within the workspace (3), a mini-map (4);
·       the Settings tab (5), where you can set additional settings, such as “what to do in case of an unknown error” or “how long the scenario should run”;
·       the Analytics tab (6), where you can view detailed statistics for this bot;
·       control panel (7), where you can save all changes, view your account login, or exit the builder.
If you do not check the box, a “bot” type scenario will be created automatically, and the new window will look exactly the same, but with the addition of the Integrations tab, where you need to link it to the necessary channels.
Chatbot builder
In this section, you can add blocks from the menu on the left, build connections between them, so you can design a conversation with the client.
Block 1. Message.
This block is designed for communication with the user, i.e., here you create messages that the bot will send to your client. The block can contain several messages, emojis, a keyboard (buttons linked to the message), attachments (images and documents linked to the message).
  • To add a Message block to the scenario, click on it in the left panel.
  • Then click on the gear icon in the upper right corner of the Message block to make it easier to work with the message.
  • In the opened window, you can select the type of window for working with the block (“Sidebar” or “Modal window”).
Let's take a look at the main fields of the message:
1. Bot says.
In this field, you can write a message that your bot will “say.” Using the +message button, you can add another field for entering a text message.
Some channels support text formatting (e.g., WhatsApp). However, keep in mind that if the scenario is also used for channels that do not support formatting, the text will display extra characters without formatting in those channels.
You can use bot variables in the text; they will be replaced with their values (provided that they were previously created in the scenario)
2. Attachments.
This feature allows you to attach an image or document to a message (you can add multiple attachments to a single message, but you cannot add an attachment if multiple text messages have been added to the block Bot says.)
To upload an attachment, click on the Attachments button (the number of files added is indicated in brackets), after which a modal window will open.
  • Click on 1 to change the attachment type (image or document).
  • Use 2 to switch between uploading an attachment from your device or providing a link to an attachment.
  • You can drag and drop a file onto area 3 to upload it.
  • Use button 4 to attach another file.
Only the first attachment added will be sent in the WhatsApp Web channel.
3. Keyboard
This feature allows you to attach buttons to a message.
Using the buttons, you can:

  • go to another bot message;
  • go to the website;
  • contact an operator (a real person);
  • collect information about your customers, classify customers, etc.
If there are multiple messages in the block, the keyboard will only be sent with the last one.

Each key on the keyboard can have a connecting line to another action. This means that if the user presses this key, the scenario will move to the specified step.
In addition to the assigned buttons, the keyboard has an Any reply option, which means that the user did not use any of the suggested buttons and wrote some text to the bot. In this case, there are several possible scenarios:
  • if the Any reply option has a line leading to the next step, the scenario will proceed to the specified action;
  • if there is NO line leading from the Any reply option, the bot will send the last message again and display the keyboard associated with it again;
  • if the Any reply option does NOT lead to the next step and the message What if user reply is not recognized is set in the Settings tab, the bot will send the specified message and then repeat the message with the keyboard again.
Creating keyboard buttons.
To add a button to the keyboard, use the +button. In the Button Text field that appears, enter the text that will be visible to the user on the button. If you want to add a link to the button, change the button type using the gear icon (not supported on Instagram).
In order for buttons to display correctly in the bot, pay attention to the acceptable number of buttons and their length in accordance with the channel used.

The WhatsApp Web channel does not support buttons; in this channel, buttons will be replaced with numbers.
Checkboxes The “Back” button and “Main menu” button allow you to add/remove these buttons from the keyboard. You do not need to link these buttons to any action.

You can change the text of these buttons in Settings —> General —> Button text.
You can adjust the position of the buttons using the Rows and Columns settings.
If the Inline Keyboard checkbox is active, the keyboard will appear directly below the message (Inline Keyboard is not available in all messengers).
4. Multiple choices.
Multiple choices only work in the WebChat channel.
This feature lets you offer the customer one or more answer options to choose from.
To create a block with checkboxes (multiple choices), add a Message block. Write the checkbox options in the buttons and check the box next to Multiple choice. The buttons will be converted into multiple choice options.
5. Save reply in a variable
The user's response can be saved to a separate variable.

To do this, specify the variable name in the Save reply in a variable field and select the variable type string (text)/number (number). This variable can then be used in the scenario.

The screenshot shows that any user selection (buttons “1”, “2”, “3” and “any reply”) will be saved in the variable “message_variable”, i.e. if the user clicks on button “1”, the variable will be saved as “1”.
We will use this later in the scenario (see screenshot).
As a result, we get:
6. No reply
If response options were set for this message using the keyboard, you can also set an action in case the user does not respond.

To do this:
  • go to the settings of the necessary “Message” block;
  • at the very bottom, click the “No reply” checkbox;
  • set the time during which you want to wait for a response;
  • select which block should follow after the specified time.
Block 2. Reply.
The block is designed to compare the user's response with the expected responses.
You can add as many expected responses as you want. If the user's response matches the expected response by more than 85%, they are considered to match — this allows for typos.

Each response can have a connecting line to another action. This means that if the user's response matches this response, the scenario will move on to the specified step. In addition to expected responses, the block contains the option Any reply, which means that the user's response did not match any of the expected responses. In this case, the bot's actions are the same as when the user did not press any of the suggested buttons.

Save reply in a variable
The user's response can be saved in a separate variable. To do this, specify the variable name in the Save reply in a variable field and select the variable type string (text)/number (number).
As a result, we get:
It is also possible to set an action to occur after a certain amount of time has passed without the user responding.
Block 3. Ask a question.
The block will request a response from the user, which must contain data in a specified format.
In the Question text field, enter the text of the message that will be sent to the user.

Several options are available in the Expected response type field:
  • Phone number. The algorithm will find the phone number in the user's response and write it to a variable. Example. User response: “My phone number is + 358451086128.” The variable will record “+358451086128.”
  • Email. The user's response must contain an email address. Example. User response: “Send an email to test@test.com.” The variable will record test@test.com.
Block 4. Variables.
The block is used to create new session variables and convert variables.

The block requires the following information:
  • Variable name. No brackets, quotation marks, etc. For example, firstName.
  • Variable value, for example, Nick.
IThe value of a variable can be set in several ways:
With a specific value, for example, Nick.
An expression in JavaScript. For example, “Kori”.toUpperCase ().
An expression in JS using variables. For example, #firstName# + “” + #secondName#. Here we combine two variables obtained earlier, adding a space between them.
You can write almost any JavaScript code with security restrictions (you cannot use external dependencies, and code execution time is limited to 1 second). However, you can use one external dependency—the lodash library (https://lodash.com/docs/4.17.15), which contains many utility methods. It is accessible via the underscore symbol _. For example, if you need to use the https://lodash.com/docs/4.17.15#chunk method, enter _.chunk (some arguments) in the variable value field.
Block 5. Condition.
The action is designed to branch the dialogue depending on the calculated condition.
You can add an unlimited number of conditions. The condition is a JavaScript expression that supports variables. Each condition can have a line leading to another action, meaning that if this condition is true, the scenario will proceed to the specified action. If none of the specified conditions are true, the Else transition will be triggered. Important: if there is no line coming from else, the scenario will be terminated!
Block 6. Digital Profile.
A digital profile is a block that allows you to change variables that are in the CRM.

In the chatbot builder, the Digital Profile block is designed to update the user's digital profile. The variables in the Digital Profile block differ from the variables in the Variables block because they apply to all scenarios and are stored in the CRM section, while the variables in the Variables block are only active within a specific scenario.
In the Action field, select the action you want to apply to the digital profile:

  1. Set variable. Select a standard variable from the drop-down list or create a new one. The variable value can be text, a number, or a JavaScript expression that supports variables.
  2. Delete variable. Select a variable to delete its value in the digital profile.
Next, add a new Digital Profile block and select the action — Update Profile, passing phonenumber to the phone parameter. Currently, in this step, you need to enclose the parameter name with #.# symbols.
Block 7. Switch to operator.
If a person cannot find the answer to their question in the bot, you can give them the opportunity to contact a live person using the Switch to operator block.

This action stops the bot's operation for a specified time, allowing the user to communicate with the operator.
Move the slider to change the time frame (each user message in operator mode extends this period by the specified number of hours).

After switching to operator mode, the current dialogue is not finished (even though this action will always be at the end of the scenario), but is paused for the specified time. This means that the bot stops responding to user messages (including keyboard presses, except for the “Back” and “Main menu” buttons).
Operator mode can be exited in several ways:
  1. Operator mode will end on its own after a timeout;
  2. The operator closes the dialogue themselves (in the Messenger section using the Resume button).
  3. Another scenario has been launched (the user has entered a trigger message (see Settings —> Triggers)) or you have launched a campaign.
  4. The “Back” or “Main menu” button (provided that the user did not send any messages in operator mode).
Block 8. HTTP-request.
The action is intended for requests to external APIs.
In the URL and request method field, specify the request URL and HTTP verb (GET, POST, PUT, DELETE).

The request body only supports JSON format. You can use bot variables in field values.
Block 9. Switch scenarios.
Ends the current scenario and starts a new one.
InSelect one of your scenarios from the drop-down list.
When switching scenarios, all variables created in the previous scenario are transferred, including scenario variables.
Block 10. Notifications.
This block is used to send an email message at a specific point in the scenario.
InSelect one of your scenarios from the drop-down list.
When switching scenarios, all variables created in the previous scenario are transferred, including scenario variables.
Block 11. Timer.
This block is used to send an email message at a specific point in the scenario.
If you want to set a timer only in case of no response from the user, use the timer in the settings of the “Message” or “Reply” block.
General information
Clicking on the three dots on any block opens a context menu:

  • Mark as “Start” makes the selected block the first action that will be performed when the scenario is launched.
  • Mark as “Main Menu” indicates that the bot should go to this block if the user clicks on the “Main Menu” button.
  • Duplicate — creates an identical block.
  • Remove — deletes the block.
At the bottom right, there is a mini-map that allows you to:

  • see where you are at the moment;
  • change the scale of the workspace (1);
  • hide the map (2) and expand the chatbot builder to full screen (3).
Integrations
In this section, you need to connect the channels in which the customizable scenario will be active. Available only for scenarios that are of the “bot” type.
Settings
This tab is located in the Chatbot Builder at the top center.

This section consists of three blocks: Triggers, General, and Scenario variables.
  1. Triggers
In this section, you can set rules or commands that will trigger the scenario to start.
Commands for activating the scenario (1).
Here you can specify any number of words, phrases, or sentences that should activate this scenario. After entering each scenario activation command, click the Save button.

Set as default scenario (2).
Available only for scenarios that are of the “bot” type.
In this section, you can select channels (from those connected in the “Integrations” tab) in which this scenario will be the default scenario.
The default scenario is the scenario that is activated for any user message if no other scenario is currently active.
If another default scenario was previously selected for the selected channel, it will be reassigned.
2. General
In this section, you can set up the general settings for the scenario
What if the user's reply is not recognized (1).
In this field, you need to select what will happen if the bot does not understand what the user has written:

  • End scenario — the scenario will end;
  • Send message — a message from the Bot message field will be sent and the previous message from the scenario will be repeated.
What if an unknown error occurs (2).
If an error occurs in the scenario that cannot be handled by the bot, the scenario ends with an error. Select:
  • End scenario — the scenario will end;
  • Send message — the scenario will end and a message will be sent from the Bot message field.
How much time is given to the user to reply
After the bot sends a message, it waits for a response from the user. When the time expires, the scenario ends. The time is set in hours. If you specify 0, the response timeout is infinite.
Button texts.
You can change the text of the system buttons “Back” and “Main menu”:
  • “Back” button — the bot will go to the previous message;
  • “Main menu” button — the bot will go to the “Main menu”.
3. Scenario variables
In this section, you specify the variables that will be used by default in the scenario.
  • Variable name — specify the name that will be used for the variable in the scenario.
  • Variable value — specify the value that will be displayed in user messages instead of the variable name.
Analytics
This tab is located at the top and far right, in the center of the chatbot builder.
Actions and transitions.
You can see how many people moved to a particular block, or via a particular connection between blocks:
Statistics.
This tab displays the following information for the selected period:

  • number of times this scenario was launched;
  • unique subscribers who communicated with the bot;
  • messages sent according to this scenario (from the bot to the user);
  • messages received (sent by the user as part of the scenario).
Scenario types
When creating a scenario, you can select its type — bot or campaign.

The main difference comes down to who initiates the dialogue according to the scenario.
  • For a Campaign, it can only be a Business (company).
  • For a Bot, it can only be a user who writes a message in a channel where the corresponding scenario is active.
When you activate a “Campaign” type scenario (using the Campaign scenario checkbox), the first block, Message, is automatically activated in the chatbot builder.

You must select either a Template or a Template group that will be sent as part of the campaign.
Campaign scenarios that have a template in the first message can be sent manually or when an event transmitted via API occurs.
Variable types
Variables are special symbols that will be replaced with the recipient's data when sent.

There are three types of variables in the chatbot builder:
  • digital profile;
  • scenario;
  • session.
Digital profile variables.
Variables from the CRM section, i.e. variables such as Name, Birthday, City, Gender, Country, Surname, etc.

The Digital Profile block is used to change variables. To use variables in the message, in the Variables block or elsewhere, you need to write: #$contact# (for example, #$contact.phone# - phone number, #$contact.Name# - user name, provided that such a parameter exists in CRM).

It is convenient to use when you need to find out something about your target audience and then use this data. For example: tag people who agree to receive advertising campaigns or find out a person's name so that the manager and/or bot can personalize their messages.
Scenario variables.
Variables that are set when the scenario is created and are the same for all users.

Scenario variables also include variables for shortening links #SHORTLINK#, #SHORTLINK1#, #SHORTLINK2#, etc. These variables allow you to shorten the link when sending an SMS.
All clicks on such links will be recorded in the statistics (you can view them in the Statistics section —> Campaigns).
This variable is set in the same way as all other scenario variables
Session variables.
Session variables (session — the time from the start of the scenario dialogue to its completion). They are created during the session and deleted after its completion.

A session variable can be set in several ways:
  • Saving the user's response to a variable (in the Message or Reply block);
  • Variables block;
  • Campaign variable. When a campaign containing recipient data is launched, variables with the names of these fields become available.
Need more help?
Write us email to help@fromni.com
Did this answer your question?
Customers support, engagement and marketing through multiple channels including WhatsApp, Instagram and SMS.
Transactional messaging. Deliver SMS-messages around the world on a platform trusted by 2000+ customers.
Fromni. Chatbots
Fromni. SMS-gateway
Customers support, engagement and marketing through multiple channels including WhatsApp, Instagram and SMS.
Transactional messaging. Deliver SMS-messages around the world on a platform trusted by 2000+ customers.
Fromni. Chatbots
Fromni. SMS-gateway