{
  "id": "LakshJobDiscoveryErrorAlert",
  "name": "Laksh Job Discovery \u2014 Failure Alert",
  "nodes": [
    {
      "parameters": {},
      "id": "3f2c1a90-6d41-4f2b-9c33-1a8e5b0d7c11",
      "name": "On Workflow Error",
      "type": "n8n-nodes-base.errorTrigger",
      "typeVersion": 1,
      "position": [
        -620,
        0
      ]
    },
    {
      "parameters": {
        "method": "POST",
        "url": "=https://discord.com/api/v10/channels/{{ $env.DISCORD_DM_CHANNEL_ID }}/messages",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "=Bot {{ $env.DISCORD_BOT_TOKEN }}"
            }
          ]
        },
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={{ JSON.stringify({ content: [\n  '\\ud83d\\udea8 **Job discovery failed** \\u2014 ' + ($json.workflow?.name ?? 'unknown workflow'),\n  'node: `' + ($json.execution?.lastNodeExecuted ?? '?') + '`',\n  'error: ' + String($json.execution?.error?.message ?? 'no message').split('\\n').filter(line => !line.includes('\"event\":\"source_complete\"')).slice(-8).join('\\n').slice(-1200),\n  ($json.execution?.error?.description ? 'why: ' + String($json.execution.error.description).slice(0, 300) : null),\n  'execution: ' + ($json.execution?.id ?? '?') + ' \\u2014 run `./scripts/diagnose.sh` for the full record'\n].filter(Boolean).join('\\n').slice(0, 3800) }) }}",
        "options": {
          "timeout": 15000
        }
      },
      "id": "8b7d2e54-0a19-4c6f-b2d8-96e4f3a1c022",
      "name": "DM Discord",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        -380,
        0
      ],
      "retryOnFail": true,
      "maxTries": 3,
      "waitBetweenTries": 3000
    }
  ],
  "connections": {
    "On Workflow Error": {
      "main": [
        [
          {
            "node": "DM Discord",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1",
    "timezone": "America/Los_Angeles",
    "saveManualExecutions": true,
    "callerPolicy": "workflowsFromSameOwner"
  },
  "versionId": "b41d7c02-9e55-4a18-8f36-2d0c7a91e644",
  "meta": {
    "templateCredsSetupCompleted": false
  },
  "tags": []
}