{
  "name": "Schedule Trigger Workflow",
  "nodes": [
    {
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "cronExpression",
              "expression": "0 */5 * * * *"
            }
          ]
        }
      },
      "id": "schedule-trigger",
      "name": "Every 5 Minutes",
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1,
      "position": [
        250,
        300
      ]
    },
    {
      "parameters": {
        "requestMethod": "GET",
        "url": "https://api.example.com/health",
        "options": {}
      },
      "id": "check-health",
      "name": "Check API Health",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 1,
      "position": [
        450,
        300
      ]
    },
    {
      "parameters": {
        "conditions": {
          "number": [
            {
              "value1": "={{$json.status}}",
              "operation": "notEqual",
              "value2": 200
            }
          ]
        }
      },
      "id": "check-status",
      "name": "IF Unhealthy",
      "type": "n8n-nodes-base.if",
      "typeVersion": 1,
      "position": [
        650,
        300
      ]
    },
    {
      "parameters": {
        "fromEmail": "monitor@example.com",
        "toEmail": "admin@example.com",
        "subject": "API Health Alert",
        "text": "The API health check failed at {{$now}}"
      },
      "id": "send-alert",
      "name": "Send Alert Email",
      "type": "n8n-nodes-base.emailSend",
      "typeVersion": 1,
      "position": [
        850,
        200
      ]
    },
    {
      "parameters": {
        "functionCode": "// Log successful check\nreturn [{\n  json: {\n    status: 'healthy',\n    checkedAt: new Date().toISOString()\n  }\n}];"
      },
      "id": "log-success",
      "name": "Log Success",
      "type": "n8n-nodes-base.function",
      "typeVersion": 1,
      "position": [
        850,
        400
      ]
    }
  ],
  "connections": {
    "Every 5 Minutes": {
      "main": [
        [
          {
            "node": "Check API Health",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check API Health": {
      "main": [
        [
          {
            "node": "IF Unhealthy",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "IF Unhealthy": {
      "main": [
        [
          {
            "node": "Send Alert Email",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Log Success",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}