⚡ Only 300 spots remaining • Closes in 2d 14h 32m

Back to Workflow Library
Developer Tools
Featured Blueprint
High Voltage

MySQL Performance & Slow Query Alert

Optimize your database efficiency. This workflow runs every 4 hours. It connects to your MySQL server and queries the information_schema to find threads that have been running longer than 10 seconds. It formats the offending SQL and sends an emergency alert to the engineering Discord channel for immediate triage.

#MySQL
#Database
#Performance
#Discord
#SRE

Automation Logic

n8n JSON Blueprint

This workflow is pre-configured and ready for deployment. Simply import the JSON template into your n8n instance and configure your credentials.

This is an exclusive blueprint. Copy the JSON below to use it.

QUICK DEPLOY

  • 1
    Download the .json file
  • 2
    Open n8n & click "Import"
  • 3
    Configure your API keys

PRO TIP

Always test your workflow in a development environment before pushing to production.

JSON BLUEPRINT

n8n-workflow.json
{
  "nodes": [
    {
      "parameters": {
        "interval": 4,
        "unit": "hours"
      },
      "name": "Every 4h",
      "type": "n8n-nodes-base.cron",
      "typeVersion": 1,
      "position": [250, 300]
    },
    {
      "parameters": {
        "operation": "executeQuery",
        "query": "SELECT * FROM information_schema.processlist WHERE time > 10 AND command != 'Sleep';"
      },
      "name": "Check Slow Queries",
      "type": "n8n-nodes-base.mySql",
      "typeVersion": 2,
      "position": [450, 300]
    },
    {
      "parameters": {
        "url": "YOUR_DISCORD_WEBHOOK",
        "method": "POST",
        "bodyParametersUi": {
          "parameter": [
            {
              "name": "content",
              "value": "=⚠️ SLOW QUERY DETECTED\nUser: {{$json[\"USER\"]}}\nTime: {{$json[\"TIME\"]}}s\nSQL: {{$json[\"INFO\"]}}"
            }
          ]
        }
      },
      "name": "Discord Alert",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 3,
      "position": [650, 300]
    }
  ],
  "connections": {
    "Every 4h": {
      "main": [[{"node": "Check Slow Queries", "type": "main", "index": 0}]]
    },
    "Check Slow Queries": {
      "main": [[{"node": "Discord Alert", "type": "main", "index": 0}]]
    }
  }
}

To use this, copy the JSON above and paste it directly onto your n8n canvas.

IMPLEMENTATION GUIDE

Required Nodes

  • MySQL Node
  • Database Node
  • Performance Node
  • Discord Node
  • SRE Node
  • Cron / Webhook Trigger

Core Benefits

  • 100% Automated Execution
  • Reduces Manual Data Entry
  • Infinite Scalability

Need Help Building Your Private Cloud?

Join the elite marketers who have offloaded their entire backend to n8n. Get direct support and custom builds in our private forum.

user