{
  "name": "TrustField Ops / CI Notify",
  "nodes": [
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "trustfield-ops-notify",
        "responseMode": "onReceived"
      },
      "id": "wh",
      "name": "Ops Notify Webhook",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2,
      "position": [
        240,
        300
      ]
    },
    {
      "parameters": {
        "jsCode": "const b = $input.first().json.body || $input.first().json;\nreturn [{ json: { chain: 'ops', event: b.event || 'unknown', status: b.status || '', ref: b.ref || '', url: b.url || '', at: b.at || new Date().toISOString() } }];"
      },
      "id": "norm",
      "name": "Normalize Ops",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        480,
        300
      ]
    },
    {
      "parameters": {
        "chatId": "={{$env.TELEGRAM_CHANNEL_ID}}",
        "text": "=Ops {{$json.event}} {{$json.status}}\\n{{$json.ref}}\\n{{$json.url}}"
      },
      "id": "tg",
      "name": "Telegram",
      "type": "n8n-nodes-base.telegram",
      "typeVersion": 1,
      "position": [
        720,
        300
      ]
    }
  ],
  "connections": {
    "Ops Notify Webhook": {
      "main": [
        [
          {
            "node": "Normalize Ops",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Normalize Ops": {
      "main": [
        [
          {
            "node": "Telegram",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "meta": {
    "description": "GHA secret N8N_OPS_WEBHOOK_URL \u2192 this webhook. Skipped when unset (fast-forever)."
  }
}