n8n - 💡(How to fix) Fix AgentToolV3: EngineRequest returned by sub-agent LLM tool calls is not handled, causes "not supported in Agents" error

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Error Message

Error: The Tool attempted to return an engine request, which is not supported in Agents

Root Cause

Root Cause (traced to source)

Fix Action

Workaround

Convert each AgentToolV3 sub-agent into a standalone n8n workflow called via a toolWorkflow node. Inside the standalone workflow, a regular AI Agent node handles EngineRequests correctly via the workflow engine's request/response cycle.

Code Example

Error: The Tool attempted to return an engine request, which is not supported in Agents

---

// packages/@n8n/nodes-langchain/.../ToolsAgent/V3/helpers/runAgent.ts
   const actions = createEngineRequests(result.toolCalls, itemIndex, tools);
   return { actions, ... }; // returns EngineRequest (has `actions` property)

---

} else if (isEngineRequest(result)) {
     response = 'Error: The Tool attempted to return an engine request, which is not supported in Agents';
   }

---

{ "response": "Error: The Tool attempted to return an engine request, which is not supported in Agents" }
RAW_BUFFERClick to expand / collapse

Bug Description

When an AgentToolV3 node (sub-agent) is used as a tool for a parent agent, and that sub-agent's LLM decides to call one of its own tools (e.g. a toolWorkflow node), the execution fails with:

Error: The Tool attempted to return an engine request, which is not supported in Agents

The sub-agent's tools are never called — the error occurs earlier, when the sub-agent's LLM response is passed back through makeHandleToolInvocation in the parent agent's context.

Root Cause (traced to source)

  1. Parent agent calls order-agent (AgentToolV3) via makeHandleToolInvocation
  2. makeHandleToolInvocation runs nodeType.execute?.call(context)toolsAgentExecute
  3. Inside runAgent.ts, the sub-agent's LLM decides to call a tool and executes:
    // packages/@n8n/nodes-langchain/.../ToolsAgent/V3/helpers/runAgent.ts
    const actions = createEngineRequests(result.toolCalls, itemIndex, tools);
    return { actions, ... }; // returns EngineRequest (has `actions` property)
  4. This EngineRequest propagates back to makeHandleToolInvocation in get-input-connection-data.ts:
    } else if (isEngineRequest(result)) {
      response = 'Error: The Tool attempted to return an engine request, which is not supported in Agents';
    }
  5. The error string is returned to the parent agent as the tool result. The sub-agent's tools are never invoked.

The EngineRequest mechanism works correctly when AgentToolV3 runs as a top-level workflow node (the workflow engine handles the request/response cycle). It breaks only when AgentToolV3 is invoked from within makeHandleToolInvocation's synchronous callback, which has no way to relay EngineRequests back to the engine.

Steps to Reproduce

  1. Create a workflow with:
    • A parent AI Agent node (manage-agent)
    • An AgentToolV3 node (order-agent) connected as a tool to manage-agent
    • One or more toolWorkflow nodes connected as tools to order-agent
  2. Trigger the parent agent with a message that causes it to call order-agent
  3. order-agent's LLM will try to call one of its own tools

Result: Error: The Tool attempted to return an engine request, which is not supported in Agents

Expected: order-agent completes its tool call loop and returns a final answer to manage-agent

Verified via Execution Data

Confirmed by inspecting SQLite execution data (execution_data table):

{ "response": "Error: The Tool attempted to return an engine request, which is not supported in Agents" }

The toolWorkflow sub-workflows are never startedisEngineRequest fires on the sub-agent's own LLM response, before any tool node runs.

Environment

  • n8n version: 2.21.4 (also verified identical code in 2.22.0 — not fixed)
  • Deployment: Docker (self-hosted)
  • Node type: @n8n/n8n-nodes-langchain.agentTool typeVersion 3

Related

  • PR #26389 proposes a fix (executeSubAgentTools / resolveSubAgentEngineRequests) but has not been merged as of 2.22.0
  • The issue exists for any tool type connected to AgentToolV3 that triggers an LLM tool call internally (not just MCP/Vector Store/HITL as listed in that PR)

Workaround

Convert each AgentToolV3 sub-agent into a standalone n8n workflow called via a toolWorkflow node. Inside the standalone workflow, a regular AI Agent node handles EngineRequests correctly via the workflow engine's request/response cycle.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING