Fix: AI Agent Fallback Model Visual Bug
AI Agent Fallback Model Bug: A Visual Glitch in n8n
Hey n8n community! 👋 We've got a little visual bug report to discuss today regarding the AI Agent node in n8n, specifically when using the Fallback model feature. As you know, n8n is an incredible tool for automating workflows, and the AI Agent node is super powerful for integrating AI into your automations. However, there's a minor hiccup that we need to address: a visual bug related to the Fallback model.
The Problem: Lingering Connections
The issue, in a nutshell, is this: when you enable the Fallback model in the AI Agent node and connect a model (like OpenAI or OpenRouter), everything looks good. But, if you then disable the Fallback model, the visual connection to the model doesn't disappear. It stays there, visually linked, even though it's no longer active. It's like a ghost connection! 👻
What's Happening Behind the Scenes?
Now, let's dive a bit into what might be going on behind the scenes, guys. When you configure the AI Agent node, you're essentially telling it how to handle different scenarios. The Fallback model is there as a backup. So, when it's enabled, the node knows to use the specified model if the primary model fails or encounters issues. When you disable the Fallback, the node should ideally sever all ties with the fallback model, both functionally and visually. The bug, it seems, is that the visual representation isn't updating correctly. The connections of the node are not being updated.
Impact of the Bug
It is important to remember that this bug is mainly a visual issue. It does not seem to affect the actual functionality of your workflows. Disabling the Fallback model should still prevent the fallback model from being used. But, it can be a bit confusing and lead to the following:
- Confusion: The lingering visual connection might mislead users into thinking the Fallback model is still active, which could lead to incorrect assumptions about how the workflow is operating.
- Workflow Clarity: A clean, uncluttered visual representation is crucial for understanding your workflow at a glance. The ghost connection adds unnecessary visual clutter, making it harder to quickly grasp the overall flow.
How to Reproduce the Bug
Reproducing this bug is fairly straightforward, making it easy to confirm and for the n8n team to address it.
- Create an AI Agent Node: Start by adding an AI Agent node to your n8n workflow.
- Enable Fallback Model: In the AI Agent node's settings, turn on the Fallback model option.
- Connect a Model: Select and connect a model (like OpenAI or OpenRouter) to the AI Agent node.
- Disable Fallback Model: After connecting the model, go back to the AI Agent node settings and disable the Fallback model.
- Observe the Connection: Notice that the visual connection to the model remains, even though the Fallback model is turned off.
The Error Message (if any)?
No specific error messages are triggered by this bug, as it's purely a visual glitch. Your workflow will still function as designed. The absence of an error message is typical for this type of issue, as it doesn't disrupt the core processing of data. The visual discrepancy is the primary indicator of the problem. This can cause some confusion for the users.
Workflow, Screenshots and Example
Let's take a look at the provided screenshots and workflow to better understand the issue. The screenshots clearly show the visual bug, with the model connection remaining even after the Fallback model is disabled. Below we have provided the workflow data.
{
"nodes": [
{
"parameters": {
"conditions": {
"options": {
"caseSensitive": true,
"leftValue": "",
"typeValidation": "strict",
"version": 2
},
"conditions": [
{
"id": "0be397db-6b32-496b-89ac-7b18c53605b5",
"leftValue": "={{ $json.data.approved }}",
"rightValue": "true",
"operator": {
"type": "boolean",
"operation": "true",
"singleValue": true
}
},
{
"id": "dc5f49bd-5b5c-46e5-9254-65166e37fb4a",
"leftValue": "={{ $json.data.approved }}",
"rightValue": "false",
"operator": {
"type": "boolean",
"operation": "false",
"singleValue": true
}
}
],
"combinator": "or"
},
"options": {}
},
"type": "n8n-nodes-base.if",
"typeVersion": 2.2,
"position": [
704,
192
],
"id": "df4f33ab-c3a3-4551-a571-65607a20c4bb",
"name": "If"
},
{
"parameters": {
"options": {}
},
"type": "@n8n/n8n-nodes-langchain.agent",
"typeVersion": 3,
"position": [
864,
192
],
"id": "8571c00f-8dbc-4675-9b99-028dc689d8be",
"name": "AI Agent"
},
{
"parameters": {
"model": {
"__rl": true,
"value": "gpt-5-mini",
"mode": "list",
"cachedResultName": "gpt-5-mini"
},
"builtInTools": {},
"options": {}
},
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"typeVersion": 1.3,
"position": [
848,
432
],
"id": "6ccb8260-0067-4702-bb6f-ead36ea2af54",
"name": "OpenAI Chat Model",
"credentials": {
"openAiApi": {
"id": "GT9WLL9y9hXxvZ7H",
"name": "OpenAi account"
}
}
},
{
"parameters": {
"options": {}
},
"type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter",
"typeVersion": 1,
"position": [
992,
432
],
"id": "1850bb25-160e-49c3-8296-a4965f70a8ed",
"name": "OpenRouter Chat Model",
"credentials": {
"openRouterApi": {
"id": "UK4jV9FZhyXZgbPb",
"name": "OpenRouter account"
}
}
}
],
"connections": {
"If": {
"main": [
[
{
"node": "AI Agent",
"type": "main",
"index": 0
}
],
[]
]
},
"OpenAI Chat Model": {
"ai_languageModel": [
[
{
"node": "AI Agent",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"OpenRouter Chat Model": {
"ai_languageModel": [
[
{
"node": "AI Agent",
"type": "ai_languageModel",
"index": 1
}
]
]
}
},
"pinData": {},
"meta": {
"templateCredsSetupCompleted": true,
"instanceId": "87708e9e6a86789d256c7f86a30f6ee4e9d68328b2491bc7fe66d38ccca93403"
}
}
This workflow demonstrates the issue. The AI Agent node is configured with a Fallback model, and the connection persists even after disabling the fallback. This workflow structure, with an AI Agent node connected to language models, provides a clear example of the bug in action. The presence of the conditional If node further adds complexity that can highlight the issue in more intricate workflow structures.
Share the Output Returned by the Last Node
Since this is a visual bug, the output of the last node is not relevant to the problem. The functionality of the workflow is not affected. The output of the last node will depend on the other parameters in the workflow such as the AI model or any conditional logic. So, the output will depend on your specific model choice. In this case, since there is not error, the workflow should work as expected.
Debugging Information
Here is a summary of the debug information provided. This information is helpful for the n8n team to further investigate and address this bug.
- n8n Version: 1.119.2
- Platform: Docker (self-hosted)
- Node.js Version: 22.21.0
- Node Env: Production
- Database: Postgres
- Execution Mode: Regular
- Concurrency: -1
- License: Enterprise (production)
- Storage: Memory mode, all success, no errors.
- Pruning: Enabled
- Client: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36
This information helps the n8n team understand the environment in which the bug is occurring, making it easier to pinpoint the cause and develop a fix. The details on the database, execution mode, and other configurations provide valuable context.
Conclusion: Visual Bug and Its Impact
So, guys, we have a visual bug in the n8n AI Agent node related to the Fallback model. While it doesn't break any functionality, it does create some visual confusion. Hopefully, the n8n team can address this soon, so our workflows can be even clearer and more intuitive. Keep an eye out for updates, and happy automating!
This article has detailed the issue of a visual bug in the n8n AI Agent node related to the Fallback model feature. It has explained the problem, provided steps to reproduce it, discussed its impact, and shared the necessary debug information. It also provided sample workflows to help you understand the problem.