{
  "name": "Daily CEO Pulse 09:00",
  "nodes": [
    {
      "id": "036aed85-8a5a-58c3-a4cf-551d6fbdee99",
      "name": "Every Day 09:00",
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1.2,
      "position": [
        0,
        0
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "cronExpression",
              "expression": "0 9 * * *"
            }
          ]
        }
      }
    },
    {
      "id": "d044b728-8489-5c3b-bbef-e6adab5f3013",
      "name": "Config",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        220,
        0
      ],
      "parameters": {
        "mode": "manual",
        "includeOtherFields": true,
        "assignments": {
          "assignments": [
            {
              "id": "site-url",
              "name": "SITE_URL",
              "value": "",
              "type": "string"
            },
            {
              "id": "d451f3b6-347c-5895-846e-a046640ffc44",
              "name": "TELEGRAM_CHAT_ID",
              "value": "",
              "type": "string"
            },
            {
              "id": "14d0e27e-0951-5336-b2fd-b3b887fa3e7b",
              "name": "LAVA_DASHBOARD",
              "value": "",
              "type": "string"
            },
            {
              "id": "5ee742bd-b375-5819-ab4a-3c36d995862e",
              "name": "REVOLUT_LINK",
              "value": "",
              "type": "string"
            }
          ]
        }
      }
    },
    {
      "id": "48764b11-520e-5912-b1b1-47454ccbce41",
      "name": "My Site",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        440,
        0
      ],
      "parameters": {
        "method": "GET",
        "url": "={{ $('Config').first().json.SITE_URL }}",
        "options": {
          "timeout": 10000,
          "response": {
            "response": {
              "fullResponse": true,
              "neverError": true
            }
          }
        }
      },
      "alwaysOutputData": true,
      "onError": "continueRegularOutput"
    },
    {
      "id": "d13a408e-d191-5d5e-9cb6-ad1be58f42c6",
      "name": "n8n healthz",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        1100,
        0
      ],
      "parameters": {
        "method": "GET",
        "url": "http://127.0.0.1:5678/healthz",
        "options": {
          "timeout": 10000,
          "response": {
            "response": {
              "fullResponse": true,
              "neverError": true
            }
          }
        }
      },
      "alwaysOutputData": true,
      "onError": "continueRegularOutput"
    },
    {
      "id": "c87031f7-ca74-58c0-b330-96c64fb6bfc6",
      "name": "Build Pulse",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        1320,
        0
      ],
      "parameters": {
        "jsCode": "const cfg = $('Config').first().json;\nconst names = [\"My Site\", \"n8n healthz\"];\nconst rows = names.map(n => {\n  let st = 0;\n  try { const r = $(n).first().json; st = r.statusCode || 0; } catch (e) { st = 0; }\n  return { name: n, status: st, ok: st >= 200 && st < 400 };\n});\nconst day = new Date().toLocaleDateString('ru-RU', { timeZone: 'Asia/Makassar', weekday: 'long', day: 'numeric', month: 'long' });\nconst bad = rows.filter(r => !r.ok);\nconst text = [\n  `☀️ CEO Pulse · ${day}`,\n  '',\n  ...rows.map(r => `${r.ok ? '🟢' : '🔴'} ${r.name} — ${r.status || 'нет ответа'}`),\n  '',\n  bad.length ? `Внимание: ${bad.length} сервис(а) не отвечают.` : 'Все сервисы в норме.',\n  \n  'WIP ≤ 2. Первая задача дня — та, что ближе всего к деньгам.'\n].join('\\n');\nreturn [{ json: { text, chat_id: cfg.TELEGRAM_CHAT_ID, failing: bad.length } }];",
        "mode": "runOnceForAllItems"
      }
    },
    {
      "id": "5ab6b602-4855-585e-8737-90af6df277d8",
      "name": "Telegram → Me",
      "type": "n8n-nodes-base.telegram",
      "typeVersion": 1.2,
      "position": [
        1540,
        0
      ],
      "parameters": {
        "chatId": "={{ $json.chat_id }}",
        "text": "={{ $json.text }}",
        "additionalFields": {
          "appendAttribution": false
        }
      }
    },
    {
      "id": "dea19f68-b41b-5423-a052-15cbca1fab45",
      "name": "Run Now (UI)",
      "type": "n8n-nodes-base.manualTrigger",
      "typeVersion": 1,
      "position": [
        0,
        200
      ],
      "parameters": {}
    },
    {
      "id": "bb6792df-c960-5700-b7d4-aef6710c5370",
      "name": "Run Now (CLI / sub-workflow)",
      "type": "n8n-nodes-base.executeWorkflowTrigger",
      "typeVersion": 1.1,
      "position": [
        0,
        400
      ],
      "parameters": {
        "inputSource": "passthrough"
      }
    }
  ],
  "connections": {
    "Every Day 09:00": {
      "main": [
        [
          {
            "node": "Config",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Config": {
      "main": [
        [
          {
            "node": "My Site",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "My Site": {
      "main": [
        [
          {
            "node": "n8n healthz",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "n8n healthz": {
      "main": [
        [
          {
            "node": "Build Pulse",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Build Pulse": {
      "main": [
        [
          {
            "node": "Telegram → Maxim",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Run Now (UI)": {
      "main": [
        [
          {
            "node": "Config",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Run Now (CLI / sub-workflow)": {
      "main": [
        [
          {
            "node": "Config",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1",
    "timezone": "Asia/Makassar",
    "saveManualExecutions": true,
    "saveDataErrorExecution": "all"
  },
  "pinData": {},
  "meta": {
    "templateCredsSetupCompleted": false
  }
}