n8n-io/n8n · error · NodeOperationError

The operation "${operation}" is not supported!

Error message

The operation "${operation}" is not supported!

What it means

Default branch of the resource switch in the Google Gemini router. The switch keys on googleGeminiTypeData.resource (audio/document/file/fileSearch/image/text/video); any other value lands here. Note the message string is misleading — it interpolates the 'operation' variable even though it is the 'resource' that is unsupported, so the reported value is not the thing that failed.

Source

Thrown at packages/@n8n/nodes-langchain/nodes/vendors/GoogleGemini/actions/router.ts:48

			execute = document[googleGeminiTypeData.operation].execute;
			break;
		case 'file':
			execute = file[googleGeminiTypeData.operation].execute;
			break;
		case 'fileSearch':
			execute = fileSearch[googleGeminiTypeData.operation].execute;
			break;
		case 'image':
			execute = image[googleGeminiTypeData.operation].execute;
			break;
		case 'text':
			execute = text[googleGeminiTypeData.operation].execute;
			break;
		case 'video':
			execute = video[googleGeminiTypeData.operation].execute;
			break;
		default:
			throw new NodeOperationError(
				this.getNode(),
				`The operation "${operation}" is not supported!`,
			);
	}

	for (let i = 0; i < items.length; i++) {
		try {
			const responseData = await execute.call(this, i);
			returnData.push(...responseData);
		} catch (error) {
			if (this.continueOnFail()) {
				returnData.push({ json: { error: error.message }, pairedItem: { item: i } });
				continue;
			}

			throw new NodeOperationError(this.getNode(), error, {
				itemIndex: i,
				description: error.description,

View on GitHub (pinned to 5ac6606e81)

Solutions

  1. Re-open the node and pick a supported Resource from the dropdown (Audio, Document, File, File Search, Image, Text, Video).
  2. If the workflow came from another instance, upgrade n8n / the nodes-langchain package so its router recognises the new resource.
  3. Inspect the raw workflow JSON: ensure the 'resource' value matches one of the switch cases exactly (lowercase, no spaces).
  4. If an expression drives 'resource', bound it to an allowed-values check before this node runs.

Example fix

// before
const resource = 'codegen'; // unsupported

// after
const resource = 'text';
Defensive patterns

Strategy: validation

Validate before calling

const SUPPORTED_RESOURCES = ['audio','document','file','fileSearch','image','text','video'] as const;
const resource = this.getNodeParameter('resource', 0) as string;
if (!SUPPORTED_RESOURCES.includes(resource as never)) {
  throw new Error(`Unsupported resource: ${resource}. Must be one of ${SUPPORTED_RESOURCES.join(', ')}`);
}

Type guard

const SUPPORTED_RESOURCES = ['audio','document','file','fileSearch','image','text','video'] as const;
type GeminiResource = typeof SUPPORTED_RESOURCES[number];
function isGeminiResource(v: unknown): v is GeminiResource {
  return typeof v === 'string' && (SUPPORTED_RESOURCES as readonly string[]).includes(v);
}

Prevention

When it happens

Trigger: The resource parameter resolves to a value outside the known set: a future/renamed resource (e.g. 'code'), a value injected by an expression that returns undefined or a wrong-case string, or a stale workflow JSON whose resource enum was renamed in a newer node version.

Common situations: Loading a workflow exported from a newer n8n version whose Gemini node added a resource the current version doesn't know; hand-editing the workflow JSON and typo'ing the resource; an upstream expression feeding the resource field with unexpected input.

Related errors


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