{
  "name": "Сводка заказов по будням в 9:15 по Москве",
  "nodes": [
    {
      "parameters": {
        "content": "## Сводка по расписанию\nCron в n8n — шесть полей, первое секунды: 0 15 9 * * 1-5 = будни 9:15. Пояс задан в настройках воркфлоу (Europe/Moscow), иначе возьмётся пояс сервера.\n\nПосле импорта: адрес и токен своего API заказов, бот и chat id.",
        "width": 520,
        "height": 200
      },
      "id": "841e8d93-4d0c-57e6-af75-a3d3d09246d3",
      "name": "Заметка f9fbf2",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -40,
        -260
      ]
    },
    {
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "cronExpression",
              "expression": "0 15 9 * * 1-5"
            }
          ]
        }
      },
      "id": "3ef6bab4-fa14-57cd-9f6d-707b9fb3372c",
      "name": "Будни 9:15",
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1.2,
      "position": [
        0,
        0
      ]
    },
    {
      "parameters": {
        "url": "https://shop.example.ru/api/orders",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "sendQuery": true,
        "queryParameters": {
          "parameters": [
            {
              "name": "from",
              "value": "={{ $now.minus({days: 1}).startOf('day').toISO() }}"
            },
            {
              "name": "to",
              "value": "={{ $now.startOf('day').toISO() }}"
            }
          ]
        },
        "options": {}
      },
      "id": "daf69001-b5d7-5a70-a349-96d99663dc7c",
      "name": "Заказы за сутки",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        220,
        0
      ]
    },
    {
      "parameters": {
        "jsCode": "const zakazy = $input.all().map(i => i.json);\nconst summa = zakazy.reduce((s, z) => s + Number(z.total || 0), 0);\nconst den = $now.minus({ days: 1 }).toFormat('dd.MM');\nreturn [{ json: { text: `Заказы за ${den}: ${zakazy.length}, на ${summa.toLocaleString('ru-RU')} ₽` } }];"
      },
      "id": "ed2b05ec-6fff-5366-be59-ea156a5f013c",
      "name": "Текст сводки",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        440,
        0
      ]
    },
    {
      "parameters": {
        "chatId": "ВАШ_CHAT_ID",
        "text": "={{ $json.text }}",
        "additionalFields": {
          "appendAttribution": false
        }
      },
      "id": "b3c20632-9d24-5720-aa90-020becb4bba4",
      "name": "В чат",
      "type": "n8n-nodes-base.telegram",
      "typeVersion": 1.2,
      "position": [
        660,
        0
      ]
    }
  ],
  "connections": {
    "Будни 9:15": {
      "main": [
        [
          {
            "node": "Заказы за сутки",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Заказы за сутки": {
      "main": [
        [
          {
            "node": "Текст сводки",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Текст сводки": {
      "main": [
        [
          {
            "node": "В чат",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1",
    "timezone": "Europe/Moscow"
  },
  "pinData": {},
  "active": false,
  "meta": {
    "templateCredsSetupCompleted": false,
    "source": "promtbaza.com/voprosy/shablony-n8n"
  }
}