Integrate into a Flow
Put your agent to work by adding it to a flow.
Overview
In this article, we cover integrating your AI agent into a flow.
This article is part of a series covering setting up and deploying AI agents. See the other parts in the series:
- Create an AI Agent - this article
- Write a Behavior Description (Prompt)
- Create Actions and Tools
- Add Your Knowledge Center
- Add Input Parameters
- Check Your Agent
- Test Your Agent
- Integrate into a Flow - this article
- Use Multiple Agents
Integrating into Your Flows
Tip:Don't replace your whole flow with agents right away. Replace one piece at a time and test your agents at every step of the process.
Once you're done building and testing your agents, it's time to integrate them into your flows. You can build entirely new flows, or replace pieces of your existing flows with AI agents.
When building out your flows, keep in mind that the actions and tools you built for your agent need to be connected to relevant flow steps in order to actually complete the defined task. For example, if you defined actions called "Route to Tier 1" and "Route to Tier 2", you need to then add flow steps which actually route your conversations to the appropriate teams:

The same applies to tools. If you define a tool called "Get More Info", you need to build out the flow steps which actually gather the information you're looking for:

AI agents are just one part of a larger chatbot flow. They must always be integrated into a wider flow in order to take actions, route conversations, perform functions and use tools:

Building an Example Flow
Below we'll walk through the process of building a flow which includes an AI agent.
In this example, we'll be setting up a basic flow that greets the customer and then routes to the appropriate support team.
Step 1: Add Your Agent Step
The first step in creating any flow with an agent is to add an AI agent step:

You then need to edit the step and choose which agent you want to use. Here, we'll be using the Tier 1 or Tier 2 Router we built in the example above:

At this stage, we should give our agent step a name and add in an intro message:

Note:The intro message will be included in the AI agent's context. This means that the AI agent will be aware that it has already sent the intro message you set.
Step 2: Connect Your Actions and Build Your Tools
Now that we have our AI agent step set up, we need to connect the actions to actual flow steps to complete each task, and build the tools we defined.
Let's start by connecting the Route to Tier 1 and Route to Tier 2 actions.
Route to Tier 1:

Route to Tier 2:

Now we need to build our tool flow. For instructions on building your tool flow, see here.
Step 3: Test Your Flow
Even if you tested your agent already, it's important to test your flow in order to make sure your agent still behaves how you expect. Remember, agents get additional context when they're in a flow than they do when you're using their testing tool.
Step 4: Publish and Map Your Flow
Just like any other chatbot flow, an AI agent's flow needs to be published and mapped to a channel. See our Flows Editor documentation for more information.
Updated 1 day ago