Automated Purge of N8N Execution History in MySQL

This workflow automates the deletion of N8N execution history older than 30 days from a MySQL database.

n8n
Automated Purge of N8N Execution History in MySQL

The '700-purge-n8n-execution-history-located-in-mysql' workflow is designed to streamline the management of N8N execution history stored in a MySQL database. By utilizing a scheduled cron trigger, this automation allows for the regular purging of old execution records, specifically those that are older than 30 days. This helps in maintaining a clean database, optimizing performance, and ensuring that unnecessary data does not accumulate over time.

The workflow consists of three main nodes: a manual trigger for ad-hoc executions, a MySQL node that executes the deletion query, and a cron node that automates the process on a daily basis at a specified hour. This setup provides flexibility, allowing users to either run the workflow manually when needed or rely on the automated schedule for routine maintenance.

This workflow can be particularly beneficial for organizations that rely heavily on N8N for automation tasks and need to manage their database effectively. Keeping the execution history under control not only enhances database performance but also improves the overall efficiency of N8N workflows. Additionally, it ensures compliance with data retention policies by systematically removing outdated records.

Use cases for this workflow include any N8N user looking to maintain their execution history without manual intervention. It is especially useful in environments with frequent executions, where the volume of historical data can grow rapidly, leading to potential slowdowns and management challenges.

$14.99
Last updated September 5, 2026
30-day money-back guarantee
Instant download
Lifetime updates included

New buyers can create an account from the cart to unlock a controlled $10 first-purchase credit on eligible orders of $25+.

Secure checkout powered by Stripe

Support

How to import this workflow into n8n

  1. 1Purchase or download the workflow to get the n8n workflow JSON file.
  2. 2In your n8n instance, open Workflows and choose "Import from File" (or paste the JSON with Ctrl+V on the canvas).
  3. 3Open each node marked with a credential warning and connect your own accounts and API keys.
  4. 4Run the workflow once manually to verify the data flow, then toggle it to Active.

Related AI workflows

More from BestWorkflows

Need this deployed? We'll set it up for you.

Our automation experts deploy this workflow in your stack, connect your accounts, and verify it works — or build a custom solution from scratch.