# Blocks and types

## How to work with blocks

{% hint style="info" %}
MaviBot allows you to create a chatbot by designing its structure as a flowchart consisting of blocks and arrows.
{% endhint %}

A **block** represents an action or event that the bot needs to process or perform.

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

**Block limitations:**\
The total limit per flowchart is no more than **500 blocks** of the following types:

* **Start block**
* **Trigger block**
  {% endhint %}

There are Connections between blocks, where you can define a condition and/or the exact time for transitioning to the next block.

{% hint style="info" %}
**Conditional blocks** serve to trigger the bot under specific conditions.\
**Unconditional blocks** operate only when reached via arrows or callbacks (which we will cover later).
{% endhint %}

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

**Blocks and connection have an execution priority!**\
Blocks that have a condition set will always be executed first.

**Execution priority of blocks and arrows:**\
The **"Start"** block is always executed first:

* First, the **"Start"** block with a condition set in the condition field is executed.
* Then, if it exists, the **"Start"** block without a condition is executed.

Next, the Connection from the block where the client is currently located is executed (if the client is already in the funnel).\
Then:

* another  **"Start"** blocks
* The **"Trigger"** block

If no matching response is found and the **AI assistant** is enabled, the assistant will respond (if the launch condition allows it).
{% endhint %}

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

**All blocks share a unified structure:**\
Each block contains a list of sections that you can enable or disable as needed.

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

The **Message** section allows you to specify the text of the message.\
You can use variables in the text by applying the following format: `#{variable_name}`.

## **Popup menu**

Each block has a popup menu that allows you to perform specific actions on the block, including:

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

* **Block copying:**

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

* **Block deleting:**

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

* **Copying the block with linking**&#x20;

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

* **Moving to another sheet:**

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

{% hint style="success" %}
**Priority of blocks/transitions in descending order:**\
· Start\
· Connections\
· Trigger
{% endhint %}

Let’s take a closer look at each block type: how to create them and what they are used for.\
To create the first block, simply double-click the left mouse button on the editor workspace (by default, a Start block will be created), or select the block type from the menu.

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

## **Chat block**

{% hint style="info" %}
If the block should not contain any text, enter `#{none}` in the response field (this is the default).
{% endhint %}

**Dialogue state:** a white block without a condition.\
You can enter this block only via an arrow. It is intended for intermediate responses, branching, and sending multiple messages one after another at specific time intervals.

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

## **Start block**

**Initial condition:** a bright green block with the highest priority.\
The entire bot sequence can also start from this block. The main difference from the **Start of dialogue** block is that conditions in these blocks are checked first. If the client enters a keyword or phrase from this block during the conversation, they will be immediately redirected to it.

Example of configuring the bot’s reaction to a client greeting:

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

The client will receive the message **"Hello!"** in response.

## Leads block

Leads block it's a block without a condition, colored red.

The main purpose of this block type is to create an application (lead). When transitioning to this block, all data collected up to that point (variable values) about the user are sent to the CRM system, email, personal WhatsApp or Telegram (or any other contact specified in the project settings) as a ready-made application. After the transfer, the variable values of the deal are deleted from the builder.

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

## Trigger

**Trigger block** is a dark gray block.\
Functionally, it is similar to the Start block, with the only difference being that the client does not transition into this block.

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

{% hint style="info" %}
The priority of this block, compared to other conditional blocks, is the lowest — meaning it will be triggered last.
{% endhint %}

## Fallback

**Fallback block** is a gray block. It doesn’t have conditions like the **Trigger t** block, and it cannot be transitioned into.

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

{% hint style="warning" %}
You can use Fallback blocks to create timed connection or, for example, to validate data entered by clients! Since the user cannot transition into these blocks, they also cannot exit the main flow.

Fallback blocks can also be used to trigger broadcast sequences.
{% 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/types.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.
