Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4072 pages

Help for owners

My n8n database keeps growing and the server is running out of space

Short answer

n8n stores the data of every execution, so a busy instance fills its database. n8n prunes finished executions by default, after 14 days or 10,000 runs, but pruning on SQLite does not give disk space back to the server. Save less data, check the pruning limits, and back up before changing anything.

  • Written for business owners
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Does this sound like your situation?

  • The server disk is almost full and n8n is the biggest thing on it.
  • n8n has become slow to open and the executions list takes a long time to load.
  • I have automations that run every few minutes and the history is huge.
  • I deleted old executions but the disk did not get any emptier.
  • n8n stopped after the disk filled up.

Why does this happen?

  1. Every execution saves its data

    n8n's documentation says that, depending on your execution settings and volume, the database can grow in size and run out of storage. It recommends not saving unnecessary data and keeping pruning of old executions on. A workflow that runs every minute and carries large items writes a lot of data every day.

  2. Pruning has limits you may have raised

    Pruning is on by default and removes finished executions older than 336 hours (14 days), or the oldest ones once there are more than 10,000. Someone may have switched pruning off, raised the maximum age, or set the count to 0, which means unlimited. Executions that are running, waiting or annotated with tags or ratings are never pruned.

  3. On SQLite, pruned space is reused, not returned

    n8n uses SQLite by default. With SQLite the disk space of pruned data is not freed automatically; it is reused for future executions. To release it, n8n documents a vacuum option on startup or a manual VACUUM, which should only be run after a backup.

  4. Binary files add to the size

    Pruning applies only to the binary data storage mode that is active now. Data written under an earlier mode is not pruned, so files saved before a storage change can stay behind.

  5. The default database was never meant for heavy load

    Self-hosted n8n uses SQLite unless PostgreSQL is configured. A growing instance with many executions is the usual moment to look at PostgreSQL, which n8n also supports.

What can I do about it today?

  1. Find out how full the disk isAsk whoever hosts n8n for the free space on the server, not just the size of n8n. A disk that is nearly full is urgent; one that is half full gives you time.
  2. Do not delete files by handThe database file and the n8n data folder hold your workflows and the key that unlocks your saved logins. Deleting files to make room can destroy both.
  3. Take a backup firstAsk for a copy of the whole n8n data folder, and of the PostgreSQL database if you use one. n8n says the folder holds the encryption key, and without it saved credentials cannot be restored.
  4. List the workflows that run most oftenWrite down the ones that run every minute or handle large files. They are the first candidates for saving less data.
  5. Ask what the execution settings areIs pruning on, how many days of history are kept, and are successful runs saved? These are the three answers that explain most growth.

When should I bring someone in?

  • The disk is almost full now, or n8n has already stopped.
  • You are on SQLite and the instance is slow even after pruning.
  • Nobody on your side knows where the n8n data folder is or whether it is backed up.

How do I handle it?

  1. Measure before touchingI check free disk space, the size of the database and the data folder, and which workflows produce the most execution data.
  2. Back up the data folder and databaseNothing is pruned or vacuumed until a restorable copy exists, including the encryption key.
  3. Save only what you will useI propose which workflows should keep failed runs only, and set pruning age and count to match how long you really look back.
  4. Reclaim space safelyOn SQLite I plan a vacuum in a quiet window, with n8n stopped. If the load calls for it, I plan a move to PostgreSQL as a separate, tested step.
  5. Watch the disk afterwardsA simple disk-space alert is added so the next fill-up is a warning, not an outage.

The price depends on what I find, so I quote in writing after a short discovery call. Tell me what is happening and I reply within 24 hours.

What do owners ask about this?

Is it safe to turn pruning off?

It is safe for the data, but the database then grows without a limit. n8n turns pruning on by default and recommends not saving unnecessary data.

Will pruning delete my workflows?

No. Pruning deletes finished executions and their data, not workflows or credentials.

Why did the disk not shrink after pruning?

With the default SQLite database, n8n reuses the freed space but does not give it back automatically. A vacuum is needed, and it should be done after a backup.

Do I have to move to PostgreSQL?

Not always. It depends on volume and on whether you plan to scale n8n. n8n supports both databases.

Sources

How was this page made?

I drafted this page with AI assistance from the official documents listed under Sources. Found a mistake? Tell me.

For your developer: the technical fixes

Next step

Want this off your desk?

Send me a few lines on where things stand. I reply within 24 hours.