The AI Step element in chatbots
With the AI Step element, you can incorporate AI into your chatbot flows to branch them based on user actions or goal completion and save data for personalized responses.
To give you an idea, you can analyze client needs and conversation tone, process user responses, guide your subscribers toward a purchase, and share personalized recommendations.
Let's talk about how to use the AI Step element.
Add the element
Go to the flow builder and add the AI step element. You can place it anywhere in your flow, including the start, the middle, or the end.
If you're adding this element for the first time, add a token to its settings.
In the Instruction for the bot field, enter a prompt outlining your company, products, or services. Define the response format and include examples of popular questions and desired answers. You can also add variables to personalize messages.
Your prompt can include business specifics, limitations, and communication style. You can instruct the AI to analyze customer intent and preferences and offer different options based on their responses. This will make chatbot interactions personalized and drive more results.
Here's how your chatbot can approach conversations based on customer tone:
- If the customer is feeling positive, offer a bonus or special deal.
- If their mood is neutral, offer helpful information.
- If they seem upset, respond with empathy and offer assistance.
Keep in mind that you need to add prompts to every AI Step element. To save time, add your prompt to a global variable and reuse it.
Select a step type
In the Step type field, select an element execution mode. Relevant settings will appear based on your selected type.
One-time execution
This mode is suitable for simple flows where your chatbot needs to generate and send a response immediately. For instance, it can calculate an expression or translate a piece of text.
In the Execution behavior field, select one of the following actions:
Send a reply from AI to the subscriber as a message | Use this action to respond as soon as the user reaches this element. |
Continue the chain without a response | Use this action to pass data to the next element.
You can process the user’s response and add it to your next Message element using the |
Conditional exit
This mode makes your chatbot wait until a specific goal is achieved within a set timeframe before the user exits the element and continues down the flow.
If another chatbot trigger is activated, the user will exit the AI Step element, and the AI will stop waiting for a response.
In the When entering the element field, decide when to activate the AI.
The AI bot writes first | Use this option to initiate chatbot conversations immediately, for example, to send a welcome message or offer to take a test. |
Waiting for incoming message | Use this option to make your chatbot wait for the first user message. This can help process requests or gather more information before starting an interaction. |
In the Set goals as exit conditions field, define what constitutes a completed goal for the user to move to the next flow element.
You can also add variables to create a dynamic goal. Every user will have a unique value based on variables available at the time they reach the AI Step element.
This way, you can determine user needs and purchases they are ready to make. These goals help the AI understand user intent and offer relevant solutions.
Your AI model should understand which user intentions or actions to track and what data to collect and save.
To avoid false triggers, it’s essential to use clear and specific data collection conditions and criteria. General and vague descriptions can lead to errors in the flow execution.
Clear: “When the user shares a phone number in international format, or their phone number is already known.”
Vague: “Phone number received.”
Condition and variable description clarity determine your flow accuracy, so take the time to write them out and minimize the risk of false triggers.
To make your chatbot save specific user data to a variable, click Save user response data. In the first field, define the data to be retrieved from the user's response. In the second field, select a variable from your chatbot audience.
Let's say a user selects a specific meal when ordering delivery from you. Your chatbot can save this value to a variable and use it in other flow elements. If you own an online school and your chatbot assesses users' language proficiency, it can save their results. Similarly, if a user shares their address to get free shipping, your chatbot can record it.
When selecting variables, be mindful of their types. To save numbers that may need future updates, use the Number
variable type. To record dates, select Date
, and for text data, use String
. Data will be automatically converted based on your variable’s data type.
In the Stay in element maximum field, set the time during which the element should remain active. Suppose you set it to 1 hour, and the user sends their first message after 59 minutes. In this case, they will exit the AI Step element after 1 minute, and their next messages will no longer be processed by it.
In the Execution behavior field, select one of the following actions:
Send a reply from AI to the subscriber as a message | Use this action to respond as soon as the user reaches this element. |
Continue the chain without a response | Use this action to pass data to the next element.
You can process the user’s response and add it to your next Message element using the |
Configure the AI model
To customize the AI model, click its name in the upper right corner and fill in the following fields:
OpenAI Token | Decide how to authorize requests (inherit the token from your settings or use a dedicated token for this chatbot). |
Model | Select an AI model to generate responses. |
Conversation context size | Specify the number of previous messages the AI should consider when generating a response. |
Maximum number of tokens in response | Specify the number of tokens your chatbot can use for a single response. |
Temperature | Adjust response creativity — the higher the value, the more creative the response. |
To learn more about how to configure AI models, see How to connect ChatGPT from OpenAI to your chatbot.
After filling in all the fields, click Save.
After filling in all the fields, click Apply to save your settings.
Continue your flow
Branch your flow using exit points to adapt it to user actions and make chatbot interactions more natural.
If the AI Step element reaches its goal, use the green exit point to continue your flow. For example, when the user accepts an offer, shares their data, or signs up for a webinar, you can extend your flow using other elements to send a confirmation, offer product recommendations, or request payment.
If the waiting time expires and the user does not complete the target action, they will automatically reach the red exit point. This allows you to properly move on from the current step or send a notification to re-engage the user.
Flow branching helps your chatbot account for user actions and adjust your flow to the conversation context.
Next, add elements to every flow branch. For instance, if the user wants to sign up for a demo and you’ve saved this information, you can send them a confirmation message and add a tag using an action. To personalize this conversation, add a filter and set its conditions.
Optionally, add another AI Step element to clarify the user’s queries or offer multiple options based on their request. You can also send an API request or integrate with Google Sheets to check product availability or status. Use variables to add external data points to your prompts and deliver them to users seamlessly.
Test your flow
To see your flow in action, click Save and send to yourself in the upper right corner of the builder. To share your flow, exit the builder, click the three dots under your flow name, and select Link to launch a flow.
You may need to reset your conversation context to test condition triggers. To do this, unsubscribe from your chatbot using the /stop command and resubscribe using the /start command.
Monitor user status
To track subscribers who have exited or are still in the AI Step element, switch to flow view mode and click the number at the bottom of the element.
When chatting with a subscriber, you can pause flows that include the AI Step element to prevent them from interrupting conversations.
Last Updated: 17.01.2025
or