{
  "name": "Daily AI Briefing",
  "nodes": [
    {
      "parameters": {
        "rule": {
          "interval": [
            {
              "triggerAtHour": 7
            }
          ]
        }
      },
      "id": "a1",
      "name": "Every Day at 7am",
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1.2,
      "position": [
        0,
        0
      ]
    },
    {
      "parameters": {
        "jsCode": "// ✏️ Edit this list to pick your news sources (any RSS/Atom feed URL works)\nconst feeds = [\n  'https://www.theverge.com/rss/ai-artificial-intelligence/index.xml',\n  'https://techcrunch.com/category/artificial-intelligence/feed/',\n  'https://www.technologyreview.com/topic/artificial-intelligence/feed',\n  'https://hnrss.org/frontpage',\n];\nreturn feeds.map(url => ({ json: { url } }));"
      },
      "id": "a2",
      "name": "Your News Feeds",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        220,
        0
      ]
    },
    {
      "parameters": {
        "url": "={{ $json.url }}",
        "options": {}
      },
      "id": "a3",
      "name": "Read RSS Feeds",
      "type": "n8n-nodes-base.rssFeedRead",
      "typeVersion": 1.2,
      "position": [
        440,
        0
      ],
      "onError": "continueRegularOutput"
    },
    {
      "parameters": {
        "jsCode": "// Merge all feed items, remove duplicates, keep only the last 24 hours\nconst cutoff = Date.now() - 24 * 60 * 60 * 1000;\nconst seen = new Set();\nconst fresh = [];\nfor (const item of $input.all()) {\n  const a = item.json;\n  const link = (a.link || '').split('?')[0];\n  const title = (a.title || '').trim();\n  const key = link || title.toLowerCase();\n  const when = new Date(a.isoDate || a.pubDate || 0).getTime();\n  if (!title || !key || seen.has(key)) continue;\n  if (!when || when < cutoff) continue;\n  seen.add(key);\n  fresh.push({ title, link, when, snippet: (a.contentSnippet || '').slice(0, 300) });\n}\nfresh.sort((x, y) => y.when - x.when);\nconst top = fresh.slice(0, 40);\nconst articles = top.map((a, i) => `${i + 1}. ${a.title}\\n${a.link}\\n${a.snippet}`).join('\\n\\n');\nreturn [{ json: { count: top.length, articles: articles || 'No new articles in the last 24 hours.' } }];"
      },
      "id": "a4",
      "name": "Merge, Dedupe & Last 24h",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        660,
        0
      ]
    },
    {
      "parameters": {
        "promptType": "define",
        "text": "=You are a friendly tech news editor. Below are today's AI and tech headlines.\n\nPick the 5 most important or interesting stories for a non-technical reader who loves AI, tech and video games. Merge duplicates about the same story.\n\nReply in simple HTML only (no markdown, no code fences):\n<h2>Your Daily AI Briefing</h2>\n<ul> with exactly 5 <li> items. Each item: a bold short headline, one or two plain-English sentences on why it matters, then <a href=\"LINK\">Read more</a> using the real link from the list.</ul>\nNever invent links or facts.\n\nArticles ({{ $json.count }}):\n{{ $json.articles }}"
      },
      "id": "a5",
      "name": "Write 5-Bullet Summary",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "typeVersion": 1.5,
      "position": [
        880,
        0
      ]
    },
    {
      "parameters": {
        "model": {
          "__rl": true,
          "value": "gpt-4o-mini",
          "mode": "list",
          "cachedResultName": "gpt-4o-mini"
        },
        "options": {
          "temperature": 0.3
        }
      },
      "id": "a6",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "typeVersion": 1.2,
      "position": [
        880,
        220
      ],
      "credentials": {
        "openAiApi": {
          "id": "REPLACE_ME",
          "name": "OpenAI account"
        }
      }
    },
    {
      "parameters": {
        "sendTo": "you@example.com",
        "subject": "=☕ Your Daily AI Briefing – {{ $now.toFormat('MMM d') }}",
        "message": "={{ $json.text }}",
        "options": {
          "appendAttribution": false
        }
      },
      "id": "a7",
      "name": "Email Me the Briefing",
      "type": "n8n-nodes-base.gmail",
      "typeVersion": 2.1,
      "position": [
        1160,
        -100
      ],
      "credentials": {
        "gmailOAuth2": {
          "id": "REPLACE_ME",
          "name": "Gmail account"
        }
      },
      "webhookId": "b7e1c2d4-0000-4000-8000-000000000001"
    },
    {
      "parameters": {
        "select": "channel",
        "channelId": {
          "__rl": true,
          "value": "",
          "mode": "list"
        },
        "text": "={{ $json.text.replace(/<[^>]+>/g, ' ') }}",
        "otherOptions": {}
      },
      "id": "a8",
      "name": "Post to Slack (optional)",
      "type": "n8n-nodes-base.slack",
      "typeVersion": 2.3,
      "position": [
        1160,
        120
      ],
      "credentials": {
        "slackApi": {
          "id": "REPLACE_ME",
          "name": "Slack account"
        }
      },
      "disabled": true,
      "webhookId": "b7e1c2d4-0000-4000-8000-000000000002"
    },
    {
      "parameters": {
        "content": "## ☕ Daily AI Briefing (free template)\nEvery morning this reads top AI & tech news, picks the 5 stories that matter, and emails you a short summary with links.\n\n**Setup (5 min):**\n1. Open **OpenAI Chat Model** → add your OpenAI key\n2. Open **Email Me the Briefing** → connect Gmail, put your email in *To*\n3. Click **Test workflow**, then toggle **Active**\n\nWant inbox triage, research & more? Get the full AI Agent Starter Pack.",
        "height": 300,
        "width": 560,
        "color": 4
      },
      "id": "s0",
      "name": "Sticky Note s0",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -60,
        -560
      ]
    },
    {
      "parameters": {
        "content": "### 1️⃣ When & what\n**Every Day at 7am** starts the run (change the hour inside it; time zone is in workflow Settings).\n**Your News Feeds** is your list of sources — add or remove any RSS link.",
        "height": 200,
        "width": 460
      },
      "id": "s1",
      "name": "Sticky Note s1",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -60,
        -220
      ]
    },
    {
      "parameters": {
        "content": "### 2️⃣ Gather & clean\nReads every feed, merges all stories, removes duplicates and drops anything older than 24 hours.",
        "height": 200,
        "width": 400
      },
      "id": "s2",
      "name": "Sticky Note s2",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        420,
        -220
      ]
    },
    {
      "parameters": {
        "content": "### 3️⃣ AI summary\nOpenAI picks the top 5 and writes them in plain English with links.",
        "height": 200,
        "width": 260
      },
      "id": "s3",
      "name": "Sticky Note s3",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        840,
        -220
      ]
    },
    {
      "parameters": {
        "content": "### 4️⃣ Deliver\nSends the briefing by Gmail. Prefer Slack? Right-click the Slack node → *Activate*, pick a channel, and disable Gmail.",
        "height": 200,
        "width": 300
      },
      "id": "s4",
      "name": "Sticky Note s4",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        1120,
        -320
      ]
    }
  ],
  "connections": {
    "Every Day at 7am": {
      "main": [
        [
          {
            "node": "Your News Feeds",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Your News Feeds": {
      "main": [
        [
          {
            "node": "Read RSS Feeds",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Read RSS Feeds": {
      "main": [
        [
          {
            "node": "Merge, Dedupe & Last 24h",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge, Dedupe & Last 24h": {
      "main": [
        [
          {
            "node": "Write 5-Bullet Summary",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Write 5-Bullet Summary",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Write 5-Bullet Summary": {
      "main": [
        [
          {
            "node": "Email Me the Briefing",
            "type": "main",
            "index": 0
          },
          {
            "node": "Post to Slack (optional)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1",
    "timezone": "America/New_York"
  },
  "pinData": {},
  "meta": {
    "templateCredsSetupCompleted": false
  },
  "tags": []
}