n8n-io/n8n · error · NodeOperationError

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

Error message

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

What it means

Thrown by the Anthropic node router's switch default branch when the resource parameter does not match 'document', 'file', 'image', 'prompt', or 'text'. Note: despite the message saying 'operation', the switch is keyed on resource (anthropicTypeData.resource), making the message misleading — it fires when the resource is unrecognized, not the operation. The operation value is shown in the message but is the resource context that is actually invalid.

Source

Thrown at packages/@n8n/nodes-langchain/nodes/vendors/Anthropic/actions/router.ts:40

	let execute;
	switch (anthropicTypeData.resource) {
		case 'document':
			execute = document[anthropicTypeData.operation].execute;
			break;
		case 'file':
			execute = file[anthropicTypeData.operation].execute;
			break;
		case 'image':
			execute = image[anthropicTypeData.operation].execute;
			break;
		case 'prompt':
			execute = prompt[anthropicTypeData.operation].execute;
			break;
		case 'text':
			execute = text[anthropicTypeData.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. Open the Anthropic node in the editor and reselect the Resource dropdown — valid values are Document, File, Image, Prompt, or Text.
  2. Inspect the workflow JSON and verify the 'resource' parameter matches one of: 'document', 'file', 'image', 'prompt', 'text'.
  3. Delete and recreate the node if the UI cannot correct the parameter value.

Example fix

// before — resource value not matched by any case
// resource: 'chat'  (not supported)

// after — use a supported resource
// resource: 'text'
Defensive patterns

Strategy: validation

Validate before calling

const VALID_ANTHROPIC_RESOURCES = ['document', 'file', 'image', 'prompt', 'text'];
const resource = this.getNodeParameter('resource', 0) as string;
if (!VALID_ANTHROPIC_RESOURCES.includes(resource)) {
  throw new Error(`Invalid resource '${resource}'. Valid: ${VALID_ANTHROPIC_RESOURCES.join(', ')}`);
}

Type guard

function isValidAnthropicResource(r: string): r is 'document' | 'file' | 'image' | 'prompt' | 'text' {
  return ['document', 'file', 'image', 'prompt', 'text'].includes(r);
}

Prevention

When it happens

Trigger: The node's 'resource' parameter is set to any value other than 'document', 'file', 'image', 'prompt', or 'text'. The operation value in the message is actually the resource parameter value passed to the switch. This happens on node version changes that renamed resources, workflow JSON corruption, or programmatic workflow generation with invalid resource identifiers.

Common situations: Node upgraded/downgraded across a version that changed resource names; workflow imported from an incompatible node version; manual JSON editing introduced an invalid resource value; copy-paste from a different vendor node.

Related errors


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