{
  "name": "Track npm package downloads with Telegram commands and reports",
  "nodes": [
    {
      "id": "d2168682-f0ed-4369-9c40-baee62aebab1",
      "name": "Switch Command",
      "type": "n8n-nodes-base.switch",
      "position": [
        -16,
        1312
      ]
    },
    {
      "id": "d94f22e4-81e3-4f9a-af3d-001ad6c75868",
      "name": "1st of Month 6PM",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -800,
        2800
      ]
    },
    {
      "id": "fd700615-112e-4eb5-b951-6bb947102ca8",
      "name": "Fetch Trending",
      "type": "n8n-nodes-base.code",
      "position": [
        512,
        1904
      ]
    },
    {
      "id": "e42a065d-3481-4142-9ab6-36e886c6f134",
      "name": "Fetch Monthly Digest",
      "type": "n8n-nodes-base.code",
      "position": [
        -496,
        2800
      ]
    },
    {
      "id": "79a50834-460e-42f7-a61e-d745fa12778f",
      "name": "Check Milestones",
      "type": "n8n-nodes-base.code",
      "position": [
        -496,
        3040
      ]
    },
    {
      "id": "bc57611c-85f0-49b4-ada2-afa92a5e29cd",
      "name": "Has Milestones?",
      "type": "n8n-nodes-base.if",
      "position": [
        16,
        3040
      ]
    },
    {
      "id": "fed0f4e1-3749-42f2-9933-ab4c9e818bef",
      "name": "Send Trending",
      "type": "n8n-nodes-base.telegram",
      "position": [
        848,
        1904
      ]
    },
    {
      "id": "695971b5-34d1-4cd8-99c1-8904be43463e",
      "name": "Send Weekly Digest",
      "type": "n8n-nodes-base.telegram",
      "position": [
        864,
        2592
      ]
    },
    {
      "id": "ed776110-d887-4363-91ed-e990ad3e69b6",
      "name": "Send Monthly Digest",
      "type": "n8n-nodes-base.telegram",
      "position": [
        864,
        2800
      ]
    },
    {
      "id": "38150ac3-1e2f-4e81-9ec3-9cdb6e9e309b",
      "name": "Send Milestone Alert",
      "type": "n8n-nodes-base.telegram",
      "position": [
        864,
        3024
      ]
    },
    {
      "id": "4eb0cc68-c920-45c2-ba62-983aa03d5778",
      "name": "Send Downloads",
      "type": "n8n-nodes-base.telegram",
      "position": [
        848,
        1296
      ]
    },
    {
      "id": "b595746b-b9c0-4a59-93ab-6089efe37820",
      "name": "Send Weekly",
      "type": "n8n-nodes-base.telegram",
      "position": [
        848,
        1488
      ]
    },
    {
      "id": "27752c2f-469e-4a61-a3a4-8a17df0dcd6e",
      "name": "Send Status",
      "type": "n8n-nodes-base.telegram",
      "position": [
        848,
        1696
      ]
    },
    {
      "id": "27e41db2-4eab-4c43-b744-4ceec3bc13ab",
      "name": "Send Help",
      "type": "n8n-nodes-base.telegram",
      "position": [
        864,
        2112
      ]
    },
    {
      "id": "b34b3279-942a-43f5-a407-b48c6abc8069",
      "name": "Send Unknown",
      "type": "n8n-nodes-base.telegram",
      "position": [
        864,
        2304
      ]
    },
    {
      "id": "7c81fc11-aba2-4628-9481-f6d6783305ed",
      "name": "Fetch All-Time Downloads",
      "type": "n8n-nodes-base.code",
      "position": [
        512,
        1296
      ]
    },
    {
      "id": "a1344ec4-4afb-44ea-9af1-da23f1874486",
      "name": "Fetch Weekly Downloads",
      "type": "n8n-nodes-base.code",
      "position": [
        512,
        1488
      ]
    },
    {
      "id": "3de20ce0-c41c-4c1e-9910-d714fbb04b21",
      "name": "Fetch Status",
      "type": "n8n-nodes-base.code",
      "position": [
        512,
        1696
      ]
    },
    {
      "id": "48634482-dc40-414a-942a-983c665a4e92",
      "name": "Help Message",
      "type": "n8n-nodes-base.code",
      "position": [
        512,
        2112
      ]
    },
    {
      "id": "4cf91307-35cc-45c2-9442-0c16737c0a9c",
      "name": "Unknown Command",
      "type": "n8n-nodes-base.code",
      "position": [
        512,
        2304
      ]
    },
    {
      "id": "40604584-62db-4d99-bb30-0cee6992bb77",
      "name": "Parse Command",
      "type": "n8n-nodes-base.code",
      "position": [
        -512,
        1376
      ]
    },
    {
      "id": "4b8fdde6-a8f1-4d17-a9c1-873145f3309d",
      "name": "Every Friday 6PM",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -800,
        2592
      ]
    },
    {
      "id": "f064321b-de5e-4e95-8429-13a7f74c83b3",
      "name": "Milestone (daily check 9AM)",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -800,
        3040
      ]
    },
    {
      "id": "107d892a-8c7e-4f2c-8f16-a7801b1b5e77",
      "name": "Fetch Weekly Digest",
      "type": "n8n-nodes-base.code",
      "position": [
        -496,
        2592
      ]
    },
    {
      "id": "ef764f5c-f774-4be2-ac28-5b53448dca26",
      "name": "Telegram Trigger",
      "type": "n8n-nodes-base.telegramTrigger",
      "position": [
        -816,
        1376
      ]
    },
    {
      "id": "c7e241a0-98ff-472b-8c15-3e463bbd922b",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1184,
        1104
      ],
      "parameters": {
        "width": 480,
        "height": 524,
        "content": "## Final Output\n![](https://res.cloudinary.com/dewqzljou/image/upload/v1773000261/NPM_package_tracker_-_demo_a59te9.jpg)"
      }
    },
    {
      "id": "853f6261-6b4f-4dba-98c3-e5f259c56b12",
      "name": "Sticky Note9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1776,
        1344
      ],
      "parameters": {
        "width": 768,
        "height": 1904,
        "content": "# NPM package tracker\n\nMonitor npm package downloads from Telegram with commands, weekly digests, and milestone alerts\n\n## Description\n\nThis template is designed for developers and teams who publish p"
      }
    },
    {
      "id": "5ed24a2d-3ba3-4a3a-ae7b-0366f20066f0",
      "name": "Sticky Note10",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        400,
        1104
      ],
      "parameters": {
        "width": 664,
        "height": 2140,
        "content": "## What to change\n\n1. NPM_USERNAME in the Code nodes - set your npm username\n\n2. Telegram chatId in the digest and milestone nodes"
      }
    },
    {
      "id": "981950e9-cb2c-4f0a-a396-757a07cb6655",
      "name": "Sticky Note11",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -896,
        2352
      ],
      "parameters": {
        "width": 584,
        "height": 892,
        "content": "## What to change\n\n1. Cron schedules if you want different reporting times\n\n2. NPM_USERNAME in the Code nodes - set your npm username\n\n3. MILESTONES array to customize alert thresholds\n"
      }
    }
  ],
  "connections": {
    "Fetch Status": {
      "main": [
        [
          {
            "node": "Send Status",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Help Message": {
      "main": [
        [
          {
            "node": "Send Help",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Parse Command": {
      "main": [
        [
          {
            "node": "Switch Command",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Trending": {
      "main": [
        [
          {
            "node": "Send Trending",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Switch Command": {
      "main": [
        [
          {
            "node": "Fetch All-Time Downloads",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Fetch Weekly Downloads",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Fetch Status",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Fetch Trending",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Help Message",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Unknown Command",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Has Milestones?": {
      "main": [
        [
          {
            "node": "Send Milestone Alert",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Unknown Command": {
      "main": [
        [
          {
            "node": "Send Unknown",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "1st of Month 6PM": {
      "main": [
        [
          {
            "node": "Fetch Monthly Digest",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check Milestones": {
      "main": [
        [
          {
            "node": "Has Milestones?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Every Friday 6PM": {
      "main": [
        [
          {
            "node": "Fetch Weekly Digest",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Telegram Trigger": {
      "main": [
        [
          {
            "node": "Parse Command",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Weekly Digest": {
      "main": [
        [
          {
            "node": "Send Weekly Digest",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Monthly Digest": {
      "main": [
        [
          {
            "node": "Send Monthly Digest",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Weekly Downloads": {
      "main": [
        [
          {
            "node": "Send Weekly",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch All-Time Downloads": {
      "main": [
        [
          {
            "node": "Send Downloads",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Milestone (daily check 9AM)": {
      "main": [
        [
          {
            "node": "Check Milestones",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}