Flows skill¶
Executes scripted dialogs that can be configured without without coding.
Notice the distinction between the word Flow and Dialog. A flow is a dialog that can be configured without coding.
Overview¶
The Flows skill enables simple dialogs to be configured without the use of Bubblescript coding. Flows can be composed in the content section of the platform. The content form will automatically generate Flows into real Bubblescript dialogs. A Flow comprises of one or more steps, like say
, ask
or show
, just as the Bubblescript language offers.
How to use¶
When the Flows skill is installed, it can be configured in the Content section. The skill comes with a predefined set of Flows to fulfill basic chat assistant behaviour.
Initially the Flows are all folded, but can be opened by clicking on the >
icon in the title bar. The button "Add flow" creates a new Flow. Hovering your mouse pointer over the title bar of a Flow enables the 'garbage bin' icon on the right hand side of the Flow. Clicking on this icon will delete the Flow from your application. The drag icon in front of a Flow title bar, that becomes visible when hovering your mouse over it, enables you to change the order of the flows.
The Flow flow_main
for instance is a simple flow that, out of the box. Notice it only has one step: saying 'Hi there'. Feel free to add another step, for instance to introduce the bot, like: 'I am your virtual assistant':
1. make sure you 'unfolded' the flow flow_main
2. click Add Step
3. Select type say
4. Fill the text field with 'I am your virtual assistant'
5. Press the blue save button in the bottom of the screen
6. Press the preview button to see what you've build.
Flows always execute from top to bottom. So the visual order of the steps define the actual execution order.
Now you've added a step to a Flow and tested the result using the Preview button. To have a Flow executed as part of the chatbot you need to do one of the following:
- select the system dialog you want it to trigger (e.g. main, unknown, close)
- or invoke it from out an Answer, see the Answers skill;
- or invoke it from out a Nudge, see the Nudging skill.
If you want to make a flow conditionally to the current state of the conversation, you can configure tags in the field 'Only execute this flow when tagged'. Once you've configured tags in this field, this step will become conditional. Otherwise it is always executed.
You can also trigger a flow manually design time by clicking the Preview Button.
Don't forget to press save before pushing the Preview button.
How it works¶
The next sections explain how the Flow skill works.
Flows¶
As explained Flows represent scripted dialogs that can be configured instead of coded. A Flow consists of the following fields:
field | description |
---|---|
name | a human readable name that the system will use to generate a unique identifier by prepending the name with '_flow', removes any non-system characters |
trigger on system dialog | to have it triggered as one of the predefined system dialogs which can be configured in the settings of the Flow skill. |
condition to execute | to configure when or when not to execute this flow |
steps | the steps that need to be executed |
Steps¶
Flows are built out of one or more steps. Steps are executed sequencially; first step first, followed by the next one, etc. Until all steps in the flow are executed. A step can be limited for certain tags only. This way you can skip a step when these tags are not present, or show it when they are present. For instance in this example you can see that this text is only show when the closed
tag is set. See example.
A step represents only one specific response type, like a say, ask or show. These are all the supported response types:
step type | purpose |
---|---|
say | to say something |
ask | to ask for something |
prompt | prompts the user for his or her intent |
show | shows an image, video or audio fragment |
tag | sets a tag |
invoke | invokes another flow or system dialog |
escalate | escalates to an operator (only when inbox is enabled) |
note | creates a not in the studio |
sends an e-mail | |
dial | redirects to another phone number (for telephony bots only) |
sms | sends an sms (only if a SMS provider is configured) |
stop | stops the conversation (but doens't close it) |
close | closes the conversation |
Step Say¶
Simply utters the text configured in this step.
field | description |
---|---|
text | text to be said |
condition to execute | to configure when or when not to execute this step |
Step Ask, type topic¶
For asking a question that defines the relevant Topic for this conversation. This ask type is used mainly upfront (in the main flow) to elicit the topic for this conversation early, or as part of the fallback (in the unknown flow) to determine how to escalate or follow up. See example.
field | description |
---|---|
question | to be asked initially, like for example: 'What color do you like?' |
returning | to be asked next time, when a false answer was given, like for example: 'Please type or choose the color your prefer' |
condition to execute | to configure when or when not to execute this step |
topics | containing the possible anwers, linked to topics |
Add the possible choices by clicking the button "Add topic". For each choice a topic can be selected that was previously configured in the Topics skill. The choices given here will be displayed as quick replies in the chat. This helps users to easily pick an answer rather than typing it. When an answer is typed however, it will be matched against the configured Label and the Keywords of the topic. See example.
Topics¶
You can give your topics a label, which is used for the quick reply, select which topic label to link to this answer and optionally which intent to use for triggering this answer. In the picture above you see we used the @other
intent, which is trained for utterances like 'Something else', 'The other one', 'Other'. This way when the user answers "Something else" on the question "Who do you want to talk to" the topic "Reception" is triggered.
field | description |
---|---|
label | to be shown as quick reply |
topic | to be selected out of the Topic skill and used to match the answer on the topic's keywords when the label wasn't selected |
Step Ask, type closed¶
For asking a closed question, other than Topics. Only the options configured here are expected. Use the Add expecting button to add your choices. See example.
field | description |
---|---|
question | to be asked initially, like for example: 'What color do you like?' |
returning | to be asked next time, when a false answer was given, like for example: 'Please type or choose the color your prefer' |
condition to execute | to configure when or when not to execute this step |
expecting | containing the possible anwers |
Expecting¶
Expecting holds the possibe answers for this question and require the following fields:
field | description |
---|---|
label | to be shown as quick reply |
tag | to be set when this answer is given |
match | to match possible other variances of the answer (use BML syntax) |
intent | to match a trained intent |
Step Ask, type open¶
For asking an open question. An open ask still has the ability to allow for predefined choices, but the answer will not be limited to it. Therefore these choices are called quick replies here instead of expecting, since they are merely suggestions. The outcome of this ask will not be stored using tags, but in a conversation field configured using the field "Field Name".
field | description |
---|---|
field name | in which the outcome of this ask will be stored |
question | to be asked initially, like for example: 'What color do you like?' |
returning | to be asked next time, when a false answer was given, like for example: 'Please type or choose the color your prefer' |
condition to execute | to configure when or when not to execute this step |
quick replies | with possible suggestions |
The example shows how the answer given in the first step is used to display in the second step. The ask stores the outcome in the Field Name color
, after which it is referred to in the text of the second step by using the following mustach syntax: {{conversation.color}}
.
Quick replies¶
Quick replies are optional for this type of ask. When used, they are built up out of the following fields:
field | description |
---|---|
label | to be shown as quick reply |
value | to be stored in the given Field Name within the conversation object |
match | to match possible other variances of the answer (use BML syntax) |
intent | to match a trained intent |
Step Prompt¶
Prompts the user for his or her intent. When the intent is handled, the bot always returns here and reprompts the user for his or her next intent. After prompting the question or the returning question the prompt waits for the user to submit a new message which will be handled by the system (as a frequently asked question, a flow or any other trained intent). See this example to learn how the following fields could be used.
field | description |
---|---|
question | to be asked initially, like for example: 'What can I do for you today?' |
returning | to be asked next time, like for example: 'Anything else I can do for you?' |
condition to execute | to configure when or when not to execute this step |
suggestions | with possible suggestions |
Suggestions¶
To give the user possible suggestions. This example shows how the following fields could be used.
field | description |
---|---|
suggestion | to be offered as a quick reply |
condition to suggest | to configure when or when not to offer this suggestion |
Step Show¶
To show the user an image, a video, an audio fragment or a predefined answer (FAQ), see example.
field | description |
---|---|
media type | image, video, audio or answer (FAQ) |
condition to execute | to configure when or when not to execute this step |
image URL | the URL to the image |
video URL | the URL to the video |
audio URL | the URL to the audio fragment |
FAQ | to select the FAQ from the list of answers |
Be aware that the system doesn't prevent you from adding an image step, even when your bot is only connected to the Telephony channel.
Step Tag¶
For reasons of ease of use all conditionals in Flows and Answers are configured out of tags. This way non technical users are able to make their content conditional: just checking wether a set of tags is present or not. When a tag is missing to base a condition on, the tag needs to be set first. This can be done by using more sophisticated conditionals using bubblescript condition, see this example. When the condition evaluates to true
, it will set the tag given.
field | description |
---|---|
tag | to set when the condition evaluates true |
condition to execute | to configure when or when not to execute this step |
condition | bubblescript condition to evaluate |
Step Invoke, Flow¶
For invoking another flow.
field | description |
---|---|
target | Flow |
flow | to select which Flow to invoke |
condition to execute | to configure when or when not to execute this step |
Step Invoke, Dialog¶
For invoking a system dialog that is configured in the settings of this skill.
field | description |
---|---|
target | Dialog |
dialog | to select which system dialog to invoke |
condition to execute | to configure when or when not to execute this step |
Step Escalate¶
For escalating to an operator.
field | description |
---|---|
tag | only operators configured for this tag will be notified |
text | optional text to render before escalating |
condition to execute | to configure when or when not to execute this step |
show wait control | to show a spinner with count down |
time out | amount of minutes to wait until continuing this flow |
Notice that this step can only be used in channels that are based on chat, like the Web Widget, Web PWA, Messenger, etc. For Telephone, Google Assistant and Alexa this is not possible. The platform will not prevent you from using this step type however, so be aware to check.
Step Note¶
For leaving a note in the studio.
field | description |
---|---|
subject | title of the note |
body | the contents of the note will be automatically generated when left blank |
condition to execute | to configure when or when not to execute this step |
As most of the fields in this skill you can use mustache syntax to render user and conversation fields in the content. You could configure the following body text to render both the user name and the user message in the note:
A message from {{user.first_name}} about {{conversation.message}}.
Step Email¶
For sending an email.
field | description |
---|---|
email address | to send this email to |
subject | title of the email |
body | the contents of the email will be automatically generated when left blank |
condition to execute | to configure when or when not to execute this step |
cc | the list of email addresses to use in CC |
bcc | the list of email addresses to use in BCC |
As most of the fields in this skill you can use mustache syntax to render user and conversation fields in the content. You could configure the following body text to render both the user name and the user message in the email:
A message from {{user.first_name}} about {{conversation.message}}.
Step SMS¶
For sending an SMS using a preconfigured SMS provider.
field | description |
---|---|
phone number | to send this SMS to |
subject | title of the email |
body | the contents of the email will be automatically generated when left blank |
condition to execute | to configure when or when not to execute this step |
As most of the fields in this skill you can use mustache syntax to render user and conversation fields in the content. You could configure the following body text to render both the user name and the user message in the sms:
A message from {{user.first_name}} about {{conversation.message}}.
An SMS can only be sent if an SMS provider is configured.
Step Dial¶
For forwarding a call when used with the Telephony channel. It can forward to either a direct phone number, or to a predefined extension (see IVR Skill).
field | description |
---|---|
phone number | to dial and forward this conversation to |
extension | to dial and forward this conversation to (see IVR Skill) |
text | optional text to render before dialing out |
condition to execute | to configure when or when not to execute this step |
Step Stop¶
To stop the conversation, but not ending it. The conversation will continue when the user sends a new message.
field | description |
---|---|
condition to execute | to configure when or when not to execute this step |
Stop Close¶
To close the conversation. The conversation will not continue when the user sends a new message. Instead it will start a new conversation.
field | description |
---|---|
condition to execute | to configure when or when not to execute this step |
System dialogs¶
In the step type Invoke Dialog, or in the Trigger on system dialog the following dialogs are configured out of the box and can be managed in the settings of this skill:
dialog | skill | description |
---|---|---|
main | bsqd/base | start of a conversation |
unknown | bsqd/base | as fallback when no intent is recognised |
resume | bsqd/base | when a user returns after being away |
close | bsqd/base | closure of the conversation |
ask_name | bsqd/identity | asks the name of the user |
ask_email | bsqd/identity | asks the email address of the user |
ask_phone | bsqd/identity | asks the phone number of the user |
ask_message | bsqd/notes | reconfirms the message of the user |
identify | bsqd/identity | asks the user to identify by asking name and email and optionally by providing oauth buttons if configured in integrations.yaml , see the Identity skill |
subscribe | bsqd/identity | asks the user to subscribe for notifications |
send_note | bsqd/notes | sends a note based on the user name, email and last message (deprecated: use the note step type) |
poll | bsqd/poll | polls the user for his or her experience (use the poll flow if you want to customize) |
hello | bsqd/base | to say hi |
bye | bsqd/base | to say bye |
reassign_bot | bsqd/chat | to explain the bot is back after escalation ended |