{
  "name": "Error monitor: AI-powered resolution [Context7, Supabase]",
  "nodes": [
    {
      "id": "950b05f0-f34f-4cce-aa1c-108560e7c1c1",
      "name": "Get Workflow",
      "type": "n8n-nodes-base.n8n",
      "position": [
        688,
        240
      ]
    },
    {
      "id": "05a9e46e-3919-4b78-8683-9306ad96abea",
      "name": "Get Execution",
      "type": "n8n-nodes-base.n8n",
      "position": [
        912,
        240
      ]
    },
    {
      "id": "fdfdb487-ecf1-432b-abc0-611d779c5edf",
      "name": "Find Workflow",
      "type": "n8n-nodes-base.supabase",
      "position": [
        1472,
        320
      ]
    },
    {
      "id": "7ebe8c3b-abab-4172-8e8b-a9ee486d2f49",
      "name": "Workflow Exists?",
      "type": "n8n-nodes-base.if",
      "position": [
        1696,
        240
      ]
    },
    {
      "id": "60ca18c6-b6ec-4347-a76a-e0f55dc43814",
      "name": "Insert Error",
      "type": "n8n-nodes-base.supabase",
      "position": [
        1920,
        144
      ]
    },
    {
      "id": "0b99e408-3d1b-48f5-9ba8-d5836ddf00e9",
      "name": "Create Workflow",
      "type": "n8n-nodes-base.supabase",
      "position": [
        1920,
        336
      ]
    },
    {
      "id": "6c7c77be-3624-46c5-a731-f86b2014d747",
      "name": "AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        2480,
        240
      ]
    },
    {
      "id": "3d08e9fe-fd4c-4167-b741-94f639bb374c",
      "name": "OpenRouter",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter",
      "position": [
        2480,
        448
      ]
    },
    {
      "id": "1827da8b-9e2f-44ae-a51d-b39cb6591d0f",
      "name": "Context7",
      "type": "@n8n/n8n-nodes-langchain.mcpClientTool",
      "position": [
        2624,
        448
      ]
    },
    {
      "id": "88590c63-17da-4955-8b70-39d1d7e51ee6",
      "name": "Save Analysis",
      "type": "n8n-nodes-base.supabase",
      "position": [
        2832,
        240
      ]
    },
    {
      "id": "5dbf9eb2-e44b-47a0-8c77-eed45e88b07f",
      "name": "Format Notification",
      "type": "n8n-nodes-base.code",
      "position": [
        3168,
        240
      ]
    },
    {
      "id": "315f1c62-c0bb-4ccf-8a1b-9aeafcc58a2a",
      "name": "Mark Notified",
      "type": "n8n-nodes-base.supabase",
      "position": [
        3824,
        240
      ]
    },
    {
      "id": "da434f3e-644a-423d-aba8-4e5c13998250",
      "name": "Workflow Error",
      "type": "n8n-nodes-base.errorTrigger",
      "position": [
        464,
        240
      ]
    },
    {
      "id": "eac72671-c9b9-4861-a519-d4e3738a5eac",
      "name": "Workflow Creation",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        2144,
        416
      ]
    },
    {
      "id": "c1905ec0-4323-4803-9b3d-3d7f79410a5f",
      "name": "Send Error Email",
      "type": "n8n-nodes-base.emailSend",
      "position": [
        3600,
        240
      ]
    },
    {
      "id": "5cbf6716-a734-4778-a760-bc5e615614ce",
      "name": "Update Statistics",
      "type": "n8n-nodes-base.supabase",
      "position": [
        2144,
        144
      ]
    },
    {
      "id": "274a73ba-157b-40ad-856d-b09a181c2d94",
      "name": "Build HTML",
      "type": "n8n-nodes-base.code",
      "position": [
        3376,
        240
      ]
    },
    {
      "id": "74b4bb97-9dbd-48a6-a03c-7a24ecc28694",
      "name": "Main Overview",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        336,
        -944
      ],
      "parameters": {
        "width": 480,
        "height": 832,
        "content": "# AI-Powered Error Monitor\n\nAutomatically capture, analyze, and debug workflow failures using AI-powered insights from official n8n documentation.\n\n## How it works\n\n**Error Capture** → Triggered on an"
      }
    },
    {
      "id": "43530829-f23f-41df-b9bd-b2f116d9790c",
      "name": "Supabase Setup",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -432,
        512
      ],
      "parameters": {
        "width": 720,
        "height": 832,
        "content": "# Supabase Setup\n\nCopy this SQL into your Supabase SQL Editor and run it.\n\n**What this creates:**\n• `workflows` table - tracks each monitored workflow with error statistics\n• `errors` table - stores e"
      }
    },
    {
      "id": "e410a3f2-9c98-4445-9fd0-51846d8caa48",
      "name": "Setup Instructions",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -432,
        -944
      ],
      "parameters": {
        "width": 720,
        "height": 1408,
        "content": "# Setup Instructions\n\n## 1. Enable n8n API Access\n\n**Settings → API** → Enable API access\n\n**Create Credential:**\n- Type: n8n API\n- API Key: Copy from Settings → API\n- Base URL: Your n8n instance URL\n"
      }
    },
    {
      "id": "b035b185-ab51-4736-b304-7d7b1160743a",
      "name": "Step 1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        336,
        -64
      ],
      "parameters": {
        "width": 992,
        "height": 728,
        "content": "## Step 1: Capture Error\n\nTriggered automatically when any workflow fails:\n\n- **Error Trigger** → Catches the failure\n- **Get Workflow** → Fetches workflow structure via n8n API\n- **Get Execution** → "
      }
    },
    {
      "id": "f6e2b757-0255-4e5f-bebe-8ca536a014bb",
      "name": "Step 2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1328,
        -64
      ],
      "parameters": {
        "width": 1024,
        "height": 728,
        "content": "## Step 2: Check Database\n\nLooks up workflow in Supabase:\n\n- **Find Workflow** → Searches for existing workflow record\n- **Workflow Exists?** → Routes to appropriate action\n- **Insert Error** → Logs e"
      }
    },
    {
      "id": "449ec517-08e2-4618-bc52-824d8ab69775",
      "name": "Step 4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        3024,
        -64
      ],
      "parameters": {
        "width": 1024,
        "height": 728,
        "content": "## Step 4: Send Notification\n\nFormats and sends detailed error email:\n\n- **Format Notification** → Prepares error data for email\n- **Build HTML** → Creates professional styled email\n- **Send Error Ema"
      }
    },
    {
      "id": "e98adab4-7ff4-4a5d-b57b-aaac2bb5b650",
      "name": "Step ",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2352,
        -64
      ],
      "parameters": {
        "width": 672,
        "height": 728,
        "content": "## Step 3: AI Analysis\n\nSmart debugging with Context7 n8n docs:\n\n- **AI Agent** → Analyzes error using Claude Sonnet 4\n- **Context7** → Searches official n8n documentation first\n- **OpenRouter** → Pro"
      }
    },
    {
      "id": "25b4a579-1918-4910-883d-638fd0549357",
      "name": "Structure Error Data",
      "type": "n8n-nodes-base.code",
      "position": [
        1136,
        240
      ]
    },
    {
      "id": "c634d27a-3cd5-444e-9026-369a3be2e325",
      "name": "Quick Customization",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        4096,
        -144
      ],
      "parameters": {
        "width": 560,
        "height": 896,
        "content": "# Optional Customization\n\n## Switch to Slack/Discord\n\n**1. Remove** the \"Build HTML\" node\n\n**2. Add** your preferred communication node (Slack, Discord, etc.)\n\n**3. Connect** \"Format Notification\" → Y"
      }
    }
  ],
  "connections": {
    "AI Agent": {
      "main": [
        [
          {
            "node": "Save Analysis",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Context7": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Build HTML": {
      "main": [
        [
          {
            "node": "Send Error Email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenRouter": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Get Workflow": {
      "main": [
        [
          {
            "node": "Get Execution",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Insert Error": {
      "main": [
        [
          {
            "node": "Update Statistics",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Find Workflow": {
      "main": [
        [
          {
            "node": "Workflow Exists?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Execution": {
      "main": [
        [
          {
            "node": "Structure Error Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Save Analysis": {
      "main": [
        [
          {
            "node": "Format Notification",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Workflow Error": {
      "main": [
        [
          {
            "node": "Get Workflow",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create Workflow": {
      "main": [
        [
          {
            "node": "Workflow Creation",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Error Email": {
      "main": [
        [
          {
            "node": "Mark Notified",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Workflow Exists?": {
      "main": [
        [
          {
            "node": "Insert Error",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Create Workflow",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update Statistics": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Workflow Creation": {
      "main": [
        [],
        [
          {
            "node": "Find Workflow",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Format Notification": {
      "main": [
        [
          {
            "node": "Build HTML",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Structure Error Data": {
      "main": [
        [
          {
            "node": "Find Workflow",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}