{"record":{"id":"ea50ffedfd60a794","repo":"n8n-io/n8n","slug":"node-not-found","errorCode":"NODE_NOT_FOUND","errorMessage":"Node with ID \"${nodeId}\" not found in workflow","messagePattern":"Node with ID \"(.+?)\" not found in workflow","errorType":"error_code","errorClass":"NodeNotFoundError","httpStatus":null,"severity":"error","filePath":"packages/@n8n/ai-workflow-builder.ee/src/tools/helpers/validation.ts","lineNumber":100,"sourceCode":"\tdetails?: Record<string, string>,\n): ToolError {\n\t// Create the appropriate error instance for better tracking\n\tconst error = new ValidationError(message, { tags: { code, ...details } });\n\treturn {\n\t\tmessage: error.message,\n\t\tcode,\n\t\tdetails,\n\t};\n}\n\n/**\n * Create a node not found error\n */\nexport function createNodeNotFoundError(nodeIdentifier: string): ToolError {\n\tconst error = new NodeNotFoundError(nodeIdentifier);\n\treturn {\n\t\tmessage: error.message,\n\t\tcode: 'NODE_NOT_FOUND',\n\t\tdetails: { nodeIdentifier },\n\t};\n}\n\n/**\n * Create a node type not found error\n */\nexport function createNodeTypeNotFoundError(nodeTypeName: string): ToolError {\n\tconst error = new NodeTypeNotFoundError(nodeTypeName);\n\treturn {\n\t\tmessage: error.message,\n\t\tcode: 'NODE_TYPE_NOT_FOUND',\n\t\tdetails: { nodeTypeName },\n\t};\n}\n\n/**\n * Create a node parameter is too large error","sourceCodeStart":82,"sourceCodeEnd":118,"githubUrl":"https://github.com/n8n-io/n8n/blob/5ac6606e81f67bb9534255570cd4e86fd8101eee/packages/@n8n/ai-workflow-builder.ee/src/tools/helpers/validation.ts#L82-L118","documentation":"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.","triggerScenarios":"Any tool that calls validateNodeExists / findNodeByIdOrName and the identifier matches neither an ID nor a (case-insensitive) name.","commonSituations":"Stale node ID cached from a prior session; the node was renamed or deleted; typo in a name; wrong workflow loaded.","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."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"import { findNodeByIdOrName } from '@/tools/helpers/validation';\n\n// Resolve before invoking the consuming tool.\nconst node = findNodeByIdOrName(identifier, workflow.nodes);\nif (!node) { /* surface 'unknown identifier' to the agent, call list_nodes */ }","typeGuard":"function isToolError(v: unknown): v is { message: string; code: string; details?: unknown } {\n  return typeof v === 'object' && v !== null && 'code' in v && 'message' in v;\n}","tryCatchPattern":"// NODE_NOT_FOUND is returned in the structured ToolError shape, not thrown.\nconst res = await someTool.invoke(input);\nif (isToolError(res) && res.code === 'NODE_NOT_FOUND') {\n  const id = (res.details as any).nodeIdentifier;\n  // refresh node list and re-resolve\n}","preventionTips":["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."],"tags":["workflow-builder","nodes","validation","lookup"],"backgroundTag":null,"analyzedSha":"5ac6606e81f67bb9534255570cd4e86fd8101eee","analyzedAt":"2026-08-12T05:26:35.080Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}