Keep your n8n instance tidy by removing old or failed runs on a set schedule. This helps admins and ops teams control storage, speed up maintenance, and avoid manual cleanups.
Two triggers start the flow. A schedule trigger runs at your chosen time, and a manual trigger lets you test safely. The n8n API node lists all executions and sends them to a filter. An If node checks each run against your rules, like status or age. Matches go to a delete action that removes each execution by its id. Items that do not match are sent to a no operation step, so nothing happens to them.
Setup is simple. Create an n8n credential for the n8n API nodes, set your schedule, and define your delete rules in the If node. Expect less clutter, fewer errors, and faster admin work. Great for auto clearing failed runs, purging old successes after backups, or keeping a lean history on shared instances.