# How to make a chatbot

{% hint style="warning" %}

#### <mark style="color:red;">**Please note!**</mark>

**YOUR PROJECTS ARE NEVER DELETED** and remain on the platform indefinitely.

Upon subscription expiry, the following data will be removed:

**Messenger connections:** disabled after 3 weeks.

**Long messages:** those over 800 characters are deleted after 3 months.

**Conversations:** all chats are stored for 2 to 6 months.

**Clients:** removed after 1 year.

**Additional info:**

**Undelivered messages** are kept for 2 weeks.

**Messenger access:** revoked 3 weeks post-expiry if no payment is made.

**System limits:**

**Scheduled messages:** Max 32 per client.

**Test bots:** Limited to 1,000 messages/day (including test account messages).
{% endhint %}

### How to create the first block in a funnel

Every chatbot built in MaviBot is made up of blocks.

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

A block is a set of chatbot commands and settings, configured by you or our developers for your project.

Each block provides the bot with instructions on how to respond or act, and determines where the client should go next in the funnel.

**Creating a block is simple: double-click any empty space in the workspace to get started.**

You can move a block (or multiple blocks) anywhere within the builder canvas to optimize the layout and give your funnel a cleaner, more organized appearance.

To make it easier to understand, we’ll walk through a sample funnel diagram and explain how the editor works using that example.

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

You’re looking at a chatbot flow. The flow consists of **blocks** and **connections.**

**Start block (Green):** This is where every conversation begins.

**Trigger blocks (Dark Gray):** These blocks activate specific flows based on user actions.

When a user sends a message or clicks a button, they can move from one block to another — but **only if the transition condition is met**. Conditions can be set on both **blocks** and **Connectors.**

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

To make the bot launch when a user clicks the "**Start"** button in Telegram (or any other messenger), you need to specify a **trigger word** in the green block.

Trigger blocks come in two colors: **green and** **gray**.

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

There are four types of **condition blocks**:

1. &#x20;**Start**&#x20;
2. **Trigger**&#x20;

The "**Start"** block has the highest priority among all condition blocks — meaning it will be triggered **first** if its condition matches any of the client’s actions.

**Step 1: Create a "Chat" block**

To do this, click anywhere on the empty canvas in the flow builder.

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

{% hint style="success" %}
**Good to know!**\
**What is the `#{none}` construction?**\
The `#{none}` construction, which appears by default in the response field, is a special placeholder used to handle unspecified or general input.

This means, for example, that a **condition block** with `#{none}` will be triggered **when a client sends any message** (if no specific keyword or trigger is defined).\
If you leave `#{none}` in the message field, it allows you to **route clients into a specific funnel block**, regardless of the content of their message.
{% endhint %}

To create a block that doesn’t send a message, enter `#{none}` in the response field (this is set by default).

Then click on the block and select its type — "**Start".**

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

1. Select the **"Start"** block type. This will open the condition settings panel.
2. For this first test in MaviBot's internal mode, set a simple trigger word like **"Hello"**.

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

Now, set up the bot's response for when the trigger is activated. For example, enter the message: **"Hello! How can I help you?"**

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

Then be sure to click "**Save"** so all settings are applied to the block:

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

**Step 2: Create the next block**

To create a new block and connect it to the previous one, open the block's **additional settings menu**.

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

To build a seamless conversation flow, your blocks need to be connected. Here’s how to do it quickly:

1. Locate and open the **additional settings menu** for the block you want to connect from (e.g., your "Start" block).
2. Find and click the button labeled **"Create a block below."**

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

Now your funnel contains **two blocks** which are connected.

{% hint style="warning" %}
**Please note!**

**What does this mean in practice?**

If your bot has two separate conversation **flows**, a user cannot go through both simultaneously. They will follow one **flow** or the other, but never both at the same time.

**Need to send a message without interrupting their current flow?**

Use gray blocks — either **"Fallback"** or **"Trigger"** — to send separate messages without disrupting the user's active conversation.
{% endhint %}

**Connectors** between blocksguide the client through the funnel flow.

You can also set conditions directly on the connectors. This allows you to control the flow, for instance, by making a button click or a successful payment a requirement to move forward.

**Let’s create a button in the “Chat” block** so the client can move to the next block.

**Step 3. Create a button**

Click on the **“Start” block**. You’ll see a **“Buttons”** tab:

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

Click on the tab — this will open the button settings menu.

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

Click **“+ Add Button”**, and a button settings menu will appear.

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

In the button text field, enter any label you like — for example, **“GO”**.

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

Click **“Add”**, and the button will appear in the block settings.

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

Buttons can be displayed in two ways: in the message keyboard or directly within the message text.

Note that some button types may not be supported in certain messengers (like WhatsApp).

For optimal compatibility, use the **"Auto"** option. This will automatically display the button in the format best supported by each specific messenger.

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

And don’t forget to save the block settings.

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

All done! You’ve created your first trigger block with a button! 🎉

**Step 4. Set up the connection**

Let's configure the connector so that when a client clicks the button, they move to the next block.

**Here's how:**

1. Locate the **arrow** (connector) leading from your button block.
2. **Hover your cursor** over the arrow.
3. Click the **gear icon** that appears to open its settings.

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

The connection settings will be opened, where you need to choose your created button.

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

Then you need to choose **"Exact match"** in the **"Match type"**:

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

And click **"Save"**.

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

Once you save the connection settings, the condition will be displayed directly on the connector. This gives you a clear visual reference for what triggers the transition between blocks.

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

Connection can be curved:

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

This allows you to clearly see connections that overlap. To do this, grab the arrow with your mouse at the point you want to bend it and drag it to the desired location.&#x20;There’s no limit to the number of bends you can make.

To delete unnecessary bends from a connector, simply double-click the desired node with the left mouse button.

**Step 5. “Chat” block**

By default, when you clicked on the canvas earlier, a white **“Chat”** block was created — this is the most commonly used block when building chatbot flows.

You can configure almost anything inside a “Chat” block (except for conditions). In fact, the majority of your chatbot will likely consist of **“Chat”** blocks.

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

Unlike condition blocks, a **“Chat”** block can only be accessed if:

* It is connected by an connection from a previous block, or
* You’ve sent a mailing that directs users to it.

If you want the client to enter the block based on a trigger, the trigger must be set either:

* In the **connection** (as shown in Step 4), or
* Using a **timer**.

In the **"Chat"** block: enter the message that the bot will send to the client (when they click on the button in the **"Start"** block).

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

Be sure to click **“Save”** in the **“Chat”** block settings.

{% hint style="success" %}
You’ve now created your first chatbot!
{% endhint %}

#### Video tutorial

{% embed url="<https://www.youtube.com/watch?v=RMYNdF8gq_w>" %}

## Chatbot testing

After creating — or even while building — any chatbot, it’s important to **test** the bot to ensure your flows work correctly and the settings are configured properly.

You can connect the bot to a project and test it there. However, if you create a bot for **WhatsApp**, keep in mind that **you can’t send messages to yourself**.

That’s why there’s another way: you can open an **online chat** with the bot and interact with it directly.

To do this, click the **button in the lower-left corner** of the builder:

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

When you click the **“Test chatbot”** button, a test window will open.

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

The **left area** of the test window displays the blocks you’ve created for the chatbot.

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

On the **right side**, you’ll see the test client data — that is, your own simulated user profile.

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

In the **center of the screen**, you’ll see the **online chat** where you can test the bot. To do this, type the trigger phrase from the **“Start”** block.

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

Here’s how the bot works:

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

{% hint style="success" %}
**Congratulations!** 🎉 **You've successfully built a functional chatbot that includes:**

* **Trigger configuration** in both blocks and connectors
* **A fully operational button**
* **Real-time testing** that let you see exactly how your chatbot works
  {% endhint %}

### About the "Testing" tab

After creating the chatbot flow in test mode, you will see all the panels with information about the blocks on the left.

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

Each panel on the left side of the screen displays the block number, its type, and its content.

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

You can filter and display blocks by their type using the corresponding "Filter" button.

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

To test the execution of a single block from the flow, you can select the corresponding block by clicking on it and then click **"Send block."**

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

The selected block will be sent on behalf of the chatbot in the middle section of the screen — the testing window.

In this same area, you can test the entire block flow starting from the very first block in the diagram.

{% hint style="info" %}
You don’t have to start testing the chatbot flow from the very beginning: for example, if you’ve added new blocks to your flow, you can use the **"Send block"** feature and begin testing the flow from the selected block.
{% endhint %}

On the right side of the screen, you’ll find the test client view.

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

In this same client window, the following features are available:

– Assign or add tags/lists to the client;\
– Add variables;\
– View the variables assigned to the client through the chatbot flow execution.

This way, you can fully test the chatbot flow (or any part of it) and immediately view the client card and their data.

### Response options in the bot

Now let’s add a question with multiple response options to our starter flow. Response options are represented by connectors coming out of the block. One connector will have the condition **“Yes,”** and the other — “No.”

To do this, click on the second block labeled “Chat” and create two blocks below it using the additional settings menu.

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

**Now that we've added two blocks to our flow, the next step is to configure the trigger on their connection.**

**Here's how:**

1. Hover over the connector (arrow) leading to the second block.
2. In the trigger field that appears, enter the user response that should activate this path, for example, **"Yes"**.

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

Then make sure to save it. After that, specify the other response option in the settings of the second arrow as well.

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

In the previous block, from which the two arrows with response options originate, enter any question.

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

Now, in the **"Chat" blocks** that the connection with response options lead to, enter the bot’s response message.

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

Now the final flow looks as follows:

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

#### Here’s how this flow works:

1. The user types **“Hello”** and enters the green block.
2. Then, the user clicks a button and moves to the second block;
3. The user types **“Yes”** or **“No”** and proceeds to one of the states depending on the answer.

But what if the user types something else — neither **“Yes”** nor **“No”**? The conversation won’t move to any of the following states and will remain stuck in the current one. The dialogue will stall.

## How to create a loop

To prevent the bot from falling silent when a user sends a message that doesn't match any of the triggers on the connectors, we’ll add a loop.

To do this, loop the question by adding an arrow **without any trigger** that points **back to the same block**.

{% hint style="info" %}
Good to know!\
Blocks and connections **without triggers** have a **lower priority** than those **with triggers**.
{% endhint %}

To create a loop, click on the block where you ask the client a question. In the settings form that opens, click the three dots in the upper right corner, then select **“Create a loop.”**

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

This will create a loop in the flow.

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

Now, if the client sends a message to the bot that differs from **“Yes”** or **“No,”** the message from the second block will be sent again.

**What if the client doesn't respond to the bot’s message?**

You can send follow-up messages using a **timer** to remind the client that a response is needed.

So, when the user enters the block with the question *“Are you happy?”*, and doesn’t answer with **“Yes”** or **“No”**, we want to send a message like:**“You didn’t answer the question :(”** and then ask the question again.

To do this, we’ll use a **timer.**

## How to create a message with a timer

Let’s create a new block that the arrow from the **"Are you happy?"** block will lead to, and also remove the loop.&#x20;To do this, hover over the loop and click the **cross icon** to delete it.

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

Now, go to the settings of the arrow that leads to the new block from the question block.

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

In the arrow settings, there is a panel called **“Delay before response”** — this is a timer that sets the amount of time after which the flow will automatically proceed to the next block.

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

You should also activate the checkbox **“Cancel if left the block”** so that the message won't be sent if the client does respond to the question.

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

Now, let’s enter the message in the new block:

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

And from the new block, draw an connection back to the question block.

To do this, hover over the block — you’ll see a dot appear that allows you to create an connection:

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

Step 1. Click the button and drag the connector to the block with the question.

Step 2. The two connectors will overlap, so you'll need to drag one of them higher.\
To do this, hover your mouse over the connectors and look for the elongated handle — use it to adjust the curve and separate the connection.

Step 3. Then, click and hold the connector and drag it upward.

Now go to the settings of the newly created arrow and set a **1-second timer**, so that the client is redirected back to the question block.

The final flow looks as follows:

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

{% hint style="success" %}
You’ve successfully created your first chatbot — complete with buttons, connectors, response options, loops, and timed redirect arrows!
{% endhint %}

## **How to add funnel stages (lists)**

Using funnel stages (lists), you can organize your bot in a way that’s most convenient for you. It’s still one large workspace where all branches of the bot are located, but visually it’s divided into separate pages. The bot itself continues to operate as a single flow.

When flow chains are broken across lists, **linking blocks** are created automatically.

To add a new list, click the **plus icon** in the bottom right corner of the workspace and enter the name of the new list.

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

To continue the current flow on a new list, click on a block or select multiple blocks, then click the arrow↪️ with the tooltip **“Click to move selected items to another list.”**

When the warning about moving blocks appears, choose the desired list from the dropdown at the bottom near the plus icon.

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

In the window that opens, you’ll see instructions on what needs to be done to complete the transfer.

## How to connect messengers

After testing, you can connect the flow to messengers. To do this, go to the **Messengers** section in the main menu.

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

Next, you need to click on the button for the desired messenger.

{% hint style="success" %}
Read how to connect bots in different messengers in the **“**[**Messengers**](/chatbot/messengers.md)**”** article.
{% 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/funnel.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.
