{
  "name": "01 - Good Morning (صبح بخیر)",
  "nodes": [
    {
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "cronExpression",
              "expression": "30 7 * * *"
            }
          ]
        }
      },
      "id": "a1000000-0000-4000-8000-000000000001",
      "name": "Schedule 07:30",
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1.2,
      "position": [-220, 0]
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "f1",
              "name": "api_base",
              "value": "https://YOUR-PROJECT.pages.dev",
              "type": "string"
            },
            {
              "id": "f2",
              "name": "api_key",
              "value": "PASTE_YOUR_API_KEY",
              "type": "string"
            },
            {
              "id": "f3",
              "name": "bot_token",
              "value": "PASTE_YOUR_BOT_TOKEN",
              "type": "string"
            },
            {
              "id": "f4",
              "name": "chat_id",
              "value": "@your_channel",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "id": "a1000000-0000-4000-8000-000000000002",
      "name": "Config",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [0, 0],
      "notes": "چهار مقدار بالا را پر کنید. فقط همین نود نیاز به ویرایش دارد."
    },
    {
      "parameters": {
        "url": "={{ $json.api_base }}/api/content/morning",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "x-api-key",
              "value": "={{ $json.api_key }}"
            }
          ]
        },
        "options": {}
      },
      "id": "a1000000-0000-4000-8000-000000000003",
      "name": "Get Morning Text",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [220, 0]
    },
    {
      "parameters": {
        "method": "POST",
        "url": "=https://api.telegram.org/bot{{ $('Config').item.json.bot_token }}/sendMessage",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={{ JSON.stringify({ chat_id: $('Config').item.json.chat_id, text: $json.text, parse_mode: 'HTML', disable_web_page_preview: true }) }}",
        "options": {}
      },
      "id": "a1000000-0000-4000-8000-000000000004",
      "name": "Send To Telegram",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [440, 0]
    },
    {
      "parameters": {
        "method": "POST",
        "url": "={{ $('Config').item.json.api_base }}/api/log",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "x-api-key",
              "value": "={{ $('Config').item.json.api_key }}"
            }
          ]
        },
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={{ JSON.stringify({ kind: 'morning', ref_id: $('Get Morning Text').item.json.poem_id, message_id: $json.result.message_id, chat_id: $('Config').item.json.chat_id }) }}",
        "options": {}
      },
      "id": "a1000000-0000-4000-8000-000000000005",
      "name": "Log Post",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [660, 0]
    }
  ],
  "connections": {
    "Schedule 07:30": {
      "main": [[{ "node": "Config", "type": "main", "index": 0 }]]
    },
    "Config": {
      "main": [[{ "node": "Get Morning Text", "type": "main", "index": 0 }]]
    },
    "Get Morning Text": {
      "main": [[{ "node": "Send To Telegram", "type": "main", "index": 0 }]]
    },
    "Send To Telegram": {
      "main": [[{ "node": "Log Post", "type": "main", "index": 0 }]]
    }
  },
  "settings": {
    "executionOrder": "v1",
    "timezone": "Asia/Tehran",
    "saveExecutionProgress": true
  },
  "pinData": {}
}
