n8n-io/n8n · error · NodeOperationError

Error executing tool: ${(error as Error).message}

Error message

Error executing tool: ${(error as Error).message}

What it means

Catch-all NodeOperationError thrown by the ToolExecutor node when executing the selected tool (single tool or tools within a toolkit) raises any exception. The for-loop over toolInputs and the per-tool executeTool calls are wrapped in try/catch; the catch re-throws with 'Error executing tool: <message>', normalizing arbitrary tool errors into a NodeOperationError.

Source

Thrown at packages/@n8n/nodes-langchain/nodes/ToolExecutor/ToolExecutor.node.ts:192

									metadata: buildResponseMetadata(response, 0),
								};
							}

							const result = await executeTool(toolkitTool, getQueryData(toolName) ?? {});
							resultData.push(result);
						}
					}
				} else {
					// Handle single tool
					if (!toolName || toolName === tool.name) {
						const toolInput = getQueryData(toolName || tool.name);
						const result = await executeTool(tool, toolInput ?? {});
						resultData.push(result);
					}
				}
			}
		} catch (error) {
			throw new NodeOperationError(
				this.getNode(),
				`Error executing tool: ${(error as Error).message}`,
			);
		}
		return [resultData];
	}
}

View on GitHub (pinned to 5ac6606e81)

Solutions

  1. Read the appended error.message to identify the underlying tool failure.
  2. Ensure the query arguments match the tool's input schema (field names and types).
  3. For API-backed tools, verify credentials, rate limits, and endpoint availability.
  4. Run the tool in isolation with the same arguments to reproduce, then fix the argument shape.
Defensive patterns

Strategy: try-catch

Validate before calling

// Validate arguments against the tool's schema before calling executeTool.

Try / catch

try {
  for (const tool of toolInputs) { ... await executeTool(tool, args); }
} catch (e) {
  if (e instanceof NodeOperationError && e.message.startsWith('Error executing tool:')) {
    // inspect suffix, decide retry vs skip vs fail item
  } else throw e;
}

Prevention

When it happens

Trigger: Any error thrown inside the tool execution loop (toolkit getTools, executeTool, schema conversion, the tool's own run) is caught and re-thrown. Fires when the underlying LangChain tool raises: bad arguments, upstream API failure, zod schema validation failure, permission errors.

Common situations: Tool arguments do not match its schema; the tool's backend API rejects the call (auth, rate limit, not found); a custom tool implementation throws; zod validation fails when converting a string input to the tool's ZodObject schema.

Related errors


AI-assisted analysis of n8n-io/n8n@5ac6606e81 (2026-08-12). Data as JSON: /api/errors/6d5608022790aee5. Report an issue: GitHub.