Building Flows

A flow is started by a trigger (usually either New Message or Catch-all), and starts a series of actions, such as Send a Message in response. Each time a flow is triggered, we call this an interaction.

As well as sending messages back, you can Ask a Question (or even a series of questions) to collect info, or connect to other services (and webhooks) to get or post data to other apps.

Triggering Flows

When a bot receives a message, it follows these steps to decide what to do:

  1. If a user types a word or phrase that has matching New Message triggers, those flows will run.
  2. If the message is a mention or overhear, we stop here.
  3. If the word or phrase is not recognised (or when the bot is first installed on some platforms), then the bot will run any Catch-all triggers*.
  4. If no New Message or Catch-all triggers are found, then the bot's default welcome message (including any shortcut buttons) will be shown.
* By default, if Catch-all triggers are found, they will run instead of the welcome message. You can change this in your bot's settings (so the welcome message is also shown).

Structuring Your Bot

There are a couple of options depending on how you want your bot to behave:

  • Single purpose bots: If your bot does one thing, you can start the flow with the Catch-all trigger. The flow will run as soon as the user installs or connects to your bot, and every time the user says anything to it. You can think of Catch-all as the default flow.

  • Multi-purpose bots: For bots that have a range of options/services, add a New Message trigger for each option. You can choose to show a shortcut button, so that your users will see a set of options when they install your bot or when the user types something that isn't recognised (including 'help' or 'hello').

You can use both New Message and Catch-all triggers together too.

Get more details on using bot triggers

Adding Bot Actions

Once your flow is triggered, you can choose from a set of bot actions that let you interact with the user.

See the available bot actions

There are also some other important core services for building bot flows:

  • Attributes: Store details about your bot users that you can retrieve again later. 
  • Messaging: Receive and reply to messages from your bot users.
  • Code: Execute custom JavaScript and output the result.
  • Webhook & HTTP: Get data from or post data to, external API's.
  • Flow: Control flows, such as going back/forward (goto), or triggering other flows.

Using Outputs

Most triggers and actions give outputs. An output is some data that can be used in subsequent actions or in filters.

For example, the New Message trigger has a Message output, which contains the full text of the message that is received. You can then use this output with a webhook action to post the message to another app, or use it as a filter so that an action is ignored if the message contains a certain word.

To use an output in an input field (when setting up an action), either type {{ or click the Flow XO icon inside the input field. You'll then see all the outputs available to you.

By linking your trigger/actions with outputs, and using filters to add logic, you can create complex behaviours without needing to use any code.

Other Actions & Integrations

As well as our core services, we have over 90 other services and integrations you can use in your flows, such as for sending email, manipulating spreadsheets, and fetching data from your CRM.

Let us know how we can improve Flow XO on our feedback site.

Still need help? Contact Us Contact Us