{"record":{"id":"9b706af8f0c29d87","repo":"n8n-io/n8n","slug":"attachment-exceeds-maximum-size-of-formatmb-max-9b706a","errorCode":null,"errorMessage":"Attachment exceeds maximum size of ${formatMB(MAX_DECODED_SIZE_BYTES)} (got ${formatMB(actualBytes)})","messagePattern":"Attachment exceeds maximum size of (.+?) \\(got (.+?)\\)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/@n8n/instance-ai/src/parsers/html-parser.ts","lineNumber":40,"sourceCode":"\tquerySelectorAll(selector: string): Iterable<StrippableElement>;\n\tbody?: { innerHTML?: string };\n}\n\n/**\n * Extracts main content from an HTML/XHTML attachment.\n *\n * Pipeline:\n *   linkedom (`parseHTML`) → strip script/style → turndown (markdown)\n *\n * We avoid Readability here to keep the type surface small (no DOM typings\n * pulled in). The body content is converted directly to markdown.\n */\nexport async function extractHtmlContent(\n\tattachment: AttachmentInfo,\n): Promise<HtmlExtractionResult> {\n\tconst decoded = Buffer.from(attachment.data, 'base64');\n\tif (decoded.length > MAX_DECODED_SIZE_BYTES) {\n\t\tthrow new Error(formatSizeLimitMessage(decoded.length));\n\t}\n\n\tconst html = decoded.toString('utf-8');\n\n\tconst linkedom = await import('linkedom');\n\tconst TurndownModule = await import('turndown');\n\tconst TurndownService = TurndownModule.default;\n\n\tconst dom = linkedom.parseHTML(html) as { document: StrippableDocument };\n\tconst htmlDocument: StrippableDocument = dom.document;\n\n\tconst title = htmlDocument.querySelector('title')?.textContent?.trim() ?? undefined;\n\n\tfor (const tag of STRIPPABLE_TAGS) {\n\t\tfor (const el of Array.from(htmlDocument.querySelectorAll(tag))) {\n\t\t\tel.remove();\n\t\t}\n\t}","sourceCodeStart":22,"sourceCodeEnd":58,"githubUrl":"https://github.com/n8n-io/n8n/blob/5ac6606e81f67bb9534255570cd4e86fd8101eee/packages/@n8n/instance-ai/src/parsers/html-parser.ts#L22-L58","documentation":"Error \"Attachment exceeds maximum size of ${formatMB(MAX_DECODED_SIZE_BYTES)} (got ${formatMB(actualBytes)})\" thrown in n8n-io/n8n.","triggerScenarios":"Thrown at packages/@n8n/instance-ai/src/parsers/html-parser.ts:40 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"5ac6606e81f67bb9534255570cd4e86fd8101eee","analyzedAt":"2026-08-12T05:26:35.080Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}