{
  "name": "error-notify",
  "nodes": [
    {
      "id": "trigger",
      "name": "Error Trigger",
      "type": "n8n-nodes-base.errorTrigger",
      "typeVersion": 1,
      "position": [
        -160,
        0
      ],
      "parameters": {}
    },
    {
      "id": "format",
      "name": "Format Message",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        80,
        0
      ],
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "wf-name",
              "name": "workflowName",
              "value": "={{ $json.workflow.name }}",
              "type": "string"
            },
            {
              "id": "wf-id",
              "name": "workflowId",
              "value": "={{ $json.workflow.id }}",
              "type": "string"
            },
            {
              "id": "exec-url",
              "name": "executionUrl",
              "value": "={{ $json.execution.url }}",
              "type": "string"
            },
            {
              "id": "err-node",
              "name": "errorNode",
              "value": "={{ $json.execution.error.node.name || 'unknown' }}",
              "type": "string"
            },
            {
              "id": "err-msg",
              "name": "errorMessage",
              "value": "={{ $json.execution.error.message }}",
              "type": "string"
            },
            {
              "id": "err-details",
              "name": "errorDetails",
              "value": "={{ $json.execution.error.context?.metadata?.details || $json.execution.error.cause || '' }}",
              "type": "string"
            }
          ]
        },
        "options": {}
      }
    },
    {
      "id": "slack",
      "name": "Send Slack Alert",
      "type": "n8n-nodes-base.slack",
      "typeVersion": 2.4,
      "position": [
        336,
        0
      ],
      "parameters": {
        "select": "channel",
        "channelId": {
          "__rl": true,
          "value": "#REPLACE-WITH-YOUR-ALERT-CHANNEL",
          "mode": "name"
        },
        "text": "=:rotating_light: *\uc6cc\ud06c\ud50c\ub85c \uc5d0\ub7ec \ubc1c\uc0dd*\n\n*\uc6cc\ud06c\ud50c\ub85c*: {{ $json.workflowName }}\n*\uc2e4\ud328 \ub178\ub4dc*: `{{ $json.errorNode }}`\n*\uba54\uc2dc\uc9c0*: {{ $json.errorMessage }}\n*\uc0c1\uc138*: {{ $json.errorDetails }}\n\n<{{ $json.executionUrl }}|\uc2e4\ud589 \ub85c\uadf8 \uc5f4\uae30>",
        "otherOptions": {}
      },
      "credentials": {
        "slackApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "id": "note",
      "name": "Usage",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -200,
        -260
      ],
      "parameters": {
        "width": 720,
        "height": 220,
        "content": "## error-notify (Error Workflow \ud15c\ud50c\ub9bf)\n\n**\uc0ac\uc6a9\ubc95**\n1. \uc774 \uc6cc\ud06c\ud50c\ub85c\ub97c import \u2192 activate.\n2. `Send Slack Alert` \ub178\ub4dc\uc758 `channelId` \ub97c \ud300 \uc54c\ub9bc \ucc44\ub110\ub85c \ubcc0\uacbd.\n3. `slackApi` credential \uc744 \ud300 \ubd07 \ud1a0\ud070\uc73c\ub85c \uad50\uccb4.\n4. \uc54c\ub9bc\uc744 \ubc1b\uace0 \uc2f6\uc740 \uc6cc\ud06c\ud50c\ub85c\uc758 **Settings \u2192 Error Workflow** \uc5d0\uc11c \ubcf8 \uc6cc\ud06c\ud50c\ub85c\ub97c \uc9c0\uc815.\n\n**\uc785\ub825 \ucee8\ud14d\uc2a4\ud2b8** (`Error Trigger` payload)\n- `$json.workflow.{id,name}` \u2014 \uc2e4\ud328\ud55c \uc6cc\ud06c\ud50c\ub85c\n- `$json.execution.{id,url,error}` \u2014 \uc2e4\ud589/\uc5d0\ub7ec \uc815\ubcf4\n- `$json.execution.error.node.name` \u2014 \uc2e4\ud328 \ub178\ub4dc\n\n\ub3c4\uba54\uc778\ubcc4 \ud544\ud130(\ud2b9\uc815 \uc5d0\ub7ec \ubb34\uc2dc \ub4f1)\uac00 \ud544\uc694\ud558\uba74 `Format Message` \ub4a4\uc5d0 `IF` \ub97c \ucd94\uac00\ud574 \uac00\uc9c0\ub97c \ubd84\uae30\ud558\uc138\uc694."
      }
    }
  ],
  "connections": {
    "Error Trigger": {
      "main": [
        [
          {
            "node": "Format Message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Format Message": {
      "main": [
        [
          {
            "node": "Send Slack Alert",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1",
    "executionTimeout": 300,
    "saveExecutionProgress": true
  },
  "staticData": null,
  "tags": []
}