{
  "name": "Telegram AI News Summary Bot",
  "nodes": [
    {
      "parameters": {
        "rule": {
          "interval": [{ "field": "hours", "hoursInterval": 6 }]
        }
      },
      "id": "tanb0001-0001-4000-8000-000000000001",
      "name": "Schedule Every 6 Hours",
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1,
      "position": [240, 300]
    },
    {
      "parameters": {
        "url": "https://feeds.bbci.co.uk/news/technology/rss.xml",
        "options": {}
      },
      "id": "tanb0001-0002-4000-8000-000000000002",
      "name": "Fetch Tech RSS Feed",
      "type": "n8n-nodes-base.rssFeedRead",
      "typeVersion": 1,
      "position": [460, 300]
    },
    {
      "parameters": {
        "mode": "runOnceForEachItem",
        "jsCode": "const items = $input.all();\nconst top5 = items.slice(0, 5);\nreturn [{ json: { articles: top5.map(i => ({ title: i.json.title, link: i.json.link, pubDate: i.json.pubDate })) } }];"
      },
      "id": "tanb0001-0003-4000-8000-000000000003",
      "name": "Pick Top 5 Articles",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [680, 300]
    },
    {
      "parameters": {
        "model": "gpt-4o-mini",
        "messages": {
          "values": [
            {
              "role": "system",
              "content": "You are a tech news curator. Summarize these articles into a brief, engaging Telegram message with emoji bullets. Keep the total under 600 characters. Include article links."
            },
            {
              "role": "user",
              "content": "={{ JSON.stringify($json.articles) }}"
            }
          ]
        },
        "options": {
          "temperature": 0.6,
          "maxTokens": 400
        }
      },
      "id": "tanb0001-0004-4000-8000-000000000004",
      "name": "Summarize News with GPT",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "typeVersion": 1,
      "position": [900, 300]
    },
    {
      "parameters": {
        "chatId": "={{ $env.TELEGRAM_CHANNEL_ID }}",
        "text": "={{ $json.message.content }}",
        "additionalFields": {
          "parse_mode": "Markdown",
          "disable_web_page_preview": false
        }
      },
      "id": "tanb0001-0005-4000-8000-000000000005",
      "name": "Post to Telegram Channel",
      "type": "n8n-nodes-base.telegram",
      "typeVersion": 1,
      "position": [1120, 300]
    }
  ],
  "connections": {
    "Schedule Every 6 Hours": {
      "main": [[{ "node": "Fetch Tech RSS Feed", "type": "main", "index": 0 }]]
    },
    "Fetch Tech RSS Feed": {
      "main": [[{ "node": "Pick Top 5 Articles", "type": "main", "index": 0 }]]
    },
    "Pick Top 5 Articles": {
      "main": [[{ "node": "Summarize News with GPT", "type": "main", "index": 0 }]]
    },
    "Summarize News with GPT": {
      "main": [[{ "node": "Post to Telegram Channel", "type": "main", "index": 0 }]]
    }
  },
  "active": false,
  "settings": { "executionOrder": "v1" },
  "meta": {},
  "pinData": {}
}
