Issue with OpenAI Message to Model Node Loop Causing Excessive API Charges

Hi everyone,

I’ve encountered a significant issue while using the Message to Model node in n8n, which had an HTTP Request tool attached to it. Unfortunately, the tool responded with a 404 error, which triggered an endless loop in the node. This resulted in a massive number of API requests being sent to OpenAI, leading to a bill of $300 for just 30 minutes of this accidental loop.

The most concerning part is that even after I disabled the node and the entire workflow, the requests from the n8n servers continued to run. When I enabled the workflow again, the requests persisted, causing additional charges.

I’m seeking advice on the following:

  1. Why did this happen? How can an error response like a 404 cause such a loop in the Message to Model node?
  2. How can I prevent this in the future? Are there any safeguards I can implement to avoid infinite loops and excessive API calls, especially in cases of unexpected errors?
  3. How can I stop these background processes? Even after disabling the node and workflow, the queries continued. What steps can I take to ensure that all processes are fully stopped to prevent further charges?

This seems like incorrect behavior in the n8n OpenAI Message to Model node, and I’m worried about what could happen if this issue persists for longer periods. Any insights or advice would be greatly appreciated.

Thank you!

It looks like your topic is missing some important information. Could you provide the following if applicable.

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

Hi @Arturs_Birzgals

first of all, we are very sorry this has happened to you and will take your reporting of this very serious - therefore Thank You for posting here!

There could be different factors at play here, possibly for example how Langchain reuses tools after an error. This might be something for which we should add an option in the node.

Can you re-construct the entire scenario and the steps you took? Did you disable the tool, the agent, or the entire workflow? And in which order?

Can you also please share the workflow so that we can investigate your setup and configurations?

Thank You!

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.