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 processItem in the Basic LLM Chain when needsFallback is true (the user enabled 'Use Fallback Model') but getChatModel(ctx, 1) returned null — meaning no LLM is connected to the secondary 'Fallback Model' AI input. The chain cannot fall back without a fallback model.
Source
Thrown at packages/@n8n/nodes-langchain/nodes/chains/ChainLLM/methods/processItem.ts:40
}
// We get the models in reversed order from the workflow so we need to reverse them again to match the right index
const reversedModels = [...connectedModels].reverse();
model = reversedModels[index] as BaseLanguageModel;
} else {
model = connectedModels as BaseLanguageModel;
}
return model;
}
export const processItem = async (ctx: IExecuteFunctions, itemIndex: number) => {
const needsFallback = ctx.getNodeParameter('needsFallback', 0, false) as boolean;
const llm = await getChatModel(ctx, 0);
assert(llm, 'Please connect a model to the Chat Model input');
const fallbackLlm = needsFallback ? await getChatModel(ctx, 1) : null;
if (needsFallback && !fallbackLlm) {
throw new NodeOperationError(
ctx.getNode(),
'Please connect a model to the Fallback Model input or disable the fallback option',
);
}
// Get output parser if configured
const outputParser = await getOptionalOutputParser(ctx, itemIndex);
// Get user prompt based on node version
let prompt: string;
if (ctx.getNode().typeVersion <= 1.3) {
prompt = ctx.getNodeParameter('prompt', itemIndex) as string;
} else {
prompt = getPromptInputByType({
ctx,
i: itemIndex,
inputKey: 'text',View on GitHub (pinned to 5ac6606e81)
Solutions
- Connect a second AiLanguageModel-compatible node to the 'Fallback Model' input of the Basic LLM Chain.
- If you do not need a fallback, disable the 'Use Fallback Model' option in the node settings.
- Make sure the connected fallback node is enabled and not erroring on its own.
- Confirm the connection type is AiLanguageModel (chat model), not a tool or other AI connection.
Example fix
// before
const fallbackLlm = needsFallback ? await getChatModel(ctx, 1) : null;
if (needsFallback && !fallbackLlm) {
throw new NodeOperationError(ctx.getNode(), 'Please connect a model to the Fallback Model input or disable the fallback option');
}
// after — clearer instruction; no behavioral change
if (needsFallback && !fallbackLlm) {
throw new NodeOperationError(ctx.getNode(), {
message: 'Fallback model is enabled but no model is connected to the Fallback Model input.',
description: 'Either connect a Chat Model to the Fallback input, or turn off the Use Fallback Model option.',
});
} Defensive patterns
Strategy: validation
Validate before calling
const needsFallback = ctx.getNodeParameter('needsFallback', 0, false) as boolean;
if (needsFallback) {
const fb = await getChatModel(ctx, 1);
if (!fb) {
throw new Error('Fallback enabled but no model connected to input 1');
}
} Type guard
function isLanguageModel(m: unknown): m is BaseLanguageModel {
return !!m && typeof (m as any).invoke === 'function';
} Prevention
- When enabling Use Fallback Model, immediately wire a second chat model.
- Disable the fallback option if you are not using it.
- Verify the fallback model node is enabled and healthy.
When it happens
Trigger: The node option 'needsFallback' is enabled, but the second AI Language Model input (connection index 1) has nothing wired to it. getChatModel returns null and the guard throws.
Common situations: User toggled the fallback option on but forgot to wire a second model; the fallback model node is disabled; the connection was deleted when reorganizing the canvas; the wrong connection type was used (e.g. AiTool instead of AiLanguageModel).
Related errors
- Please connect a model to the Fallback Model input or disabl
- Please connect a model to the Fallback Model input or disabl
- The ‘text‘ parameter is empty.
- The ‘text‘ parameter is empty.
- The ‘prompt’ parameter is empty.
AI-assisted analysis of n8n-io/n8n@5ac6606e81 (2026-08-12).
Data as JSON: /api/errors/b73d327dae0386f3.
Report an issue: GitHub.