{"record":{"id":"f8f8de41e64b63b0","repo":"n8n-io/n8n","slug":"max-nodes-exceeded","errorCode":"MAX_NODES_EXCEEDED","errorMessage":"Workflow has ${count} ${displayName} nodes. Maximum allowed is ${maxNodes}.","messagePattern":"Workflow has (.+?) (.+?) nodes\\. Maximum allowed is (.+?)\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/@n8n/workflow-sdk/src/workflow-builder/plugins/validators/max-nodes-validator.ts","lineNumber":52,"sourceCode":"\t\t\tconst type = graphNode.instance.type;\n\t\t\tnodeCountByType.set(type, (nodeCountByType.get(type) ?? 0) + 1);\n\t\t}\n\n\t\t// Check each type against its maxNodes limit\n\t\tfor (const [type, count] of nodeCountByType) {\n\t\t\tif (count <= 1) continue;\n\n\t\t\tconst firstNode = [...ctx.nodes.values()].find((n) => n.instance.type === type);\n\t\t\tconst versionRaw = firstNode?.instance.version;\n\t\t\tconst version = parseVersion(versionRaw);\n\n\t\t\tconst nodeType = provider.getByNameAndVersion(type, version);\n\t\t\tconst maxNodes = nodeType?.description?.maxNodes;\n\n\t\t\tif (maxNodes !== undefined && count > maxNodes) {\n\t\t\t\tconst displayName = nodeType?.description?.displayName ?? type;\n\t\t\t\tissues.push({\n\t\t\t\t\tcode: 'MAX_NODES_EXCEEDED',\n\t\t\t\t\tmessage: `Workflow has ${count} ${displayName} nodes. Maximum allowed is ${maxNodes}.`,\n\t\t\t\t\tseverity: 'error',\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\treturn issues;\n\t},\n};\n","sourceCodeStart":34,"sourceCodeEnd":62,"githubUrl":"https://github.com/n8n-io/n8n/blob/5ac6606e81f67bb9534255570cd4e86fd8101eee/packages/@n8n/workflow-sdk/src/workflow-builder/plugins/validators/max-nodes-validator.ts#L34-L62","documentation":"Workflow-level validator: it counts nodes per type and compares against the node type's declared maxNodes limit. More instances of that node type exist than maxNodes allows (e.g. multiple Schedule Triggers where the type permits one), so the built workflow is rejected with the counts and the limit.","triggerScenarios":"Thrown at packages/@n8n/workflow-sdk/src/workflow-builder/plugins/validators/max-nodes-validator.ts:52 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Remove nodes of that type until the count is within maxNodes","Consolidate the duplicated functionality into fewer instances of the node type"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"5ac6606e81f67bb9534255570cd4e86fd8101eee","analyzedAt":"2026-08-12T05:26:35.080Z","contentChangedAt":"2026-08-12T05:26:35.080Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}