AutomationFlowsGeneral › API Health Check with Email Alerts

API Health Check with Email Alerts

Original n8n title: API Health Check

API Health Check. Uses httpRequest, emailSend. Scheduled trigger; 5 nodes.

Cron / scheduled trigger★★☆☆☆ complexity5 nodesHTTP RequestEmail Send
General Trigger: Cron / scheduled Nodes: 5 Complexity: ★★☆☆☆ Added:

This workflow follows the Emailsend → HTTP Request 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": "API Health Check",
  "nodes": [
    {
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "minutes",
              "minutesInterval": 5
            }
          ]
        }
      },
      "id": "schedule-trigger",
      "name": "Every 5 minutes",
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1,
      "position": [
        250,
        300
      ]
    },
    {
      "parameters": {
        "url": "${API_ENDPOINT}/health",
        "authentication": "none",
        "sendQuery": false,
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "User-Agent",
              "value": "n8n-health-checker/1.0"
            }
          ]
        },
        "options": {
          "timeout": 10000,
          "response": {
            "response": {
              "fullResponse": true
            }
          }
        }
      },
      "id": "health-check",
      "name": "Check API Health",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4,
      "position": [
        450,
        300
      ]
    },
    {
      "parameters": {
        "conditions": {
          "number": [
            {
              "value1": "={{$json.statusCode}}",
              "operation": "notEqual",
              "value2": 200
            }
          ]
        }
      },
      "id": "if-unhealthy",
      "name": "Check Status",
      "type": "n8n-nodes-base.if",
      "typeVersion": 1,
      "position": [
        650,
        300
      ]
    },
    {
      "parameters": {
        "fromEmail": "${ALERT_FROM_EMAIL}",
        "toEmail": "${ALERT_TO_EMAIL}",
        "subject": "API Health Check Failed",
        "text": "=API health check failed at {{$now.toISO()}}\n\nStatus Code: {{$json.statusCode}}\nResponse: {{JSON.stringify($json.body, null, 2)}}\n\nPlease investigate immediately.",
        "options": {}
      },
      "id": "send-alert",
      "name": "Send Alert Email",
      "type": "n8n-nodes-base.emailSend",
      "typeVersion": 2,
      "position": [
        850,
        200
      ]
    },
    {
      "parameters": {
        "values": {
          "string": [
            {
              "name": "status",
              "value": "healthy"
            },
            {
              "name": "checkedAt",
              "value": "={{$now.toISO()}}"
            }
          ]
        },
        "options": {}
      },
      "id": "log-success",
      "name": "Log Success",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3,
      "position": [
        850,
        400
      ]
    }
  ],
  "connections": {
    "Every 5 minutes": {
      "main": [
        [
          {
            "node": "Check API Health",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check API Health": {
      "main": [
        [
          {
            "node": "Check Status",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check Status": {
      "main": [
        [
          {
            "node": "Send Alert Email",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Log Success",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1",
    "saveManualExecutions": false,
    "callerPolicy": "workflowsFromSameOwner",
    "errorWorkflow": ""
  },
  "staticData": null,
  "tags": [
    "monitoring",
    "health-check"
  ],
  "triggerCount": 1,
  "updatedAt": "2024-01-01T00:00:00.000Z",
  "versionId": null
}
Pro

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

About this workflow

API Health Check. Uses httpRequest, emailSend. Scheduled trigger; 5 nodes.

Source: https://github.com/pvdyck/n8n-tdd-framework/blob/1417ba0de755ef06ca873baee44b2192f5c42c5c/templates/api-health-check.json — 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

Politician Research Pipeline. Uses httpRequest, emailSend. Scheduled trigger; 9 nodes.

HTTP Request, Email Send
General

Arenza — Monthly Competitor Comparison Email. Uses httpRequest, emailSend. Scheduled trigger; 6 nodes.

HTTP Request, Email Send
General

backup. Uses googleDrive, httpRequest. Scheduled trigger; 15 nodes.

Google Drive, HTTP Request
General

Smart google indexing: sitemap filter and url inspection. Uses httpRequest, xml, splitOut, scheduleTrigger. Scheduled trigger; 13 nodes.

HTTP Request, XML
General

Yourang - Complete Workflow Example. Uses n8n-nodes-yourang, httpRequest. Scheduled trigger; 10 nodes.

N8N Nodes Yourang, HTTP Request