聊天节点(Chat node)#
将聊天节点与 聊天触发器 节点配合使用,可向聊天中发送消息,并可选择等待用户的响应。这使得在聊天工作流中实现人工介入(HITL)案例成为可能,让你在一次执行中进行多个聊天互动。聊天节点也可作为 AI 代理的工具使用。
🌐 Use the Chat node with the Chat Trigger node to send messages into the chat and optionally wait for responses from users. This enables human-in-the-loop (HITL) use cases in chat workflows, allowing you to have multiple chat interactions within a single execution. The Chat node also works as a tool for AI Agents.
所有功能都适用于嵌入式和托管的聊天界面。
🌐 All features work with both embedded and hosted chat interfaces.
聊天触发节点
聊天节点需要在工作流中存在一个 Chat Trigger 节点,并且 Response Mode 设置为“使用响应节点”。
以前的版本
在以前的版本中,这个节点被称为“响应聊天”,并使用单个“等待用户回复”开关。该功能现已重新组织为两个独立的操作,并增加了响应类型。
节点参数(Node parameters)#
This node can be used as an AI tool
This node can be used to enhance the capabilities of an AI agent. When used in this way, many parameters can be set automatically, or with information directed by AI - find out more in the AI tool parameters documentation.
Human-in-the-loop for AI tool calls
This node can be used as a human review step for AI Agent tool calls. When configured this way, the AI Agent will pause and request human approval through this service before executing tools that require oversight. Learn more in Human-in-the-loop for AI tool calls.
使用以下参数配置此节点。
🌐 Configure this node using the following parameters.
操作(Operation)#
聊天节点支持以下操作:
🌐 The Chat node supports the following operations:
- 发送消息:向聊天发送消息。发送后,工作流执行将立即继续。
- 发送并等待响应:向聊天发送消息并等待用户的回复。此操作会暂停工作流的执行,直到用户提交响应。
选择发送并等待响应会激活额外的参数和选项,如等待响应中所述。
🌐 Choosing Send and Wait for Response activates additional parameters and options as discussed in waiting for a response.
消息(Message)#
要发送到聊天的信息。此参数可用于两个操作。
🌐 The message to send to the chat. This parameter is available for both operations.
节点选项(Node options)#
使用这些选项来进一步优化节点的行为。
🌐 Use these Options to further refine the node's behavior.
添加内存输入连接(Add Memory Input Connection)#
选择是否将来自聊天节点的消息提交到连接的记忆中。在代理或链的根节点与聊天节点之间使用共享记忆会将相同的会话密钥附加到这些消息上,并允许你捕获完整的消息历史记录。
🌐 Choose whether you want to commit the messages from the Chat node to a connected memory. Using a shared memory between an agent or chain root node and the Chat node attaches the same session key to these messages and lets you capture the full message history.
等待响应(Waiting for a response)#
通过选择发送并等待响应操作,你可以发送消息并暂停工作流执行,直到有人回复。这使得在单次执行中实现多轮对话和审批工作流成为可能。
🌐 By choosing the Send and Wait for Response operation, you can send a message and pause the workflow execution until a person responds. This enables multi-turn conversations and approval workflows within a single execution.
响应类型(Response Type)#
你可以在以下类型的回应中进行选择:
🌐 You can choose between the following types of responses:
- 自由文本:用户可以在聊天中输入任何回应。这与之前的“等待用户回复”选项的行为相同。
- 批准:用户可以使用消息中的内联按钮进行同意或不同意。你也可以选择允许用户输入自定义回复。
根据你选择的类型,可用的参数和选项会有所不同。
🌐 Different parameters and options are available depending on which type you choose.
自由文本参数和选项(Free Text parameters and options)#
使用自由文本响应类型时,用户可以输入任何消息作为他们的响应。
🌐 When using the Free Text response type, the user can type any message as their response.
使用案例:
- 开放性问题
- 收集详细反馈
- 请求特定信息
选项:
- 限制等待时间:工作流是否在指定的时间限制后自动恢复执行。这可以是一个时间间隔或一个具体的实时时间。
审批参数和选项(Approval parameters and options)#
使用“审批”响应类型时,消息会显示内联按钮,用户可以点击这些按钮进行批准或拒绝。此响应类型遵循 n8n 中其他人工干预(HITL)节点的相同模式。
🌐 When using the Approval response type, the message displays inline buttons that users can click to approve or disapprove. This response type follows the same pattern as other human-in-the-loop (HITL) nodes in n8n.
使用案例:
- 简单的是/否决策
- 审批工作流
- 确认
使用“批准”响应类型时,可使用以下参数:
🌐 When using the Approval response type, the following parameters are available:
- 批准类型:是仅显示批准按钮,还是同时显示批准和拒绝按钮。
- 仅批准:显示一个批准按钮
- 批准与拒绝:显示两个按钮(默认)
- 批准按钮标签:显示在批准按钮上的文本。默认值:
Approve - 不批准按钮标签:显示在不批准按钮上的文字(仅在审批类型为“批准和不批准”时显示)。默认值:
Disapprove - 阻止用户输入:是否阻止用户输入自定义消息(启用)或允许他们输入回复(禁用,默认)。
- 当禁用(默认)时:用户可以点击按钮或输入自定义消息。输入的消息将被视为带有自定义消息的反对意见。
- 当启用时:用户只能使用按钮进行互动。
批准响应类型还提供以下选项:
🌐 The Approval response type also offers the following option:
- 限制等待时间:工作流是否在指定的时间限制后自动恢复执行。这可以是一个时间间隔或一个具体的实时时间。
相关资源(Related resources)#
View n8n's Advanced AI documentation.
有关设置聊天界面的信息,请参阅 Chat Trigger 节点文档。
🌐 Refer to the Chat Trigger node documentation for information about setting up the chat interface.
模板和示例(Templates and examples)#
常见问题(Common issues)#
- 当聊天节点作为子代理的工具使用时,它不起作用。
- 当在子工作流中使用时,聊天节点无法工作。这包括在作为 AI 代理工具使用的子工作流中的使用。
- 确保聊天触发节点的响应模式设置为“使用响应节点”,以使聊天节点正常工作。
有关 Chat Trigger 节点的常见问题或问题,请参阅 常见 Chat Trigger 节点问题。
🌐 For common questions or issues with the Chat Trigger node, refer to Common Chat Trigger Node Issues.