n8n-io/n8n · error · NodeOperationError

Please connect a model to the Fallback Model input or disabl

Error message

Please connect a model to the Fallback Model input or disable the fallback option

What it means

Thrown by Tools Agent V2 when needsFallback=true but the fallback model loader returned null. The primary model loaded fine (assert passed earlier), but getChatModel(this, 1) yielded nothing — no model is connected to the Fallback Model input.

Source

Thrown at packages/@n8n/nodes-langchain/nodes/agents/Agent/agents/ToolsAgent/V2/execute.ts:294

		// FIXME: remove when this is fixed: https://github.com/langchain-ai/langchainjs/pull/9082
		// Responses API + tools is broken when using langchain default call handling. In V3 calls are handled differently, so it works.
		if (checkIsResponsesApi(model)) {
			throw new NodeOperationError(
				this.getNode(),
				`This model is not supported in ${version} version of the Agent node. Please upgrade the Agent node to the latest version.`,
			);
		}

		if (checkIsResponsesApi(fallbackModel)) {
			throw new NodeOperationError(
				this.getNode(),
				`This fallback model is not supported in ${version} version of the Agent node. Please upgrade the Agent node to the latest version.`,
			);
		}

		if (needsFallback && !fallbackModel) {
			throw new NodeOperationError(
				this.getNode(),
				'Please connect a model to the Fallback Model input or disable the fallback option',
			);
		}

		// Check if streaming is enabled
		enableStreaming = this.getNodeParameter('options.enableStreaming', 0, true) as boolean;

		for (let i = 0; i < items.length; i += batchSize) {
			const batch = items.slice(i, i + batchSize);
			const batchPromises = batch.map(async (_item, batchItemIndex) => {
				const itemIndex = i + batchItemIndex;

				const input = getPromptInputByType({
					ctx: this,
					i: itemIndex,
					inputKey: 'text',
					promptTypeKey: 'promptType',

View on GitHub (pinned to 5ac6606e81)

Solutions

  1. Connect a chat model node to the Fallback Model input of the Agent.
  2. Or disable the 'needsFallback' option if no fallback is required.
  3. Verify the fallback model node executes without error in isolation.
Defensive patterns

Strategy: validation

Validate before calling

const needsFallback = this.getNodeParameter('needsFallback', 0, false) as boolean;
if (needsFallback) {
  const fb = await getChatModel(this, 1);
  if (!fb) {
    throw new NodeOperationError(this.getNode(), 'Fallback enabled but no model connected to the Fallback Model input.');
  }
}

Type guard

function isChatModel(model: unknown): model is BaseChatModel {
  return !!model && typeof (model as any).invoke === 'function';
}

Prevention

When it happens

Trigger: Tools Agent V2 with the 'Use Fallback Model' option enabled but no node wired to the Fallback Model input, or the connected node failed to produce a model.

Common situations: User toggled needsFallback during configuration and forgot to wire the second input; the fallback model node errored silently upstream; the model node was deleted but the option remained.

Related errors


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