N8N 2.0 crashes when using AI Agent

What is the new memory requirements for n8n v2?

I built a simple workflow with chatinput node, an AI agent and a connected AI/LLM.

Once I interact with the chat node, then n8n crashes. the log only shows “FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory”

This happens both in production (when using webhook instead of a chat node) and when manually interacting with my workflow during testing by chatting in the chat node

n8n crashes also for short text inputs in the chat node, such as “test”

Self-hosted.
n8n version 2.0.3
Running using the official n8n Docker container
512 MB RAM.
This workflow worked until n8n was upgraded from v1 to v2

As part of my testing, I built a new workflow from scratch after n8n was upgraded to v2, but the bug persists

This workflow works on n8n hosted in the cloud.

I downgraded my n8n docker image to the latest v1, 1..123.5, and now it works again.

What is the new memory requirements for n8n v2? Or is there another issue beside the memory issue?

2 Likes

Same here. Hosting in a 512MB RAM server. No matter how lightweight my nodes are (just forwarding a text string), when AI agent handles input data, server hits memory limit and restarts.

That looks like a memory leak or something wrong with the AI nodes. It also happened to me with the Information Extractor node. I have some other nodes that actually process very big payloads without any problem.

1 Like

Hello Joe, I’m having the same problem. Have you found any alternative besides downgrading the n8n version?

Unfortunately not!