← Back to Blog

n8n Postgres Disk Full at 3 AM: Why Our AI Phone Bot Stopped Answering Calls and the Settings That Prevent It

Ihor Odariuk
· updated · 7 min read
Quick answer

The n8n Postgres volume hit its 5 GB limit, filled with execution data (the log n8n keeps of every run), and the AI phone bot for five US service locations stopped. Emptying the execution history took the disk from 5.00 GB to about 0.2 GB in roughly thirty seconds, and total downtime was about 20 minutes.

Contents · 8 sections

If an AI receptionist answers your phones, it runs on software and a database somewhere, and when that database fills up, the bot stops and every call in that window goes unanswered. This post is the story of one such night across five US service locations: what filled the disk, how it was fixed in about 20 minutes, and the few settings that keep it from happening again. If someone set up automation for your business, the checks near the end are the questions to ask them.

If you run n8n on Postgres in production, this is the outage that is most likely to find you, and it is completely preventable. Below is how it happened to me, what was filling the disk, and the settings that stop it.

The 3 AM alert: Postgres out of memory, disk full at 5.00 GB

My phone buzzed with a platform alert:

"Primary out of memory. aware-healing | production"

Out of memory notification

That production environment runs the n8n workflows (n8n is an automation tool that passes data between your phone system, calendar and CRM) behind an AI receptionist answering calls for five US service locations. If it is down, calls are going unanswered right now.

My first instinct was the wrong one. We had been tuning the bot's prompt in Retell AI that week, so I went straight to the voice agent configuration looking for a bad change. The prompt was fine. The error log was not about AI at all. Postgres is the database where n8n keeps its records:

PostgreSQL had hit its hard limit: the disk was full at 5.00 GB.

Why did the n8n database fill up?

The Railway volume graph (Railway is the hosting service, and the volume is the disk the database lives on) showed a steady climb for weeks and a final spike at the top. At 5 GB, Postgres stopped accepting writes, and n8n, which stores its own state in that database, stopped with it. Call routing, client lookups and callback scheduling all went down together.

Railway PostgreSQL disk usage

The cause was execution data, the log n8n keeps of every automated run. By default n8n saves every production execution, successful or failed, together with the full input and output of every node. For a phone bot that means every webhook (the automatic message the voice platform sends when something happens on a call) from the voice platform, every lookup and every retry, each one stored with its payload.

n8n workflow execution logs

Two tables carry it:

Table What it holds Why it grows
execution_entity One row per execution: workflow, status, timestamps Grows with call volume
execution_data The full run data of each execution, node by node Grows with call volume times payload size

The second table is the one that eats disk. A webhook carrying a call transcript or a long JSON body is stored in full, every time.

How do you check what is using the space?

Before touching anything, confirm it. Run this against the n8n database:

SELECT relname AS table_name,
       pg_size_pretty(pg_total_relation_size(relid)) AS total_size
FROM pg_catalog.pg_statio_user_tables
ORDER BY pg_total_relation_size(relid) DESC
LIMIT 10;

If execution_data and execution_entity are at the top, you have found it.

The fastest safe fix: empty the execution history, 5.00 GB down to 0.2 GB

When the disk is already full and production is down, the fastest safe fix is to empty the execution history. It is a log, not business data: workflows, credentials and settings live in other tables and are untouched.

TRUNCATE TABLE execution_entity CASCADE;

CASCADE also empties the tables that reference it, including execution_data. The disk dropped from 5.00 GB to about 0.2 GB in roughly thirty seconds. I restarted the workflows, checked all five locations, and the bot was answering again. Total downtime: about 20 minutes.

Why TRUNCATE and not DELETE ... WHERE started_at < ...? Because in Postgres a DELETE does not hand space back to the operating system. Deleted rows become dead tuples that later writes can reuse, but the files stay the same size until a VACUUM FULL rewrites the table, and VACUUM FULL needs free disk to do it. On a full volume that is a dead end. TRUNCATE drops the table's files and frees the space immediately. If you need to keep recent history, take a backup first, or free space by resizing the volume, then delete and vacuum.

Which n8n settings prevent it?

On self-hosted n8n, retention is controlled by environment variables, not by a switch in the editor. The defaults in current n8n source:

Variable Default What it does
EXECUTIONS_DATA_PRUNE true Turns automatic pruning on
EXECUTIONS_DATA_MAX_AGE 336 Hours to keep executions (14 days)
EXECUTIONS_DATA_PRUNE_MAX_COUNT 10000 Maximum executions kept, 0 for unlimited
EXECUTIONS_DATA_SAVE_ON_SUCCESS all Save data for successful production runs, or none
EXECUTIONS_DATA_SAVE_ON_ERROR all Save data for failed production runs, or none
EXECUTIONS_DATA_SAVE_MANUAL_EXECUTIONS true Save data for runs started by hand in the editor

Three things in that table caught me out, and they are the actual lesson:

1. Pruning limits age and count, not size. Ten thousand executions of a workflow that stores a transcript per run is a very different number of gigabytes from ten thousand executions of a cron that checks a status flag. Size the limits against your largest payloads and your volume, not against the defaults.

2. Successful runs are saved in full by default. For a high-volume webhook that works 99% of the time, the history you will ever look at is the failures. Set EXECUTIONS_DATA_SAVE_ON_SUCCESS=none globally, or per workflow in its settings, and keep SAVE_ON_ERROR=all. That one change removes most of the growth.

3. Pruning (automatic cleanup of old records) is two-step. n8n first marks old executions as deleted, then hard-deletes them on a separate interval, and it keeps a buffer of recent ones. Even when pruning works, the space comes back in Postgres the way any DELETE does: reusable by new rows, not returned to the volume. A database that grew to its limit once will not shrink on its own.

Whatever the exact reason on my instance, the combination meant months of full payloads were sitting in execution_data, and nothing was watching the size.

What should you monitor?

Disk usage alerts on the volume. Railway and most hosts let you alert at a threshold. At 70% or 80% you get days of warning and fix it in business hours. I had no alert, so the first warning was the outage.

Table size, weekly. The query above, run on a schedule from n8n itself, posting to a channel. If execution_data grows faster than call volume, a workflow has started storing something large.

The thing the bot does, not the server. The alert I got was about memory and disk. What mattered was that calls were not being answered. A synthetic check, meaning an automated test call made on a schedule, that calls the line or hits the bot's webhook and expects a valid answer would have caught it whatever the cause. The same principle, applied to AI outputs rather than infrastructure, is in monitoring LLM outputs.

Read the error first, and other lessons from the outage

Read the error before you form a theory. I lost the first ten minutes checking the AI prompt because that was what I had been working on. The log said disk full the whole time.

Work from the outside in. Is the service up, is the database reachable, is the database accepting writes, is the application erroring, is the data right. Do not start with the most interesting explanation.

Ask for help immediately. I pasted the error and the setup into Claude and had "execution data" as the likely cause within a minute. No prize for diagnosing alone at 3 AM.

Write down what you do as you do it. Commands, times, results. It makes the post-mortem possible and it makes a repeat incident a five-minute fix.

Do the post-mortem the next day. Mine ended with pruning limits sized to the payloads, success data off for the high-volume webhooks, a disk alert, and a weekly table-size report.

Ask whoever runs your call bot about disk alerts and retention

If an AI phone bot or any automation handles your calls, ask whoever runs it three questions: is there an alert before the database disk fills up, are successful runs being stored in full when only failures are ever looked at, and is anything checking that calls are being answered rather than just that the server is on. A yes to all three is what turns a 3 AM outage into a warning you read during business hours.


Running n8n in production? Run the size query above today. If you want automation built so this kind of failure is caught before customers notice, that is what I do, and you can send me a line.


Related:

The package for this
Operations automation buildfrom $1,800
2 to 4 weeks

One narrow system that makes a decision your team cannot make at volume: paid-lead disputes, call classification, document and invoice parsing, or a reporting pipeline.