{
  "name": "08 · DevOps & Monitoring / Deploy Health Gate",
  "active": false,
  "nodes": [
    {
      "id": "1e028b7e-38ec-45f6-96ab-c4fd6cda06fb",
      "name": "📘 Guide",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -640,
        -120
      ],
      "parameters": {
        "content": "## 08 · DevOps & Monitoring · Deploy Health Gate\n\n### What this does\nCI deploy webhook waits, checks health/error rate, auto-rolls back via HTTP if unhealthy.\n\n### Setup checklist\n1. CI webhook\n2. Health + metrics URLs\n3. Rollback API\n\n### How to test locally\nPOST `ops-deploy` with `{ \"version\":\"1.2.3\", \"healthUrl\":\"https://httpbin.org/status/200\" }`\n\n### Tips\n- Keep credentials in n8n Credentials (never hardcode secrets).\n- Use **Test URL** on the Webhook while developing.\n- Activate only after credentials + destinations are configured.\n",
        "width": 560,
        "height": 560,
        "color": 8
      }
    },
    {
      "id": "f326d1d1-10ff-4c94-9189-6b429d1ec272",
      "name": "⚙️ Config",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -640,
        480
      ],
      "parameters": {
        "content": "## Config map\n\n- **Webhook path:** `ops-deploy`\n- **Replace** all `https://httpbin.org/...` calls with real integrations.\n- **Credentials:** create in n8n → Credentials, then select on HTTP nodes.\n- **Activate** workflow only after a successful Test execution.\n\n### Local files\nShared host folder is mounted at `/files` inside n8n.",
        "width": 560,
        "height": 320,
        "color": 2
      }
    },
    {
      "id": "3f75bd92-00b7-4950-b973-2b9af3676422",
      "name": "Start Sequence",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2,
      "position": [
        0,
        200
      ],
      "webhookId": "6312d965-f293-4cd4-b583-281e1934129e",
      "parameters": {
        "httpMethod": "POST",
        "path": "ops-deploy",
        "responseMode": "responseNode",
        "options": {}
      }
    },
    {
      "id": "9e48cd69-c3fc-42ef-a871-d7d8fb6494b5",
      "name": "Step 1 · Confirm",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        280,
        200
      ],
      "parameters": {
        "mode": "manual",
        "duplicateItem": false,
        "assignments": {
          "assignments": [
            {
              "id": "1",
              "name": "step",
              "value": 1,
              "type": "number"
            },
            {
              "id": "2",
              "name": "message",
              "value": "Confirmation sent (replace with Email/SMS node)",
              "type": "string"
            },
            {
              "id": "3",
              "name": "data",
              "value": "={{ $json.body || $json }}",
              "type": "object"
            }
          ]
        },
        "options": {}
      }
    },
    {
      "id": "e0169251-48d1-42e0-9edf-8934d2b98de1",
      "name": "Wait Before Reminder",
      "type": "n8n-nodes-base.wait",
      "typeVersion": 1.1,
      "position": [
        560,
        200
      ],
      "webhookId": "1b59d8db-ec31-4ace-954f-58c0d600a791",
      "parameters": {
        "resume": "timeInterval",
        "amount": 3,
        "unit": "seconds"
      }
    },
    {
      "id": "8e3ea01f-8b7c-4468-ae30-9969113ab858",
      "name": "Step 2 · Reminder",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        840,
        200
      ],
      "parameters": {
        "mode": "manual",
        "duplicateItem": false,
        "assignments": {
          "assignments": [
            {
              "id": "1",
              "name": "step",
              "value": 2,
              "type": "number"
            },
            {
              "id": "2",
              "name": "message",
              "value": "Reminder prepared",
              "type": "string"
            }
          ]
        },
        "options": {}
      }
    },
    {
      "id": "21a8183f-09a6-4988-9b5d-1c47e99a7d7d",
      "name": "Send Messages",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        1120,
        200
      ],
      "parameters": {
        "method": "POST",
        "url": "https://httpbin.org/post",
        "options": {},
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={{ JSON.stringify($json) }}"
      }
    },
    {
      "id": "e455b345-612e-4ee9-a982-642b1c864d7f",
      "name": "Webhook Response",
      "type": "n8n-nodes-base.respondToWebhook",
      "typeVersion": 1.1,
      "position": [
        1400,
        200
      ],
      "parameters": {
        "respondWith": "json",
        "responseBody": "={{ $json }}",
        "options": {}
      }
    }
  ],
  "connections": {
    "Start Sequence": {
      "main": [
        [
          {
            "node": "Step 1 · Confirm",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Step 1 · Confirm": {
      "main": [
        [
          {
            "node": "Wait Before Reminder",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait Before Reminder": {
      "main": [
        [
          {
            "node": "Step 2 · Reminder",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Step 2 · Reminder": {
      "main": [
        [
          {
            "node": "Send Messages",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Messages": {
      "main": [
        [
          {
            "node": "Webhook Response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1",
    "callerPolicy": "workflowsFromSameOwner"
  },
  "tags": [],
  "meta": {
    "templateCredsSetupCompleted": true,
    "description": "CI deploy webhook waits, checks health/error rate, auto-rolls back via HTTP if unhealthy."
  },
  "pinData": {}
}