{
  "name": "FlowKit — Automated email news watch (free)",
  "nodes": [
    {
      "parameters": {
        "content": "## Automated email news watch — FlowKit (free)\nEvery morning at 8am: your RSS feeds are read, filtered to the last 24 hours, summarised by AI and delivered as a digest to your inbox.\n\n3 settings before you activate:\n1. Your RSS feeds in \"Feeds to watch\"\n2. Your OpenAI credential on \"OpenAI model\"\n3. Your addresses + SMTP credential on \"Send the digest by email\"\n\nIf there are no new articles, no email is sent.\n\nMore ready-to-import workflows: https://getflowkit.fr/en",
        "height": 340,
        "width": 440
      },
      "id": "7a1c2d3e-4f5a-4b6c-8d7e-9f0a1b2c3d4e",
      "name": "Note — How it works",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [-700, -380]
    },
    {
      "parameters": {
        "content": "## The prompt does the work\nThe \"Write the digest\" node ships a complete prompt: prioritisation, grouping by topic, clickable links. Adapt it to your field (keywords to watch, tone, language).\n\nFor a weekly watch: switch the cron to \"0 8 * * 1\" and WINDOW_HOURS to 168 in \"Keep the last 24 hours\".",
        "height": 240,
        "width": 400
      },
      "id": "8b2d3e4f-5a6b-4c7d-9e8f-0a1b2c3d4e5f",
      "name": "Note — Customisation",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [260, -320]
    },
    {
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "cronExpression",
              "expression": "0 8 * * *"
            }
          ]
        }
      },
      "id": "9c3e4f5a-6b7c-4d8e-0f9a-1b2c3d4e5f6a",
      "name": "Every morning at 8am",
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1.2,
      "position": [-680, 0]
    },
    {
      "parameters": {
        "jsCode": "// Add or replace the RSS feeds to watch here (one per line).\nconst feeds = [\n  \"https://blog.n8n.io/rss/\",\n  \"https://news.ycombinator.com/rss\",\n];\nreturn feeds.map((url) => ({ json: { url } }));"
      },
      "id": "0d4f5a6b-7c8d-4e9f-1a0b-2c3d4e5f6a7b",
      "name": "Feeds to watch",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [-460, 0]
    },
    {
      "parameters": {
        "url": "={{ $json.url }}",
        "options": {}
      },
      "id": "1e5a6b7c-8d9e-4f0a-2b1c-3d4e5f6a7b8c",
      "name": "Read the RSS feeds",
      "type": "n8n-nodes-base.rssFeedRead",
      "typeVersion": 1.1,
      "position": [-240, 0]
    },
    {
      "parameters": {
        "jsCode": "// Keep only articles published in the last 24 hours, without duplicates.\nconst WINDOW_HOURS = 24;\nconst cutoff = Date.now() - WINDOW_HOURS * 60 * 60 * 1000;\nconst seen = new Set();\nconst articles = [];\nfor (const item of $input.all()) {\n  const j = item.json;\n  const raw = j.isoDate || j.pubDate || j.pubdate || j.date;\n  const date = raw ? new Date(raw).getTime() : NaN;\n  if (Number.isFinite(date) && date < cutoff) continue;\n  const link = j.link || \"\";\n  if (!link || seen.has(link)) continue;\n  seen.add(link);\n  articles.push({\n    json: {\n      title: j.title || \"(untitled)\",\n      link,\n      excerpt: String(j.contentSnippet || j.content || \"\").replace(/<[^>]+>/g, \"\").slice(0, 300),\n      date: raw || \"\",\n    },\n  });\n}\n// Cap to keep token costs under control.\nreturn articles.slice(0, 30);"
      },
      "id": "2f6b7c8d-9e0f-4a1b-3c2d-4e5f6a7b8c9d",
      "name": "Keep the last 24 hours",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [-20, 0]
    },
    {
      "parameters": {
        "aggregate": "aggregateAllItemData",
        "options": {}
      },
      "id": "3a7c8d9e-0f1a-4b2c-4d3e-5f6a7b8c9d0e",
      "name": "Aggregate the articles",
      "type": "n8n-nodes-base.aggregate",
      "typeVersion": 1,
      "position": [200, 0]
    },
    {
      "parameters": {
        "promptType": "define",
        "text": "={{ 'Here are the articles collected over the last 24 hours, in JSON format:\\n\\n' + JSON.stringify($json.data) }}",
        "messages": {
          "messageValues": [
            {
              "message": "You write the daily news digest of a busy professional. You are given the JSON list of articles published over the last 24 hours on the feeds they watch (title, link, excerpt, date).\n\nWrite a digest in English, in simple HTML (only <h3>, <p>, <ul>, <li>, <a>, <strong> — no <html>, <head> or <body>):\n\n1. One opening sentence with the number of articles collected.\n2. <h3>Read first</h3>: the 3 to 5 most important articles. For each, a <li> with the title as a clickable link (<a href=\"...\">) followed by one sentence explaining why it matters.\n3. <h3>The rest, in brief</h3>: group the remaining articles by topic, one line per topic with the links.\n\nRules:\n- Reuse the provided links exactly, never invent an article or a URL.\n- Maximum 25 lines in total: summarise, do not copy everything.\n- No introduction or conclusion outside the requested format."
            }
          ]
        }
      },
      "id": "4b8d9e0f-1a2b-4c3d-5e4f-6a7b8c9d0e1f",
      "name": "Write the digest",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "typeVersion": 1.5,
      "position": [420, 0]
    },
    {
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4o-mini"
        },
        "options": {}
      },
      "id": "5c9e0f1a-2b3c-4d4e-6f5a-7b8c9d0e1f2a",
      "name": "OpenAI model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "typeVersion": 1.2,
      "position": [420, 200]
    },
    {
      "parameters": {
        "fromEmail": "watch@your-domain.com",
        "toEmail": "you@your-domain.com",
        "subject": "=News watch — {{ $now.toFormat('yyyy-LL-dd') }}",
        "emailFormat": "html",
        "html": "={{ $json.text }}",
        "options": {}
      },
      "id": "6d0f1a2b-3c4d-4e5f-7a6b-8c9d0e1f2a3b",
      "name": "Send the digest by email",
      "type": "n8n-nodes-base.emailSend",
      "typeVersion": 2.1,
      "position": [660, 0]
    }
  ],
  "connections": {
    "Every morning at 8am": {
      "main": [
        [
          {
            "node": "Feeds to watch",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Feeds to watch": {
      "main": [
        [
          {
            "node": "Read the RSS feeds",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Read the RSS feeds": {
      "main": [
        [
          {
            "node": "Keep the last 24 hours",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Keep the last 24 hours": {
      "main": [
        [
          {
            "node": "Aggregate the articles",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Aggregate the articles": {
      "main": [
        [
          {
            "node": "Write the digest",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI model": {
      "ai_languageModel": [
        [
          {
            "node": "Write the digest",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Write the digest": {
      "main": [
        [
          {
            "node": "Send the digest by email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "pinData": {},
  "meta": {
    "templateCredsSetupCompleted": false
  },
  "tags": []
}
