Execution logs - data pruning

Hello!

We wanted to figure out how exactly data pruning is working:
So, our environment variable regarding EXECUTION_DATA:
EXECUTIONS_DATA_MAX_AGE=336
EXECUTIONS_DATA_SAVE_ON_ERROR=all
EXECUTIONS_DATA_PRUNE=true

The problem is that executions are saved for only 11 hours. All of them, no successful or error executions available older than that.

We would like to save everything for 14 days or at least 7.
We would start with error executions and then move to all.

What could be the problem with why executions are not saved?
Maybe we have missed something, OR maybe there is an env variables combo which is not working?

## Information on your n8n setup
- **n8n version:** --> Version 1.89.2
- **Database (default: SQLite):** --> PostgreSQL
- **Running n8n via (Docker, npm, n8n cloud, desktop app):** --> Docker

You didn’t mention EXECUTIONS_DATA_PRUNE_MAX_COUNT, which defaults to 10000. Any chance you are running a LOT of workflows and hitting that limit?

1 Like

@hubschrauber Ahaa, maybe that is the problem. Yeah, we are running a LOT more. There is nothing mentioned about the default 10k EXECUTIONS_DATA_PRUNE_MAX_COUNT in the docs. In the docs, an example is 50k. What is the max amount?

It’s in the docs I linked…


The max, is “unlimited” as far as I can tell, but you’d have to explicitly add the environment variable and set it to 0

    EXECUTIONS_DATA_PRUNE_MAX_COUNT=0
2 Likes

Sorry, I was looking in the wrong place:

Thank you, we will try this!

Yeah, the “guide” glosses over a few things. They could probably make some improvements to the way that is documented. There is a link to the environment variables reference on that page, but it doesn’t exactly catch your attention.

Anyway, hope that helps you get things set up like you want them. Once you confirm whether that “count” setting makes the difference, please click the “solved” button (blue box with checkmark) on the post that has the answer.

2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.