{
  "name": "Send a Daily Google Analytics Digest to Telegram Every Morning",
  "nodes": [
    {
      "name": "Schedule",
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1,
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "hours",
              "hoursInterval": 24
            }
          ]
        }
      },
      "notes": "Fire every morning at 08:00.",
      "position": [
        260,
        300
      ]
    },
    {
      "name": "Google Analytics — Fetch Metrics",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4,
      "parameters": {
        "method": "POST",
        "url": "https://api.example.com/replace-with-real-endpoint",
        "sendBody": true,
        "options": {}
      },
      "notes": "Google Analytics has no dedicated n8n node — use an HTTP Request to the Google Analytics API. Pull yesterday's figures.",
      "position": [
        500,
        300
      ]
    },
    {
      "name": "Format Digest",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3,
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "760",
              "name": "summary",
              "value": "=Daily digest — {{ $json.metric }}: {{ $json.value }}",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "notes": "",
      "position": [
        740,
        300
      ]
    },
    {
      "name": "Notify Telegram",
      "type": "n8n-nodes-base.telegram",
      "typeVersion": 1,
      "parameters": {
        "text": "={{ $json.summary }}"
      },
      "notes": "Connect this channel's credential.",
      "position": [
        980,
        300
      ]
    },
    {
      "name": "Respond / Finish",
      "type": "n8n-nodes-base.noOp",
      "typeVersion": 1,
      "parameters": {},
      "notes": "End of flow — extend with extra steps as needed.",
      "position": [
        1220,
        300
      ]
    }
  ],
  "connections": {
    "Schedule": {
      "main": [
        [
          {
            "node": "Google Analytics — Fetch Metrics",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Analytics — Fetch Metrics": {
      "main": [
        [
          {
            "node": "Format Digest",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Format Digest": {
      "main": [
        [
          {
            "node": "Notify Telegram",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Notify Telegram": {
      "main": [
        [
          {
            "node": "Respond / Finish",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
