人在循環迴路中不適用於 N8N 聊天推論的工具調用

Describe the problem/error/question

I am trying to use a Human-in-the-loop setup with an n8n chat agent and a Google Sheets tool. However, the agent is not calling the Google Sheets tool with chat HITL node, even after I tried adjusting the system prompt. Does anyone have an idea of how to implement this, or any suggestions for what I should look at in my current setup? Thank you in advance!

Please share your workflow

Share the output returned by the last node

the other tools that connect to the agent is working perfectly fine except the google sheet one that connect to HITL node

The agent isn’t calling that tool for three fixable reasons, and they compound.

  1. Tool names with spaces and special characters. customer address checking, Append row in sheet in Google Sheets, and the Call ‘add_to_cart’ style names all hurt tool-calling. The model sees the node name as the tool name, and spaces plus quotes make it unreliable, especially on lighter models. Give every tool a clean, consistent name with no spaces or punctuation. Half your tools already do this (product_catalog_query, address_lookup), so match that: save_customer_address, confirm_address_with_customer, add_to_cart, view_cart, remove_from_cart.

  2. The prompt never names the address-save or confirmation step. Your system prompt walks through address_lookup and shipping, but it never tells the agent to call the confirmation/save tool at all. Models call tools far more reliably when the prompt names each tool explicitly and gives always/never rules and an ordered checkout sequence. I rewrote that section below.

  3. The model. Your active model is google/gemini-3-flash-preview on OpenRouter (your OpenAI and Gemini nodes aren’t connected to the agent, so they’re inert). Flash-tier models are weak at picking the right tool from a large set. Move to GPT-5 (not mini) or Sonnet 4.5/4.6. That alone usually fixes half of “the agent won’t call my tool.”

Two smaller things I noticed: your HITL message was {{ $tool.parameters.district }}, but the wrapped tool has no district field (it’s district_th), so the confirmation would render blank. I fixed it to show the full address. And once you’ve done the above, if the agent still won’t fire it, connect save_customer_address directly to the agent and drive the approval from the prompt as a fallback.

Here’s your workflow with the renames, the rewritten prompt, GPT-5 wired in, and the HITL message fixed. Import and reconnect your credentials:

另外,我看到這是你的第一篇貼文…歡迎!!@Theeranop_Laohade

@Theeranop_Laohade
唯一永遠不會觸發的工具是坐在人工審查包裝器後面的那個,所以應該查看的是包裝器,而不是代理的推理。打開你最後一次執行,點擊聊天模型子節點,閱讀其輸入:這就是模型收到的確切工具列表。如果 Google Sheets 工具不在該列表中,模型就從未有機會調用它,任何提示都無法改變這一點。
對於在聊天中確認自己地址的客戶,支援的方式是在代理上放置兩個簡單工具,而不是審查包裝器:

  1. 聊天節點連接為工具,操作「發送並等待回應」,回應類型「核准」。
  2. Google Sheets 工具直接連接到代理。
    代理用第一個工具請求確認,一旦客戶核准,就用第二個工具追加該行。這需要聊天觸發器的回應模式設為「使用回應節點」,而你已經有這個設置。將兩個工具都保留在主工作流中:聊天節點在子工作流內(包括用作代理工具的子工作流)無法運作,因此保存不能移到像你購物車那樣的「呼叫 n8n 工作流」工具中。
    Chat | Nodes | n8n Docs