# Blocks

Chatlayer offers multiple block types serving different functionalities. On your bot canvas, the blocks appearing are either:

* Build by yourself by choosing out of our available [block types](#block-types).
* [Default](#default-blocks) blocks existing for any bot on Chatlayer.

## Block types

There are 4 kinds of blocks that you can choose from to build your flows. Each block type comes with its own colour and functionalities.&#x20;

The blocks menu is available on the left-hand side of your [bot canvas](/navigation/bot-builder/flows.md).

<figure><img src="/files/IQci9SHen1iPkCHv54yh" alt="" width="96"><figcaption></figcaption></figure>

### Message

Any message a bot is sending to a user is what we call a bot message. This includes text messages, buttons, quick replies, etc.

{% content-ref url="/pages/-LLTwJAHL2ERL5kp1bHx" %}
[Message](/buildabot/flow-logic/dialog-state/message-components.md)
{% endcontent-ref %}

### Condition

If you want to add rules to determine where a user is guided to, based on the value of a variable, you can do it with this block type.

{% content-ref url="/pages/-LLTwJAIjPPN\_qaMXi5S" %}
[Condition](/buildabot/flow-logic/dialog-state/plugins.md)
{% endcontent-ref %}

### Collect input

Use Collect input blocks to gather input from your users.

{% content-ref url="/pages/-LV38yKP7fk4ExBsXHfF" %}
[Collect input](/buildabot/flow-logic/dialog-state/user-input-bot-dialog.md)
{% endcontent-ref %}

### Action

Action blocks are where 3rd-party, coding logic or special operations can be added to your bot.

{% content-ref url="/pages/-LV3979rV56-MLUQqpS0" %}
[Action](/buildabot/flow-logic/dialog-state/action-bot-dialog.md)
{% endcontent-ref %}

### Intent

Intent blocks represent an [intent](/navigation/natural-language-processing-nlp/intents.md) from the user.

{% content-ref url="/pages/AeMkT81FoAUHUZn3TRDA" %}
[Intents](/navigation/natural-language-processing-nlp/intents.md)
{% endcontent-ref %}

## Default blocks

When you create a bot from scratch on Chatlayer, a few predefined blocks appear in your General flow:

<figure><img src="/files/B4vf7L5v1xrTg6toyq2x" alt=""><figcaption><p>Default blocks.</p></figcaption></figure>

* [Not understood](https://docs.chatlayer.ai/tips-and-best-practices/not-understood-bot-dialog)**:** a block show when your bot didn't understand the user.
* [Introduction](https://docs.chatlayer.ai/tips-and-best-practices/not-understood-bot-dialog)**:** the first message that is send to the user to open the conversation.
* **Error occurred**: a block triggered when an API integration fails to complete a certain request, or when Chatlayer considers your bot to be blocked in a loop.
* **Block disabled**: appears when you disable your bot in the [**Settings**](/navigation/settings/settings.md).

{% hint style="success" %}
Not sure where to go from there? We've got you covered with our [Leadzy](/start-quickly/leadzy-tutorial.md) tutorial.
{% endhint %}

## Blocks view

Chatlayer offers two different views of your block, where you can configure what the bot will answer to a user.

### Flows view

The [Flows](https://docs.chatlayer.ai/buildabot/bot-navigation/bot-builder/flows) view displays your flows on the bot canvas in a tree-like visual.

To access the Flow view:

1. Open your bot.
2. Under the **Bot builder** tab, click on [**Flows**](https://docs.chatlayer.ai/buildabot/bot-navigation/bot-builder/flows).

<figure><img src="/files/Eso3uSKaVlKb0R4HO0nt" alt=""><figcaption><p>Visualize your bot canvas under Flows.</p></figcaption></figure>

### Bot dialogs view

In the [Bot dialogs](https://docs.chatlayer.ai/buildabot/bot-navigation/bot-builder/bot-dialogs-view) view, you can visualize your blocks as a table, which is helpful for searching, filtering and sorting blocks.

{% hint style="info" %}
You can filter the Bot dialogs view based on many filters. Learn more [here](https://docs.chatlayer.ai/buildabot/bot-navigation/bot-builder/bot-dialogs-view).
{% endhint %}

<figure><img src="/files/HggpZs1le0JxaozfRPeG" alt=""><figcaption><p>Bot dialogs view.</p></figcaption></figure>

## Block settings

You can modify your block when you open it, either under the **Settings** tab or the **NLP** tab.

### General settings

To access your block general settings:

1. Open your block.
2. At the top of the windown, click on the **Settings** tab. From there, you can access and modify different pieces of information.

<figure><img src="/files/dRbV7975r6x75uWf6hh7" alt="" width="337"><figcaption><p>Modify your block's settings inside the block.</p></figcaption></figure>

#### Block name

Your block name.

#### Type

Your block type.

#### Flow

The specific [flow or subflow](/navigation/bot-builder/flows/manage-your-flows.md) where your block is stored.

#### Label

You may use the **Label** field as a custom identifier for your block when integrating solutions through the [Webhook](/channels/all-channels/webhook-api.md) Channel API .

For example: say you want to store the number of times some specific block ( eg. `Greeting Message` ) has been triggered. You have added a custom label to that block (eg. `messages_greeting`). Now if you delete the `Greeting Message` and recreate it, its unique identifier on the Chatlayer side will change, but you could still add `messages_greeting` as the custom label again.

If you use this custom label in your system to check if the block has been triggered then nothing on your side needs to be changed, just make sure the label of the recreated block is the same as the label of the block you deleted.

#### Parent

In this field, you can define a [Parent](https://docs.chatlayer.ai/buildabot/bot-navigation/bot-builder/bot-dialogs-view) block.&#x20;

{% hint style="info" %}
The parent block and the child block should be in the same flow.
{% endhint %}

#### ID

This is the ID associated with the block. You can use this to debug your bot using the Emulator.

### NLP settings

To access your block NLP settings:

1. Open your block.
2. At the top of the windown, click on the **NLP** tab. From there, you can access and modify different pieces of information.

<figure><img src="/files/cCKPy0p9DY3KLI0CAL77" alt="" width="332"><figcaption><p>Modify the NLP settings of a block.</p></figcaption></figure>

#### Give output context & lifespan

Here, you can select an output context for your bot if you wish to re-use the same intent at different points in the conversation. Learn more about context and lifespan below:

{% content-ref url="/pages/-LLTwJAa6dAUSXOPdl1g" %}
[Context](/nlp/natural-language-processing-nlp/using-context.md)
{% endcontent-ref %}


---

# 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.chatlayer.ai/buildabot/flow-logic/dialog-state.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.
