Execution data#
Depending on your executions settings and volume, your n8n database can grow in size and run out of storage.
To avoid this, n8n recommends that you don't save unnecessary data, and enable pruning of old executions data.
To do this, configure the corresponding environment variables.
Reduce saved data#
Configuration at workflow level
You can also configure these settings on an individual workflow basis using the workflow settings.
You can select which executions data n8n saves. For example, you can save only executions that result in an Error
.
1 2 3 4 5 6 7 8 9 10 11 12 |
|
1 2 3 4 5 6 7 8 9 |
|
1 2 3 4 5 6 7 |
|
Enable data pruning#
You can enable data pruning to automatically delete finished executions after a given time. If you don't set EXECUTIONS_DATA_MAX_AGE
, 336 hours (14 days) is the default.
You can choose to prune finished executions data before the time set in EXECUTIONS_DATA_MAX_AGE
, using EXECUTIONS_DATA_PRUNE_MAX_COUNT
. This sets a maximum number of executions to store in the database. Once you reach the limit, n8n starts to delete the oldest execution records. This can help with database performance issues, especially if you use SQLite. The database size can still exceed the limit you set: old executions that haven't finished running don't get deleted, even if they would otherwise be subject to deletion.
1 2 3 4 5 6 7 8 9 |
|
1 2 3 4 5 6 7 |
|
1 2 3 4 5 6 |
|
SQLite
If you run n8n using the default SQLite database, the disk space of any pruned data isn't automatically freed up but rather reused for future executions data. To free up this space configure the DB_SQLITE_VACUUM_ON_STARTUP
environment variable or manually run the VACUUM operation.
Binary data pruning
Binary data pruning operates on the active binary data mode. For example, if your instance stored data in S3, and you later switched to filesystem mode, n8n only prunes binary data in the filesystem. This may change in future.