> For the complete documentation index, see [llms.txt](https://docs.chatlayer.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.chatlayer.ai/buildabot/flow-logic/dialog-state/plugins.md).

# Condition

Add a Condition block by [dragging and dropping it](https://docs.chatlayer.ai/buildabot/bot-navigation/bot-builder/flows/canvas-functionalities#drag-and-drop) to your flow.

<figure><img src="/files/7alvzUbwAm4zjijbBWj2" alt="" width="145"><figcaption><p>Condition block tab.</p></figcaption></figure>

Condition blocks enable your bot to redirect the user to another block depending on the conditions of the session variables, following an if-then logic.&#x20;

{% hint style="info" %}
**Condition** blocks shouldn't be confused with [**Go-to** connections](/buildabot/flow-logic/go-to-connections.md). Even if they work in a similar way, Go-to connections do not check any variables.
{% endhint %}

<figure><img src="/files/dpS0qe9zZ676aKwrUSde" alt="" width="563"><figcaption><p>What a Condition block (here: Class redirect) looks like on your canvas.</p></figcaption></figure>

## Set up your Condition block logic

Condition blocks follow an if-then logic, where each condition leads to a certain result. The bot will understand this logic by reading it from the top to the bottom.

In other words, this means that:

* If statement A is true,
  * then the bot will Go to block X
* Else if statement B is true,
  * then the bot will Go to block Y
* Else,&#x20;
  * then the bot will Go to block Z.

{% hint style="warning" %}
The order of the conditional items determines their priority. If a conditional item is met, other conditional items will not be taken into account.
{% endhint %}

<figure><img src="/files/3CYLNuoVnGcFEvan9PzP" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
If you want to check variables without taking into account their case, please select a **'case insensitive**' condition in the dropdown.
{% endhint %}

## 🆕 Expression syntax (beta)

We launched expression syntax as a beta feature. You can use expression syntax inside Condition blocks as variables. Read more below 👇

{% content-ref url="/pages/vlrwV7ta0MuYFj8P0okC" %}
[Expression syntax](/integrateandcode/expression-syntax.md)
{% endcontent-ref %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.chatlayer.ai/buildabot/flow-logic/dialog-state/plugins.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
