n8n-io/n8n · error · NodeOperationError

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

Error message

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

What it means

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.

Source

Thrown at packages/@n8n/nodes-langchain/nodes/vendors/Ollama/actions/router.ts:28

	const items = this.getInputData();
	const resource = this.getNodeParameter('resource', 0);
	const operation = this.getNodeParameter('operation', 0);

	const ollamaTypeData = {
		resource,
		operation,
	} as OllamaType;

	let execute;
	switch (ollamaTypeData.resource) {
		case 'image':
			execute = image[ollamaTypeData.operation].execute;
			break;
		case 'text':
			execute = text[ollamaTypeData.operation].execute;
			break;
		default:
			throw new NodeOperationError(this.getNode(), `The resource "${resource}" is not supported!`);
	}

	for (let i = 0; i < items.length; i++) {
		try {
			const responseData = await execute.call(this, i);
			returnData.push.apply(returnData, 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 node in the n8n UI and re-select the resource from the dropdown.
  2. Inspect the workflow JSON's resource field and set it to 'image' or 'text'.
  3. Update the Ollama node to the latest version so the router and enum agree.
  4. After importing a workflow, remap the resource field to the current enum.
Defensive patterns

Strategy: validation

Validate before calling

const OLLAMA_RESOURCES = ['image', 'text'] as const;
type OllamaResource = typeof OLLAMA_RESOURCES[number];
function isValidOllamaResource(r: unknown): r is OllamaResource {
  return typeof r === 'string' && (OLLAMA_RESOURCES as readonly string[]).includes(r);
}

const resource = this.getNodeParameter('resource', 0) as unknown;
if (!isValidOllamaResource(resource)) {
  throw new NodeOperationError(
    this.getNode(),
    `Resource '${String(resource)}' is invalid. Supported: ${OLLAMA_RESOURCES.join(', ')}.`,
  );
}

Type guard

function isOllamaResource(r: unknown): r is 'image' | 'text' {
  return r === 'image' || r === 'text';
}

Try / catch

// This is a programming/data error, not a transient one — do not retry.
// Validate up front (see validationCode) so the user gets a clear message.

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


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