{"record":{"id":"0aea760f1dbe47e6","repo":"n8n-io/n8n","slug":"please-connect-a-model-to-the-fallback-model-input","errorCode":null,"errorMessage":"Please connect a model to the Fallback Model input or disable the fallback option","messagePattern":"Please connect a model to the Fallback Model input or disable the fallback option","errorType":"exception","errorClass":"NodeOperationError","httpStatus":null,"severity":"error","filePath":"packages/@n8n/nodes-langchain/nodes/agents/Agent/agents/ToolsAgent/V2/execute.ts","lineNumber":294,"sourceCode":"\n\t\t// FIXME: remove when this is fixed: https://github.com/langchain-ai/langchainjs/pull/9082\n\t\t// Responses API + tools is broken when using langchain default call handling. In V3 calls are handled differently, so it works.\n\t\tif (checkIsResponsesApi(model)) {\n\t\t\tthrow new NodeOperationError(\n\t\t\t\tthis.getNode(),\n\t\t\t\t`This model is not supported in ${version} version of the Agent node. Please upgrade the Agent node to the latest version.`,\n\t\t\t);\n\t\t}\n\n\t\tif (checkIsResponsesApi(fallbackModel)) {\n\t\t\tthrow new NodeOperationError(\n\t\t\t\tthis.getNode(),\n\t\t\t\t`This fallback model is not supported in ${version} version of the Agent node. Please upgrade the Agent node to the latest version.`,\n\t\t\t);\n\t\t}\n\n\t\tif (needsFallback && !fallbackModel) {\n\t\t\tthrow new NodeOperationError(\n\t\t\t\tthis.getNode(),\n\t\t\t\t'Please connect a model to the Fallback Model input or disable the fallback option',\n\t\t\t);\n\t\t}\n\n\t\t// Check if streaming is enabled\n\t\tenableStreaming = this.getNodeParameter('options.enableStreaming', 0, true) as boolean;\n\n\t\tfor (let i = 0; i < items.length; i += batchSize) {\n\t\t\tconst batch = items.slice(i, i + batchSize);\n\t\t\tconst batchPromises = batch.map(async (_item, batchItemIndex) => {\n\t\t\t\tconst itemIndex = i + batchItemIndex;\n\n\t\t\t\tconst input = getPromptInputByType({\n\t\t\t\t\tctx: this,\n\t\t\t\t\ti: itemIndex,\n\t\t\t\t\tinputKey: 'text',\n\t\t\t\t\tpromptTypeKey: 'promptType',","sourceCodeStart":276,"sourceCodeEnd":312,"githubUrl":"https://github.com/n8n-io/n8n/blob/5ac6606e81f67bb9534255570cd4e86fd8101eee/packages/@n8n/nodes-langchain/nodes/agents/Agent/agents/ToolsAgent/V2/execute.ts#L276-L312","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Connect a chat model node to the Fallback Model input of the Agent.","Or disable the 'needsFallback' option if no fallback is required.","Verify the fallback model node executes without error in isolation."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"const needsFallback = this.getNodeParameter('needsFallback', 0, false) as boolean;\nif (needsFallback) {\n  const fb = await getChatModel(this, 1);\n  if (!fb) {\n    throw new NodeOperationError(this.getNode(), 'Fallback enabled but no model connected to the Fallback Model input.');\n  }\n}","typeGuard":"function isChatModel(model: unknown): model is BaseChatModel {\n  return !!model && typeof (model as any).invoke === 'function';\n}","tryCatchPattern":null,"preventionTips":["Whenever you toggle needsFallback, immediately wire the Fallback Model input.","If fallback is unused, disable the option to avoid the check.","Validate the fallback model node executes in isolation."],"tags":["langchain","agent","tools-agent","fallback","configuration","v2"],"backgroundTag":null,"analyzedSha":"5ac6606e81f67bb9534255570cd4e86fd8101eee","analyzedAt":"2026-08-12T05:26:35.080Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}