{
  "name": "77STF \u2014 Guardian Daily (08:00)",
  "nodes": [
    {
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "cronExpression",
              "expression": "0 8 * * *"
            }
          ]
        }
      },
      "id": "schedule-trigger",
      "name": "Codziennie 08:00",
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1.2,
      "position": [
        240,
        300
      ]
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://77stf-system-crypto77stf-4430s-projects.vercel.app/api/guardian/run",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "x-webhook-secret",
              "value": "a2e09b11523539ca26e4bb60468b4015e114848edf3dbb9e382201d6e5e4e664"
            }
          ]
        },
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "{\"trigger\":\"cron\"}",
        "options": {
          "timeout": 30000
        }
      },
      "id": "guardian-http",
      "name": "Guardian Uruchom",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        480,
        300
      ]
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict"
          },
          "conditions": [
            {
              "id": "c1",
              "leftValue": "={{ $json.alert_count }}",
              "rightValue": 0,
              "operator": {
                "type": "number",
                "operation": "gt"
              }
            }
          ],
          "combinator": "and"
        }
      },
      "id": "check-alerts",
      "name": "Czy sa alerty",
      "type": "n8n-nodes-base.if",
      "typeVersion": 2,
      "position": [
        720,
        300
      ]
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "msg",
              "name": "text",
              "value": "=*Guardian {{ new Date().toLocaleDateString('pl-PL') }}*\n{{ $json.summary }}\nAlerty: {{ $json.alert_count }} (krytyczne: {{ $json.critical }}, ostrzezenia: {{ $json.warnings }})\nhttps://ds-ai.pl/dashboard/guardian",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "id": "build-msg",
      "name": "Buduj wiadomosc",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        960,
        220
      ]
    },
    {
      "parameters": {
        "method": "POST",
        "url": "SLACK_WEBHOOK_PLACEHOLDER",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={{ JSON.stringify({ text: $json.text }) }}",
        "options": {}
      },
      "id": "slack-notify",
      "name": "Slack daily-brief",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        1200,
        220
      ]
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "s",
              "name": "status",
              "value": "ok",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "id": "no-alerts",
      "name": "Brak alertow OK",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        960,
        400
      ]
    }
  ],
  "connections": {
    "Codziennie 08:00": {
      "main": [
        [
          {
            "node": "Guardian Uruchom",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Guardian Uruchom": {
      "main": [
        [
          {
            "node": "Czy sa alerty",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Czy sa alerty": {
      "main": [
        [
          {
            "node": "Buduj wiadomosc",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Brak alertow OK",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Buduj wiadomosc": {
      "main": [
        [
          {
            "node": "Slack daily-brief",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1",
    "saveManualExecutions": true
  },
  "staticData": null
}