{
  "name": "Error Handler",
  "nodes": [
    {
      "parameters": {},
      "type": "n8n-nodes-base.errorTrigger",
      "typeVersion": 1,
      "position": [
        -800,
        208
      ],
      "id": "69f94ffc-a09b-46b9-96b8-04ee1649293a",
      "name": "Error Trigger"
    },
    {
      "parameters": {
        "operation": "append",
        "documentId": {},
        "sheetName": {},
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "Error ": "={{ $('Error Trigger').item.json.execution.error.stack}} - {{ $('Error Trigger').item.json.execution.error.message }}",
            "Type": "={{ $('Error Trigger').item.json.execution.mode }}",
            "Time": "={{ $now }}",
            "ID": "={{ $('Error Trigger').item.json.execution.id }}",
            "Link": "={{ $('Error Trigger').item.json.execution.url }}",
            "Workflow": "={{ $('Error Trigger').item.json.workflow.name }}",
            "Error Node": "={{ $('Error Trigger').item.json.execution.lastNodeExecuted }}",
            "Status": "Unresolved",
            "Severity": "{{$json.error_severity}}"
          },
          "matchingColumns": [],
          "schema": [
            {
              "id": "ID",
              "displayName": "ID",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "Workflow",
              "displayName": "Workflow",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "Error Node",
              "displayName": "Error Node",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "Time",
              "displayName": "Time",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "Type",
              "displayName": "Type",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "Error ",
              "displayName": "Error ",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "Severity",
              "displayName": "Severity",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "Link",
              "displayName": "Link",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "Status",
              "displayName": "Status",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.7,
      "position": [
        16,
        512
      ],
      "id": "a3a48d9b-46f6-4014-ab5f-7693ff5ae8a8",
      "name": "Append row in sheet",
      "notesInFlow": true,
      "credentials": {},
      "notes": "low errors"
    },
    {
      "parameters": {
        "operation": "append",
        "documentId": {},
        "sheetName": {},
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "Time": "={{ $now }}",
            "Workflow": "={{ $('Error Trigger').item.json.workflow.name }}",
            "ID": "={{ $('Error Trigger').item.json.execution.id }}",
            "Link": "={{ $('Error Trigger').item.json.execution.url }}",
            "Error ": "={{ $('Error Trigger').item.json.execution.error.stack}} - {{ $('Error Trigger').item.json.execution.error.message }}",
            "Type": "={{ $('Error Trigger').item.json.execution.mode }}",
            "Error Node": "={{ $('Error Trigger').item.json.execution.lastNodeExecuted }}",
            "Status": "Unresolved",
            "Severity": "=High"
          },
          "matchingColumns": [],
          "schema": [
            {
              "id": "ID",
              "displayName": "ID",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "Workflow",
              "displayName": "Workflow",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "Error Node",
              "displayName": "Error Node",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "Time",
              "displayName": "Time",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "Type",
              "displayName": "Type",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "Error ",
              "displayName": "Error ",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "Severity",
              "displayName": "Severity",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "Link",
              "displayName": "Link",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "Status",
              "displayName": "Status",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.7,
      "position": [
        16,
        160
      ],
      "id": "5cfa679f-3307-466f-bc89-e784aab23b06",
      "name": "Append row in sheet1",
      "notesInFlow": true,
      "credentials": {},
      "notes": "high errors"
    },
    {
      "parameters": {
        "operation": "append",
        "documentId": {},
        "sheetName": {},
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "ID": "={{ $('Error Trigger').item.json.execution.id }}",
            "Time": "={{ $now }}",
            "Type": "={{ $('Error Trigger').item.json.execution.mode }}",
            "Error ": "={{ $('Error Trigger').item.json.execution.error.stack}} - {{ $('Error Trigger').item.json.execution.error.message }}",
            "Workflow": "={{ $('Error Trigger').item.json.workflow.name }}",
            "Link": "={{ $('Error Trigger').item.json.execution.url }}",
            "Severity": "Critical",
            "Status": "Unresolved",
            "Error Node": "={{ $('Error Trigger').item.json.execution.lastNodeExecuted }}"
          },
          "matchingColumns": [],
          "schema": [
            {
              "id": "ID",
              "displayName": "ID",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "Workflow",
              "displayName": "Workflow",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "Error Node",
              "displayName": "Error Node",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "Time",
              "displayName": "Time",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "Type",
              "displayName": "Type",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "Error ",
              "displayName": "Error ",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "Severity",
              "displayName": "Severity",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "Link",
              "displayName": "Link",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "Status",
              "displayName": "Status",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.7,
      "position": [
        0,
        0
      ],
      "id": "b41cfa54-f9b6-4d9f-9335-fdc26f2ec185",
      "name": "Append row in sheet2",
      "notesInFlow": true,
      "credentials": {},
      "notes": "critical errors"
    },
    {
      "parameters": {
        "rules": {
          "values": [
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 3
                },
                "conditions": [
                  {
                    "leftValue": "={{ $('Error Evaluation').item.json.content.parts[0].text }}",
                    "rightValue": "Critical",
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    },
                    "id": "1fc02ba6-aba7-4407-a1d6-32834b8e9c7e"
                  }
                ],
                "combinator": "and"
              },
              "renameOutput": true,
              "outputKey": "critical"
            },
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 3
                },
                "conditions": [
                  {
                    "id": "a19151d0-0e98-4576-b1e9-ee436ad29502",
                    "leftValue": "={{ $('Error Evaluation').item.json.content.parts[0].text }}",
                    "rightValue": "High",
                    "operator": {
                      "type": "string",
                      "operation": "equals",
                      "name": "filter.operator.equals"
                    }
                  }
                ],
                "combinator": "and"
              },
              "renameOutput": true,
              "outputKey": "high"
            },
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 3
                },
                "conditions": [
                  {
                    "id": "114751aa-0d13-4a10-b4a9-1789a728ce48",
                    "leftValue": "={{ $('Error Evaluation').item.json.content.parts[0].text }}",
                    "rightValue": "Medium",
                    "operator": {
                      "type": "string",
                      "operation": "equals",
                      "name": "filter.operator.equals"
                    }
                  }
                ],
                "combinator": "and"
              },
              "renameOutput": true,
              "outputKey": "medium"
            },
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 3
                },
                "conditions": [
                  {
                    "id": "f17ced23-54d4-4a72-8c77-3b1398a6a8bf",
                    "leftValue": "={{ $('Error Evaluation').item.json.content.parts[0].text }}",
                    "rightValue": "Low",
                    "operator": {
                      "type": "string",
                      "operation": "equals",
                      "name": "filter.operator.equals"
                    }
                  }
                ],
                "combinator": "and"
              },
              "renameOutput": true,
              "outputKey": "low"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.switch",
      "typeVersion": 3.4,
      "position": [
        -288,
        208
      ],
      "id": "d4ca4ea3-7135-47c9-91eb-fe803da1988f",
      "name": "Switch"
    },
    {
      "parameters": {
        "modelId": {
          "__rl": true,
          "value": "models/gemini-2.5-flash",
          "mode": "list",
          "cachedResultName": "models/gemini-2.5-flash"
        },
        "messages": {
          "values": [
            {
              "content": "=Grade the severity of this n8n node error with a one word response of low, medium, high, or critical: {{$('Error Trigger').item.json.execution.error.stack}} - {{ $('Error Trigger').item.json.execution.error.message }}"
            }
          ]
        },
        "builtInTools": {},
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.googleGemini",
      "typeVersion": 1.1,
      "position": [
        -608,
        208
      ],
      "id": "94130966-4d68-4ed4-9c96-d3cb86dbd0f6",
      "name": "Error Evaluation",
      "credentials": {}
    },
    {
      "parameters": {
        "operation": "append",
        "documentId": {},
        "sheetName": {},
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "Link": "={{ $('Error Trigger').item.json.execution.url }}",
            "Status": "Unresolved",
            "Severity": "Medium",
            "Error ": "={{ $('Error Trigger').item.json.execution.error.stack}} - {{ $('Error Trigger').item.json.execution.error.message }}",
            "Type": "={{ $('Error Trigger').item.json.execution.mode }}",
            "Time": "={{ $now }}",
            "Workflow": "={{ $('Error Trigger').item.json.workflow.name }}",
            "ID": "={{ $('Error Trigger').item.json.execution.id }}",
            "Error Node": "={{ $('Error Trigger').item.json.execution.lastNodeExecuted }}"
          },
          "matchingColumns": [],
          "schema": [
            {
              "id": "ID",
              "displayName": "ID",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "Workflow",
              "displayName": "Workflow",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "Error Node",
              "displayName": "Error Node",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "Time",
              "displayName": "Time",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "Type",
              "displayName": "Type",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "Error ",
              "displayName": "Error ",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "Severity",
              "displayName": "Severity",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "Link",
              "displayName": "Link",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "Status",
              "displayName": "Status",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.7,
      "position": [
        16,
        320
      ],
      "id": "89cdacfc-422f-476a-b37f-33c472c66793",
      "name": "Append row in sheet3",
      "notesInFlow": true,
      "credentials": {},
      "notes": "medium errors"
    },
    {
      "parameters": {
        "numberInputs": 4
      },
      "type": "n8n-nodes-base.merge",
      "typeVersion": 3.2,
      "position": [
        400,
        176
      ],
      "id": "f2b75e48-c0f1-42d9-855f-401dd0dc4fd2",
      "name": "Merge"
    },
    {
      "parameters": {
        "minutesSaved": 1
      },
      "type": "n8n-nodes-base.timeSaved",
      "typeVersion": 1,
      "position": [
        608,
        176
      ],
      "id": "18c7acfa-316a-4356-9d17-2e5dedc6a5b4",
      "name": "Time Saved"
    }
  ],
  "pinData": {},
  "connections": {
    "Error Trigger": {
      "main": [
        [
          {
            "node": "Error Evaluation",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Switch": {
      "main": [
        [
          {
            "node": "Append row in sheet2",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Append row in sheet1",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Append row in sheet3",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Append row in sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Append row in sheet2": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Append row in sheet1": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Error Evaluation": {
      "main": [
        [
          {
            "node": "Switch",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Append row in sheet3": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 2
          }
        ]
      ]
    },
    "Append row in sheet": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 3
          }
        ]
      ]
    },
    "Merge": {
      "main": [
        [
          {
            "node": "Time Saved",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": true,
  "settings": {
    "executionOrder": "v1",
    "binaryMode": "separate",
    "availableInMCP": false,
    "timeSavedMode": "dynamic",
    "callerPolicy": "workflowsFromSameOwner",
    "errorWorkflow": "XpIwFbxtOZCVqH80"
  },
  "versionId": "1701d123-e4bf-402e-93ee-975d70dbe611",
  "meta": {
    "templateCredsSetupCompleted": true,
    "instanceId": "de33315ccd8c8df612c54de8ea941ad063e50c03727d03cbfc3a7e6c3875936b"
  },
  "id": "XpIwFbxtOZCVqH80",
  "tags": [
    {
      "updatedAt": "2026-03-14T13:30:15.728Z",
      "createdAt": "2026-03-14T13:30:15.728Z",
      "id": "u2Zf7F4Fj1uPzjeQ",
      "name": "ZMGIT"
    }
  ]
}