MongodDB Connection Exhausted - Chat Memory Node

Hello Everyone,

Over the past 4 months, I’ve been working extensively with n8n—building workflows ranging from simple to very complex. During this time, I’ve noticed that some nodes, particularly those related to data access, are not implemented efficiently.

The main issue lies in how connections are managed. There’s no clear guarantee of when connections are created or closed, which makes debugging extremely difficult. For example, I’ve experienced stuck executions where connections remain open after being stopped. The only way to understand what happened was by digging into the logs.

My biggest challenge has been with the MongoDB nodes. They are implemented in inefficient way, overwhelming the database, hitting maximum limits, and even causing crashes. After a week of investigation, I traced the problem to a loop in MongoDB chat memory.

:backhand_index_pointing_right: My Question:
Is there a way to implement a custom memory for chat nodes that would allow building a node with proper connection pooling?
I’ve already done this with standard nodes, but for chat memory it doesn’t seem possible so far.

Any ideas, suggestions, or guidance would be greatly appreciated!

Thanks in advance :folded_hands:

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