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 deprecated—use the AI Transition Card instead. Any existing Intent Cards in your Workflows will still work as expected.
- By selecting a predefined intent from your Library
- By defining an inline intent that only exists for this card.