Home · Blog · Chatbot flow start triggers: how the bot decides what to reply

Chatbot flow start triggers: how the bot decides what to reply

· Command CHBT · Flows, Basics

A flow is started by the first matching trigger. The bot checks flows in creation order, triggers within a flow by their list order, and Any message last. If none matches, the bot stays silent, and the conversation gets the Bot didn’t reply mark in Conversations. So if the bot replies with the wrong flow, the cause is almost always two triggers on the same word or Any message in a flow created before the others.

What a trigger is

A trigger is a flow start condition: “if the customer did this, start here”. Every trigger has a type — the When to start field — and the step the flow starts from — Starting step.

One flow can have several triggers. For example, a “Price list” flow can be started by the word “price”, by a link from a post and by an AI intent. Triggers are added with the Add trigger button on the flow’s triggers tab. If a flow has no triggers at all, it will never start — the editor warns about this.

Which triggers there are

TriggerWhen it fires
Command (/start)the person tapped Start or sent /start
Keywordsthe message contains one of the words
Deeplinkthe bot was started by a link with a ?start= label
AI intentthe meaning of the message matched the description you set
Button pressthe person pressed a button under a bot message
Widget openeda visitor opened the website chat
Publication commenta comment under a post from the Studio
Incoming webhookyour system sent a request to the trigger’s address
Shop eventa shop order was placed, paid, shipped and so on
Any messageno other trigger matched

Most bots need three: Command (/start) for the greeting, Keywords for frequent questions and Any message for everything else. Menu buttons do not need a separate trigger: a button with the Goes to a flow step action moves the customer to the right step of the same flow by itself. So it is convenient to keep menu items as branches of one main flow and create separate flows for what is started by words or links.

If customers from different channels need different replies, you do not need separate triggers for that: put a Condition on the Channel field at the start of the flow and split Telegram, MAX, VK and the website into their own branches.

Command (/start) and the first message

In Telegram the first touch is almost always the Start button, that is, the /start command. That is why the greeting flow has the Command (/start) trigger.

In other channels /start does not arrive on its own. VK sends it only on the “Start” button, which communities usually do not have, and in MAX and the widget the person just writes “Hello”. So that the bot does not stay silent, CHBT routes a contact’s first message in VK, MAX and the website chat to the flow with Command (/start) if no other trigger matched.

How to write the greeting itself — in the article on the bot’s first message.

Keywords: three ways to match

In the Comma-separated words field list the variants: price, cost, how much, price list. In Match type choose a method:

  • Contains a word — fires if the word is somewhere in the message: “what is the price for a repair?”. The most common option.
  • Exact match — the message must match the word entirely. Suitable for code words from a post: “CODE25”.
  • Regular expression — a pattern for complex cases, for example deliver(y|ed|ing).

Case does not matter: “Price” and “price” are the same. But “contains” looks for a piece of text, not a whole word: “price” will also be found in “priceless”. Short words are better set with an exact match or a regular expression. About code words from posts — a separate article on code words in a bot.

On plans with AI, voice messages are transcribed to text before the trigger search (1 AI credit), so keywords fire on voice too. Not on the Free plan. When there are too many wordings for a word list, use AI intent — a separate article covers it.

Any message — the safety net

Any message catches everything for which no other reply was found. Usually behind it is an AI agent, a menu with buttons or a handover to an operator. Without such a trigger, a person who wrote something unexpected will get no reply at all.

Within its own flow, Any message is checked last, after the commands and keywords of that same flow. But there is an important detail: if the flow with Any message was created before another flow, it will intercept the message before the second flow’s keywords get their turn. So keep Any message in one main flow or in the flow created last.

In group chats Any message does not fire: otherwise the bot would reply to every remark of the participants.

In what order the bot checks triggers

  1. Flows are checked in creation order: the one created earlier goes first.
  2. Within a flow — triggers in list order, Any message — at the end.
  3. The first matching trigger replies. The rest are no longer checked.
  4. If the bot was started by a link with a label, a Deeplink for that label is looked for first, then the usual Command (/start).

Hence the main rule: if two flows catch the same word, the one created earlier replies. There is no manual priority setting — split triggers so that they do not overlap.

What happens when a conversation is already underway

Suppose the bot asked a question and is waiting for an answer — for example, Data collection asks for the city. What happens to the customer’s message?

  • Any message does not interrupt the running flow: the answer goes to the step that is waiting for it.
  • Keywords and commands do interrupt. If the customer’s answer contains a keyword of another flow, that flow starts. For example, to the question “What are you interested in?” the customer writes “price”, and instead of continuing the questionnaire the bot sends the price list.
  • A new trigger starts from a clean slate: the previous flow’s variables are reset.

If the bot is waiting for a button press and the person types text, the Any message of that same flow replies, if there is one — usually an AI agent that answers the free question without breaking the menu.

Why the bot stays silent

If the flow has ended and no trigger matched, the bot does not reply. Such a conversation is not lost: in Conversations it gets the Bot didn’t reply mark, goes into the list of those awaiting a reply, and operators get a push. Reply yourself or add Any message to a flow — with an AI agent or an Operator step.

Other common reasons:

  • the flow is turned off — in the flow list it is marked Flow off;
  • the trigger has no step selected in Starting step;
  • the Go silent in this chat action fired in this chat — the bot is silent until the /start command;
  • the conversation was handed over to an operator — the bot waits until it is returned with the Return to bot button.

A full breakdown — in the article why a Telegram bot does not reply.

How to set up triggers for a typical bot

FlowTriggers
Main menuCommand (/start), Keywords: menu, start, hello
Price listKeywords: price, cost, price list
BookingAI intent: the customer wants to book
Promotion from a postDeeplink with the post’s label or Keywords with an exact match
Reply to everything elseAny message → AI agent or Operator

Create flows in this order: specific ones first — price list, booking, promotions — and the flow with Any message last. Then the specific triggers will always get to fire before the general one.

How to test triggers

  1. Open Check flow and write to the bot in different words: exact keywords, with a typo, a long phrase.
  2. Keep in mind: in the test chat only the triggers of the flow you are checking work. Overlaps with neighbouring flows are visible only in a real messenger — write to the bot from there with the same words.
  3. Write something completely unrelated — Any message should fire.
  4. In the middle of a questionnaire, type a keyword of another flow and see whether you are fine with the bot switching.
  5. Test Deeplink and voice messages from a real messenger: labels and voice cannot be passed in the test chat.

More about testing — in the article how to test a chatbot.

More on the blog