{"record":{"id":"ec1265cb079301b3","repo":"n8n-io/n8n","slug":"the-resource-resource-is-not-supported-ec1265","errorCode":null,"errorMessage":"The resource \"${resource}\" is not supported!","messagePattern":"The resource \"(.+?)\" is not supported!","errorType":"validation","errorClass":"NodeOperationError","httpStatus":null,"severity":"error","filePath":"packages/@n8n/nodes-langchain/nodes/vendors/Ollama/actions/router.ts","lineNumber":28,"sourceCode":"\tconst items = this.getInputData();\n\tconst resource = this.getNodeParameter('resource', 0);\n\tconst operation = this.getNodeParameter('operation', 0);\n\n\tconst ollamaTypeData = {\n\t\tresource,\n\t\toperation,\n\t} as OllamaType;\n\n\tlet execute;\n\tswitch (ollamaTypeData.resource) {\n\t\tcase 'image':\n\t\t\texecute = image[ollamaTypeData.operation].execute;\n\t\t\tbreak;\n\t\tcase 'text':\n\t\t\texecute = text[ollamaTypeData.operation].execute;\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tthrow new NodeOperationError(this.getNode(), `The resource \"${resource}\" is not supported!`);\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.apply(returnData, 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,\n\t\t\t});\n\t\t}\n\t}","sourceCodeStart":10,"sourceCodeEnd":46,"githubUrl":"https://github.com/n8n-io/n8n/blob/5ac6606e81f67bb9534255570cd4e86fd8101eee/packages/@n8n/nodes-langchain/nodes/vendors/Ollama/actions/router.ts#L10-L46","documentation":"Default branch of the Ollama router switch on the resource parameter. Supported values are image and text; any other value falls through to this throw. The UI enum normally makes this unreachable, but hand-edited workflow JSON, a stale node definition, or a renamed resource can land here. Note this router uses returnData.push.apply (spread) rather than push(...spread), but the throw shape matches the other vendor routers.","triggerScenarios":"Workflow JSON has resource set to a value not in {image, text}; node definition and router out of sync; corrupted/migrated workflow with a legacy or localized resource string; programmatic workflow injection with an invalid resource.","commonSituations":"Direct JSON editing; imported workflow from a different n8n version; localization leaked into the parameter; community fork renamed resources; running a workflow designed for a future Ollama resource not yet wired into the router.","solutions":["Open the node in the n8n UI and re-select the resource from the dropdown.","Inspect the workflow JSON's resource field and set it to 'image' or 'text'.","Update the Ollama node to the latest version so the router and enum agree.","After importing a workflow, remap the resource field to the current enum."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"const OLLAMA_RESOURCES = ['image', 'text'] as const;\ntype OllamaResource = typeof OLLAMA_RESOURCES[number];\nfunction isValidOllamaResource(r: unknown): r is OllamaResource {\n  return typeof r === 'string' && (OLLAMA_RESOURCES as readonly string[]).includes(r);\n}\n\nconst resource = this.getNodeParameter('resource', 0) as unknown;\nif (!isValidOllamaResource(resource)) {\n  throw new NodeOperationError(\n    this.getNode(),\n    `Resource '${String(resource)}' is invalid. Supported: ${OLLAMA_RESOURCES.join(', ')}.`,\n  );\n}","typeGuard":"function isOllamaResource(r: unknown): r is 'image' | 'text' {\n  return r === 'image' || r === 'text';\n}","tryCatchPattern":"// This is a programming/data error, not a transient one — do not retry.\n// Validate up front (see validationCode) so the user gets a clear message.","preventionTips":["Select resource from the node UI dropdown rather than editing JSON by hand.","After importing a workflow, re-select each Ollama node's resource to reset it to a valid enum value.","Keep the Ollama node updated so the UI enum and router switch stay in sync.","If forking the node, add new resources to both the parameter enum and the router switch in the same commit."],"tags":["ollama","router","resource","enum","workflow-json"],"backgroundTag":null,"analyzedSha":"5ac6606e81f67bb9534255570cd4e86fd8101eee","analyzedAt":"2026-08-12T05:26:35.080Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}