# 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: 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/plugins.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.
