Steps
Within the Scripted Chatbot steps are the building blocks for a conversation. They represent the individual actions taken by the bot and expected to be taken by user. Each step has its own functionality and corresponding configuration options. Below all of these will be discussed.
Do note that step implementations are channel dependent. For example, even though listpickers can be used in both WhatsApp and Apple Messages for Business their implementations may look and behave different.
Properties
All step types share following properties:
- Step name: identifier for the step. In certain situations this is used to reference a specific step within the script.
Entry
Conversations are always started via an entry step. There can be multiple entry steps within a script and at most one entry step per flow. Entry steps contained within a flow must be the first step within that flow.
When a customer without a running session messages one of the script's conversation owners the Scripted Chatbot will look through all available entry steps to see if it can match the input and start a conversation, and therefore a session. In the presence of multiple entry steps they will be evaluated in script order (looking through the flows from top to bottom) and the first match will be used.
Properties
- Match all input: match on all input given, does not start a new session.
- Is Case Sensitive: match taking casing into account.
- Allow Restart: start a new session in case one is already present.
- Regex Matches: regular expressions to be used for the matching.
- When using named capture groups the captures will be put in variables.
- Matches: texts to be used for the matching.
Text
Send a text to the user.
Properties
- Message: the text to send.
- Unicode emoji's can be used 🚀
- Refer to this page for a full reference on these.
- Enter can be used to create separate text blocks.
- URLs can be entered, how these are shown depends on the channel.
- Variables can be inserted by using
{
and}
, e.g. when there is a variable calledfirstName
use{firstName}
.
Input
Wait for input from the user and save it in a variable. This supports the following message types:
- Text
- Media
- Location
Properties
- Save input as variable: the name of the variable under which to store the input.
- Text input is directly saved in the variable, for media and location this works a bit differently. Please refer to these docs for their specifics.
- The variable is available in the scope as chosen at
This variable is available
. - Timeout (seconds): number of seconds to wait for input.
- Timeout flow: the flow to continue with when the timeout has been exceeded.
- Timeout step: the step to continue with when the timeout has been exceeded.
Media
Send a media file to the user.
Properties
- Name: the display name of the file.
- Uri: an URI pointing to a publicly accessible media file.
- Mime Type: the MIME type (media type) of the referenced media file.
Logic
Choose how to proceed with the conversation. Based on variable data, for example user input or the time of day, choose at what position in the script the conversation should continue.
Properties
There are no dedicated properties. A logic step acts comparable to switch statements in programming languages. You can add condition definitions which also include how to act if the condition is met. There are several condition types. One of the simpler ones, and also the default, is an equals
condition.
Equals properties
- Variable: the name of the variable to base the condition on.
- Is case sensitive: determine whether equality is influenced by capitalisation.
- Tests: texts with which the variable will be compared. They are successful when at least one of them equals the value hold by the variable.
- Cursor - Flow: if the tests are successful continue with the selected flow.
- Cursor - Step: if the tests are successful continue with the selected step.
Position
Choose where to proceed with the conversation.
Properties
- Flow: continue with the selected flow.
- Step: continue with the selected step.
CDP event
Send data to our own Customer Data Platform (CDP) via events.
Properties
- Tenant id: the identifier of the tenant to which you want to send the data.
- Event type id: the identifier of the event type which you are using.
- Body: the data to send to CDP. It should be a JSON matching the event type.
Terminate
Stop the execution of the script and end the session. With its defaults enabled this does the same as when the script gets to a point where there is no next step to execute.
Properties
- Reset router session: also end the session on the Conversational Router. Any further communication will start a new router session with the default configuration.
Web request
Send a web request and, optionally, handle the returned response body. In case the request fails we have an exponential backoff retry mechanism which moves from 1 to 10 seconds.
If you use IP whitelisting, our IP address is 34.141.248.107
.
Properties
- Method: the HTTP method to be used.
- URL: the URL to which the request is send.
- Fail flow: if the request (including retries) fails continue with the selected flow.
- Fail step: if the request (including retries) fails continue with the selected step.
- Body: the body to be send with the request.
- Variables can be inserted by using
{{
and}}
, e.g. when there is a variable calledfirstName
use{{firstName}}
. - Wait for response: wait for the response to be received before continuing with the script.
- This useful when you want to inform users whether the call succeeded or not.
- This is necessary when you want to get data out of the response (see
Response extractions
, below). - Fail text: the text to show when the response contains an error status code.
- Headers: the HTTP headers to be send with the request.
- Query parameters: the query parameters to include in the query string.
- Response extractions: get data out of the response.
- Source: whether the expected response is in JSON format or plain text.
- Variable: the name of the variable under which to store the data from the response.
- The variable is available in the scope as chosen at
This variable is available
. - Selector: determine what part of the response body is put in the variable. For JSON we use JSONPath, for text this field is ignored and the whole response body is put in the variable.
Listpicker
Send a list of choosable items to the user.
Properties
- Header: the header text to show alongside the listpicker.
- Body: the body text to show alongside the listpicker.
- Footer: the footer text to show alongside the listpicker.
- Button title: the text to show in the button that opens the listpicker.
- Media URL: an image that is shown alongside the listpicker.
- Buttons: a number of choosable items.
- The
Title
is shown to the user, theId
is how the Scripted Chatbot will receive the input as given by the user.Description
is a descriptive text rendered nearby the title, which can be used to elaborate on the title.
Reply buttons
Send a list of possible responses for the user to choose from.
Properties
- Header: the header text to show alongside the reply buttons.
- Body: the body text to show alongside the reply buttons.
- Footer: the footer text to show alongside the reply buttons.
- Buttons: a number of possible responses.
- The
Title
is shown to the user, theId
is how the Scripted Chatbot will receive the input as given by the user.
Set variable
Create a variable to be reused within the rest of the script.
Properties
- Set: determine the names and values of the variables.
- Other variables can be inserted by using
{
and}
, e.g. when there is a variable calledfirstName
use{firstName}
. - The variables are available in the scope as chosen at
This variable is available
.
Location
Send a location. Often shown as a pin on a map.
Properties
- Label: the text to show alongside the location.
- Latitude: the latitude of the location.
- Longitude: the longitude of the location.
- Search query: the address to show for the location.
- Radius: support of this property is under investigation. At the very least WhatsApp does not support it.
Pro tip: one can get the latitude and longitude from Google Maps, by right clicking on any location. E.g.
Wait
Wait for the specified amount of time. This can be used to replicate humanlike behaviour, as humans don't respond within fractions of a second.
Properties
- Interval (seconds): the number of seconds the script should wait before continuing with the next step.
Handover
Trigger a handover. This basically means having a different Conversational Router adapter (application) handle the conversation with a client. In the rule of thumb this entails moving the conversation from being handled by a bot to an agent.
Properties
- Mutations: the changes in adapters/links that need to be applied to facilitate the functionality of the handover.
- Context: a number of key/value pairs which get passed to the application being handover'ed to, giving it information on how to handle the conversation.
Command
Execute a command as defined in the Conversational Router.
Properties
- Name: the name of the command as defined in the Conversational Router.
- Context: a number of key/value pairs which get passed to the application being impacted by the command.
While we offer this functionality it is currently being investigated how we should move forward with it. If there are other ways to achieve your goals we recommend to use those. In case of doubt please contact us.
Menu
Give the user a number of options and continue the conversation based on what is chosen.
This is an abstraction for an often implemented use case. Before we had this step, one needed to...
- Give some options via text/listpicker/reply buttons
- Use an input step to get the chosen value
- Use a logic step to determine the way forward
Now this is all encapsulated in a single step, with the extra benefit of being able to quickly switch between how the choices are presented to the user.
Properties
- Display type: how the options should be presented to the user.
- Header: the header text to show alongside the options.
- Footer: the footer text to show alongside the options.
- Fallback: the text to show when the input did not match any of the options.
- Input timeout (seconds): number of seconds to wait for input.
- Input timeout flow: the flow to continue with when the timeout has been exceeded.
- Input timeout step: the step to continue with when the timeout has been exceeded.
- Add option: add an option.
- The
Displayed text
is the option as shown to the user. TheKey
is the value used technically. If you want the user to be able to type alternatives to the Key and still match the option, useKey Aliases
(only for display type text).Flow
indicates with what flow to continue when the option was selected,Step
does the same for the step.
Previous: Overview of the Interface
Next: Variables