{
  "name": "Kubernetes deployment & pod monitoring with Telegram alerts",
  "nodes": [
    {
      "id": "f0b0f7f0-b5e1-4bfd-85a0-6c0f90336a6e",
      "name": "Schedule Trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -480,
        208
      ]
    },
    {
      "id": "976ee100-553e-4b40-8b9f-09a3afd980a9",
      "name": "Kubeconfig Setup",
      "type": "n8n-nodes-base.code",
      "position": [
        -224,
        208
      ]
    },
    {
      "id": "b95b994d-00b2-4bb7-9d4b-9f417f8bd1e1",
      "name": "Get Pods",
      "type": "n8n-nodes-base.executeCommand",
      "position": [
        0,
        0
      ]
    },
    {
      "id": "0b5b3388-2de0-479e-a9d3-a1b136b0cf56",
      "name": "Get Deployments",
      "type": "n8n-nodes-base.executeCommand",
      "position": [
        -16,
        432
      ]
    },
    {
      "id": "f0a55a90-5bcf-42dc-96b0-3a21bd83c12e",
      "name": "Process & Generate Report",
      "type": "n8n-nodes-base.code",
      "position": [
        208,
        224
      ]
    },
    {
      "id": "22af800d-d130-4d13-9e6b-6a9176b886b9",
      "name": "Has Alerts?",
      "type": "n8n-nodes-base.if",
      "position": [
        432,
        224
      ]
    },
    {
      "id": "deb746c1-42b4-4e12-8530-d0340cf52e90",
      "name": "Send Telegram Alert",
      "type": "n8n-nodes-base.telegram",
      "position": [
        704,
        16
      ]
    },
    {
      "id": "c8cf22c0-7954-4a5c-84fc-3513ece1e376",
      "name": "Save Report",
      "type": "n8n-nodes-base.writeBinaryFile",
      "position": [
        704,
        480
      ]
    },
    {
      "id": "277ca9f2-b6bf-4c87-8d56-1734c0fecae0",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -752,
        0
      ],
      "parameters": {
        "width": 360,
        "height": 180,
        "content": "## Kubernetes Monitoring Workflow\n\nAutomatically monitors your K8s cluster and sends Telegram alerts when workloads have zero ready pods.\n\nReports are saved as markdown files for every execution."
      }
    },
    {
      "id": "da5b3125-2dfd-4ee5-9732-27404ef98455",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -416,
        352
      ],
      "parameters": {
        "width": 300,
        "height": 240,
        "content": "## CONFIGURATION REQUIRED\n\n1. Paste your kubeconfig content\n2. Set target namespace (default: 'production')\n\nThe workflow will automatically download kubectl during execution."
      }
    },
    {
      "id": "848a775e-d3c7-4c5b-8b1b-6ad4200b9687",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -96,
        -208
      ],
      "parameters": {
        "width": 280,
        "height": 188,
        "content": "## Data Collection\n\nBoth nodes run in parallel to fetch:\n- All pods\n- All deployments\n\nfrom the specified namespace"
      }
    },
    {
      "id": "5e94eb86-fb7a-4cde-a2b5-3778f057c316",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        192,
        384
      ],
      "parameters": {
        "width": 280,
        "height": null,
        "content": "## Processing & Alert Detection\n\nGroups pods by owner (Deployment, DaemonSet, StatefulSet, Node)\n\nDetects alerts: workloads with 0 ready pods\n\nGenerates comprehensive markdown report"
      }
    },
    {
      "id": "83b169f1-7bf5-497d-bdb8-9b999baaa980",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        704,
        -224
      ],
      "parameters": {
        "width": 464,
        "height": 216,
        "content": "## TELEGRAM CONFIGURATION\n\n1. Create bot via @BotFather\n2. Get bot token & add as credential\n3. Replace YOUR_TELEGRAM_CHAT_ID with your actual chat ID\n\nFind chat ID: message your bot, then visit:\nhttp"
      }
    },
    {
      "id": "00a9cb9f-6e0b-4537-adee-b2b6cef02f86",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        704,
        624
      ],
      "parameters": {
        "width": 280,
        "height": 220,
        "content": "## Report Output\n\nSaves markdown report with timestamp:\nk8s-report-YYYY-MM-DD-HHmmss.md\n\nExecutes on every run regardless of alert status"
      }
    }
  ],
  "connections": {
    "Get Pods": {
      "main": [
        [
          {
            "node": "Process & Generate Report",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Has Alerts?": {
      "main": [
        [
          {
            "node": "Send Telegram Alert",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Save Report",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Deployments": {
      "main": [
        [
          {
            "node": "Process & Generate Report",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Kubeconfig Setup": {
      "main": [
        [
          {
            "node": "Get Pods",
            "type": "main",
            "index": 0
          },
          {
            "node": "Get Deployments",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "Kubeconfig Setup",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Telegram Alert": {
      "main": [
        [
          {
            "node": "Save Report",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Process & Generate Report": {
      "main": [
        [
          {
            "node": "Has Alerts?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}