Building Your First Flow
Step-by-step guide to creating and configuring your first AI agent flow
Building your first flow on the platform is a straightforward process. This guide will walk you through each step, from creating a new flow to configuring its states and actions.
Introduction to Flows
Flows are essential to directing your AI agent’s conversation with customers. Each flow is composed of States and Transitions that guide the agent’s responses based on customer input. Setting up flows effectively ensures your AI agent can handle various scenarios and provide an optimal customer experience.
Step 1: Creating a New Flow
To start, navigate to the Flows section under the Build tab in the sidebar.
- Click Create in the top-right corner.
- Enter a Name and Description for your flow. The name should be something descriptive, like “Car Cleaning Appointment Flow,” to help identify the flow’s purpose.
After you create the flow, it will appear in your list of flows. Now, you can begin adding states and configuring the flow.
Step 2: Configuring Flow Settings
Click on the flow to open the Configure Flow settings.
Here, you can define details that provide context and support for the flow:
- Private Display Name: The internal name displayed within the platform.
- Public Display Name: The name displayed to customers.
- Description: A brief explanation of the flow’s purpose.
- Documents: Attach any reference documents the agent might need.
- Frequently Asked Questions: Link FAQs relevant to the flow.
- Document Chunks: Control how much documentation the agent receives in each message.
- Initial State: Choose the starting state of the flow.
- Finalizer Functions: Functions that execute at the end of the conversation (without parameters).
When you’re done, click Save to apply your settings.
Step 3: Adding and Editing States
Creating the Initial State
The Initial State is where the flow begins. By default, a flow starts with an “Initial” state that you can edit to define how the agent introduces itself or begins the interaction.
-
Right-click on the Initial State and select Edit to open the state configuration dialog.
-
In the Thought section, enter the instructions that guide the agent’s response. For instance, “Welcome the customer and ask how you can assist with their car cleaning needs.” For a in-depth guide on designing Thoughts, check out our Thoughts Guide.
-
Functions: Add any functions (predefined or custom) that the agent should perform at this state. For example, if you need the agent to verify customer information, select a relevant function from the list.
-
Tags: Tags help categorize and visually group states in the flow. Assign tags if needed for organization.
When you’re finished, click Save to finalize the state.
Step 4: Adding More States
Each additional state allows you to structure the conversation further, guiding the agent based on customer responses.
- Right-click on the flow editor canvas or navigate to the top-right and choose Add New State.
- Name the state descriptively (e.g., “Confirm Appointment” or “Provide Pricing”).
- Repeat the steps to add a Thought, Functions, and Tags as needed.
- To edit or delete an existing state, right-click on it and choose the appropriate option.
Each state should represent a clear step in the conversation, directing the agent on what to say, ask, or do based on the conversation context.
Step 5: Connecting States with Transitions
Transitions between states are controlled by Events. Events are triggered by function calls. When an event is triggered, the flow moves to the next state based on the event’s conditions.
- Drag a line from one state to another to create a transition.
- A dialog will appear to configure the event that triggers the transition. The options are limited to possible events output by the functions of the upstream state.
For example, if the customer confirms their address, that function will emit the ‘Address Verified’ event that then triggers a transition to the “Verify Appointment Details” state.
Step 6: Testing the Flow
Testing is crucial to ensuring your flow behaves as expected. To test:
- From the Flows page, click the three-dot menu on the flow card and select Test Platform.
- Select Test Platform and choose the platform you wish to simulate (Voice, SMS, Web, or Email).
- Begin typing responses as if you were the customer to verify that the agent follows the flow correctly.
During testing, ensure the AI agent responds accurately and moves through states as intended. Watch for things like:
- Accurate Transitions: The flow should move to the correct states based on customer responses.
- Proper Execution of Functions: Ensure that any functions attached to states work as expected.
- Response Clarity: The agent’s language should be clear and aligned with your instructions.
For more information on testing, check the Testing a Flow guide.
Step 7: Deploying the Flow
To deploy the flow, you will need to configure a Point-Of-Contact (POC) that connects the flow to a communication channel like Voice, SMS, or Web.
Check out our guide on Creating a Point of Contact for detailed instructions on setting up a POC for your flow.
Key Concepts Reference
States
- Definition: A point in the conversation where the AI agent performs actions or gives responses.
- Configuration: Set the Thoughts (instructions) and Functions (actions) to guide the agent’s responses at each stage.
Functions
- Purpose: Functions allow the AI to perform tasks like data retrieval or notifications.
- Customization: Users can create custom functions via webhooks, defining them on external servers.
Parameters
- Types: Normal parameters (passed to functions) and internal parameters (set by functions).
- Usage: Used to maintain data consistency across the flow and perform specific tasks based on the conversation.
Events
- Definition: Triggers that determine when the conversation moves from one state to another.
- Example: An event could move the flow from “Confirm Address” to “Confirm Appointment” once the address is verified.
By following this guide, you can set up a flow that effectively manages customer interactions. Building flows with well-defined states, functions, and events will help your AI agent provide consistent and valuable support across various customer scenarios.