n8n Execution Data Pruning Not Reducing Disk Usage

maorm200PRO

6 days ago

Hi,

I’m running a self-hosted instance of n8n on Railway, and I’ve noticed that my disk usage is slowly increasing over time, currently sitting at around 1.49 GB.

I assumed this was due to workflow execution data building up, so a few weeks ago I added the following environment variables:

N8N_EXECUTIONS_DATA_MAX_AGE=168

N8N_EXECUTIONS_DATA_PRUNE=true

My understanding is that this should prune execution data older than 168 hours (7 days) automatically but despite these settings, disk usage continues to grow steadily. It doesn’t seem like any execution pruning is happening.

Just wanted to ask:

  • Is there anything else I need to configure on Railway for this pruning to actually run?

  • Or anything else I missed? Since I don't want it to keep growing exponentially (I barely have that many workflows too so I'm assuming it's all execution data).

Thanks a lot!

$10 Bounty

4 Replies

maorm200PRO

6 days ago

Sharing a screenshot of disk usage over time:

Attachments


5 days ago

You have to run vacuum on the Postgres database.

The way I do it is by connecting it to Windsurf via Railway MCP server and and asking it to do it for me. However, you can just install the DBGate service on the n8n project and do it from there.

Make sure to backup your volume first to prevent accidental mistakes.


maorm200PRO

4 days ago

Can you let me know how to install it exactly?


maorm200

Can you let me know how to install it exactly?

4 days ago

The fastest way is to download windsurf then paste your Railway API key there. Then just ask it to run vacuum on the database of your project.

First do it on a test database, then on your actual database but please create a backup first.