n8n-io/n8n · error · NodeNotFoundError
NODE_NOT_FOUND
NODE_NOT_FOUND
Error message
Node with ID "${nodeId}" not found in workflow What it means
Factory createNodeNotFoundError in helpers/validation.ts wraps a NodeNotFoundError instance. It is returned (not thrown) by helpers that resolve a node by identifier (ID or name) and find no match in workflow.nodes. Consumers report it via reporter.error and createErrorResponse.
Source
Thrown at packages/@n8n/ai-workflow-builder.ee/src/tools/helpers/validation.ts:100
details?: Record<string, string>,
): ToolError {
// Create the appropriate error instance for better tracking
const error = new ValidationError(message, { tags: { code, ...details } });
return {
message: error.message,
code,
details,
};
}
/**
* Create a node not found error
*/
export function createNodeNotFoundError(nodeIdentifier: string): ToolError {
const error = new NodeNotFoundError(nodeIdentifier);
return {
message: error.message,
code: 'NODE_NOT_FOUND',
details: { nodeIdentifier },
};
}
/**
* Create a node type not found error
*/
export function createNodeTypeNotFoundError(nodeTypeName: string): ToolError {
const error = new NodeTypeNotFoundError(nodeTypeName);
return {
message: error.message,
code: 'NODE_TYPE_NOT_FOUND',
details: { nodeTypeName },
};
}
/**
* Create a node parameter is too large errorView on GitHub (pinned to 5ac6606e81)
Solutions
- Call list_nodes to get the current set of IDs and names.
- Pass a currently-valid ID (preferred) or exact name.
- If the node was renamed, use the new name or re-resolve by ID.
Defensive patterns
Strategy: validation
Validate before calling
import { findNodeByIdOrName } from '@/tools/helpers/validation';
// Resolve before invoking the consuming tool.
const node = findNodeByIdOrName(identifier, workflow.nodes);
if (!node) { /* surface 'unknown identifier' to the agent, call list_nodes */ } Type guard
function isToolError(v: unknown): v is { message: string; code: string; details?: unknown } {
return typeof v === 'object' && v !== null && 'code' in v && 'message' in v;
} Try / catch
// NODE_NOT_FOUND is returned in the structured ToolError shape, not thrown.
const res = await someTool.invoke(input);
if (isToolError(res) && res.code === 'NODE_NOT_FOUND') {
const id = (res.details as any).nodeIdentifier;
// refresh node list and re-resolve
} Prevention
- Always resolve node IDs from a fresh list_nodes call at the start of a multi-step sequence.
- Reference nodes by stable ID (not name) to survive renames.
- Re-resolve identifiers after any add/delete/rename operation.
When it happens
Trigger: Any tool that calls validateNodeExists / findNodeByIdOrName and the identifier matches neither an ID nor a (case-insensitive) name.
Common situations: Stale node ID cached from a prior session; the node was renamed or deleted; typo in a name; wrong workflow loaded.
Related errors
AI-assisted analysis of n8n-io/n8n@5ac6606e81 (2026-08-12).
Data as JSON: /api/errors/ea50ffedfd60a794.
Report an issue: GitHub.