{"record":{"id":"bcebfb43973f35ce","repo":"n8n-io/n8n","slug":"the-operation-operation-is-not-supported","errorCode":null,"errorMessage":"The operation \"${operation}\" is not supported!","messagePattern":"The operation \"(.+?)\" is not supported!","errorType":"exception","errorClass":"NodeOperationError","httpStatus":null,"severity":"error","filePath":"packages/@n8n/nodes-langchain/nodes/vendors/Anthropic/actions/router.ts","lineNumber":40,"sourceCode":"\tlet execute;\n\tswitch (anthropicTypeData.resource) {\n\t\tcase 'document':\n\t\t\texecute = document[anthropicTypeData.operation].execute;\n\t\t\tbreak;\n\t\tcase 'file':\n\t\t\texecute = file[anthropicTypeData.operation].execute;\n\t\t\tbreak;\n\t\tcase 'image':\n\t\t\texecute = image[anthropicTypeData.operation].execute;\n\t\t\tbreak;\n\t\tcase 'prompt':\n\t\t\texecute = prompt[anthropicTypeData.operation].execute;\n\t\t\tbreak;\n\t\tcase 'text':\n\t\t\texecute = text[anthropicTypeData.operation].execute;\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tthrow new NodeOperationError(\n\t\t\t\tthis.getNode(),\n\t\t\t\t`The operation \"${operation}\" is not supported!`,\n\t\t\t);\n\t}\n\n\tfor (let i = 0; i < items.length; i++) {\n\t\ttry {\n\t\t\tconst responseData = await execute.call(this, i);\n\t\t\treturnData.push(...responseData);\n\t\t} catch (error) {\n\t\t\tif (this.continueOnFail()) {\n\t\t\t\treturnData.push({ json: { error: error.message }, pairedItem: { item: i } });\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tthrow new NodeOperationError(this.getNode(), error, {\n\t\t\t\titemIndex: i,\n\t\t\t\tdescription: error.description,","sourceCodeStart":22,"sourceCodeEnd":58,"githubUrl":"https://github.com/n8n-io/n8n/blob/5ac6606e81f67bb9534255570cd4e86fd8101eee/packages/@n8n/nodes-langchain/nodes/vendors/Anthropic/actions/router.ts#L22-L58","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Open the Anthropic node in the editor and reselect the Resource dropdown — valid values are Document, File, Image, Prompt, or Text.","Inspect the workflow JSON and verify the 'resource' parameter matches one of: 'document', 'file', 'image', 'prompt', 'text'.","Delete and recreate the node if the UI cannot correct the parameter value."],"exampleFix":"// before — resource value not matched by any case\n// resource: 'chat'  (not supported)\n\n// after — use a supported resource\n// resource: 'text'","handlingStrategy":"validation","validationCode":"const VALID_ANTHROPIC_RESOURCES = ['document', 'file', 'image', 'prompt', 'text'];\nconst resource = this.getNodeParameter('resource', 0) as string;\nif (!VALID_ANTHROPIC_RESOURCES.includes(resource)) {\n  throw new Error(`Invalid resource '${resource}'. Valid: ${VALID_ANTHROPIC_RESOURCES.join(', ')}`);\n}","typeGuard":"function isValidAnthropicResource(r: string): r is 'document' | 'file' | 'image' | 'prompt' | 'text' {\n  return ['document', 'file', 'image', 'prompt', 'text'].includes(r);\n}","tryCatchPattern":null,"preventionTips":["Always select the resource through the node's Resource dropdown UI.","Avoid manually editing the resource field in the workflow JSON.","After importing workflows, verify Anthropic node resource values are valid before executing.","When upgrading the Anthropic node version, check for renamed resources."],"tags":["configuration","node-parameters","router","anthropic"],"backgroundTag":null,"analyzedSha":"5ac6606e81f67bb9534255570cd4e86fd8101eee","analyzedAt":"2026-08-12T05:26:35.080Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}