Templates / Purge n8n execution history located in Mysql

Purge n8n execution history located in Mysql

Needs changes

by Miquel Colomer ✓ · 2,458 views · created 2020-10-04 · DevOps

Needs changes. This template uses 1 thing(s) that n8n 3.0 removes: Cron. 1 breaking item(s) found. Static check, last run 2026-10-19.

What to replace before upgrading

Removed in 3.0Replace with
Cron
Cron
Schedule Trigger

Nodes used (3)

MySQL

What it does

This workflow is useful if you have lots of tasks running daily. MySQL node (or the database used to save data shown in n8n - could be Mongo, Postgres, ... -) remove old entries from executionentity table that contains the history of the executed workflows. !workflow-screenshot(fileId:267) If you have multiple tasks executed every minute, 1024 rows will be created every day (60 minutes x 24 hours) per every task. This will increase the table size fastly. SQL query deletes entries older than 30 days taking stoppedAt column as a reference for date calculations. !image.png(fileId:265) You only have to setup Mysql connection properly and config cron to execute once per day in a low traffic hour, this way !image.png(fileId:266)

View the original on n8n.io → Check your own copy

Get the weekly “what broke” email

New templates, newly broken ones, and n8n release changes. One short email a week.

Form not loading? Subscribe here.