Why the disk grows when nothing is happening
n8n saves the data of every execution: which nodes ran, what each one returned, and — if your workflow reads a PDF — the extracted text. n8n's own documentation opens its execution-data page with the problem in plain words: depending on your settings and volume, the database can grow and run out of storage.1
So the growth is a default, not a bug. The defaults are also documented, which means this is one of the few self-hosting problems you can solve by reading rather than experimenting.
1. Know the defaults before you change them
| Variable | Default | What it does |
|---|---|---|
EXECUTIONS_DATA_PRUNE | true | Delete old executions on a rolling basis — already on |
EXECUTIONS_DATA_MAX_AGE | 336 | Hours before an execution is eligible for deletion (14 days) |
EXECUTIONS_DATA_PRUNE_MAX_COUNT | 10000 | Rows kept; 0 means no limit |
EXECUTIONS_DATA_SAVE_ON_SUCCESS | all | Set to none and successful runs stop being stored |
EXECUTIONS_DATA_SAVE_ON_ERROR | all | Keep errors — this is the one you want to see |
EXECUTIONS_DATA_SAVE_ON_PROGRESS | false | Per-node progress; false cuts the volume per execution |
EXECUTIONS_DATA_SAVE_MANUAL_EXECUTIONS | true | Manual test runs are stored too |
EXECUTIONS_DATA_HARD_DELETE_BUFFER | 1 | Hours a finished execution must be old before hard delete |
EXECUTIONS_DATA_PRUNE_HARD_DELETE_INTERVAL | 15 | Minutes between hard-delete passes |
EXECUTIONS_DATA_PRUNE_SOFT_DELETE_INTERVAL | 60 | Minutes between soft-delete passes |
N8N_EXECUTION_DATA_STORAGE_MODE | database | filesystem, s3, azure also exist |
All of these are documented on n8n's Executions environment variables page; the pruning behaviour itself is on the Manage execution data page.12
2. Measure before you tune
Two numbers, one minute. The first is the data directory inside the container — the
.n8n folder, which holds the SQLite database and the encryption key:
docker compose exec n8n du -sh /home/node/.n8n
docker compose exec n8n ls -lh /home/node/.n8n
The second is how many executions exist. With PostgreSQL:
docker compose exec -T postgres psql -U n8n -d n8n -c '\dt'
That lists the tables — including the one holding executions, which is named
execution_entity in the n8n source tree this guide was written
against.5 Confirm the name in your own output rather than trusting
mine, then count:
docker compose exec -T postgres psql -U n8n -d n8n \
-c 'select count(*) from execution_entity;'
With SQLite the database is a file in that folder; the count needs the sqlite3
binary, which the n8n image may not include. The directory size is then the honest measure.
Remember these two numbers. Without them, "I changed a setting" has no observable consequence.
3. Set the two numbers you actually chose
For a homelab instance, the interesting choice is usually the age. Thirty days of a small workflow's history is cheap; thirty days of a workflow that extracts a 40-page PDF four times a day is not. Decide with the directory size in front of you, not from a blog's table.
services:
n8n:
environment:
EXECUTIONS_DATA_PRUNE: "true"
EXECUTIONS_DATA_MAX_AGE: "168" # 7 days
EXECUTIONS_DATA_PRUNE_MAX_COUNT: "5000"
EXECUTIONS_DATA_SAVE_ON_PROGRESS: "false"
EXECUTIONS_DATA_SAVE_MANUAL_EXECUTIONS: "false"
Then recreate the container and read the values back from inside it. An
environment: block that the running container never received is the most common
version of this mistake:
docker compose up -d n8n
docker compose exec n8n printenv EXECUTIONS_DATA_MAX_AGE EXECUTIONS_DATA_PRUNE_MAX_COUNT
4. Why the space does not come back immediately
Pruning is two passes, and the documentation says why: for performance, n8n first marks targets for deletion, then later removes them permanently.2 Three details follow from that, and each one has surprised someone:
- Age or count, whichever comes first. Pruning happens when an execution
finished more than
EXECUTIONS_DATA_MAX_AGEhours ago or when the total exceedsEXECUTIONS_DATA_PRUNE_MAX_COUNT— oldest first. - Some rows are never pruned. Executions in
new,runningorwaitingstate are not eligible, and annotated executions — anything with tags or ratings — are never pruned. If you tag executions to keep them, you have opted out of pruning for those rows, forever. - Deletion is not shrinking, on SQLite. Removing rows frees pages inside the
database file; the file itself may not get smaller. A
VACUUMis what reclaims the space, and it needs free disk to work — do it while you still have some.
5. Filesystem storage: moving the growth, not removing it
If the database itself is what you want to keep small, n8n can write execution data outside
it: N8N_EXECUTION_DATA_STORAGE_MODE=filesystem, with the base path in
N8N_STORAGE_PATH (default N8N_USER_FOLDER/storage). The
s3 and azure modes require a self-hosted Business or Enterprise
plan.1
This keeps queries fast and backups of the database small. It does not make the data disappear: the same pruning rules still decide how long it lives, and your backup now has two things to include instead of one. Do this if you have a reason; do not do it because it sounds tidier.
6. SQLite or PostgreSQL — the honest boundary
Fresh self-hosted installs use SQLite; the documentation describes PostgreSQL as the option you configure through environment variables.3 SQLite is a file: one writer, no network, nothing to administer, and it is entirely adequate for one person's workflows.
PostgreSQL starts to matter when several things write at once — queue mode, several workers, or a second user clicking while a schedule fires. The documentation's own framing is that SQLite is fine to try and Postgres is what you use for a production instance handling more than a handful of users or workflows running around the clock.4
Migrating is not a toggle. There is no supported button that turns a SQLite instance into a Postgres one; you export, point the instance at the new database, and import. That is a separate afternoon, and this guide does not pretend otherwise. If you are starting fresh and expect to grow, start on Postgres — the Compose file in the hardware guide does exactly that.
7. Prove it happened
Come back after the intervals above have passed — an hour is enough to see soft deletes, a day to see the shape — and take the same two measurements:
docker compose exec -T postgres psql -U n8n -d n8n \
-c 'select count(*) from execution_entity;'
docker compose exec n8n du -sh /home/node/.n8n
What a pass looks like:
- the row count stopped climbing and, if you were above your limit, fell;
- the directory stopped growing day over day;
- the values printed by
printenvmatch the Compose file.
If the count did not move, the setting did not reach the process, or every row you have is annotated. Both are worth knowing, and both are visible in one command.
Troubleshooting
printenvshows the old value. The variable was exported in your shell, not given to the container. Put it under the service'senvironment:block, then recreate:docker compose up -d n8n.- The row count never falls. Either you are below both limits, pruning is off, or every row you have is annotated — tagged or rated executions are never pruned.
- The count falls but the file does not shrink (SQLite). Pruned pages are
reused, not released. Run
VACUUM, or setDB_SQLITE_VACUUM_ON_STARTUP, and keep free disk for the operation. - The directory grows even though the count is steady. Check whether
execution data lives in filesystem mode under
N8N_STORAGE_PATH— the rows were pruned, the files may not be the ones you are measuring.
Honest limits
- No growth rate is quoted here. Rows per day depend entirely on your
workflows and on how big each payload is; measuring your own
dutwice, a day apart, beats any number a guide could print. - The table name is a version-dependent detail.
execution_entityis what this guide was written against; list your own tables before trusting it. saveOnSuccess=nonecosts you debugging. You lose the ability to open yesterday's successful run and see what it returned. Keep errors; drop successes knowingly.- Execution data can contain invoice text. If your workflow parses documents, the history is a second copy of those documents on your disk — which is both a privacy point and a volume point. The privacy policy says the same in the place a buyer looks.
- Deleting execution data is not a backup strategy. Pruning removes history; it does not protect the ledger. That is the backup guide.
If the workflow filling your disk reads invoices
The pack this site sells runs eleven workflows on your own instance, parses invoices without an AI model, and writes one CSV ledger. Its nightly template keeps a dated copy of that ledger, which is the part execution pruning does not cover.
Invoice Ledger — 11 workflows, USD 49 · how the pipeline works · listed on the n8n template library
Sources
- n8n docs — Executions environment variables (defaults for
EXECUTIONS_DATA_MAX_AGE336,EXECUTIONS_DATA_PRUNE_MAX_COUNT10,000, save-on-* flags, hard-delete buffer and intervals, storage modes;s3/azureneed Business or Enterprise). Read 2026-10-22. - n8n docs — Manage execution data (soft delete then hard delete; age or count; running/waiting rows and annotated executions never pruned). Read 2026-10-22.
- n8n docs — Choose n8n's database. Read 2026-10-22.
- n8n docs — Install using Docker Compose (SQLite by default; Postgres “for a production instance that must handle more than a handful of users or workflows running around the clock”). Read 2026-10-22.
- n8n repository — generated Postgres schema,
public.execution_entity(the table name the count queries use, in the current source tree). Read 2026-10-22.