AutomationFlowsGeneral › MySQL Purge Old History >10 Days

MySQL Purge Old History >10 Days

Original n8n title: N8n Mysql Purge History Greater Than 10 Days

n8n_mysql_purge_history_greater_than_10_days. Uses manualTrigger, mySql. Event-driven trigger; 3 nodes.

Event trigger★☆☆☆☆ complexity3 nodesMySQL
General Trigger: Event Nodes: 3 Complexity: ★☆☆☆☆ Added:

The workflow JSON

Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →

Download .json
{
  "id": "60",
  "name": "n8n_mysql_purge_history_greater_than_10_days",
  "nodes": [
    {
      "name": "On clicking 'execute'",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        250,
        300
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "name": "MySQL",
      "type": "n8n-nodes-base.mySql",
      "position": [
        450,
        300
      ],
      "parameters": {
        "query": "DELETE FROM execution_entity \nWHERE DATE(stoppedAt) < DATE_SUB(CURDATE(), INTERVAL 30 DAY)",
        "operation": "executeQuery"
      },
      "credentials": {
        "mySql": "<your credential>"
      },
      "typeVersion": 1
    },
    {
      "name": "Cron",
      "type": "n8n-nodes-base.cron",
      "position": [
        250,
        460
      ],
      "parameters": {
        "triggerTimes": {
          "item": [
            {
              "hour": 7
            }
          ]
        }
      },
      "typeVersion": 1
    }
  ],
  "active": true,
  "settings": {},
  "connections": {
    "Cron": {
      "main": [
        [
          {
            "node": "MySQL",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "On clicking 'execute'": {
      "main": [
        [
          {
            "node": "MySQL",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}

Credentials you'll need

Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.

Pro

For the full experience including quality scoring and batch install features for each workflow upgrade to Pro

About this workflow

n8n_mysql_purge_history_greater_than_10_days. Uses manualTrigger, mySql. Event-driven trigger; 3 nodes.

Source: https://github.com/Zie619/n8n-workflows — original creator credit. Request a take-down →

More General workflows → · Browse all categories →

Related workflows

Workflows that share integrations, category, or trigger type with this one. All free to copy and import.

General

GoogleSheets MySQL Integration. Uses manualTrigger, compareDatasets, noOp, scheduleTrigger. Event-driven trigger; 15 nodes.

Google Sheets, MySQL
General

Manual Schedule. Uses manualTrigger, n8n, scheduleTrigger, noOp. Event-driven trigger; 7 nodes.

n8n
General

Manual Schedule. Uses manualTrigger, signl4, openWeatherMap, scheduleTrigger. Event-driven trigger; 5 nodes.

Signl4, OpenWeatherMap
General

Auto - Resume Disabled Workflows. Uses manualTrigger, n8n, scheduleTrigger. Event-driven trigger; 5 nodes.

n8n
General

OpenClaw — Cron Job Management. Uses CUSTOM. Event-driven trigger; 3 nodes.

Custom