AutomationFlowsSlack & Telegram › System Health Check

System Health Check

System Health Check. Uses httpRequest, postgres, slack. Scheduled trigger; 10 nodes.

Cron / scheduled trigger★★★★☆ complexity10 nodesHTTP RequestPostgresSlack
Slack & Telegram Trigger: Cron / scheduled Nodes: 10 Complexity: ★★★★☆ Added:

This workflow follows the HTTP Request → Postgres recipe pattern — see all workflows that pair these two integrations.

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
{
  "name": "System Health Check",
  "nodes": [
    {
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "minutes",
              "minutesInterval": 5
            }
          ]
        }
      },
      "name": "Every 5 Minutes",
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1,
      "position": [
        250,
        400
      ]
    },
    {
      "parameters": {
        "operation": "executeQuery",
        "query": "SELECT 1 as health_check",
        "options": {}
      },
      "name": "Check Database",
      "type": "n8n-nodes-base.postgres",
      "typeVersion": 2,
      "position": [
        450,
        300
      ]
    },
    {
      "parameters": {
        "url": "http://host.docker.internal:11434/api/tags",
        "options": {}
      },
      "name": "Check Ollama",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 3,
      "position": [
        450,
        400
      ]
    },
    {
      "parameters": {
        "operation": "executeQuery",
        "query": "SELECT \n  (SELECT COUNT(*) FROM signal_objects WHERE processed = false) as unprocessed_signals,\n  (SELECT COUNT(*) FROM content_intent_objects WHERE status = 'DRAFT') as draft_cios,\n  (SELECT COUNT(*) FROM content_intent_objects WHERE status = 'SCHEDULED') as scheduled_cios,\n  (SELECT COUNT(*) FROM execution_metrics WHERE created_at > NOW() - INTERVAL '1 hour') as recent_executions",
        "options": {}
      },
      "name": "Check Queue Depth",
      "type": "n8n-nodes-base.postgres",
      "typeVersion": 2,
      "position": [
        450,
        500
      ]
    },
    {
      "parameters": {
        "jsCode": "const dbCheck = $('Check Database').first();\nconst ollamaCheck = $('Check Ollama').first();\nconst queueCheck = $('Check Queue Depth').first();\n\nconst health = {\n  timestamp: new Date().toISOString(),\n  status: 'healthy',\n  checks: {\n    database: {\n      status: dbCheck.json ? 'healthy' : 'unhealthy',\n      message: dbCheck.json ? 'Connected' : 'Connection failed'\n    },\n    ollama: {\n      status: ollamaCheck.json ? 'healthy' : 'unhealthy',\n      message: ollamaCheck.json ? 'Available' : 'Not accessible'\n    },\n    queue: {\n      unprocessed_signals: queueCheck.json?.unprocessed_signals || 0,\n      draft_cios: queueCheck.json?.draft_cios || 0,\n      scheduled_cios: queueCheck.json?.scheduled_cios || 0,\n      recent_executions: queueCheck.json?.recent_executions || 0\n    }\n  }\n};\n\n// Determine overall status\nif (!dbCheck.json || !ollamaCheck.json) {\n  health.status = 'unhealthy';\n} else if (queueCheck.json?.unprocessed_signals > 100) {\n  health.status = 'degraded';\n  health.warning = 'High queue depth';\n}\n\nreturn health;"
      },
      "name": "Aggregate Health",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        650,
        400
      ]
    },
    {
      "parameters": {
        "conditions": {
          "string": [
            {
              "value1": "={{ $json.status }}",
              "value2": "unhealthy"
            }
          ]
        }
      },
      "name": "Is Unhealthy?",
      "type": "n8n-nodes-base.if",
      "typeVersion": 1,
      "position": [
        850,
        400
      ]
    },
    {
      "parameters": {
        "jsCode": "// Log health status\nconst health = $input.item.json;\n\nconsole.log('=== MetalOS Health Check ===');\nconsole.log(`Status: ${health.status}`);\nconsole.log(`Database: ${health.checks.database.status}`);\nconsole.log(`Ollama: ${health.checks.ollama.status}`);\nconsole.log(`Queue - Signals: ${health.checks.queue.unprocessed_signals}`);\nconsole.log(`Queue - Draft CIOs: ${health.checks.queue.draft_cios}`);\nconsole.log(`Queue - Scheduled: ${health.checks.queue.scheduled_cios}`);\nconsole.log(`Recent Executions: ${health.checks.queue.recent_executions}`);\n\nif (health.warning) {\n  console.warn(`WARNING: ${health.warning}`);\n}\n\nreturn health;"
      },
      "name": "Log Health Status",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        1050,
        500
      ]
    },
    {
      "parameters": {
        "jsCode": "const health = $input.item.json;\n\nreturn {\n  alert: true,\n  severity: 'critical',\n  message: `MetalOS Health Check Failed!`,\n  details: health,\n  timestamp: new Date().toISOString()\n};"
      },
      "name": "Create Alert",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        1050,
        300
      ]
    }
  ],
  "connections": {
    "Every 5 Minutes": {
      "main": [
        [
          {
            "node": "Check Database",
            "type": "main",
            "index": 0
          },
          {
            "node": "Check Ollama",
            "type": "main",
            "index": 0
          },
          {
            "node": "Check Queue Depth",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check Database": {
      "main": [
        [
          {
            "node": "Aggregate Health",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check Ollama": {
      "main": [
        [
          {
            "node": "Aggregate Health",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check Queue Depth": {
      "main": [
        [
          {
            "node": "Aggregate Health",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Aggregate Health": {
      "main": [
        [
          {
            "node": "Is Unhealthy?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Is Unhealthy?": {
      "main": [
        [
          {
            "node": "Create Alert",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Log Health Status",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create Alert": {
      "main": [
        [
          {
            "node": "Log Health Status",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1"
  },
  "tags": [
    {
      "name": "Phase 4",
      "id": "phase4"
    },
    {
      "name": "Monitoring",
      "id": "monitoring"
    }
  ]
}

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

System Health Check. Uses httpRequest, postgres, slack. Scheduled trigger; 10 nodes.

Source: https://github.com/kyletaylored/n8n-docker-demo/blob/84bda45802ceaf2a5ac14b7d45606f1d78cb750b/examples/n8n-demo/workflows/02-system-health-check.json — original creator credit. Request a take-down →

More Slack & Telegram workflows → · Browse all categories →

Related workflows

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

Slack & Telegram

The template allows to make Dropcontact batch requests up to 250 requests every 10 minutes (1500/hour). Valuable if high volume email enrichment is expected.

Postgres, HTTP Request, Slack
Slack & Telegram

Crypto Price Tracker. Uses httpRequest, postgres, slack. Scheduled trigger; 9 nodes.

HTTP Request, Postgres, Slack
Slack & Telegram

WF-7: Health Check. Uses httpRequest, slack, postgres. Scheduled trigger; 7 nodes.

HTTP Request, Slack, Postgres
Slack & Telegram

Heavy IO — HTTP + DB + Slack (well-handled). Uses httpRequest, postgres, slack. Scheduled trigger; 5 nodes.

HTTP Request, Postgres, Slack
Slack & Telegram

debug. Uses httpRequest, slack, redis, mailgun. Scheduled trigger; 60 nodes.

HTTP Request, Slack, Redis +2