{"record":{"id":"5c0ba352f448f52c","repo":"n8n-io/n8n","slug":"node-parameter-too-large","errorCode":"NODE_PARAMETER_TOO_LARGE","errorMessage":"Parameter value is too large to retrieve","messagePattern":"Parameter value is too large to retrieve","errorType":"error_code","errorClass":"ParameterTooLargeError","httpStatus":null,"severity":"warning","filePath":"packages/@n8n/ai-workflow-builder.ee/src/tools/helpers/validation.ts","lineNumber":133,"sourceCode":"}\n\n/**\n * Create a node parameter is too large error\n */\nexport function createNodeParameterTooLargeError(\n\tnodeId: string,\n\tparameter: string,\n\tmaxSize: number,\n): ToolError {\n\tconst error = new ParameterTooLargeError('Parameter value is too large to retrieve', {\n\t\tparameter,\n\t\tnodeId,\n\t\tmaxSize,\n\t});\n\n\treturn {\n\t\tmessage: error.message,\n\t\tcode: 'NODE_PARAMETER_TOO_LARGE',\n\t\tdetails: { nodeId, parameter, maxSize: maxSize.toString() },\n\t};\n}\n\n/**\n * Check if a workflow has nodes\n */\nexport function hasNodes(workflow: SimpleWorkflow): boolean {\n\treturn workflow.nodes.length > 0;\n}\n","sourceCodeStart":115,"sourceCodeEnd":144,"githubUrl":"https://github.com/n8n-io/n8n/blob/5ac6606e81f67bb9534255570cd4e86fd8101eee/packages/@n8n/ai-workflow-builder.ee/src/tools/helpers/validation.ts#L115-L144","documentation":"Factory createNodeParameterTooLargeError wraps a ParameterTooLargeError with the literal message 'Parameter value is too large to retrieve'. It is returned when a parameter's serialized value exceeds the configured maxSize (in bytes), protecting tool-response size and LLM context windows from runaway parameter data.","triggerScenarios":"Reading a parameter whose value (e.g. HTTP Request body, Code node source, Set node JSON) exceeds maxSize bytes; binary/base64 blobs stored as a parameter value.","commonSituations":"HTTP Request node storing a large response body in a parameter; Code node with a very large script; Set node assigning a big JSON literal; version-upgrade migration that inflated a parameter.","solutions":["Reference the parameter via an expression ($json, $('Node').item) instead of materializing its raw value.","Reduce the parameter size at the source node (limit response body, shorten code, externalize data).","Stream or paginate the data rather than reading it whole."],"exampleFix":"// before: read raw parameter (may exceed limit)\nconst value = node.parameters.bigBody;\n// after: reference via expression in downstream node\n// $('HTTP Request').item.json.body  // lazy, not materialized","handlingStrategy":"validation","validationCode":"// Estimate serialized size before reading a parameter.\nfunction estimateParamSize(node: INode, param: string): number {\n  const v = (node.parameters as Record<string, unknown>)[param];\n  return Buffer.byteLength(typeof v === 'string' ? v : JSON.stringify(v ?? ''), 'utf8');\n}\n\nif (estimateParamSize(node, 'body') > MAX_SIZE) { /* reference via expression instead */ }","typeGuard":null,"tryCatchPattern":"const res = await getParameterTool.invoke(input);\nif (isToolError(res) && res.code === 'NODE_PARAMETER_TOO_LARGE') {\n  // switch strategy: read via expression or paginate\n}","preventionTips":["Prefer expression references ($('Node').item.json) over materializing large parameters.","Cap response bodies and code sizes at the source node configuration.","Stream or paginate large data into the workflow instead of embedding it in parameters."],"tags":["workflow-builder","parameters","limits","memory"],"backgroundTag":null,"analyzedSha":"5ac6606e81f67bb9534255570cd4e86fd8101eee","analyzedAt":"2026-08-12T05:26:35.080Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}