n8n-io/n8n · error · Error

Attachment exceeds maximum size of ${formatMB(MAX_DECODED_SI

Error message

Attachment exceeds maximum size of ${formatMB(MAX_DECODED_SIZE_BYTES)} (got ${formatMB(actualBytes)})

What it means

Error "Attachment exceeds maximum size of ${formatMB(MAX_DECODED_SIZE_BYTES)} (got ${formatMB(actualBytes)})" thrown in n8n-io/n8n.

Source

Thrown at packages/@n8n/instance-ai/src/parsers/html-parser.ts:40

	querySelectorAll(selector: string): Iterable<StrippableElement>;
	body?: { innerHTML?: string };
}

/**
 * Extracts main content from an HTML/XHTML attachment.
 *
 * Pipeline:
 *   linkedom (`parseHTML`) → strip script/style → turndown (markdown)
 *
 * We avoid Readability here to keep the type surface small (no DOM typings
 * pulled in). The body content is converted directly to markdown.
 */
export async function extractHtmlContent(
	attachment: AttachmentInfo,
): Promise<HtmlExtractionResult> {
	const decoded = Buffer.from(attachment.data, 'base64');
	if (decoded.length > MAX_DECODED_SIZE_BYTES) {
		throw new Error(formatSizeLimitMessage(decoded.length));
	}

	const html = decoded.toString('utf-8');

	const linkedom = await import('linkedom');
	const TurndownModule = await import('turndown');
	const TurndownService = TurndownModule.default;

	const dom = linkedom.parseHTML(html) as { document: StrippableDocument };
	const htmlDocument: StrippableDocument = dom.document;

	const title = htmlDocument.querySelector('title')?.textContent?.trim() ?? undefined;

	for (const tag of STRIPPABLE_TAGS) {
		for (const el of Array.from(htmlDocument.querySelectorAll(tag))) {
			el.remove();
		}
	}

View on GitHub (pinned to 5ac6606e81)

When it happens

Trigger: Thrown at packages/@n8n/instance-ai/src/parsers/html-parser.ts:40 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/9b706af8f0c29d87. Report an issue: GitHub.