- 简介
- 入门指南
- 使用 Maestro BPMN 进行构建
- 使用 Maestro Case 构建
- Maestro Case 简介
- Maestro BPMN 与 Maestro Case 对比:何时使用 Case Management
- Maestro 案例生命周期:从事件触发到应用体验
- 使用 Maestro Case 构建第一个案例
- Build a Maestro Case with a coding agent (preview)
- 定义案例键(系统键与外部键)
- 建立任务 I/O 与回写契约
- 退出规则和早期阶段终止
- 主阶段和次阶段建模
- 从 Data Fabric 触发案例
- 实施阶段级角色和权限
- 设置 SLA 和自动升级规则
- 配置返工循环(重新进入)
- Configuring and testing the Case Manager Agent (preview)
- 案例管理器输入和输出合同
- Maestro Case 组件字典
- 使用 Maestro Flow 进行构建
- 编排 AI 智能体
- 调用外部 API
- 处理收到的电子邮件
- 构建 Slack 通知工作流
- 向工作流添加人工审批
- Build a chat agent workflow
- 处理错误
- 集成
- 运营
- 监控
- 正在优化
- 参考信息
Build a real-time, AI-powered chat experience in Maestro Flow, including capabilities like output-based routing and agent handoff.
What you'll build: A conversational flow demonstrating how the core chat nodes can be used to orchestrate flexible chat experiences.
This walkthrough builds a chat experience consisting of a general helpdesk agent that decides when to hand a conversation off to an account specialist agent.
需要满足的条件
- 有权访问 Maestro Flow 的 UiPath Automation Cloud 帐户。
- 供智能体使用的可用 LLM 模型。
使用的节点
- Conversation Trigger: marks the Flow as conversational and starts it when a user initiates a chat.
- Wait for Message: suspends until the user sends a message and returns the latest conversation context.
- Conversational Agent: single-prompt conversational AI node that runs a turn of responses and tool-calls given the conversation context.
- Decision: routes on an agent's structured output.
- Send Message: send a deterministic (non-LLM) notice to the chat.
步骤
1. Create the Flow and add a Conversation Trigger
- From Studio Web, choose Create New, and and select Maestro Flow.
- Select the default trigger (labeled Manual Trigger) and choose Change trigger.
- In the trigger picker, select Conversation trigger.
2. Wait for the user's first message
Wait for Message should be the first node after the conversation trigger:
- Drag a Wait for Message node from the Conversational tools palette onto the canvas and connect it to the Conversation Trigger.
- In the properties panel, set Conversation ID to
$vars.conversationTrigger1.output.conversationId.
The node outputs conversationContext — the recent chat history, user profile data, and other turn information — for the downstream chat nodes to consume.
3. Add a conversational agent node
The first conversational agent node we'll add is a general helpdesk agent for handling everyday IT questions itself, and decides — via a structured output — when to hand off to a specialist.
-
Drag a Conversational Agent node onto the canvas and connect it to the Wait for Message.
-
Rename it General Helpdesk Agent, and rename its ID in the agent's Advanced panel to
generalHelpdeskAgentfor easier tracking. -
In the agent's properties panel, set the System prompt:
You are the internal IT helpdesk assistant. Answer everyday questions about our tools, wifi, printers, meeting rooms, and where to find internal docs. When the employee is having an account problem — a forgotten password, a locked account, an MFA issue, or a missing permission — tell the user that they will be handed off to an account specialist agent.You are the internal IT helpdesk assistant. Answer everyday questions about our tools, wifi, printers, meeting rooms, and where to find internal docs. When the employee is having an account problem — a forgotten password, a locked account, an MFA issue, or a missing permission — tell the user that they will be handed off to an account specialist agent. -
Under Conversational Agent Settings, bind Conversation context to
$vars.waitForMessage1.output.conversationContext. -
Under Outputs, add an output variable:
- 名称:
needsAccountSpecialist - Data type: Boolean
- Default:
false - 说明:
Set to true when the employee has an account problem — a forgotten password, a locked account, an MFA issue, or a missing permission. Otherwise false.
- 名称:
The Description on the output variable is necessary — the agent uses the description in addition to the system-prompt to generate the structured outputs after its turn in the conversation.
4. Branch on the router's decision
Follow the agent with a Decision node that routes on the structured output.
- Drag a Decision node onto the canvas and connect it to the General helpdesk agent.
- Set the condition:
$vars.generalHelpdeskAgent.output.needsAccountSpecialist. - Wire the False branch back to the original Wait for Message (Step 2). The general helpdesk agent keeps the conversation — it may hand off later, or never.
Leave the True branch open for now; you'll build it out in the next steps.
5. Announce the handoff
Tell the employee what's happening and ask them for next steps before the specialist takes over.
- On the True branch of the Decision, add a Send Message node. Configure:
- Conversation ID:
$vars.conversationTrigger1.output.conversationId - Exchange ID:
$vars.waitForMessage1.output.conversationContext.latestExchangeId - Content:
"You've been connected to the account specialist, which can help with password resets, unlocking your account, and permission or group membership questions. Please explain your issue."
- Conversation ID:
6. Add a second Wait for Message loop with the account specialist
-
After the Send Message, add another Wait for Message node.
-
Set Conversation ID to
$vars.conversationTrigger1.output.conversationId. -
Drag a Conversational Agent node and connect it to this second Wait for Message.
-
Optionally rename it Account Specialist Agent.
-
Set the System prompt:
You are the account specialist. The user has been handed off to you from a general helpdesk assistant. Help only with account problems — password resets, unlocking accounts, MFA re-enrollment, and permission or group membership questions.You are the account specialist. The user has been handed off to you from a general helpdesk assistant. Help only with account problems — password resets, unlocking accounts, MFA re-enrollment, and permission or group membership questions. -
Under Conversational Agent Settings, bind Conversation context to
$vars.waitForMessage2.output.conversationContext. -
Connect the Account specialist's output back to
waitForMessage2to close the specialist's loop.
When you have multiple Wait for Message nodes, you might accidentally configure a downstream node to reference a stale conversation context from a Wait for Message node that executed earlier.
For easier tracking, create a Flow-level variable (for example, $vars.globalConversationContext), and update it from each Wait for Message node's Update Variable section. Downstream nodes can then reference that single source of truth instead of needing to pick the last-executed Wait for Message node's output.
7. Debug the Flow
Select Debug in the top toolbar. A chat panel opens next to the canvas.
- Ask "How do I connect to my office VPN?" — the general helpdesk agent should answer directly and loop back for another turn.
- Ask "I'm having issues logging in." — the general helpdesk agent should set
needsAccountSpecialist: true, the Decision routes to the True branch, the handoff notice appears, and the account specialist takes over.
Inspect the execution trace to see which agent ran on each turn and what structured output the general helpdesk agent produced.
结果
Once published and deployed, your conversational Flow surfaces to end-users as a Conversational Agent on the chat deployment channels. Monitor its performance, metrics, and user feedback through chat agent observability.
Extend this Flow
- Give the agents context and tools: connect a context resource to the agent's Context handle so it answers from an indexed knowledge source instead of the model alone. Connect tool resources to the agent's Tools handle so it can act during its conversational turns, not just respond.
- Add parallel execution branches: In addition to routing back to Wait for Message, add parallel branches to perform behind-the-scenes actions without blocking the conversation. For example, a branch can launch a Human Task for a manager's approval, then proceed with other actions.
- End the chat when the issue is resolved: add a
resolved: trueoutput on the agent(s) that routes to a branch that ends the execution. The conversation ends gracefully and users will see that the conversation has ended.
For example, extending the walkthrough's Flow with the above capabilities may result in a complete chat experience like this:
- 需要满足的条件
- 使用的节点
- 步骤
- 1. Create the Flow and add a Conversation Trigger
- 2. Wait for the user's first message
- 3. Add a conversational agent node
- 4. Branch on the router's decision
- 5. Announce the handoff
- 6. Add a second Wait for Message loop with the account specialist
- 7. Debug the Flow
- 结果
- Extend this Flow