{
  "name": "Send severity-based error alerts using Telegram, email and Google Sheets",
  "nodes": [
    {
      "id": "72861743-6801-4c0a-8d3b-057391782d3e",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        224,
        -96
      ],
      "parameters": {
        "width": 576,
        "height": 560,
        "content": "## Workflow overview\n\nThis workflow provides a production-ready way to monitor n8n workflow failures.\n\nIt acts as a global error handler that listens for execution failures,\nclassifies them by severit"
      }
    },
    {
      "id": "c625da1a-a8c7-455e-bd6e-a2fdcce812c6",
      "name": "Send Alert",
      "type": "n8n-nodes-base.telegram",
      "position": [
        1792,
        704
      ]
    },
    {
      "id": "21537f3e-e58f-436f-800e-245d28e48b6e",
      "name": "Format Message",
      "type": "n8n-nodes-base.set",
      "position": [
        608,
        688
      ]
    },
    {
      "id": "1a9e71db-04be-4429-81a1-8ff0a8a750bf",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        816,
        64
      ],
      "parameters": {
        "width": 464,
        "height": 176,
        "content": "## 👋 Need help with n8n automations?\n\n## 🌐 https://abdallahhussein.com\n## Automation & Workflow Consulting"
      }
    },
    {
      "id": "f3f6ec2e-3bb3-4002-a224-4b570d0d79f6",
      "name": "Error Trigger",
      "type": "n8n-nodes-base.errorTrigger",
      "position": [
        0,
        688
      ]
    },
    {
      "id": "f4624aca-db6a-4996-99a6-17f907f39071",
      "name": "Classify Error & Context",
      "type": "n8n-nodes-base.code",
      "position": [
        288,
        688
      ]
    },
    {
      "id": "cddf5ddb-d2f2-4333-8479-ad3c8e939f08",
      "name": "Send an Email",
      "type": "n8n-nodes-base.gmail",
      "position": [
        1264,
        528
      ]
    },
    {
      "id": "8057ea85-b3b8-44ba-bf65-ff8603090102",
      "name": "Add Logs to Sheet",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1520,
        528
      ]
    },
    {
      "id": "2f238c72-7b24-4574-aa10-fae12bfdd9e9",
      "name": "Severity-Based Routing",
      "type": "n8n-nodes-base.switch",
      "position": [
        944,
        688
      ]
    },
    {
      "id": "e6086824-960b-4591-a7d8-741d9929ac43",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        192,
        480
      ],
      "parameters": {
        "width": 288,
        "height": 352,
        "content": "## Error classification\n\nErrors are analyzed and classified into:\n• Critical (auth & permission issues)\n• High (timeouts & server errors)\n• Normal (all other errors)\n\nThis enables smarter alert routin"
      }
    },
    {
      "id": "a773399f-2ebd-42d5-a6c3-c48fd4bbe363",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        848,
        464
      ],
      "parameters": {
        "width": 336,
        "height": 400,
        "content": "## Severity-based routing\n\nErrors are routed depending on severity:\n• Critical → Email + Telegram + Logging\n• High → Telegram\n• Normal → Telegram\n\nThis ensures proper escalation without noise.\n"
      }
    },
    {
      "id": "b468c730-fa6b-4a33-8840-d86dce477e21",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        512,
        480
      ],
      "parameters": {
        "width": 288,
        "height": 352,
        "content": "## Alert formatting\n\nBuilds a readable alert message with\nworkflow name, failed node, execution time,\nerror message, and execution link.\n"
      }
    },
    {
      "id": "87b21e3c-5f80-48b1-b82e-3d04278a3e87",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1440,
        368
      ],
      "parameters": {
        "width": 272,
        "height": 336,
        "content": "## Error logging\n\nCritical errors are logged for auditing\nand historical review using Google Sheets.\n"
      }
    }
  ],
  "connections": {
    "Error Trigger": {
      "main": [
        [
          {
            "node": "Classify Error & Context",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send an Email": {
      "main": [
        [
          {
            "node": "Add Logs to Sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Format Message": {
      "main": [
        [
          {
            "node": "Severity-Based Routing",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Add Logs to Sheet": {
      "main": [
        [
          {
            "node": "Send Alert",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Severity-Based Routing": {
      "main": [
        [
          {
            "node": "Send an Email",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Send Alert",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Send Alert",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Classify Error & Context": {
      "main": [
        [
          {
            "node": "Format Message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}