# Trigger and match type

## Match type

A **trigger** is something that activates the bot, change states, or perform another action. The words in the "Trigger" field act as a trigger for the workflow in the builder to execute the event or action contained within the block.

**Tirggers** control the flow of the conversation. They are configured in the "Trigger" field within a conditional block or on a connection arrow.

* **Format:** A trigger can be a symbol, number, regular expression, or specific keyword.
* **Action:** When a user's input matches a defined trigger, the bot executes the associated workflow, such as advancing to a new funnel state or triggering an action.

<div data-with-frame="true"><figure><img src="/files/lmIslr9u133QWsUDuxPw" alt=""><figcaption></figcaption></figure></div>

<div data-with-frame="true"><figure><img src="/files/2BhO9HDaXVUfrzpSaidK" alt=""><figcaption></figcaption></figure></div>

For example, if you need to create a block for all possible messenger start words, you can specify the following condition: start;start;get started;start

{% hint style="success" %}
In all types of comparisons, **the semicolon (;)** is used to separate conditions.
{% endhint %}

The chatbot will respond to the trigger by executing the specified action or event; for example, it might send a welcome message to the client:

<div data-with-frame="true"><figure><img src="/files/lGD8IS2GVlqyZPMe8AIy" alt="" width="563"><figcaption></figcaption></figure></div>

To recognize a trigger, you need to define the comparison type (the **"Match Type"** field). The match type helps the chatbot compare the condition to the client's message or another action (such as a button click) and determine which event to trigger next.

In MaviBot, there are five types of condition matching:

1. Fuzzy match;
2. Keyword match;
3. RegEx match;
4. Exact match;
5. Semantic search.

<div data-with-frame="true"><figure><img src="/files/7CSmfMY2P5coe1tj0Zsc" alt="" width="563"><figcaption></figcaption></figure></div>

Let’s take a closer look at each of them.

### Fuzzy match

This is the primary comparison type, allowing the bot to handle misspellings, typos, inaccuracies, missing letters, and letter rearrangements. The condition is triggered if the similarity between strings is greater than 70%.

**Example:**\
For the condition **"hello"**, the following variations would trigger a match: **"hlelo"**, **"hellp"**, **"helo"**, and so on.

<div data-with-frame="true"><figure><img src="/files/MWuLqC1WJloBvjyC4yfk" alt="" width="563"><figcaption></figcaption></figure></div>

<div data-with-frame="true"><figure><img src="/files/8xx0rtbH9M1GEApaoarc" alt="" width="563"><figcaption></figcaption></figure></div>

This type of comparison is more user-focused and takes the human factor into account when processing conditions, as typos are quite common.<br>

The **"Fuzzy"** match type is ideal for the welcome (initial) block in a chatbot flow, where the client is the one to initiate the conversation.

### Keyword match

**Keyword match** is a very powerful comparison type that helps create a human-like consultant. With this type of matching, the bot will respond to any user message that contains at least one of the condition’s keywords.

In other words, if the client sends a message containing one or more keywords from the condition, the flow will trigger according to its settings.

**Example:**\
For the condition "hello;person," the following message would trigger it:\
"I want to greet this wonderful person."

<div data-with-frame="true"><figure><img src="/files/iXIVAo8bWHVNsmjw4uCy" alt="" width="563"><figcaption></figcaption></figure></div>

<div data-with-frame="true"><figure><img src="/files/do6tz51XoBa2uf8fT26y" alt="" width="563"><figcaption></figcaption></figure></div>

You can include a large number of keywords in the condition. This allows the chatbot to recognize what the client needs at the moment and trigger the appropriate event configured within the block.

<div data-with-frame="true"><figure><img src="/files/AkC4eIWO0glIE4x6SnLS" alt="" width="375"><figcaption></figcaption></figure></div>

As seen in the example above, the bot will respond to any message that contains at least one of the keywords in the condition.\
This match type also uses the field **"Ignore triggers"** (messages that should not trigger a response).

<div data-with-frame="true"><figure><img src="/files/9tDJDOpeMnIX58hSvBuo" alt="" width="375"><figcaption></figcaption></figure></div>

This field works similarly to the condition field but with the opposite effect: if the user’s message contains any words from the **"Ignore triggers"** field, the condition will not be triggered.

Accordingly, if the condition in the **"Ignore triggers"** field is met, the overall condition will not work.

### Variability

You can add an additional trigger separated by a semicolon, but what if you need to match one of several word options?

For example, to handle phrases like "My internet is not working," "My computer is not working," or "My computer broke," with a single trigger.

Obviously, listing all keyword variations one by one is not practical. That’s why the OR syntax was created. To specify one of several equivalent keywords, place them all inside parentheses and separate them with a vertical bar (`|`).

For example, the trigger `(tar plan|tariff) (pereit|podklyuch|menit|pomen)` will match questions like:\
"Hello, how do I connect a new plan?"\
"How do I change my pricing plan?"

<div data-with-frame="true"><figure><img src="/files/RB5tgAd7P0yoDEM4vUcz" alt="" width="563"><figcaption></figcaption></figure></div>

<div data-with-frame="true"><figure><img src="/files/a1CIGO6cyJpo7HDFqKiq" alt="" width="563"><figcaption></figcaption></figure></div>

Let’s break down the trigger:\
`(tar plan | tariff)` means the string must contain **“tar” AND “plan” OR “tariff”**\
AND at the same time one of the words: **“switch” OR “connect” OR “change” OR “replace”**.

Here are some other intuitive examples:

* `change password (cab|pa)`\
  ("cab" and "pa" are short for "cabinet" and "personal account")
* `(forgot|reset|restore|remember|accepts|fits|incorrect|not the right|don’t remember) password`
* `(can’t|unable to) (restore|change) password`
* `login in contract; (lost|loss|where is|don’t know|where|can’t find|no) contract`
* `(suspend|blocked|block|disconnect) (services|internet|inet|charged); (saved|save) day; put on pause; leaving`
* `auto payment; payment; pay; recurring payment; connect payment`

### Exact match

With this type of comparison, the bot will trigger the event only if the client’s message exactly matches the condition.

{% hint style="info" %}
The comparison is case-insensitive, meaning that if the condition is "hello" and the user types "HELLO," the condition will still be triggered. This should be taken into account.
{% endhint %}

This type of comparison is suitable for use in settings like connections when a client clicks a button or transitions from a mini-landing page to the chatbot with a specified site tag.

1. **For button clicks:**\
   For example, in the conditions, we specify the names of the buttons that, when clicked by the client, should lead them to the corresponding block.

<div data-with-frame="true"><figure><img src="/files/fMolVUwWgmBWTjm75cM9" alt="" width="375"><figcaption></figcaption></figure></div>

Next, we will create the blocks to which the client should be directed after clicking the button following the first block. There should be four of them:

<div data-with-frame="true"><figure><img src="/files/8zueYrWsOQgs60POk1dl" alt=""><figcaption></figcaption></figure></div>

Next, in the arrow settings, we enter the button name and set the match type to **"Exact match."**

<div data-with-frame="true"><figure><img src="/files/Q5FYw0DQ2G8LDuV76ytp" alt=""><figcaption></figcaption></figure></div>

Now you can test the bot:

<div data-with-frame="true"><figure><img src="/files/ZWqGfoB7xTjfcsvXRgpY" alt="" width="563"><figcaption></figcaption></figure></div>

As you can see, the bot correctly processes the condition and the exact match selection when using buttons.

2. Using a site tag in the funnel:

In this case, the principle is similar to using buttons; however, the condition and match type are set directly within the conditional block itself.

Here, the tag is taken from the **Sites** tab, where you have installed the tag for the website page:

<div data-with-frame="true"><figure><img src="/files/k6tLrEFelqOIgUxoc11Y" alt="" width="563"><figcaption></figcaption></figure></div>

The tag in the block’s condition is specified **directly in the block’s CONDITION field without using the words “TAG” or any other labels.**

<div data-with-frame="true"><figure><img src="/files/sjVxJCs5hRMTAZNPRAYC" alt="" width="375"><figcaption></figcaption></figure></div>

{% hint style="info" %}
For more details on how to set up the bot trigger using a tag installed on the website, see the article **"Creating a Website and Basic Settings**[**"** in the **"Tag"** section.](/websites/sites/builder.md#tag)
{% endhint %}

The chatbot will also respond and execute the configured event within the block’s settings.

### RegEx match

RegEx match is a type of condition that allows the bot to check the format of the entered data (for example, to verify that the user has entered a phone number and not something else).

During data collection, users often enter information that differs from what was requested. Here is a typical example of a phone number validation flow. If the user enters something other than a valid phone number, the bot will prompt them to try again.

<div data-with-frame="true"><figure><img src="/files/GywrPst0zQQ8xNig6ROb" alt=""><figcaption></figcaption></figure></div>

From the block requesting the phone number, two connections lead out:

1. One connection **without a trigger**
2. Another connection with a **regex trigger** for validating a phone number

^(\\+)?((\d{2,3}) ?\d|\d)((\[ -]?\d)|( ?(\d{2,3}) ?)){5,12}\d$

The connection with a trigger adds the phone number to the request and will only trigger when a valid phone number is detected. The second connection will trigger in all other cases, as it has lower priority.

{% hint style="info" %}
To complete list of useful regular expressions can be found in [the article with the same name](/chatbot/functions/regex.md).
{% endhint %}

### Semantic search

The **"**&#x53;emantic searc&#x68;**"** option is based on artificial intelligence — a real breakthrough for your chatbot.

How it works:

* The trigger contains words or phrases representing the **MEANING** that the AI will identify in the client’s message.
* The system (chatbot) processes the client’s message by searching for the meaning embedded in the condition within the client’s input.
* The bot then triggers the corresponding event in the block.

In other words, by specifying certain phrases or values in the condition, the AI checks each condition against the client’s message and triggers the relevant event in the block (for example, sending a message, etc.).

Example:

We specified particular phrases and keywords for the AI to detect in the client's message to trigger the relevant event within the block.

In our case, the trigger includes phrases related to "closing accounts or contracts."

<div data-with-frame="true"><figure><img src="/files/zISZwXg4Uu4sT7zEAjw1" alt=""><figcaption></figcaption></figure></div>

When using the **"**&#x53;emantic searc&#x68;**"** option, the bot should find words or phrases in the client’s message that are similar in meaning to those specified in the condition:

<div data-with-frame="true"><figure><img src="/files/P21Q4owBnqzv3o2ktFAi" alt="" width="563"><figcaption></figcaption></figure></div>

Each time the bot processes a client’s message, it correctly triggers the required event defined in the block.

**How to write a trigger**\
Thetrigger is entered in the corresponding field just like other conditions for any match type: separated by semicolons (;).

<div data-with-frame="true"><figure><img src="/files/rCEe7scouBgRyP0JTLzf" alt=""><figcaption></figcaption></figure></div>

It’s best to specify phrases or words in the trigger field as accurately and concisely as possible.

{% hint style="success" %}
A concise, clear, and precise condition for the block helps the chatbot correctly trigger the event contained within the block.

The more complex, vague, and lengthy phrases the condition includes, the longer the AI takes to process client messages, which may lead to incorrect behavior of your flow.
{% endhint %}

{% hint style="warning" %} <mark style="color:red;">**Please note!**</mark>&#x20;

A trigger should **NOT** consist of just one word: although conditions need to be concise, they must reflect the meaning the bot is looking for.

If the model compares two different single words, they won’t match. For example, instead of using the word “invoice,” use the condition “payment for the monthly invoice.” This condition will better meet the intended requirements and provide the AI model with the necessary criteria for semantic matching.
{% endhint %}

Thus, using the **"**&#x53;emantic searc&#x68;**"** option, the AI will analyze various possibilities to understand the meaning of the client’s message and, based on the match, the chatbot will trigger the appropriate event.

## Trigger builder

The Trigger is a unique, specialized feature designed for quick creation of triggers within the corresponding blocks to respond to incoming callbacks from various channels, payment systems, and other integrations.

Accordingly, the trigger builder is available only for blocks that support triggers:

<div data-with-frame="true"><figure><img src="/files/CziAowKsMld4XfuLRtvY" alt="" width="375"><figcaption></figcaption></figure></div>

To use the trigger builder, open the block settings where you will see the corresponding button located just above the condition field:

<div data-with-frame="true"><figure><img src="/files/TSSQTq9TKez3gObwLc3W" alt=""><figcaption></figcaption></figure></div>

After clicking the corresponding button, a window for working with conditions will open:

<div data-with-frame="true"><figure><img src="/files/2PjyTYav0GCr0pxVSJe9" alt=""><figcaption></figcaption></figure></div>

### MaviBot triggers

<div data-with-frame="true"><figure><img src="/files/DFZmeBZYtnvVhv56EIMB" alt=""><figcaption></figcaption></figure></div>

The **"MaviBot Triggers"** tab in the trigger builder includes all system conditions that are stored and available for use across various sections in MaviBot.

**Default triggers**\
This functionality works similarly to nested conditions within a block: here you specify conditions that are **NOT** pre-built into the system. This can be a funnel tag, a site tag, or any other condition that exists only in your project.

**Variables**

<div data-with-frame="true"><figure><img src="/files/HOq87TTvTbpL7UtcgZ9H" alt=""><figcaption></figcaption></figure></div>

Triggers with variables are quite easy to set up.

**Step 1.** Enter the variable name in the appropriate field.

**Step 2.** Choose the comparison parameter.

<div data-with-frame="true"><figure><img src="/files/d5rGn4A3Z720LTy13KFP" alt="" width="563"><figcaption></figcaption></figure></div>

In other words, specify what you want to compare your variable with: a specific value or another variable.

<div data-with-frame="true"><figure><img src="/files/73TrIW6lal88xknCu5cE" alt="" width="563"><figcaption></figcaption></figure></div>

<div data-with-frame="true"><figure><img src="/files/mg895Pk4W7a3AsN6ADxX" alt="" width="563"><figcaption></figcaption></figure></div>

Step 3. Select the comparison type.

<div data-with-frame="true"><figure><img src="/files/uVZW11F9ddqUgGUuZJph" alt="" width="563"><figcaption></figcaption></figure></div>

Each comparison has its meaning: equal to (==); not equal to (!=); strictly greater than (>); greater than or equal to (>=); strictly less than (<); less than or equal to (<=).

Example:

<div data-with-frame="true"><figure><img src="/files/85WRnij8myWcaStZFg28" alt="" width="563"><figcaption></figcaption></figure></div>

In the example, the variable’s value is set to be greater than or equal to 21. What does this mean?\
It means that the event within the block will trigger only for clients who belong to the "adult" age group — that is, those who are either 21 or older.

The expression **"age >= 18"** is equivalent to **"age > 17."**

The condition **"age > 17"** will also trigger only for those strictly older than 17, i.e., starting from 18 and above.

#### MaviBot sections

<div data-with-frame="true"><figure><img src="/files/5UT0AFWa6VHeF6XwdsSC" alt=""><figcaption></figcaption></figure></div>

In the MaviBot sections conditions, there are typical callbacks — system notifications — about various events in the project.

To trigger an event within a block based on system notifications, set the required callback in the condition field, then select the match type and click the **"Add condition"** button:

After that, the condition will appear in the corresponding fields within the block.

{% hint style="success" %}
If the block already contains a condition, clicking the **"Add condition"** button will add the new condition **after** the existing one. If you need to replace the old condition with a new one, click **"Replace condition."**
{% endhint %}

### Messengers

<div data-with-frame="true"><figure><img src="/files/P7aauPUFn1gAmWgBCSdh" alt="" width="563"><figcaption></figcaption></figure></div>

The condition builder in channels helps not only to track reactions to posts or publications but also to trigger events within blocks for the chatbot’s response.

### Payment

<div data-with-frame="true"><figure><img src="/files/o7gmld7LTDS34jMCqsOr" alt="" width="563"><figcaption></figcaption></figure></div>

Step 1. To set up conditions for payment systems, make sure you have connected the corresponding integration; otherwise, you won’t be able to use the condition builder with the required system.

Step 2. Next, click on the payment system you need.

Step 3. Select the appropriate callback.

Step 4. Then enter the payment amount in the corresponding field and click **"Add condition."** The last step is to write the appropriate message in the block settings:

{% hint style="success" %}
Other sections of the condition builder are configured similarly to the sections covered here.\
We wish you success!
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.mavibot.ai/chatbot/builder/setting/trigger/type.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
