All my executions disappeared after reaching 100k; how to fix and prevent again?

Describe the problem/error/question

All my 100k executions disappeared out of nowhere. Where did they go and how can I retrieve them and prevent this from happening again?

I learned there are env variables such as EXECUTIONS_DATA_PRUNE_MAX_COUNT, but they haven’t been configured, so is there a default number n8n has even when I never added this variable?

Information on your n8n setup

  • n8n version: 1.84.3
  • Database (default: SQLite): Postgres
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app): Railway

Default is 10k for EXECUTIONS_DATA_PRUNE_MAX_COUNT .
EXECUTIONS_DATA_PRUNE default is true.
EXECUTIONS_DATA_MAX_AGE default is 336 (in hours).

One of those most likely procced. You can change those variables like:

*appreciate to mark me as solution if this was intended solution. :slight_smile:

I can’t see these variables there in the env variables. Are they active by default even if they’re not there?

Besides, it doens’t make sense. They were detelted at around 100k, not 10k, and it has always stored all the executions since the beginning which was around 3 months ago.

Is there any way to retrieve/restore the executions?

I believe, yes, that is the default.

And that is odd, tho. I am not confident if that means total or per workflow, to be frank.

There may be a chance to recover, but more likely not, what is the database type you are using for n8n?

Have you recently restarted the docker container? It could have been a glitch it didn’t delete if not explicitly setup. And a restart could have “reset” that.

Ouch :confused:

I have restarted it; nothing; anyway I disabled the EXECUTIONS_DATA_PRUNE and set the EXECUTIONS_DATA_PRUNE_MAX_COUNT to 0. How can I disable the EXECUTIONS_DATA_MAX_AGE?

Do I have to publish a new docker image for these env variable changes to take effect?

I meant that if you restarted it prior, the restart may have caused your n8n to register that it was in fact past the default executions limits and delete them (or a reboot or crash).

No, settings to 0 has been shown to not work, it must be set very high. You can also set max age very high.

Depending on your setup, putting it down then up should re-register new env vars:

docker compose down
docker compose up -d