n8n-io/n8n · error · NodeNotFoundError

NODES_NOT_FOUND

NODES_NOT_FOUND

Error message

Node with ID "${nodeId}" not found in workflow

What it means

Error "Node with ID "${nodeId}" not found in workflow" thrown in n8n-io/n8n.

Source

Thrown at packages/@n8n/ai-workflow-builder.ee/src/tools/connect-nodes.tool.ts:97

				const state = getWorkflowState();
				const workflow = getCurrentWorkflow(state);

				// Report progress
				reportProgress(reporter, 'Finding nodes to connect...');

				// Find source and target nodes
				let matchedSourceNode = validateNodeExists(validatedInput.sourceNodeId, workflow.nodes);
				let matchedTargetNode = validateNodeExists(validatedInput.targetNodeId, workflow.nodes);

				// Check if both nodes exist
				if (!matchedSourceNode || !matchedTargetNode) {
					const missingNodeId = !matchedSourceNode
						? validatedInput.sourceNodeId
						: validatedInput.targetNodeId;
					const nodeError = new NodeNotFoundError(missingNodeId);
					const error = {
						message: nodeError.message,
						code: 'NODES_NOT_FOUND',
						details: {
							sourceNodeId: validatedInput.sourceNodeId,
							targetNodeId: validatedInput.targetNodeId,
							foundSource: !!matchedSourceNode,
							foundTarget: !!matchedTargetNode,
						},
					};
					reporter.error(error);
					return createErrorResponse(config, error);
				}

				// Find node type descriptions
				const sourceNodeType = nodeTypes.find((nt) => nt.name === matchedSourceNode!.type);
				const targetNodeType = nodeTypes.find((nt) => nt.name === matchedTargetNode!.type);

				if (!sourceNodeType || !targetNodeType) {
					const missingType = !sourceNodeType ? matchedSourceNode.type : matchedTargetNode.type;
					const typeError = new NodeTypeNotFoundError(missingType);

View on GitHub (pinned to 5ac6606e81)

When it happens

Trigger: Thrown at packages/@n8n/ai-workflow-builder.ee/src/tools/connect-nodes.tool.ts:97 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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