Building AI Agent Flows

The AI Agent Flows page is where you design and build automated conversation paths for your AI agent. Using a simple visual builder, you can map out entire interactions, from answering initial questions to collecting user details and resolving issues, all without requiring a human agent.

This guide will walk you through the main components of the flow builder and the various steps you can use to create powerful, automated conversations.

The Flow Canvas

When you open a flow, you'll see the main canvas. This is your workspace for building the conversation path.

Some steps (like close conversation or transfer to agent) are terminal and can't have child steps.

Previewing and Testing Your Flow

The flow editor includes a powerful built-in Preview panel, allowing you to test your conversation logic in real-time without leaving the page. This helps you see exactly how the flow will behave from a customer's perspective.

To begin testing, click the Test AI Agent button at the top right of the editor. This will open the Preview panel, which simulates a live chat widget. You can interact with it by typing messages or clicking the buttons your flow presents.

Handling Unsaved Changes

As you build and modify your flow, your changes are not automatically reflected in the preview. A notice will appear in the panel stating, "Flow has unsaved changes."

To test the most recent version of your work, you must first save the flow. You can do this by either:

Both actions will save your flow and restart the test conversation, ensuring you are interacting with the latest version.

Triggering a Flow: The Start Point & Customer Intent

The Start point is the entry point for your flow.

Here you can describe the customer's goal or the reason they might be contacting you (e.g., "wants to track an order," "needs a refund," or "password reset"). The AI agent will analyze incoming customer messages, and if it determines the message matches the intent you've defined, it will automatically launch this specific flow.

If the Customer Intent field is left empty, the flow can still be used but will need to be triggered manually by user clicking a button or from another flow.

Flow Steps: The Building Blocks of Conversation

Steps are the individual tasks the AI agent performs at each point of the flow. Here are the key steps you can use:

Message

The Message step is the most fundamental way to send a reply to the customer. While other steps like Buttons, Show articles, Show cards, or Transfer to agent can also include a message, this step is dedicated solely to sending text, files, or images. You can format your text, attach files, add inline images, and include variables for a personalized touch. When used, a variable will be automatically replaced with the value of the selected attribute, as long as that attribute has a value set. You can also add buttons directly from this step to create interactive choices for the user.

Each button in the message and other steps that allow adding buttons can be configured to perform a specific action when a customer clicks it. This allows you to create more dynamic and powerful interactions. Available button actions include:

Buttons

This step is designed to present the customer with up to 10 clickable options. Each button creates a new branch in your flow, allowing you to guide the conversation based on the customer's selection. You can also enable the "Prevent customer from typing" option to ensure the user makes a selection from the buttons provided.

Ask for details

Use this step when you need to collect specific information from the customer. This step will show a form to the user that they will need to fill out. You can use standard attributes like name and email, as well as any custom attributes you have created in the admin area. The collected data is saved as an attribute and can be used for personalization later in the flow or for a human agent to review.

Set attribute

This step gives you direct control to manually store or update information about the user or the conversation. While other steps, such as Ask for details, will automatically save user input to attributes, the Set attribute step is used when you need to define a value yourself within the flow. For example, after a customer selects an option, you can set an attribute like interest = "pricing" to track their choice. This data can be used to control the flow's logic or to provide context to your support team.

Branches

The Branches step allows you to introduce conditional logic into your flow, creating different paths for the conversation based on data you've collected. It functions like a series of "if-then-else" statements, allowing the AI agent to make decisions.

When you add this step, it creates an initial conditional branch (with a placeholder name like "If this" that you can rename) and a default "Else" branch.

You can click "+ Add branch" to create multiple conditional branches, each with its own unique name and set of rules. The agent will check the conditions for each branch in order from top to bottom.

Use tool

The Use tool step allows your AI agent to connect to your external systems and APIs to perform actions or fetch real-time data. This is a powerful feature for creating truly dynamic and helpful conversations. For example, you can use a tool to fetch a customer's order history, check their subscription status, or update their status in an external CRM.

When you add this step, you select a tool that has been created earlier from a dropdown list. The step then creates two branches in your flow:

This allows you to handle both outcomes gracefully, for instance, by proceeding with the retrieved data on success or sending an apology and escalating to a human agent on failure. The data returned on the success path can then be used by other steps, like Dynamic buttons, to personalize the conversation.

Dynamic buttons

While the standard Buttons step is perfect for static choices, the Dynamic buttons step allows you to generate a list of buttons based on data retrieved from a previous Use tool step. This is ideal for presenting a user with personalized options based on their own information, such as their recent orders, available appointments, or open support tickets.

To configure this step, you first select the response from a successful Use tool step. Then, you specify which part of that data contains the list of items you want to create buttons for (e.g., a list of orders). For each button, you can dynamically set its label and the action it performs using variables from the data.

For example, you can display a list of user orders by using the {orderId} variable from orders list as the button label. When the customer clicks a button, you could configure it to send a message back containing that order's details, such as "Your order will be delivered on {expectedDeliveryDate}."

Dynamic cards

Similar to dynamic buttons, the Dynamic cards step allows you to display a rich, interactive gallery (or carousel) of items based on data from a Use tool step. This is perfect for visually showcasing products, listing search results, or presenting any collection of items from an external source.

To configure this step, you first select the successful Tool response you want to use. Then, you specify which list of items from the response you want to generate cards from. Finally, you map the data from your tool's response to the card's fields:

For instance, after using a tool to "Fetch most popular phone models", you can generate a card for each phone, dynamically filling the image, title, and description from the data returned by the tool.

Add tags

Organize your conversations and users by adding tags. Tags can be used to categorize an issue (e.g., shipping, feedback), flag a conversation for a specific department, or track customer types. You can apply tags to the conversation or directly to the user's profile.

Show help center articles

Promote self-service and deflect common inquiries by having the AI agent present relevant articles from your help center. You can search for and select up to 6 articles to send to the customer directly in the chat, providing them with instant answers.

Show cards

For a more engaging and visual presentation, use the Cards step. Each card can include an image, a title, a description, and its own set of buttons. This is perfect for showcasing products, comparing plans, or guiding users through options in a rich, interactive format.

A powerful feature of this step is its interaction with the Branches step. If a Branches step is placed as a direct child of the Show cards step, the flow will pause and wait for the customer to provide input. This input can be either clicking one of the buttons on the cards or typing a message. Once the customer responds, their input will be evaluated against the conditions in the Branches step to determine the next path in the conversation.

Transfer

When the AI agent cannot resolve an issue or when a customer needs to speak to a person, the Transfer step escalates the conversation to a human agent. You can write a message to inform the customer about the transfer. To ensure the customer reaches the right person, you can optionally specify a particular agent group (e.g., "Sales", "Technical Support") or even a specific agent to transfer the chat to.

Go to step

The Go to step step allows you to redirect the conversation to another step within the current flow. This is a powerful tool for simplifying your flow's structure by reusing existing steps instead of duplicating them. For example, you can have multiple branches all lead back to a single common step. Simply select the target step you want the conversation to jump to.

Go to flow

Use the Go to flow step to move the customer from the current conversation path to an entirely different flow. This helps you create modular, reusable flows for specific tasks (e.g., a dedicated flow for handling returns). When the conversation reaches this step, it will seamlessly begin at the start point of the target flow you select.

To prevent infinite loops, there is a limit on how many times a conversation can be redirected to the same flow. A single conversation can only be sent to the same target flow a maximum of two times.

Close conversation

The Close conversation step is used to end the interaction with the customer. This is the final step in a flow once a customer's query has been successfully resolved. You can add an optional final message, like "Is there anything else I can help you with today?", before the conversation is officially closed.

By combining these steps, you can build sophisticated flows that handle a wide range of customer interactions, improving efficiency and providing your customers with instant support 24/7.