How to Create AI Flows
How to Create and Publish an AI Flow
- Go to Projects > AI Flow > Create AI Flow.
- Optional: Click the Settings icon to configure AI Flow Settings as desired.
- Click Add New Agent to create an initial top-level AI Agent node, which will receive the customer interaction.
- Use the Prompt field to give this agent an objective, role, context, guidelines, and instructions on how to use the tools you give it access to in step 6.
- Once agent settings are configured, hover your cursor over the node to reveal the following options:

Agent nodes can be connected to tools and other agents - For each function you want this agent to be able to perform (e.g. external lookups, database updates, etc.), add a specialized tool or agent.
- Click + Tool to let the agent invoke a specific tool. See How to Configure Tools below.
- Click + Agent to let the agent call another AI Agent, either sequentially or as a subagent.
Note: To create a subagent, press + Agent, then enable Use as Tool and provide a Definition in the Create New Agent dialog.
- Repeat steps 5-6 to add nodes until the desired AI Flow is complete.
- Name this AI Flow using the field pre-filled with New AI Flow in the top left.
- Click the Save Draft button in the top right.
- Click Test AI Flow to debug the AI flow.
- Click the Publish Draft button in the top right to finalize your AI Flow and move it into the read-only Published state.
- When you are ready for external systems to use this AI Flow, enable the Live toggle switch in the top right corner.
How to Configure AI Agents
In the Prompt field, explicitly define a task or objective for the AI agent to complete during the customer interaction. This task or objective should not be overly restrictive. Be sure to account for any edge cases and define exception handling rules. You may also describe the expected conversation flow and specify the AI agent's identity (name, role, etc.). For more information, see How to Write a Prompt below.
The initial top-level node declares all input variables the AI Flow needs to receive. Click the Add Input Value button to declare variables that receive information from the scenario. For example, if a scenario discovers the customer's name and phone number before calling the AI Flow, it can pass the information to the AI agent for use in the prompt.
The final top-level node declares all return values. Click the Add Return Value button to define target information for the AI Agent to collect and return to the scenario that called it.
Multi-Agent Orchestration
Multi-agent orchestration allows AI agents to work dynamically in parallel to handle complex tasks. For example, the initial agent node in a complex AI Flow can greet the customer, learn their problem, and hand off the conversation summary to a relevant subagent with its own specific task (e.g. handling order returns). Once the subagent completes its task, it passes its return values along with the conversation summary back to the top-level AI Agent. From there, the top-level agent can delegate further customer inquiries to other specialized subagents, use other tools it has access to, or complete the interaction, as needed.
Subagents have many of the same fields as top-level agents, with a few distinctions.
- Below the Prompt field, enable the Agent as Tool toggle switch to designate this AI Agent a subagent.
- Enter a Definition for this subagent that describes its specific purpose, capabilities, and usage instructions. This definition provides context for the top-level AI Agent to determine when this subagent should be invoked, and must be specific enough to disambiguate it from other tools available to the same agent.
Each subagent declares any input values it needs to receive from its parent agent node, as well as any return values it passes back to the parent node upon its completion.
How to Write a Prompt
The prompt tells the AI Agent who it is, what it may answer, and how to format answers. Split it into named sections in the order below, so you can change one rule without breaking the others.
You may need to add further rules depending on the agent. For example, agents that perform knowledge searches may also need rules for query formation or article linking.
| Section | Rules | Example wording |
|---|---|---|
| Language handling | Default language; how to handle language switching, etc. | "Detect the language of the customer's message and respond entirely in that language. If it can't be determined, default to English." |
| Exception handling | No reply, off-topic, no results, errors | "If the customer asks a question unrelated to <Company>, apologize briefly and prompt them for a different question." |
| Disambiguation rules | What is/isn't ambiguous, how to resolve ambiguity | "When ambiguous, never list or summarize multiple interpretations. Ask one short question offering the options from the results, plus 'something else'. If results are still mixed, answer the best-matching topic. However, if the customer asks for an overview (e.g. "what APIs do you have?"), a summary across topics is fine." |
| Identity | Name, company, users, tone | "You are <Name>, an intelligent knowledge assistant for <Company>. Be friendly, polite and professional." |
| Conversation flow | Steps to follow in every interaction |
|
| Response format | Plain text vs HTML, grounding | "Format all knowledge-based answers in HTML using only h3, h4, p, ul, ol, li, strong, and b tags. Do not use Markdown." |
| Tool guidance | When to invoke each tool | "Questions about feature availability are best addressed by the Release Notes documents." |
| Feedback | Ask if the response helped | "End every knowledge-based answer with a feedback question in bold asking whether the answer resolved their question." |
General Tips
- Tell the AI Agent to search only when the user has asked a question. This avoids searches on greetings and "thanks".
- Add your business rules as one line each (e.g. "Mention policy exceptions when they apply").
- Keep a dated copy of every prompt version, and re-test the AI Flow after every change.
How to Configure Tools
In general, tool configuration is as follows:
- Hover your mouse over an AI Agent node, then click Tool.
- Select a tile from the Add New Tool dialog window.
- Give the tool instance a name, definition, and timeout period.
Note: For Tool Pipeline, the Timeout value applies to the entire tool sequence. - Configure tool-specific fields. For examples, see Custom API Tools, RAG Tools, and MCP Servers below.
- Optional: Enable intermediate prompts to reduce perceived latency during processing.
- Add tool inputs as desired.
- Click the Apply button.
Custom API Tools
- Use the Method drop-down menu to select the desired HTTP method.
- In the URL field, enter an absolute URL to the requested resource. The URL must return a JSON object.
- Under Query Parameters, click Add Parameter to add key-value pairs for use in the URL.
- Under Headers, click Add Headers to add custom HTTP request headers (e.g. X-Api-Key, User-Agent).
- Enable Authentication if the resource requires authentication. Your credentials are not shared with the LLM. Note: If the Authentication option is enabled, any authorization headers will be overwritten by the selected credentials.
- Select the desired credentials from the Authentication Type drop-down; or, to create new credentials, select Create New API Credential, then follow Add API Credentials.
RAG Tools
- Select a knowledge source from the Knowledge Source drop-down menu.
- If the selected knowledge source is indexed:
- Enter an integer between 1 and 100 into the Result Limit field to specify the maximum number of results to be returned.
- Enter a decimal between 0 and 1 into the Minimum Score field to specify the minimum relevance threshold for a result to be included. Results with higher scores are more semantically relevant to the AI query.
- Toggle the CRAG switch on to enable Corrective RAG, which reranks return results based on keyword matching.
- RAG tools take one input variable named search_query. If desired, click the Tool Input
sidebar icon, then use the Definition field to adjust the prompt (e.g. "An English-language keyword-focused query that encapsulates the customer's question").
MCP Servers
- Select the desired option from the MCP Server drop-down. Note: To add a new MCP server connection, select Create New MCP Server Connection, then follow the instructions at Add MCP Servers.
- Use the Tools checkboxes to select which functions the AI Flow can call (e.g. retrieving documents). Deselect any functions the AI Flow should not use (e.g. deleting users).
How to Test an AI Flow
The AI Flow Builder contains a debugging interface where you can interact with the AI Agent in real time via mock tool inputs and built-in chat functionality to understand how it reasons and what information it retrieves to support its decisions.

- Press the Test AI Flow button at the bottom of the AI Flow builder; alternatively, adjust test settings, then press the Run Test button inside the Test Settings dialog.
- Type in the Chat panel to interact with the AI Flow.
- Observe the Steps panel to see each step in the execution trace, as well as its corresponding name, timestamp, execution time, and token count. Hover your cursor over the circle icon to the left of the timestamp to view the AI model used for that step.
- Click on a step to view the JSON input and output data given to and returned by that AI Agent or tool.
Note: Enable the Verbose toggle at the top of the pane to view all technical details, or leave it disabled to view what the AI Agent can see. - Change AI Flow elements as needed, then use the Refresh button at the top right of the Chat panel to restart the interaction.
< Previous | Next >