Reduce n8n execution-history storage costs

Control n8n history growth with selective execution storage, age and count limits, binary-data checks and a recovery-aware retention policy.

Last updated

In short

  • Keeping fewer successful payloads can reduce stored history while preserving a separate business audit record.
  • Execution age, count and binary-data mode all affect cleanup.
  • Pruning is deletion; restoring a configuration value cannot recover removed history.
On this page (6)

Costs and savings · Part of n8n

Editable CSV with a worked example and fields for your own assessment. Example rows are illustrative, not measured results.

Download the n8n retention decision worksheet

An n8n database can grow even when the number of workflows stays constant. Every retained execution may contain inputs, outputs and binary data. The cost decision is which evidence the organization needs, where it belongs and how long it should remain—not whether every run can be kept forever.

This is a reference review procedure. It does not prescribe a universal retention period or claim that cleanup has been tested on your deployment.

Separate operational history from business records

A successful workflow may write an invoice or update a customer record in an authoritative system. Its full execution payload may be useful for debugging, but it is not necessarily the correct long-term business archive. Conversely, deleting it without a separate record can remove the only evidence that a handoff occurred.

Information Possible purpose Retention decision
Successful execution payload Debugging and reconciliation Keep only as long as needed for those tasks
Failed execution payload Diagnosis and safe replay Protect sensitive data and set an incident window
Business transaction record Audit and process ownership Store in the agreed authoritative system
Binary files Documents moving through a workflow Coordinate with file lifecycle and storage mode
Manual test executions Development Keep separate from production retention assumptions

The execution-data guide documents saving choices and pruning behavior. Read it against the installed release and workflow-level settings before changing a global value.

Measure what actually occupies space

Record execution volume, typical payload size, binary storage mode, database size and failure rate over a representative period. Include unusually large imports and workflows that wait for a later event. Check whether a few workflows dominate storage.

A hypothetical workload of 20,000 saved runs per day at an average 50 KB of retained data produces roughly 1 GB daily before database indexes and other overhead. That is a planning calculation, not an n8n benchmark. A workflow carrying documents can be far larger than the average.

Reducing what is saved may be more effective than merely shortening the age limit. For example, successful low-risk syncs may need a compact transaction result while failures need enough diagnostic detail. Confirm the ability to investigate and reconcile before changing the policy.

Check every cleanup boundary

The upstream guide documents both age and count criteria, exclusions and the behavior of active binary-data storage. Verify the exact settings in your release. A storage-mode change can leave historical data in a previous backend that requires a separate reviewed plan.

Queue deployments add shared dependencies. Queue-mode documentation explains the components that need access to execution and credential state. Do not remove a file path simply because one worker no longer appears to use it; identify the shared design first.

Database deletion is not identical to returning disk space to the operating system. For PostgreSQL, vacuum behavior explains reuse versus physical shrinking. Report the actual footprint and invoice effect, not only the number of deleted execution rows.

Make the change reversible where possible

Back up the relevant database, configuration and credential encryption material under the approved security controls. Verify a recovery path in isolation. Record the original retention settings and the intended deletion scope.

Changing a setting back only affects future behavior; it does not recreate permanently deleted history. The business owner must accept that consequence. Protect a sample or approved archive when needed for a current investigation, and account for its separate retention policy.

Test the cases that should survive

Use a nonproduction copy or controlled sample to check a recent success, an old success, a failure, a waiting execution and an execution containing binary data. Verify the behavior specified for your version. Confirm that ordinary scheduling, webhook intake and credential access still work after the change.

Then test an actual support question: can an operator establish whether a transaction succeeded, find the target record and safely handle a retry without duplication? A smaller database is not enough if staff lose the ability to resolve incidents.

Record the economic outcome

Measure stored bytes and growth after a suitable observation period. Include cleanup effort, any archive and changes in backup size. A fixed-volume bill may stay unchanged until the next capacity decision; that is delayed expenditure rather than an immediate saving.

Use the downloadable worksheet to keep the policy and evidence together, and the n8n cost calculator to include infrastructure, upstream licences and workflow maintenance. Retention is one operating decision inside that wider service, not a substitute for reliable error handling and recovery.

Sources and further reading

Use the linked documentation to confirm the version, edition and contract that apply to your project.

Review our n8n operating plan

Bring your current bill, required capabilities and workload assumptions. We will separate recurring operation from migration and retained services.