{
  "name": "Nodbot - Slack incident router with dedupe",
  "nodes": [
    {
      "parameters": {
        "path": "integration-slack-n8n-incident-router",
        "httpMethod": "POST",
        "responseMode": "responseNode"
      },
      "id": "82fb110f-b724-434b-921b-3c962220d87b",
      "name": "Webhook incident input",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2,
      "position": [
        0,
        260
      ]
    },
    {
      "parameters": {
        "jsCode": "const src = $json.body ?? $json;\nconst severity = String(src.severity ?? 'warning').toLowerCase();\nconst allowed = ['info','warning','critical'];\nconst sev = allowed.includes(severity) ? severity : 'warning';\nconst rawMessage = String(src.message ?? '').replace(/(token|password|secret)=\\S+/gi, '$1=[redacted]');\nconst workflow = String(src.workflow ?? src.source ?? 'n8n').trim();\nconst entity = String(src.entity_id ?? src.execution_id ?? '').trim();\nconst channel = sev === 'critical' ? '#incidents' : sev === 'warning' ? '#ops-alerts' : '#automation-log';\nconst dedupeKey = `slack:${sev}:${workflow}:${entity || rawMessage.slice(0,80)}`;\nreturn [{ json: {\n  severity: sev,\n  channel,\n  dedupe_key: dedupeKey,\n  thread_key: dedupeKey,\n  text: `[${sev.toUpperCase()}] ${workflow}: ${rawMessage.slice(0, 240)}`,\n  blocks: [\n    { type: 'section', text: { type: 'mrkdwn', text: `*${workflow}*\n${rawMessage.slice(0, 700)}` } },\n    { type: 'context', elements: [{ type: 'mrkdwn', text: `entity=${entity || 'n/a'} · severity=${sev}` }] }\n  ],\n  runbook_url: src.runbook_url ?? '',\n  needs_approval: src.needs_approval === true\n}}];"
      },
      "id": "cd7b8b14-be1b-4709-960d-987d505af8e5",
      "name": "Normalize Slack message",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        280,
        260
      ]
    },
    {
      "parameters": {},
      "id": "fcafb76f-f0f6-4e49-ae3b-269db190ce77",
      "name": "Check dedupe TTL",
      "type": "n8n-nodes-base.if",
      "typeVersion": 2,
      "position": [
        560,
        260
      ]
    },
    {
      "parameters": {},
      "id": "6d773da6-8deb-4a0a-86b3-ee6695517947",
      "name": "Send Slack alert",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 2,
      "position": [
        840,
        260
      ]
    },
    {
      "parameters": {},
      "id": "2dd393ef-f2a9-4578-8dee-db6470518a37",
      "name": "Approval callback",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 2,
      "position": [
        1120,
        260
      ]
    },
    {
      "parameters": {},
      "id": "41b7de12-4b1e-44fb-a6bd-0a4ef2d7fb96",
      "name": "Respond",
      "type": "n8n-nodes-base.respondToWebhook",
      "typeVersion": 2,
      "position": [
        1400,
        260
      ]
    }
  ],
  "connections": {
    "Webhook incident input": {
      "main": [
        [
          {
            "node": "Normalize Slack message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Normalize Slack message": {
      "main": [
        [
          {
            "node": "Check dedupe TTL",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check dedupe TTL": {
      "main": [
        [
          {
            "node": "Send Slack alert",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Slack alert": {
      "main": [
        [
          {
            "node": "Approval callback",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Approval callback": {
      "main": [
        [
          {
            "node": "Respond",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "staticData": null,
  "tags": [
    "nodbot",
    "integration",
    "production"
  ],
  "triggerCount": 1,
  "updatedAt": "2026-05-30T00:00:00.000Z",
  "versionId": "eb9dd1fa-5930-46b3-a471-f1f7492a577e",
  "meta": {
    "templateCredsSetupCompleted": false
  }
}