n8n-io/n8n · error · NodeOperationError

The agent type "${agentType}" is not supported

Error message

The agent type "${agentType}" is not supported

What it means

Thrown by the Agent V1 node's execute dispatch when agentType does not match any of the supported branches (toolsAgent, openAiFunctionsAgent, reActAgent, sqlAgent, planAndExecuteAgent). It is the fall-through after the if/else-if chain, indicating an unknown or unsupported agent type value reached the dispatcher.

Source

Thrown at packages/@n8n/nodes-langchain/nodes/agents/Agent/V1/AgentV1.node.ts:488

	async execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]> {
		const agentType = this.getNodeParameter('agent', 0, '') as string;
		const nodeVersion = this.getNode().typeVersion;

		if (agentType === 'conversationalAgent') {
			return await conversationalAgentExecute.call(this, nodeVersion);
		} else if (agentType === 'toolsAgent') {
			return await toolsAgentExecute.call(this);
		} else if (agentType === 'openAiFunctionsAgent') {
			return await openAiFunctionsAgentExecute.call(this, nodeVersion);
		} else if (agentType === 'reActAgent') {
			return await reActAgentAgentExecute.call(this, nodeVersion);
		} else if (agentType === 'sqlAgent') {
			return await sqlAgentAgentExecute.call(this);
		} else if (agentType === 'planAndExecuteAgent') {
			return await planAndExecuteAgentExecute.call(this, nodeVersion);
		}

		throw new NodeOperationError(this.getNode(), `The agent type "${agentType}" is not supported`);
	}
}

View on GitHub (pinned to 5ac6606e81)

Solutions

  1. Set agentType to one of the supported values: toolsAgent, openAiFunctionsAgent, reActAgent, sqlAgent, or planAndExecuteAgent.
  2. If migrating from another version, map the old agentType to the closest supported one.
  3. Re-create the node through the UI so the parameter is set from the valid dropdown.

Example fix

// before: parameters.agentType = 'conversationalAgent'  // not in V1 dispatch
// after: parameters.agentType = 'toolsAgent'
Defensive patterns

Strategy: validation

Validate before calling

const SUPPORTED = ['toolsAgent','openAiFunctionsAgent','reActAgent','sqlAgent','planAndExecuteAgent'];
if (!SUPPORTED.includes(agentType)) throw new Error(`Unsupported agentType: ${agentType}`);

Type guard

function isSupportedAgentType(t): t is 'toolsAgent'|'openAiFunctionsAgent'|'reActAgent'|'sqlAgent'|'planAndExecuteAgent' {
  return ['toolsAgent','openAiFunctionsAgent','reActAgent','sqlAgent','planAndExecuteAgent'].includes(t);
}

Prevention

When it happens

Trigger: agentType is read from parameters and compared against known string literals in an if/else-if chain; none match, so execution reaches the final throw. Fires when agentType is a typo, an unsupported value, a value from a newer/older version, or a custom value injected via edited JSON.

Common situations: Workflow JSON edited by hand with an invalid agentType; downgrade/upgrade mismatch where a previously valid agentType was removed; third-party or custom agent type not registered in this version of the node.

Related errors


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