Performance issue

Data pruning needed in n8n

Why missing data retention policies can fill your database and slow down n8n

What is this issue?

Without data pruning configured, n8n stores all execution data indefinitely. Over time, this accumulates gigabytes of data that slow down the UI, increase backup times, and can eventually fill disk space.

Signs you need pruning:

  • Execution history taking longer to load
  • Database size growing continuously
  • Backup times increasing week over week
  • Disk space alerts on your server

Why is this dangerous?

Disk exhaustion

Without pruning, the database will eventually fill all available storage.

Performance degradation

Large tables slow down queries, making the n8n UI sluggish.

Backup failures

Oversized databases may fail to backup within maintenance windows.

Increased costs

Cloud storage costs grow linearly with unpruned data.

How to fix it

  1. 1

    Enable automatic pruning

    Set EXECUTIONS_DATA_PRUNE=true in your environment variables.

  2. 2

    Set retention period

    Configure EXECUTIONS_DATA_MAX_AGE (e.g., '336h' for 14 days) based on your compliance needs.

  3. 3

    Limit stored executions

    Set EXECUTIONS_DATA_PRUNE_MAX_COUNT to cap the total number of stored executions.

  4. 4

    Schedule manual cleanup

    For existing data, run a one-time cleanup script to remove old executions.

Scan your workflow now

Upload your n8n workflow JSON and check for data retention configuration issues.

Scan for data issues

Related resources

Related performance issues