Automated execution cleanup system with n8n API and custom retention rules
Ready for 3.0Ready for 3.0. This template uses no nodes that n8n 3.0 removes. No removed nodes, versions or helpers found. Static check, last run 2026-10-19.
What this workflow does
This workflow has 5 nodes and runs on a schedule (every day at 02:00). It uses only n8n's built-in nodes.
How it runs
Trigger: On a schedule (every day at 02:00).
- Get many executions (n8n): work with execution
- Set Executions to Keep (Edit Fields (Set)): sets 1 field: executionsToKeep
- Code: runs custom JavaScript code
- Delete an execution (n8n): delete (execution)
Before you upgrade to n8n 3.0
Nothing in this workflow is removed in n8n 3.0, so it should import and run after the upgrade.
Nodes used (4)
- Schedule Trigger
n8n-nodes-base.scheduleTrigger - n8n
n8n-nodes-base.n8n - Code
n8n-nodes-base.code - Edit Fields (Set)
n8n-nodes-base.set
From the author
Make your n8n instance faster, cleaner, and more efficient by deleting old workflow executions — while keeping only the most recent ones you actually need. Whether you're using n8n Cloud or self-hosted, this lightweight workflow helps reduce database/storage…