I’m experiencing an issue where my execution history is being aggressively pruned after approximately 13 hours, despite having configured a much longer retention period.
Environment:
n8n version: 1.78.1
Database: PostgreSQL
Deployment: Docker container (2GB memory limit)
Configuration:
- EXECUTIONS_DATA_PRUNE=true
- EXECUTIONS_DATA_MAX_AGE=720 # 30 days
- EXECUTIONS_DATA_PRUNE_MAX_COUNT=0
Expected Behavior:
Execution history should be retained for 720 hours (30 days)
With EXECUTIONS_DATA_PRUNE_MAX_COUNT=0, there should be no count-based limitation
Actual Behavior:
Execution history is consistently truncated after ~13 hours
Latest query shows:
Oldest record: 2025-03-12 07:59:20
Newest record: 2025-03-12 21:16:30
Span: ~13 hours
Additional Details:
Memory usage is well within limits (74% of 2GB)
No relevant error messages in logs
Metrics collection is working correctly (visible in Grafana)
Database size is modest (1672 kB for execution table)
Has anyone else encountered this behavior? Is this a known issue? Any suggestions for troubleshooting would be appreciated.
I am unsure that: EXECUTIONS_DATA_PRUNE_MAX_COUNT=0 is respected how you think. The documentation does not define 0 as an option for non limits. Try 50000 or something. I would also just turn EXECUTIONS_DATA_PRUNE=false off as well instead of to true.
Well I don’t post on forums until I’ve tried everything. So I’ve tried all numbers… 0, 10000000000, removing the directives completely… with and without EXECUTIONS_DATA_PRUNE… I’m sure I’ve tried every combination.
The =0 suggestion came from the forum:
In theory just turning off DATA_PRUNE and setting EXECUTIONS_DATA_PRUNE_MAX_COUNT to 0 would do the job but if you are using SQLite I would strongly recommend against doing this.
Where are these args set? Docker compose under n8n image?
Where was that suggestion? It could be true, especially if by a team member or admin, I haven’t used those args personally, I was just references the docs.