From simple answers to transfers, queries to the database or execution of web services are just some of the programmable activities for bots.
To get started with bots you will need to log into uContact with a Supervisor type user with permissions to use the Workflow Designer.
To start creating bots you must have bot licenses available.
They can be requested by sending an email to Integra Support.
This is the core, here its behavior is defined and that it is well created is essential for its implementation.
For this we go to the Workflow Designer, there a blank page will open and on the left, in the activities menu, we will see a dropdown called Bots located at the end of the list.
From here all the activities to be carried out by the bot will be taken.
The activities allow to control the operation of the bot.
Here we will describe the function of each activity
This activity is the first of the flow, it must always be included in all the created flows, it indicates to the bot where the activities begin.
With this activity we will interact with the client, it allows to send a message after each time the client writes. This field can work in 3 ways
Send a simple message
To do this we simply write the message you want to send in the message field.
After introducing yourself, you may want to give the client options and thus make decisions based on their response. To do this, you must write the options in the message field, indicating the option number and separating them with Enter.
This action allows evaluating a response and activating a route or another depending on the time that is entered.
Evaluate an answer and based on it decide one way or the other, evaluate can be chained one after the other in case we have multiple options and each one performs different actions.
With this option the bot will read the response sent by the client and then be able to evaluate it or save it in a variable.
This option is similar to the previous one except that it is used to save an image after requesting it and thus it will successfully reach the workflow.
Allows to execute a Web Service
Here you can query the database.
It allows to create dispositions to the interaction with the bot, in this way you can track the interactions.
The dispositions are inserted directly in the DB, therefore they do not necessarily need to be created in the system, even if they are created in uContact they will not execute actions such as schedule or respool.
With this option you can transfer the interaction from a bot to a campaign on the same channel that is being used.
For it to run correctly, we must indicate the exact name of the campaign to which you want to transfer in the destination field.
Allows you to print a variable in the IntegraServer log.
This action must be at the end of each flow, it indicates to the bot that its flow has ended and closes the interaction with the client.
This activity takes the content of a variable and assigns it to the interaction's customer name and in turn assigns it to the bot's CLIENT_NAME global variable.
Through this activity it is possible to send files to the client.
Allows to send emails.
There are customer data that are obtained from the interaction, they can be used in different activities.
The global variables are:
For all channels
SMS - WhatsApp
Function bots are bots that are used as functions. Its purpose is to be able to modularize certain sections of the bots in order to facilitate their development, testing, and maintenance.
Function bots do not consume bot licenses and are uploaded to the server with the context 'botsFunction'.
The context 'botsFunction' will not exist until the first BotFunction is created
All bot activities can be used in BotFunctions, but they will start with BotFunctionStartActivity instead of BotStartActivity.
In order to create a bot function, we have the BotFunctionStartActivity.
This activity, unlike the BotStartActivity, only has the 'name' field.
In other words, the initial activity of a function bot does not have the 'bot_timeout' field, or the 'timeout_message' field, which means that the timeout that will be taken into account is that of the Bot that calls the function bot.
This activity allows you to nest both bots and bots functions.
Suppose that you have a bot named B and a function bot named BF and B has the GoToFunction activity and in the name field it has name = "BF" assigned.
When executing the GoToFunction activity, bot B execution stops and BF begins to execute. After BF finishes executing, it will return to B to continue executing the following activities.
It is in this way that it is possible to nest several bots or bots functions to an initial bot.
Since update 6.275 in the configuration of SMS, WebChat and Messenger campaigns we will see a drop-down menu called Bot Name, when it is displayed all the created bot flows will be listed.
After selecting the desired bot for the campaign, simply press the Save button and your campaign will start working with bots!
Create the first Bot
In this section we will see how to create a basic flow, as an example and practice, that contains the following actions:
Presentation - SendMessage
Options - SendMessage
Get reply - ReadMessage
Evaluate the answer - Evaluate
End interaction and make disposition - Disposition
Insert a user into a table - ExecQuery
Transfer to a campaign - TransferBot
Check the system version and save the variable - LogOp
Use the variable in a response and end the interaction - SendMessage
We will start by adding the BotStartActivity action and giving the bot a name.
This name is the same name that will be shown in the settings drop-down menu.
Then we will add two SendMessages that will be sent in a row.
The first will be our presentation, in it we will warn the user to select one of the options that we will give him below.
In the second we will give the options, making one per line and starting with number and hyphen.
In this instance the bot waits for the client's response, for this we must add the ReadMessage activity and our flow will look like the following:
Now we will add the Evaluate to analyze the response obtained. We put 4 options so we will use 4 Evaluates.
In each one we will indicate the condition that the variable must have for it to be valid
For each option we will add its destination, that is, in the second and fourth Evaluate we will use ExecQuery and in the third a TransferBot.
In the first ExecQuery we will write an insert, in the dropdown we select the database in which it is performed and in the variable we will put a name to use later in the response, in this case it is
In the second, it will make a query for the version of the system, in the drop-down we select the database in which it is performed and in the variable we will put the same name to use later in the response, in this case it is
In the TransferBot we will simply put the name of the campaign to which the client will be transferred.
So far it only remains to add a SendMessage returning the response and followed by a FinishInteraction.
Now it only remains to join our flows or adjust it to our needs by adding dispositions, logs or WS and they would have something similar to the following:
Simple bot example
This is the introduction to Bots.
Soon we will add posts and videos about it.