Skip to main content

Purge n8n execution history located in Mysql

Workflow preview

Workflow preview
100%
Purge n8n execution history located in Mysql preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

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 execution entity ...

Best for

  • DevOps automation workflows
  • beginner n8n builders looking for reusable templates

Tools used

n8n-nodes-base.manualtrigger, n8n-nodes-base.mysql, n8n-nodes-base.cron

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Miquel Colomer.

Original n8n.io source

1.1 Workflow description

Title
Purge n8n execution history located in Mysql
Workflow name
Purge n8n execution history located in Mysql

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 execution_entity table that contains the history of the executed workflows.

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.

You only have to setup Mysql connection properly and config cron to execute once per day in a low traffic hour, this way

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - On clicking 'execute'

Type / Role
n8n-nodes-base.manualTrigger - manualTrigger
Config choices
Version 1

Block 2 - MySQL

Type / Role
n8n-nodes-base.mySql - mySql
Config choices
Version 1

Block 3 - Cron

Type / Role
n8n-nodes-base.cron - cron
Config choices
Version 1

3. Summary Table

Workflow Purge n8n execution history located in Mysql
Complexity beginner
Nodes 3
Categories DevOps
Author Miquel Colomer
Published 04 Oct 2020

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/700/700.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Purge n8n execution history located in Mysql do?

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 execution entity ...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your DevOps use case.