n8n-io/n8n · warning · ParameterTooLargeError

NODE_PARAMETER_TOO_LARGE

NODE_PARAMETER_TOO_LARGE

Error message

Parameter value is too large to retrieve

What it means

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.

Source

Thrown at packages/@n8n/ai-workflow-builder.ee/src/tools/helpers/validation.ts:133

}

/**
 * Create a node parameter is too large error
 */
export function createNodeParameterTooLargeError(
	nodeId: string,
	parameter: string,
	maxSize: number,
): ToolError {
	const error = new ParameterTooLargeError('Parameter value is too large to retrieve', {
		parameter,
		nodeId,
		maxSize,
	});

	return {
		message: error.message,
		code: 'NODE_PARAMETER_TOO_LARGE',
		details: { nodeId, parameter, maxSize: maxSize.toString() },
	};
}

/**
 * Check if a workflow has nodes
 */
export function hasNodes(workflow: SimpleWorkflow): boolean {
	return workflow.nodes.length > 0;
}

View on GitHub (pinned to 5ac6606e81)

Solutions

  1. Reference the parameter via an expression ($json, $('Node').item) instead of materializing its raw value.
  2. Reduce the parameter size at the source node (limit response body, shorten code, externalize data).
  3. Stream or paginate the data rather than reading it whole.

Example fix

// before: read raw parameter (may exceed limit)
const value = node.parameters.bigBody;
// after: reference via expression in downstream node
// $('HTTP Request').item.json.body  // lazy, not materialized
Defensive patterns

Strategy: validation

Validate before calling

// Estimate serialized size before reading a parameter.
function estimateParamSize(node: INode, param: string): number {
  const v = (node.parameters as Record<string, unknown>)[param];
  return Buffer.byteLength(typeof v === 'string' ? v : JSON.stringify(v ?? ''), 'utf8');
}

if (estimateParamSize(node, 'body') > MAX_SIZE) { /* reference via expression instead */ }

Try / catch

const res = await getParameterTool.invoke(input);
if (isToolError(res) && res.code === 'NODE_PARAMETER_TOO_LARGE') {
  // switch strategy: read via expression or paginate
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


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