Actions
Actions - Conversational Building Blocks
While a chatbot can do a great many things, from querying a CRM to turning off the smart lights in your office, what makes it a chatbot is its ability to communicate with humans conversationally via a messaging platform. The first thing to get your arms around, then, once you've decided on an appropriate conversational design and bot structure, are the tools you have at your disposal for sending and receiving messages, including text messages, of course, but also video, images, etc.
Flow XO provides a standard set of core messaging tools that work as similarly as possible across the various messaging platforms Flow XO supports. This was done to allow you to build bots once that can service customers in multiple places, from your website to Facebook to Telegram without having to author multiple different sets of logic for each.
This can be very convenient and save a lot of bot development time and effort. Even so, each messaging platform IS different and will offer different sets of functionality. To allow you to take advantage of the uniqueness of each platform we expose a 'Custom Request' tool for advanced users that allows you to use almost any native feature of a particular platform using some custom JSON.
Interacting with users
Let's take a look at the various messaging tools available in Flow XO.
Send a Message
The Send a Message task is one of the simplest and most frequently used of the Flow XO messaging tasks. It simply sends a chat message to your user. This task does not wait for the user to respond (like Ask a Question does). Note that if you include a URL in your message, it will be converted to a clickable link by the messaging platform.
VariationsAny given message can have several different variations. Variations are just different ways of phrasing the same thing, and when you have configured more than one variation on a message, any given variation will be chosen at random. This feature allows you to add some variety to your bots and make them a little more lifelike.
ShortcutsSend a Message supports adding shortcuts. Shortcuts are sent to the user as buttons that, when clicked, send the value of the shortcut back into the chat. Unless you follow Send a Message with a Wait for a Response task, when the user clicks a shortcut it will usually trigger another flow or a catch-all trigger. This can be used to build a flexible menu system where shortcuts are designed to trigger additional flows whose New Message trigger matches the value of the shortcut.
NOTE on Shortcuts and URLs:
If the 'value' of a shortcut is a URL (starts with http:// or https://) then Flow XO will translate that shortcut into a link, rather than sending a message back into the chat, when the button is clicked. This makes it possible to create menus for your users that are a combination of additional conversational elements and links to external pages and sites.
Send an Image
The Send an Image task does just what it says - it sends an image to the chat. You can specify an image by its URL (including data URLs) or you can upload an image directly to Flow XO.
Send an Image also supports adding shortcuts.
Send a Video
The Send a Video task allows you to send a video into the chat by providing a link to a video hosted on You Tube, Vimeo, Wistia, Facebook Video or elsewhere.
Send a Video also supports adding shortcuts.
Send a Card
A 'Card' is a common user interface element in chatbots. It is a combination of an image, a title, a description, and an optional link and buttons:
As with shortcuts elsewhere in Flow XO, if the shortcut 'value' is a URL, then the button will be presented as a hyperlink. Note that on Facebook, Shortcuts are presented as 'Button's - you can have a maximum of 3 of these per card.
Send a Card Set
A Card Set is a collection of cards. On Facebook, a card set is sent as a carousel, a horizontally scrolling list. On other platforms, a card set will simply deliver a series of cards.
Ask a Question
The Ask a Question task one of the most important and most configurable Flow XO messaging tasks. Ask a Question is the primary means by which you will gather information from your users.
You can use an Ask a Question task to collect information like e-mail address, shipping preferences, etc. You can also use Ask a Question to let users control the flow of a conversation by presenting menu options. Another common use of Ask a Question is simply to pause the flow and give the user a chance to interact with the bot, even if it's just to click 'Yes! I'm ready to continue!'
You can read all about Ask a Question and it's many configuration options here. The most important aspect of Ask a Question is that once it sends its message to the user the flow will pause until the user responds (or the question expires). Once the user responds, the response is available throughout the rest of the flow, and can be used in subsequent messages, in filters, or stored in a database.
Turning any Message into Ask a QuestionThere are times where you want the 'pause and gather a response' behavior, but you want to present a different user interface to the user than Ask a Question provides. Perhaps you want to use a Card or a Card Set to present your user with some options in a more visual manner, or you want. touse a Custom Request to take advantage of a platform specific user interface element.
In these cases, you can add a Wait for a Response task to your flow, immediately following a Send a Card, Send Custom Response, etc. Wait for a Response, like Ask a Question, pauses the flow until the user provides some input, and then makes the value. of that input available to the rest of the flow for later processing. It does not, on its own, send anything into the chat, however, so it is ideal for converting any of the other messaging tasks into a question.
Make a Custom Request
Flow XO's normal messaging tasks are designed to work in a "cross-platform" manner. That means that the platform does its best to present your bots as similarly as possible on Telegram, Facebook Messenger, the web, etc. To achieve this, it is impossible to accommodate every feature of every platform, because each platform has features that are unique, and not available outside that specific platform.
However, if you don't need your bot to be cross-platform, or you want to use a platform-specific feature in a cross-platform flow only for users of that platform, you can use Make Custom Request to send a raw API request directly to the current user's chatbot platform.
This is an advanced feature and works slightly differently for each platform, but in general, you can refer. to your platform's API documentation to see what kind of requests are possible and what the JSON code should look like for each.
Please see here for more information on making Custom Requests: https://support.flowxo.com/article/158-make-a-custom-request
Common Messaging Settings
There are a few advanced options that (almost) all of the messaging tasks support.
The first two options are only relevant to users of Facebook Messenger. These are 'Message Type' and 'Notification Token' settings.
The Message Type setting allows you to select the specific Facebook Message Tag for any given message.
Facebook has strict rules around how you can interact with users on their platform, specifically limiting automated promotional messages to 24 hours after a user last sent your bot a message. If you are sending one of a few very specific types of non-promotional messages, you can use this setting to change the Message Type and Facebook will allow the message to be sent. If you need to send promotional messages outside of the 24 hour window, your only non-paid option is to use the One Time Notification API, where you get permission from a user in advance to send them a single message after 24 hours.
The Notification Token setting allows you to send a One Time Notificaiton Token with your message, a Facebook mechanism that allows you to request permission from your user to send them a single message after 24 hours.
The Fails for unanswered questions setting allows you to send a message to a user even if another flow is currently waiting on the user to answer a question. You can read more about how this might be used here.
The Response Path setting allows you to specify the bot user you want to receive a message. The response path is like an e-mail address for a user of your bot - it is a unique identifier for that user/bot combination.
Normally you will send messages in reply to a user who interacted with your bot. In this case, the response path does not need to be set, because it is assumed you want to message that same user. However, there are times when you want to specify a response path.
The most common is when you want to send a message as the result of a non-bot trigger, such as a Webhook or an E-mail trigger. Another reason to use response path is to send a message to a DIFFERENT user than the one who is currently chatting with your bot.
Flow Control Tasks
Flow XO provides a variety of tasks that you can use to control the flow of a conversation. Although the main flow control mechanism in Flow XO are filters, these tasks can give you a lot of additional flexibility when modeling your conversations.
Trigger a Flow
NOTE: For a complete walkthrough of triggering one flow from another flow, please see this article.
At some point, attempting to model your entire conversation in a single flow will become cumbersome and difficult to maintain. This is most common when the conversation branches, and you don't want to apply the same filter to a bunch of different steps.
Trigger a Flow allows you to call one flow from another, and therefore break a complex flow into a set of simpler ones.. Trigger a Flow on its own won't do much besides create a 'Flow not found' error. Flow XO always works with either a New Trigger trigger, or a New Message trigger, which should be at the beginning of any flow you want to trigger in this way.
You will use a New Trigger trigger if you only want the flow to be started by other flows, never as a response to user input. Use a New Message trigger if you want a flow to be triggered either by certain user input, or by a Trigger a Flow action.
The Keyword Phrase in the Trigger a Flow task and the keyword phrase in the New Trigger trigger must match exactly.
Trigger a Flow can also be used to trigger flows with a New Message trigger defined. In this case, the same fuzzy-matching logic that a New Message trigger users to match approximate inputs will apply to the New Trigger keyword phrase.
Label & Goto Label
The label task simply marks a spot in your flow to which you can send a user later using a Goto Label task. The 'keyword' used in both Label and Goto Label should match exactly.
Goto label sends the flow to a previously defined label. A label can jump forwards or backward in a flow and can be used to simplify branching logic or create loops.
You can use a label to simplify branching logic by sending flow control to one of several labels, each of which represents the branch of a flow, based on some filter condition.
You can use label/goto label to create a loop, for example, to continue to ask the user for favorite books until they indicate they are done. One caveat to keep in mind is that any given loop can only execute a maximum of 15 times before the flow will fail. This is to prevent infinitely executing flows. If you need to loop more than 15 times, you should re-trigger your flow instead of using labels.
Wait for a While
Wait for a While will pause the flow for a specified number of days, hours, minutes, or a combination of the three. Wait for a While is great for creating "drip" sequences where you send your users messages over a period of time, culminating in some kind of offer.
Note that Wait for a While can wait for a minimum of 1 minute. If you need to pause your flow for less than a minute, say 5 seconds or 10 seconds, simply to give your users more time to digest a longer message or for any other reason, you can use Wait Until with a relative time, for example, +15s to wait for 15 seconds.
Wait Until a Date
Wait Until a Date lets you delay the flow until some specific time. That can be an exact, very specific time, such as '2020-07-04 22:00' or it can be a relative time, like 'tomorrow at 1pm' or '+30s'. Please see here for different ways you can specify dates and times.
Data Oriented Tasks
Attributes are pieces of information that you can store and retrieve for each of your users. Attributes are a great way to segment your users and personalize their experience with your chatbot. Please see more information on using attributes here:
Attributes overview: https://support.flowxo.com/article/141-attributes
Using attributes in flows: https://support.flowxo.com/article/163-using-attributes
Integration
Flow XO's HTTP task is very flexible, and can be used to integrate with most other services that expose a REST API, including your own private service. Please see the documentation for the HTTP task here. If you want to integrate with an external service that is not already covered by one of Flow XO's native integrations, and would be difficult to use raw HTTP or you lack the knowledge, you can use the HTTP task in Flow XO to integrate with Zapier or Integromat, giving you access to nearly unlimited third party services:
Zapier: https://support.flowxo.com/article/215-integrating-flow-xo-with-zapier
Integromat: https://support.flowxo.com/article/214-integrating-flow-xo-and-gmail-using-integromat
Live Chat
Flow XO provides a built in live chat function for when you need to hand a bot user over to a human agent. The Live Chat actions and how to use them are described here.
Taking Payments
Flow XO allows you to accept Stripe payments directly from your bot. Read more about how to use these tools here.
Utility Tasks
In addition to the main building blocks, Flow XO offers a number of utility tasks that can make your work easier. These tasks can be found alongside our third party integrations under New Task -> More Services.
Code
The Code task allows you to run small pieces of JavaScript on the server as part of your flows. The Code task has the ability to make and receive HTTP requests, and can be used for a variety of data transformations, calculations, text manipulations or other tasks that cannot easily be accomplished using the built-in tools. You can read about the Code task and how to use it here.
Date & Time
The Date & Time task provides options to convert dates to and from different textual representations. If you're trying to construct a specific date from some text, or to format a date in a specific way, this action will help. Please read about how to use it here.
Flow XO Utils
Flow XO Utils is a grab bag of utilities to accomplish certain tasks in Flow XO. The most important of these is 'Clear Open Conversations' which you can use to cancel andy open questions that might block a broadcast you are about to make. You can read all about this utility task here.
Number
The Number task offers a variety of tools you can use to manipulate numbers. There is a powerful Calculate method that lets you apply a wide variety of mathematical calculations to your flow data, and a Random Number method that will let you generate random numbers which can be useful in games, adding variable delay to a flow, or anything else you can dream up. The Number task also allow you to format numbers in a specific way to prepare them for display. Read about using the Number task here.
SMTP
The SMTP task allows you to configure Flow XO to send e-mails from your own domain. You can read about sending e-mail using this tool here.
Text (String)
The Text task gives you a set of tools that can manipulate text in a wide variety of ways - from changing the case, to replacing one text pattern with another, to applying regular expressions to split a block of text into pieces. Read about using the different methods available in the Text action here.
Third Party Integrations
Flow XO offers a broad set of integrations with third party services. You can read about which integrations are available and how to use them here.