{
  "id": "4549f152-d52c-4753-8638-2298a44f219c",
  "name": "RSS to Human-Reviewed Digest Draft",
  "nodes": [
    {
      "parameters": {
        "content": "# Reviewed Harshith.com template\n\nReads public RSS feeds and produces one Markdown review queue. It does not publish or send anything.\n\nBefore activating: review the feed list, source terms, item limits, and output. This export contains no credentials, deployment-specific IDs, webhook IDs, or pinned data.",
        "height": 300,
        "width": 430,
        "color": 7
      },
      "id": "rss-note-001",
      "name": "Read Me First",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [-760, -280]
    },
    {
      "parameters": {},
      "id": "rss-trigger-001",
      "name": "Run Manually",
      "type": "n8n-nodes-base.manualTrigger",
      "typeVersion": 1,
      "position": [-620, 80]
    },
    {
      "parameters": {
        "url": "https://blog.n8n.io/rss/"
      },
      "id": "rss-n8n-001",
      "name": "Read n8n Blog Feed",
      "type": "n8n-nodes-base.rssFeedRead",
      "typeVersion": 1.1,
      "position": [-350, 0]
    },
    {
      "parameters": {
        "url": "https://developers.google.com/search/blog/feed.xml"
      },
      "id": "rss-google-001",
      "name": "Read Google Search Feed",
      "type": "n8n-nodes-base.rssFeedRead",
      "typeVersion": 1.1,
      "position": [-350, 180]
    },
    {
      "parameters": {
        "mode": "append"
      },
      "id": "rss-merge-001",
      "name": "Merge Feed Items",
      "type": "n8n-nodes-base.merge",
      "typeVersion": 3,
      "position": [-80, 80]
    },
    {
      "parameters": {
        "mode": "runOnceForAllItems",
        "jsCode": "const clean = (value = '') => String(value)\n  .replace(/<[^>]+>/g, ' ')\n  .replace(/\\s+/g, ' ')\n  .trim();\nconst domainFor = (link = '') =>\n  String(link).match(/^https?:\\/\\/([^/]+)/i)?.[1]?.replace(/^www\\./, '') || 'unknown';\nconst publishedAt = (item) => new Date(item.isoDate || item.pubDate || 0);\n\nconst items = $input.all()\n  .map((item) => item.json)\n  .filter((item) => item.link && item.title)\n  .sort((a, b) => publishedAt(b) - publishedAt(a));\nconst groups = new Map();\nfor (const item of items) {\n  const domain = domainFor(item.link);\n  groups.set(domain, [...(groups.get(domain) || []), item]);\n}\nconst limit = 12;\nconst perDomain = Math.max(1, Math.floor(limit / Math.max(groups.size, 1)));\nlet selected = [...groups.values()].flatMap((group) => group.slice(0, perDomain));\nconst selectedLinks = new Set(selected.map((item) => item.link));\nselected = [\n  ...selected,\n  ...items.filter((item) => !selectedLinks.has(item.link)).slice(0, limit - selected.length),\n]\n  .sort((a, b) => publishedAt(b) - publishedAt(a))\n  .slice(0, limit);\nconst rows = selected.map((item, index) => {\n  const summary = clean(item.contentSnippet || item.content || item.description).slice(0, 280);\n  return `${index + 1}. [${clean(item.title)}](${item.link}) — ${domainFor(item.link)}\\n   ${summary}`;\n});\nconst sourceDomains = [...new Set(selected.map((item) => domainFor(item.link)))];\n\nreturn [{\n  json: {\n    title: 'RSS review queue',\n    generatedAt: new Date().toISOString(),\n    itemCount: rows.length,\n    sourceDomains,\n    markdown: ['# RSS review queue', '', ...rows, '', 'Review every source before reusing or publishing its content.'].join('\\n'),\n    status: 'draft_for_human_review'\n  }\n}];"
      },
      "id": "rss-draft-001",
      "name": "Build Human Review Draft",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [190, 80]
    }
  ],
  "connections": {
    "Run Manually": {
      "main": [[
        {"node": "Read n8n Blog Feed", "type": "main", "index": 0},
        {"node": "Read Google Search Feed", "type": "main", "index": 0}
      ]]
    },
    "Read n8n Blog Feed": {
      "main": [[{"node": "Merge Feed Items", "type": "main", "index": 0}]]
    },
    "Read Google Search Feed": {
      "main": [[{"node": "Merge Feed Items", "type": "main", "index": 1}]]
    },
    "Merge Feed Items": {
      "main": [[{"node": "Build Human Review Draft", "type": "main", "index": 0}]]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1",
    "saveDataErrorExecution": "none",
    "saveDataSuccessExecution": "none",
    "saveManualExecutions": false,
    "executionTimeout": 60
  },
  "tags": []
}
