Overview
Flow Logic Cards are essential tools that help control the flow and decision-making within your bot’s conversation. They enable you to add logic and structure to your bot’s behavior, making it possible to guide the conversation based on user input, bot state, or external factors. These Cards allow you to create dynamic, interactive, and context-aware bots that respond intelligently to different scenarios.Card Types
There are two default types of Flow Logic cards available to you in the Card Tray.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, or;
- By defining an inline intent that only exists for this card.
Expression
The Expression Card evaluates custom expressions or conditions written in JavaScript to make decisions within the Workflow. This Card allows you to create more granular control based on specific criteria, such as checking variable values, user input, or any other custom logic. Expression Cards are versatile and can be used to incorporate complex decision-making within your bot. There are two ways to define conditions for transition:- Use AI to generate custom JavaScript based on a specific prompt, or;
- Disable the AI-generation tool by clicking on the star icon and manually input the JavaScript code.
Example | Description |
User Input | To check if the user entered a value between 1 and 10, you can use User Input Example: user input is between 1 & 10 |
User Variable | To retrieve a value from the user variable, you can use user.{variable name} Example: user language is English |
Workflow Variable | To check a Workflow variable, you can use workflow.{variable name} Example: Workflow variable supportEmail contains Botpress |
Intents | You can combine multiple checks together, for example you can check if an intent is of type “affirmative”, and its confidence is more than 50%. Example: intent is affirmative and intent confidence is 50% |
Advanced | You can use an advanced JavaScript expression to move from one node to the next when the expression satisfies the condition. |