Regression: Human Review approval does not execute the wrapped AI Tool in n8n 2.27.5, but works in 2.6.0

用户在 n8n 2.27.5 中搭建了 Human-in-the-Loop 工作流: Calculator AI Tool → Chat - Human Review 节点 → AI Agent 。AI Agent 使用 Ollama Chat Model 作为语言模型,触发器为 When chat

Regression: Human Review approval does not execute the wrapped AI Tool in n8n 2.27.5, but works in 2.6.0

Regression: Human Review approval does not execute the wrapped AI Tool in n8n 2.27.5, but works in 2.6.0

快速结论:在 n8n 2.27.5 版本中,当 Chat - Human Review 节点包裹 Calculator AI Tool 且用户点击 Approve 后,包装的 AI Tool 未被执行或其实结果未返回给 AI Agent,仅返回了 {approved: true}。此问题已在 n8n 2.32.0 版本中通过 PR #34271 修复。

问题场景

用户在 n8n 2.27.5 中搭建了 Human-in-the-Loop 工作流:Calculator AI Tool → Chat - Human Review 节点 → AI Agent。AI Agent 使用 Ollama Chat Model 作为语言模型,触发器为 When chat message received,响应模式设置为 Using Response Nodes。用户在聊天界面发送 TEST: 17+23 后,AI Agent 生成 Calculator 工具调用,Human Review 显示审批界面,但点击 Approve 后工具未正确执行。

报错原文

[
  {
    "data": {
      "approved": true
    }
  }
]

Instead of receiving the real Calculator result:

40

AI Agent 仅收到审批响应 {approved: true},而非真实工具结果 40,导致 Agent 可能重试直至达到最大迭代次数。

原因分析

根据 Issue 讨论和修复 PR #34271,此问题为 n8n 2.27.5 中的回归问题。可能原因是 Chat - Human Review 节点的工具包装器(tool wrapper)在工作流恢复(workflow resume)行为中存在缺陷,导致审批通过后未正确触发被包裹的 AI Tool 执行,或工具执行结果未被正确传递回 AI Agent。此问题在 n8n 2.6.0 中工作正常,表明是版本间的行为变化。

环境排查

  • 确认 n8n 版本:2.27.5(问题版本)、2.6.0(正常版本)、2.32.0(修复版本)
  • 确认工作流拓扑:CalculatorChat - Human ReviewAI Agent(通过 ai_tool 连接)
  • 确认 Chat - Human Review 节点设置:Approval TypeApprove and Disapprove
  • 确认 AI Agent 设置:Max Iterations 为 4,Return Intermediate Steps 启用
  • 确认 Chat Trigger 响应模式为 Using Response Nodes
  • 确认语言模型:Ollama Chat Model(但问题不限于特定模型)

解决步骤

  1. 验证当前 n8n 版本:检查 n8n 版本是否为 2.27.5 或更早的受影响版本。
  2. 升级 n8n:将 n8n 升级至 2.32.0 或更高版本,该版本包含 PR #34271 的修复。
  3. 重新部署并测试:升级后重新启动 n8n 实例,加载工作流并重新测试 Human-in-the-Loop 工具审批流程。

验证方法

在工作流中发送测试消息(如 TEST: 17+23),确认 AI Agent 生成 Calculator 工具调用,在 Human Review 节点点击 Approve 后,观察 AI Agent 是否收到真实工具结果(如 40)并生成正确响应(如 TOOL_APPROVED | result=40),而非仅收到 {approved: true} 或触发重试。如果响应包含 TOOL_APPROVED | result=实际计算结果,则表明问题已解决。

参考来源

n8n-io/n8n #34645

GamsGo AI

AI 工具推荐

想把多个 AI 模型放在一个入口?

GamsGo AI 集成 ChatGPT、DeepSeek、Gemini、Claude、Midjourney、Veo 等常用模型,适合写作、绘图、视频和日常 AI 工作流。

了解 GamsGo AI

推广链接:通过此链接购买,我可能获得佣金,不影响你的价格。

celebrityanime
celebrityanime
文章: 14712

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注