Bot Triggers

When creating a new flow, you can select various triggers (listed below). When you’re editing a flow, click the ‘Edit’ button to select a new trigger.

New Message (trigger)

The New Message trigger is how you’ll start your flows most of the time. It allows you to react to messages either directed at the bot (direct messages or direct mentions), messages where the bot is mentioned (mentions) or any other message (overhear).

The supported message types are:

  • Direct Message (what time is it?)
  • Direct Mention (@timebot what time is it?)
  • Mention (What time is it @timebot @john?)
  • Overhear (Does anyone know the time?)

You have these options when setting up the trigger:

  • Bots – select whether all bots or just specific bots will listen for this trigger.
  • Words or Phrases – choose the words or phrases that should trigger this flow. You don’t need to include the bot’s @handle here. You can learn more about how we match words and phrases. You can group your words or phrases, see Word or Phrase Grouping below.
  • Message Types – select the types of messages to respond to. The message type is also given as an output, so you can use filters to exclude certain messages too.
  • Shortcut Button – choose whether to display a button along with the bot’s welcome text. The first word or phrase will be used as the button’s text. Note that there are varying character limits on each platform, and if buttons can’t be used for all options, fallback text will be used instead.
  • Additional Welcome Text – any text provided here will be appended to the bot’s main welcome text. It’s intended to give additional explanation to the user, if needed. Keep this relatively short, maybe 2 lines of text at most.

You’ll have these outputs available to filter on or to feed into actions as outputs:

  • Response Path – used to route a reply message or question.
  • Bot ID – the ID of the bot.
  • Bot Connection ID – the ID of the connection to the messaging platform.
  • Bot Name – the name you gave the bot in Flow XO, e.g. Time Bot.
  • Bot Platform – the messaging platform, e.g. slack or telegram.
  • User ID – the ID of the user who sent the message.
  • User Name – the user’s full ‘real’ name.
  • User First Name – the user’s first name (either supplied by the messaging platform or derived from the full name if not).
  • User Last Name – the user’s last name (either supplied by the messaging platform or derived from the full name if not).
  • User Handle – the user’s handle or username on the platform that the message came from.
  • Channel ID – the ID of the user/channel/room where the message is sent.
  • Date & Time Received
  • Message
  • Message Type – the type of message. Either direct_messagedirect_mentionmention or overhear.
  • Group – see Word or Phrase Grouping below.
  • Metadata – any extra data that is available from the platform where the message came in from (will be different for each platform).
  • Attributes – any attributes set against this response path.

Word or Phrase Grouping

Sometimes you might want to categorise words/phrases into groups so that you can handle different types of messages in the same flow.

For example, look at some of the words/phrases that our Small Talk Template handles:

Catch-all (trigger)

This triggers when the bot is first installed by a user (or when they reinstall it), or whenever the user types anything that isn’t recognised. It has the same set of outputs as the New Message trigger.

When a catch-all is triggered because someone first installed your bot, the message will contain either ‘start’ (Web Messenger or Facebook Messenger) or ‘/start’ (Telegram). Note that not all platforms support Catch-all being run when the bot is first installed. For example, Twilio SMS.

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).

New File (trigger)

Send a Message (action)

This action simply sends a message back to a user/channel. It takes only a few inputs:

  • Response Path – this tells Flow XO where to route the message (it’s normally the response path output from the trigger).
  • Message
  • Shortcuts – add shortcuts to prompt the user for their next action. These are displayed as buttons in most platforms. When the user clicks a shortcut button, the word/phrase is triggered, just as if they’d typed it in. This is what shortcuts look like in Messenger:

Most platforms support simple markdown such as *emphasis* and `code`, but your messages should generally be simple text. You can of course include links, and most platforms will make them clickable. Some platforms will ‘unfurl links’ and display a snippet or preview inline if the website is recognised.

Ask a Question (action)

This action allows you to easily and intelligently collect input from the user.Read our separate help doc for Ask a Question for full details about how to use this action.

Send an Image/Card (actions)

Take a look at our guide to Images and Cards to learn how to send images and rich content summaries through your flows.

Make a Custom Request (action)

Use this action to make custom requests directly to each of the platforms we support. See our separate help doc for Make a Custom Request.

Leave a Reply

Your email address will not be published. Required fields are marked *