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
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.Examples
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. Example: user input is between 1 & 10 |
| User variable | To check a user variable, use user.{variable name}. Example: user.language is “English” |
| Workflow variable | To 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:- To the right of the Condition field, toggle to disable generative AI for the field.
- Enter a valid JavaScript expression in the Condition field.
Intent
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:- By selecting a predefined intent from your Library
- By defining an inline intent that only exists for this card.