{
  "name": "月初作業提醒",
  "nodes": [
    {
      "parameters": { "rule": { "interval": [{ "field": "cronExpression", "expression": "0 9 1 * *" }] } },
      "id": "schedule", "name": "每月 1 日 9:00", "type": "n8n-nodes-base.scheduleTrigger", "typeVersion": 1.1, "position": [0, 0]
    },
    {
      "parameters": {
        "jsCode": "const now = new Date();\nconst month = now.toLocaleDateString('zh-TW', { month: 'long' });\nconst prevMonth = new Date(now.getFullYear(), now.getMonth() - 1, 1).toLocaleDateString('zh-TW', { month: 'long' });\nconst year = now.getFullYear();\n\nconst text = '📅 *' + month + '月初作業提醒*\\n\\n' +\n  '✅ 待辦事項：\\n\\n' +\n  '1️⃣ 匯出上月 (' + prevMonth + ') 月結報表\\n' +\n  '2️⃣ 檢查 Google Drive 自動匯入設定\\n' +\n  '3️⃣ 確認爬蟲排程正常運作\\n' +\n  '4️⃣ 備份資料庫\\n' +\n  '5️⃣ 檢查系統日誌\\n\\n' +\n  '💡 登入系統: https://mo.wooo.work';\n\nreturn [{ json: { telegramBody: { chat_id: '5619078117', text: text, parse_mode: 'Markdown' } } }];"
      },
      "id": "code", "name": "組合提醒訊息", "type": "n8n-nodes-base.code", "typeVersion": 2, "position": [220, 0]
    },
    {
      "parameters": {
        "method": "POST", "url": "https://api.telegram.org/bot8075645931:AAH-EGKMo8ZC4QJs-Nc1_0s92xHrGdQvdpg/sendMessage",
        "sendBody": true, "specifyBody": "json",
        "jsonBody": "={{ JSON.stringify($json.telegramBody) }}"
      },
      "id": "telegram", "name": "發送提醒", "type": "n8n-nodes-base.httpRequest", "typeVersion": 4.1, "position": [440, 0]
    }
  ],
  "connections": {
    "每月 1 日 9:00": { "main": [[{ "node": "組合提醒訊息", "type": "main", "index": 0 }]] },
    "組合提醒訊息": { "main": [[{ "node": "發送提醒", "type": "main", "index": 0 }]] }
  },
  "settings": { "executionOrder": "v1" }
}
