{
  "name": "Nodbot - RSS to Telegram digest with dedupe",
  "nodes": [
    {
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "hours",
              "hoursInterval": 3
            }
          ]
        }
      },
      "id": "5a092780-1121-4361-95aa-cf5cc14a922c",
      "name": "Schedule Trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 2,
      "position": [
        0,
        260
      ]
    },
    {
      "parameters": {},
      "id": "0dce7b12-2a2a-40b8-9083-24db95173d06",
      "name": "Read RSS feeds",
      "type": "n8n-nodes-base.rssFeedRead",
      "typeVersion": 2,
      "position": [
        280,
        260
      ]
    },
    {
      "parameters": {
        "jsCode": "const cfg = $json.config ?? $json;\nconst items = $json.items ?? [$json];\nconst include = (cfg.include_keywords ?? []).map(v => String(v).toLowerCase());\nconst exclude = (cfg.exclude_keywords ?? []).map(v => String(v).toLowerCase());\nconst maxItems = Number(cfg.max_items ?? 5);\n\nconst normalized = items.map(item => {\n  const title = String(item.title ?? '').trim();\n  const link = String(item.link ?? item.guid ?? '').trim();\n  const text = `${title} ${item.contentSnippet ?? item.content ?? ''}`.toLowerCase();\n  const excluded = exclude.some(word => text.includes(word));\n  const included = include.length === 0 || include.some(word => text.includes(word));\n  return { title, link, guid: String(item.guid ?? link), included, excluded };\n}).filter(i => i.title && i.link && i.included && !i.excluded)\n  .slice(0, maxItems);\n\nif (!normalized.length) {\n  return [{ json: { action: 'skip', reason: 'no_relevant_items' } }];\n}\n\nconst lines = normalized.map((item, index) => {\n  const safeTitle = item.title.replace(/[<>]/g, '');\n  const separator = item.link.includes('?') ? '&' : '?';\n  const url = `${item.link}${separator}utm_source=${cfg.utm_source ?? 'telegram'}&utm_medium=${cfg.utm_medium ?? 'digest'}&utm_campaign=${cfg.utm_campaign ?? 'rss_digest'}`;\n  return `${index + 1}. <a href=\"${url}\">${safeTitle}</a>`;\n});\n\nreturn [{\n  json: {\n    action: 'send_digest',\n    dedupe_keys: normalized.map(i => `rss:${i.guid}`),\n    telegram: {\n      chat_id: cfg.telegram_chat_id,\n      parse_mode: 'HTML',\n      disable_web_page_preview: true,\n      text: `<b>Дайджест автоматизации</b>\n\n${lines.join('\n')}\n\n#n8n #automation`\n    }\n  }\n}];"
      },
      "id": "be7b4458-c78d-4383-9477-0ead5966cfa7",
      "name": "Filter and build digest",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        560,
        260
      ]
    },
    {
      "parameters": {},
      "id": "a973c2ff-47ab-4894-a906-cbd416eec8d8",
      "name": "Check dedupe store",
      "type": "n8n-nodes-base.if",
      "typeVersion": 2,
      "position": [
        840,
        260
      ]
    },
    {
      "parameters": {},
      "id": "07d0583e-64f6-4438-a60c-5f5706854bbb",
      "name": "Send Telegram digest",
      "type": "n8n-nodes-base.telegram",
      "typeVersion": 2,
      "position": [
        1120,
        260
      ]
    }
  ],
  "connections": {
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "Read RSS feeds",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Read RSS feeds": {
      "main": [
        [
          {
            "node": "Filter and build digest",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filter and build digest": {
      "main": [
        [
          {
            "node": "Check dedupe store",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check dedupe store": {
      "main": [
        [
          {
            "node": "Send Telegram digest",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "staticData": null,
  "tags": [
    "nodbot",
    "production",
    "template"
  ],
  "triggerCount": 1,
  "updatedAt": "2026-05-30T00:00:00.000Z",
  "versionId": "18d2fa63-8886-4616-b0be-c72c57cdba3b",
  "meta": {
    "templateCredsSetupCompleted": false
  }
}