{"record":{"id":"c638f028d1d5def3","repo":"n8n-io/n8n","slug":"the-operation-operation-is-not-supported-for","errorCode":null,"errorMessage":"The operation \"${operation}\" is not supported for resource \"${resource}\"","messagePattern":"The operation \"(.+?)\" is not supported for resource \"(.+?)\"","errorType":"exception","errorClass":"NodeOperationError","httpStatus":null,"severity":"error","filePath":"packages/@n8n/nodes-langchain/nodes/vendors/AlibabaCloud/actions/router.ts","lineNumber":23,"sourceCode":"import * as image from './image';\nimport * as video from './video';\n\nexport async function router(this: IExecuteFunctions): Promise<INodeExecutionData[][]> {\n\tconst items = this.getInputData();\n\tconst returnData: INodeExecutionData[] = [];\n\n\tconst resource = this.getNodeParameter('resource', 0) as string;\n\tconst operation = this.getNodeParameter('operation', 0) as string;\n\n\tlet execute;\n\tswitch (resource) {\n\t\tcase 'text':\n\t\t\tswitch (operation) {\n\t\t\t\tcase 'message':\n\t\t\t\t\texecute = text.message.execute;\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new NodeOperationError(\n\t\t\t\t\t\tthis.getNode(),\n\t\t\t\t\t\t`The operation \"${operation}\" is not supported for resource \"${resource}\"`,\n\t\t\t\t\t);\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 'image':\n\t\t\tswitch (operation) {\n\t\t\t\tcase 'analyze':\n\t\t\t\t\texecute = image.analyze.execute;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'generate':\n\t\t\t\t\texecute = image.generate.execute;\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new NodeOperationError(\n\t\t\t\t\t\tthis.getNode(),\n\t\t\t\t\t\t`The operation \"${operation}\" is not supported for resource \"${resource}\"`,\n\t\t\t\t\t);","sourceCodeStart":5,"sourceCodeEnd":41,"githubUrl":"https://github.com/n8n-io/n8n/blob/5ac6606e81f67bb9534255570cd4e86fd8101eee/packages/@n8n/nodes-langchain/nodes/vendors/AlibabaCloud/actions/router.ts#L5-L41","documentation":"Thrown by the AlibabaCloud (Bailian/Tongyi) router when the selected operation is not valid for the selected resource. The router dispatches resource (text/image/video) to a nested operation switch; each resource only accepts a fixed set of operations (text→message; image→analyze|generate; video→textToVideo|imageToVideo). Any other operation hits the nested default and throws.","triggerScenarios":"resource + operation pair is invalid, e.g. resource='text' with operation='generate', or resource='video' with operation='message'. Can also occur if parameters are loaded from a saved workflow where the operation was renamed/removed in a newer node version, or when operation/resource are set via expression to values the switch does not handle.","commonSituations":"Saved workflow using an operation removed/renamed in a node update; expression-driven resource/operation resolving to an unsupported value; manual JSON edit of the node parameters producing an invalid pair; partial copy-paste of node config.","solutions":["Re-open the node and pick a valid operation for the chosen resource (text: message; image: analyze|generate; video: textToVideo|imageToVideo).","If the workflow is old, recreate the AlibabaCloud node from scratch to get the current operation list.","If resource/operation come from expressions, ensure they resolve to one of the supported string values.","Update n8n/nodes-langchain so the node definition matches the parameters saved in the workflow."],"exampleFix":"// before: resource = 'text', operation = 'generate'  (invalid)\n// after:  resource = 'image', operation = 'generate'   (valid pair)","handlingStrategy":"validation","validationCode":"const VALID: Record<string, Set<string>> = { text: new Set(['message']), image: new Set(['analyze','generate']), video: new Set(['textToVideo','imageToVideo']) }; if (!VALID[resource]?.has(operation)) { throw new Error(`Invalid pair: resource='${resource}' operation='${operation}'`); }","typeGuard":"function isValidPair(resource: string, operation: string): boolean { const m: Record<string, readonly string[]> = { text: ['message'], image: ['analyze','generate'], video: ['textToVideo','imageToVideo'] }; return !!m[resource] && m[resource].includes(operation); }","tryCatchPattern":"try { await router.call(this) } catch (e) { if (/is not supported for resource/.test(e.message)) { /* reset operation to a valid one for the resource */ } else throw e; }","preventionTips":["Drive resource/operation from the node's own option lists, not free text.","When loading saved workflows, migrate removed/renamed operations to current ones.","If these come from expressions, validate them against the VALID map before dispatch.","Add a regression test that exercises each (resource, operation) pair."],"tags":["alibaba-cloud","router","config","operation","validation"],"backgroundTag":null,"analyzedSha":"5ac6606e81f67bb9534255570cd4e86fd8101eee","analyzedAt":"2026-08-12T05:26:35.080Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}