Flows

Flows are a top-level design element that allow you to create a visual representation of a conversation between your botClosed A software application that handles customer interactions in place of a live human agent. and contactsClosed The person interacting with an agent, IVR, or bot in your contact center.. Flows are a different way to work with your intents. Like stories and rules, flows allow you to design conversations tied to intents that teach your bot how to respond to those intents.

Flows take the place of storiesClosed Used to train bot for interaction handling based on intent and context. and rulesClosed Used to define bot's response to messages that don't change with context. in your bot's configurations, so you don't need to create all three. The only time you'd need to create a story or rule would be if you need to use a bot action that flows don't support yet. You still need to configure fallback in addition to flows.

Flow Designer

The flow designer is a dot-grid canvas workspace where you can add contact and bot messages, similar to what you do when creating storiesClosed Used to train bot for interaction handling based on intent and context. or rulesClosed Used to define bot's response to messages that don't change with context.. As you add messages to a flow, they're automatically connected with lines to show the flow of the conversation from message to message.

After each bot response, you can create branches in the conversation by adding one or more contact messages. Each contact message branch represents an intent the contact might introduce at that point in the conversation. This allows you to design a flow that includes the different kinds of requests or responses your contacts make.

For example, if the flow starts with the contact asking about changing their password, the bot can ask if the contact has tried changing the password on the website. You can add contact messages that branch the conversation based on the contact's response to the bot's question.

With each branch in the flow, you can build out the conversation by adding the bot's response and follow-up messages from the contact. You should only add to the conversation in a flow if the messages you add belong in the context of that flow. Learn more about bot context in the following section on this page.

Teaching Your Bot with Flows

Flows teach your bot about the conversational context, or how intents are related to each other. When a flow starts with an intent, the bot learns that subsequent intents can only occur after the initial intent.

For example, a flow starts with the contact message Hi (intent: greetings), which is followed by a bot response and then another contact message. The second contact message introduces another intent into the flow. This teaches the bot that the second intent is related to and depends on the first. If the second contact message is I need to change my password, the bot learns that the contact can only ask about changing passwords immediately after the greeting intent.

If you want your contacts to be able to ask about changing their passwords at any point in the conversation, a better approach is to create a separate flow for password changes. This is shown in the following image.

Your bot can jump from one conversational context to another depending on the flows you build. Within each flow, only include intents that depend on the context of the flow. If an intent does not depend on the context of another intent, it should be a separate flow.

Intents that Depend on Context

Some intents might depend on context for the bot to learn how to respond appropriately. For example, for a contact response such as "how do I do that," the bot depends on the conversation's context to understand how to respond. The following images show the same intent (intent: HowDoIDoThat) in two different contexts. The bot uses the context of the conversation to determine how to respond.

Including the HowDoIDoThat intent in the same flow as the conversation about a task helps the bot learn how to respond to HowDoIDoThat in the context of that particular intent. You may have several intents that include the HowDoIDoThat intent in their flow. The bot's response for each intent is likely different.

The bot learns to use a different response depending on the context of the conversation.

Connections Between Flows

Flows can be triggered by the contactClosed The person interacting with an agent, IVR, or bot in your contact center. at any point during the conversation. If the contact makes a request in the middle of the conversation that's unrelated to the current intentClosed The meaning or purpose behind what a contact says/types; what the contact wants to communicate or accomplish., the bot switches to the flow for the new intent. Bots can handle context-switching and return to the unfinished intent, but you must ensure that you have the flows set up to train them to handle it.

You can design flows so they trigger other flows where appropriate based on the context of the conversation. Buttons and quick replies allow you to specify a jump to a different flow.  For example, in a flow for handling the initial greeting phase of a conversation, the bot prompts the contact with a series of quick replies to help narrow down the intent. Each quick reply is configured to trigger the flow for that intent. When the contact chooses a quick reply, the bot jumps to that flow.

Buttons and quick replies can also trigger intents. When you trigger an intent, the conversation continues within the same flow. Triggering an intent is only appropriate when the intent depends on the context of the conversation. If the intent is independent on the context of the conversation, you should build it in a separate flow and trigger the flow instead.

Branches Within Flows

Adding buttons or quick replies to a bot response creates branches in the flow. When a button or quick reply triggers an intentClosed The meaning or purpose behind what a contact says/types; what the contact wants to communicate or accomplish., the flow of that branch must be completed with additional bot responses, intents, or both. Some branches may contain additional sub-branches. Branches that trigger other flows or open URLs end with that action and cannot be added onto.

When completing branches, be careful about introducing additional intents. Remember to keep the flow of each branch within the context of the overall intent of the flow.

Ensure that every branch within your flows is complete. Incomplete branches result in a bot that doesn't know how to respond to an intent. It will follow fallback.