n8n-io/n8n · error · UnsupportedAttachmentError

Unsupported attachment type: ${summary}

Error message

Unsupported attachment type: ${summary}

What it means

Thrown by validateAttachmentMimeTypes as an UnsupportedAttachmentError (validate-attachments.ts:87). Unlike the plain Error throws in the parser, this is a dedicated error class carrying .unsupported (the offending files) and .supported (the full allow-list) so HTTP/SSE layers can surface a typed response. Supported types are PARSEABLE_MIME_TYPES plus image/*.

Source

Thrown at packages/@n8n/instance-ai/src/parsers/validate-attachments.ts:87

		const summary = unsupported.map((u) => `${u.fileName} (${u.mimeType})`).join(', ');
		super(`Unsupported attachment type: ${summary}`);
		this.name = 'UnsupportedAttachmentError';
		this.unsupported = unsupported;
		this.supported = getSupportedAttachmentMimeTypes();
	}
}

/**
 * Validates every attachment's MIME type. Throws `UnsupportedAttachmentError`
 * with details for every offending attachment if any are unsupported.
 */
export function validateAttachmentMimeTypes(attachments: AttachmentInfo[]): void {
	const unsupported = attachments
		.filter((a) => !isSupportedAttachmentMimeType(a.mimeType))
		.map((a) => ({ fileName: a.fileName, mimeType: a.mimeType }));

	if (unsupported.length > 0) {
		throw new UnsupportedAttachmentError(unsupported);
	}
}

View on GitHub (pinned to 5ac6606e81)

Solutions

  1. Convert the file to a supported type (e.g. .doc -> .docx, .xls -> .xlsx).
  2. Set the correct mimeType on AttachmentInfo (see getSupportedAttachmentMimeTypes()).
  3. For images, ensure the mimeType starts with image/ so the wildcard match succeeds.
  4. Drop the unsupported attachment from the batch.

Example fix

// before: { fileName: 'report.doc', mimeType: 'application/msword', data }
// after:  { fileName: 'report.docx', mimeType: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', data }
Defensive patterns

Strategy: try-catch

Validate before calling

import { isSupportedAttachmentMimeType } from './validate-attachments';
const bad = attachments.filter(a => !isSupportedAttachmentMimeType(a.mimeType));
if (bad.length) throw new Error(`Unsupported mime types: ${bad.map(a => a.mimeType).join(', ')}`);

Type guard

import { isSupportedAttachmentMimeType } from './validate-attachments';
function isSupportedAttachment(a: { mimeType: string }): boolean {
  return isSupportedAttachmentMimeType(a.mimeType);
}

Try / catch

import { UnsupportedAttachmentError } from './validate-attachments';
try { validateAttachmentMimeTypes(attachments); }
catch (e) {
  if (e instanceof UnsupportedAttachmentError) {
    // e.unsupported lists offenders; e.supported lists allowed types; surface to user
  }
  throw e;
}

Prevention

When it happens

Trigger: Any attachment whose mimeType is not in PARSEABLE_MIME_TYPES and does not match an image/* wildcard. Validation runs over all attachments and collects every offender before throwing, so a single batch with two bad types lists both.

Common situations: Attaching a .doc (legacy Word) instead of .docx; an octet-stream mimeType with a generic filename; a video/audio file; a format the assistant cannot parse and that is not a vision image.

Related errors


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