{
  "name": "77STF \u2014 Radar Morning Digest (07:00)",
  "nodes": [
    {
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "cronExpression",
              "expression": "0 7 * * *"
            }
          ]
        }
      },
      "id": "schedule-trigger",
      "name": "Codziennie 07: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/intelligence/radar/run",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "x-webhook-secret",
              "value": "a2e09b11523539ca26e4bb60468b4015e114848edf3dbb9e382201d6e5e4e664"
            }
          ]
        },
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "{\"trigger\":\"cron\"}",
        "options": {
          "timeout": 60000
        }
      },
      "id": "radar-http",
      "name": "Radar Generuj Digest",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        480,
        300
      ]
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict"
          },
          "conditions": [
            {
              "id": "c1",
              "leftValue": "={{ $json.saved }}",
              "rightValue": true,
              "operator": {
                "type": "boolean",
                "operation": "equal"
              }
            }
          ],
          "combinator": "and"
        }
      },
      "id": "check-saved",
      "name": "Digest zapisany",
      "type": "n8n-nodes-base.if",
      "typeVersion": 2,
      "position": [
        720,
        300
      ]
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "msg",
              "name": "text",
              "value": "=Radar Digest {{ new Date().toLocaleDateString('pl-PL') }}\nPrzeanalizowano {{ $json.source_count }} newsow, wybrano {{ $json.scored_count }} relevantnych.\nhttps://ds-ai.pl/dashboard/intelligence",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "id": "build-msg",
      "name": "Buduj wiadomosc",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        960,
        200
      ]
    },
    {
      "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,
        200
      ]
    },
    {
      "parameters": {
        "method": "POST",
        "url": "SLACK_WEBHOOK_PLACEHOLDER",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "{\"text\": \"Radar nie zapisal digestu \u2014 sprawdz logi: https://ds-ai.pl/dashboard/errors\"}",
        "options": {}
      },
      "id": "slack-error",
      "name": "Slack alert bledu",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        960,
        420
      ]
    }
  ],
  "connections": {
    "Codziennie 07:00": {
      "main": [
        [
          {
            "node": "Radar Generuj Digest",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Radar Generuj Digest": {
      "main": [
        [
          {
            "node": "Digest zapisany",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Digest zapisany": {
      "main": [
        [
          {
            "node": "Buduj wiadomosc",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Slack alert bledu",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Buduj wiadomosc": {
      "main": [
        [
          {
            "node": "Slack daily-brief",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1",
    "saveManualExecutions": true
  },
  "staticData": null
}