Skip to main content
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 Enter. This automatically updates the Condition field with an AI-generated JavaScript expression that corresponds to your condition.
Here are some examples of conditions you could enter in the Label field:
ExampleDescription
User inputTo check if the user entered a value between 1 and 10.
Example: user input is between 1 & 10
User variableTo check a user variable, use user.{variable name}.
Example: user.language is “English”
Workflow variableTo check a Workflow variable, use workflow.{variable name}.
Example: workflow.supportEmail contains “Botpress”

Code

You can also describe the condition manually using a JavaScript expression:
  1. To the right of the Condition field, toggle to disable generative AI for the field.
  1. Enter a valid JavaScript expression in the Condition field.

Intent

The Intent Card is deprecated—use the AI Transition Card instead. Any existing Intent Cards in your Workflows will still work as expected.
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.
I