> ## Documentation Index
> Fetch the complete documentation index at: https://botpress-pb-update-api.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Flow Logic

export const AiIcon = () => {
  return <span style={{
    display: 'inline-flex',
    verticalAlign: 'middle'
  }}>
      <svg aria-label="Magic icon" width="16" height="16" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
        <path d="M12 5.5H14.5M14.5 5.5H17M14.5 5.5V3M14.5 5.5V8M3.30524 11.8365C6.14269 11.8365 8.16353 13.8574 8.16353 16.6948C8.20324 17.1017 8.79676 17.1017 8.83647 16.6948C8.83647 13.8574 10.8574 11.8365 13.6948 11.8365C14.1017 11.7968 14.1017 11.2032 13.6948 11.1635C10.8574 11.1635 8.83647 9.14273 8.83647 6.30524C8.79676 5.89825 8.20324 5.89825 8.16353 6.30524C8.16353 9.14273 6.14269 11.1635 3.30524 11.1635C2.89825 11.2032 2.89825 11.7968 3.30524 11.8365Z" stroke="#0190ff" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>
      </svg>
    </span>;
};

Flow Logic Cards **direct the flow of your bot's conversation** based certain conditions. You can use them to guide the conversation based on user input, bot state, or external factors.

There are two Flow Logic Cards available in the Card tray:

## Expression

The Expression Card evaluates custom expressions or conditions to make decisions within your Workflow. You can use it to transition to a Node based on a condition:

* If the condition evaluates to `true`, your bot will transition to whatever Node is connected to the Expression Card
* If the condition evaluates to `false`, your bot will skip the Card and continue its execution

There are two ways to describe conditions for a transition:

### Natural language

You can describe the condition using natural language. In the Card's **Label** field, describe the condition, then press <kbd>Enter</kbd>. This automatically updates the **Condition** field with an AI-generated [JavaScript](https://developer.mozilla.org/en-US/docs/Web/JavaScript) expression that corresponds to your condition.

<Accordion title="Examples">
  Here are some examples of conditions you could enter in the **Label** field:

  | Example                                                         | Description                                                                                                                    |
  | --------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------ |
  | User input                                                      | To check if the user entered a value between 1 and 10. <br />Example: *user input is between 1 & 10*                           |
  | [User variable](/studio/concepts/variables/scopes/user)         | To check a user variable, use **`user.{variable name}`**. <br />Example: *`user.language` is "English"*                        |
  | [Workflow variable](/studio/concepts/variables/scopes/workflow) | To check a Workflow variable, use **`workflow.{variable name}`**. <br />Example: *`workflow.supportEmail` contains "Botpress"* |
</Accordion>

### Code

You can also describe the condition manually using a JavaScript expression:

1. To the right of the **Condition** field, toggle <AiIcon /> to disable generative AI for the field.

2. Enter a valid JavaScript expression in the **Condition** field.

## Intent

<Warning>
  The Intent Card is **deprecated**—use the [AI Transition](/studio/concepts/cards/ai/ai-transition) Card instead. Any existing Intent Cards in your Workflows will still work as expected.
</Warning>

The **Intent** Card is used to direct the conversation's flow based on the user's recognized intent. Intents are predefined categories of user input that represent what the user wants to achieve, such as booking an appointment, asking for help, or providing feedback.

When an Intent Card is triggered, it checks if the user’s input matches any of the defined intents and routes the conversation accordingly.

There are two ways to define the intent you want to trigger using this card:

1. By selecting a predefined intent from your Library
2. By defining an inline intent that only exists for this card.
