When you build automation workflows in n8n, each run creates an execution record. This includes useful information like the workflow steps, inputs, outputs, and any errors that may have occurred.
Over time, especially if your workflows run frequently, these records can pile up. Without proper housekeeping, your n8n instance could end up with tens of thousands of executions, making your database grow unnecessarily large and potentially slowing down performance.
That’s where Tidy Up comes in.
Get this AI Course to start learning AI easily. Use the discount code QPT. Contact me to learn AI, including RAG, MCP, and AI Agents.
🔑 What is Tidy Up in n8n?
Tidy Up in n8n is a built-in feature that automatically deletes old execution records based on rules you set. Think of it as a self-cleaning system for your automations.
Instead of manually removing old logs, you can configure n8n to:
-
Keep only the most recent X number of executions, or
-
Delete executions older than X days.
This ensures your n8n stays fast, lightweight, and efficient.
⚡ Why Do You Need Tidy Up?
Here are the main reasons to enable tidy up:
1. Save Storage Space
Every workflow execution is stored in your database. For frequent workflows, this can quickly add up. Tidy up helps prevent database bloat.
2. Improve Performance
A smaller database means faster queries and smoother operation of the n8n editor and executions list.
3. Set It and Forget It
Once configured, tidy up runs automatically in the background. You don’t need to manually clean up executions.
4. Keep Only What Matters
You decide how many logs you want to keep or how long they should be retained, giving you full control over your data.
⚙️ How Tidy Up Works
You can configure tidy-up settings in two ways:
1. Using Environment Variables (for self-hosted setups)
In your n8n configuration, add:
2. Using the n8n UI (Cloud and new versions)
-
Go to Settings → Executions → Tidy up.
-
Choose your rules:
-
Max age (e.g., delete after 30 or 90 days).
-
Max count (e.g., keep only the last 5,000 executions).
-
n8n will then automatically prune executions that fall outside your rules.
📌 Example: Why Tidy Up Matters
Imagine you have a workflow that checks your Gmail inbox every 5 minutes.
-
That’s 288 executions per day.
-
In a month, that’s ~8,640 executions.
-
In six months, you’d be storing over 50,000 execution records.
Without tidy up:
-
Your database becomes huge.
-
Performance may start to degrade.
With tidy up:
-
You configure n8n to keep only the last 10,000 executions or 60 days of history.
-
Old executions are automatically deleted, and your instance stays lean.
🔮 Best Practices for Using Tidy Up
-
Choose retention rules based on workflow importance
-
For testing workflows, keep only recent runs.
-
For critical workflows, retain a longer history.
-
-
Use both max age and max count together
-
Example: Keep only 90 days of executions, but never exceed 20,000 records.
-
-
Monitor storage usage
-
If your database grows too fast, tighten tidy-up rules.
-
-
Export important logs before pruning
-
If you need long-term records, consider exporting logs to an external system before tidy up deletes them.
-
🎯 Conclusion
Tidy Up in n8n is a simple yet powerful feature that ensures your workflows remain fast, efficient, and manageable. By automatically pruning old executions, you:
-
Save valuable storage space,
-
Keep your n8n instance running smoothly, and
-
Reduce manual maintenance.
If you’re running n8n in production or have workflows that execute often, enabling tidy up is a must.
With the right tidy-up strategy, your automations will stay clean, lightweight, and ready to scale.
Get this AI Course to start learning AI easily. Use the discount code QPT. Contact me to learn AI, including RAG, MCP, and AI Agents.
No comments:
Post a Comment