{
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "a1053544-7fdf-42ba-aa8f-788726bec223",
      "name": "Structured Output Parser",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        1104,
        2512
      ],
      "parameters": {
        "schemaType": "manual",
        "inputSchema": "{\n  \"type\": \"object\",\n  \"properties\": {\n    \"activity_nation_state_actors\": {\n      \"type\": \"array\",\n      \"items\": {\n        \"type\": \"object\",\n        \"properties\": {\n          \"news_item\": { \"type\": \"string\" },\n          \"references\": {\n            \"type\": \"array\",\n            \"items\": {\n              \"type\": \"object\",\n              \"properties\": {\n                \"link\": { \"type\": \"string\" },\n                \"website_name\": { \"type\": \"string\" },\n                \"publish_date\": { \"type\": \"string\", \"format\": \"date-time\" }\n              },\n              \"required\": [\"link\", \"website_name\", \"publish_date\"]\n            }\n          }\n        },\n        \"required\": [\"news_item\", \"references\"]\n      }\n    },\n    \"activity_financially_motivated_actors\": {\n      \"type\": \"array\",\n      \"items\": {\n        \"type\": \"object\",\n        \"properties\": {\n          \"news_item\": { \"type\": \"string\" },\n          \"references\": {\n            \"type\": \"array\",\n            \"items\": {\n              \"type\": \"object\",\n              \"properties\": {\n                \"link\": { \"type\": \"string\" },\n                \"website_name\": { \"type\": \"string\" },\n                \"publish_date\": { \"type\": \"string\", \"format\": \"date-time\" }\n              },\n              \"required\": [\"link\", \"website_name\", \"publish_date\"]\n            }\n          }\n        },\n        \"required\": [\"news_item\", \"references\"]\n      }\n    },\n    \"activity_compromises_and_data_breaches\": {\n      \"type\": \"array\",\n      \"items\": {\n        \"type\": \"object\",\n        \"properties\": {\n          \"news_item\": { \"type\": \"string\" },\n          \"references\": {\n            \"type\": \"array\",\n            \"items\": {\n              \"type\": \"object\",\n              \"properties\": {\n                \"link\": { \"type\": \"string\" },\n                \"website_name\": { \"type\": \"string\" },\n                \"publish_date\": { \"type\": \"string\", \"format\": \"date-time\" }\n              },\n              \"required\": [\"link\", \"website_name\", \"publish_date\"]\n            }\n          }\n        },\n        \"required\": [\"news_item\", \"references\"]\n      }\n    },\n    \"activity_vulnerabilities\": {\n      \"type\": \"array\",\n      \"items\": {\n        \"type\": \"object\",\n        \"properties\": {\n          \"news_item\": { \"type\": \"string\" },\n          \"references\": {\n            \"type\": \"array\",\n            \"items\": {\n              \"type\": \"object\",\n              \"properties\": {\n                \"link\": { \"type\": \"string\" },\n                \"website_name\": { \"type\": \"string\" },\n                \"publish_date\": { \"type\": \"string\", \"format\": \"date-time\" }\n              },\n              \"required\": [\"link\", \"website_name\", \"publish_date\"]\n            }\n          }\n        },\n        \"required\": [\"news_item\", \"references\"]\n      }\n    },\n    \"activity_miscellaneous\": {\n      \"type\": \"array\",\n      \"items\": {\n        \"type\": \"object\",\n        \"properties\": {\n          \"news_item\": { \"type\": \"string\" },\n          \"references\": {\n            \"type\": \"array\",\n            \"items\": {\n              \"type\": \"object\",\n              \"properties\": {\n                \"link\": { \"type\": \"string\" },\n                \"website_name\": { \"type\": \"string\" },\n                \"publish_date\": { \"type\": \"string\", \"format\": \"date-time\" }\n              },\n              \"required\": [\"link\", \"website_name\", \"publish_date\"]\n            }\n          }\n        },\n        \"required\": [\"news_item\", \"references\"]\n      }\n    }\n  },\n  \"required\": [\n    \"activity_nation_state_actors\",\n    \"activity_financially_motivated_actors\",\n    \"activity_compromises_and_data_breaches\",\n    \"activity_vulnerabilities\",\n    \"activity_miscellaneous\"\n  ]\n}"
      },
      "typeVersion": 1.2
    },
    {
      "id": "36642d68-97f9-48cb-9b85-39f3ca9c5b13",
      "name": "Process output into HTML",
      "type": "n8n-nodes-base.code",
      "position": [
        1376,
        2384
      ],
      "parameters": {
        "jsCode": "function convertToHTML(data) {\n  const categoryMap = {\n    activity_nation_state_actors: \"Nation State Actors\",\n    activity_financially_motivated_actors: \"Financially Motivated Actors\",\n    activity_compromises_and_data_breaches: \"Compromises and Data Breaches\",\n    activity_vulnerabilities: \"Vulnerabilities\",\n    activity_miscellaneous: \"Miscellaneous\"\n  };\n\n  const input = data[0]?.json?.output;\n  if (!input) return [{ htmlOutput: '' }];\n\n  let html = '';\n\n  Object.keys(categoryMap).forEach((key) => {\n    const entries = input[key];\n    if (!Array.isArray(entries) || entries.length === 0) return;\n\n    html += `<h4>${categoryMap[key]}</h4>`;\n\n    entries.forEach((item) => {\n      html += `- ${item.news_item}`;\n\n      if (Array.isArray(item.references) && item.references.length > 0) {\n        const sources = item.references.map((ref, idx) => {\n          const date = new Date(ref.publish_date);\n          const formattedDate = `${String(date.getDate()).padStart(2, '0')}/${String(date.getMonth() + 1).padStart(2, '0')}/${String(date.getFullYear()).slice(-2)}`;\n          return `<a href=\"${ref.link}\" target=\"_blank\" rel=\"noopener\">${ref.website_name} (${formattedDate})</a>`;\n        }).join(', ');\n        html += ` (${sources})`;\n      }\n\n      html += '<br />';\n    });\n  });\n\n  return [{ htmlOutput: html }];\n}\n\nreturn convertToHTML($input.all());\n"
      },
      "typeVersion": 2
    },
    {
      "id": "e5a060a2-7d9c-4361-a6e4-54b4ea5f8c02",
      "name": "Baserow Push Data",
      "type": "n8n-nodes-base.baserow",
      "position": [
        1376,
        2192
      ],
      "parameters": {
        "tableId": 562928,
        "fieldsUi": {
          "fieldValues": [
            {
              "fieldId": 4515701,
              "fieldValue": "={{ JSON.stringify($json.output) }}"
            }
          ]
        },
        "operation": "create",
        "databaseId": 236879
      },
      "credentials": {
        "baserowApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "5fb2aedf-d957-44e3-93c6-54779bb813c3",
      "name": "Filter summaries and created date",
      "type": "n8n-nodes-base.set",
      "position": [
        2048,
        2192
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "9974ba68-9f3b-420c-8676-38de8c6d1292",
              "name": "daily_report",
              "type": "string",
              "value": "={{ $json.Description }}"
            },
            {
              "id": "aac39345-a8e6-4b8c-ac09-7452fe584040",
              "name": "created_on",
              "type": "string",
              "value": "={{ $json[\"Created on\"] }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "f5b9d10b-0555-42a8-be10-b229b69467a1",
      "name": "Get data of previous days",
      "type": "n8n-nodes-base.baserow",
      "position": [
        1824,
        2192
      ],
      "parameters": {
        "tableId": 562928,
        "databaseId": 236879,
        "additionalOptions": {
          "filters": {
            "fields": [
              {
                "field": 4515726,
                "value": "={{ $json.previous_days }}",
                "operator": "date_after"
              }
            ]
          }
        }
      },
      "credentials": {
        "baserowApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "2ddd6974-8b50-4d2f-8a08-c303fc87a15a",
      "name": "Google Gemini Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        2512,
        2416
      ],
      "parameters": {
        "options": {
          "temperature": 0
        }
      },
      "credentials": {
        "googlePalmApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "534e2327-26ce-491a-9acb-b885b8524c26",
      "name": "Flatten",
      "type": "n8n-nodes-base.code",
      "position": [
        2272,
        2192
      ],
      "parameters": {
        "jsCode": "const merged = items.map(e => e.json);\nreturn [{\n  json: {\n    merged_reports: merged\n  }\n}];\n"
      },
      "typeVersion": 2
    },
    {
      "id": "128fab04-8f6f-4d3b-814f-13942994a89f",
      "name": "Process output into HTML1",
      "type": "n8n-nodes-base.code",
      "position": [
        2848,
        2096
      ],
      "parameters": {
        "jsCode": "const reports = items[0].json.output;\n\nconst filtered = reports.filter(report => report.references.length >= 3);\n\nconst html = filtered.map(report => {\n  const references = report.references.map(ref => {\n    const date = ref.publish_date ? new Date(ref.publish_date).toISOString().split('T')[0] : 'N/A';\n    return `<li><a href=\"${ref.link}\">${ref.website_name}</a> (${date})</li>`;\n  }).join('');\n\n  return `\n    <section style=\"margin-bottom:2em;\">\n      <h2>${report.title}</h2>\n      <p>${report.content}</p>\n      <ul>${references}</ul>\n    </section>\n  `;\n}).join('');\n\nreturn [{\n  json: {\n    html: `<div>${html}</div>`\n  }\n}];\n"
      },
      "typeVersion": 2
    },
    {
      "id": "3e9d7228-27c5-46ca-98f8-eacf707b9704",
      "name": "Baserow Push Data1",
      "type": "n8n-nodes-base.baserow",
      "position": [
        2848,
        2288
      ],
      "parameters": {
        "tableId": 628338,
        "fieldsUi": {
          "fieldValues": [
            {
              "fieldId": 5118199,
              "fieldValue": "={{ JSON.stringify($json.output) }}"
            }
          ]
        },
        "operation": "create",
        "databaseId": 236879
      },
      "credentials": {
        "baserowApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "96165d72-d656-4e6c-9984-9ebf74c633e7",
      "name": "Daily trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        80,
        2256
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "triggerAtHour": 7
            }
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "4df5872b-ffe1-44d4-9f34-d0d54364e484",
      "name": "Write basic digest for today",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        1024,
        2288
      ],
      "parameters": {
        "text": "={{ $json.articlesText }}",
        "messages": {
          "messageValues": [
            {
              "message": "You are an intelligence analyst. Summarize the following threat intelligence articles into a concise, high-signal daily briefing. Do not make things up. Drop items that are not relevant enough. Follow these rules:  \n1. Group information by topic. Use the following sections as guidelines:\n    - Nation state actor activity\n    - Financially motivated actor activity\n    - Compromises and data breach activity (list victims only)\n    - Vulnerabilities activity (list with CVEs or affected products, only high priorities)\n    - Other miscellaneous activity that is sensible to share. Topics not related to cybersecurity can be disregarded. Ignore ads. Keep it short.\n2. Deduplicate reports. If multiple sources report on the same event, merge them. Prefer brevity over repetition.\n3. Prioritize topics mentioned multiple times. Omit low-signal, one-off articles unless highly critical. Keep lines concise, prioritize readability of the end product over including all content. Topics should typically fit on a single line, having 20 words maximum.\n4. Link all sources found for an item. Deduplicated items should have more than one source.  \n5. Remove all ads, promotional language, or off-topic content.\n6. Use clear, non-speculative language. Avoid filler. \n7. Put it in well-unified JSON format."
            }
          ]
        },
        "promptType": "define",
        "hasOutputParser": true
      },
      "typeVersion": 1.6
    },
    {
      "id": "dc92b836-b2b8-4d83-ab35-3007203b7de6",
      "name": "Send daily digest email",
      "type": "n8n-nodes-base.emailSend",
      "position": [
        1600,
        2384
      ],
      "parameters": {
        "html": "={{ $json.htmlOutput }}",
        "options": {},
        "subject": "=CTI Digest - {{ $now.format('yyyy-MM-dd') }}",
        "fromEmail": "Threat Intelligence Digest <user@example.com>"
      },
      "credentials": {
        "smtp": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "233ddaf2-70e7-4c05-aca0-9d1c070e533d",
      "name": "Send viral topics email",
      "type": "n8n-nodes-base.emailSend",
      "position": [
        3072,
        2096
      ],
      "parameters": {
        "html": "={{ $json.html }}",
        "options": {},
        "subject": "=CTI Digest (Viral Topics) - {{ $now.format('yyyy-MM-dd') }}",
        "fromEmail": "Threat Intelligence Digest <user@example.com>"
      },
      "credentials": {
        "smtp": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "35da285a-2abb-4b5a-ba7e-047798202150",
      "name": "Structured Output Parser1",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        2640,
        2416
      ],
      "parameters": {
        "schemaType": "manual",
        "inputSchema": "{\n  \"type\": \"array\",\n  \"items\": {\n    \"type\": \"object\",\n    \"properties\": {\n      \"title\": { \"type\": \"string\" },\n      \"content\": { \"type\": \"string\" },\n      \"references\": {\n        \"type\": \"array\",\n        \"items\": {\n          \"type\": \"object\",\n          \"properties\": {\n            \"link\": { \"type\": \"string\" },\n            \"website_name\": { \"type\": \"string\" },\n            \"publish_date\": { \"type\": \"string\", \"format\": \"date-time\" }\n          }\n        }\n      }\n    }\n  }\n}"
      },
      "typeVersion": 1.2
    },
    {
      "id": "847aa33a-95fc-47b7-93b7-39ec0eab3df9",
      "name": "Identify viral topics and write digest",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "onError": "continueRegularOutput",
      "position": [
        2496,
        2192
      ],
      "parameters": {
        "text": "={{ $json }}",
        "messages": {
          "messageValues": [
            {
              "message": "You are an intelligence analyst reviewing cyber threat intelligence reports from the past x days, formatted in a defined JSON schema. Your task is to identify 'viral' news items that describe the *same topic* and appear across multiple days. When such overlapping topics are found:\n\n* Merge them into a single entry.\n* Ensure the merged entry is mentioned on multiple across the grouped items.\n* Extract and synthesize a concise *title* and *summary* for the merged topic.\n* Aggregate all associated references under the merged entry.\n* Sort the merged topics based on newest source, descending.\n\nYou may merge items across different categories (e.g., \u201cNation state actors\u201d, \u201cVulnerabilities\u201d) if they clearly concern the same underlying event or threat. Do not include or report on any item that does not meet the above threshold. The objective is to surface recurring, high-signal topics for a daily digest, consolidating redundant reports into unified narratives. It is more important to have three well-processed viral topics, than many bad ones.\n"
            }
          ]
        },
        "promptType": "define",
        "hasOutputParser": true
      },
      "typeVersion": 1.6
    },
    {
      "id": "403b07f0-b37c-4d1c-a197-5c0e15a55478",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        80,
        1296
      ],
      "parameters": {
        "width": 416,
        "height": 2064,
        "content": "# Collection\n## Ingest intelligence from RSS feeds, every morning on 7am."
      },
      "typeVersion": 1
    },
    {
      "id": "0a7109a1-c9ca-4b85-9755-b4f99dc9cccd",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        528,
        1296
      ],
      "parameters": {
        "color": 3,
        "width": 416,
        "height": 2064,
        "content": "# Processing\n## Process the ingested data for further analysis by merging it into a single data block. Filter articles older than 24h and irrelevant fields."
      },
      "typeVersion": 1
    },
    {
      "id": "8b3ed565-27ad-4dfa-8630-ec188f01f3a9",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        976,
        1296
      ],
      "parameters": {
        "color": 4,
        "width": 320,
        "height": 2064,
        "content": "# Analysis\n## Leverage AI to deduplicate, organize, and summarize the information for a daily digest email."
      },
      "typeVersion": 1
    },
    {
      "id": "85e5a8b7-26b0-4907-8965-724e9a191c81",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2448,
        1296
      ],
      "parameters": {
        "color": 4,
        "width": 320,
        "height": 2064,
        "content": "# Analysis\n## Leverage AI to identity viral topics in reporting from the previous week and organize it into a viral topics threat brief."
      },
      "typeVersion": 1
    },
    {
      "id": "cc122ef6-13eb-4e86-8259-ecb1b1aa9368",
      "name": "7 days ago date",
      "type": "n8n-nodes-base.code",
      "position": [
        1600,
        2192
      ],
      "parameters": {
        "jsCode": "return [{\n  json: {\n    previous_days: new Date(Date.now() - 604800000).toISOString().split('T')[0]\n  }\n}];"
      },
      "typeVersion": 2
    },
    {
      "id": "caa6b20c-8b55-4af8-88c3-b46c3eacbb77",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1328,
        2352
      ],
      "parameters": {
        "color": 5,
        "width": 416,
        "height": 1008,
        "content": "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n# Dissemination\n## Disseminate the report over email."
      },
      "typeVersion": 1
    },
    {
      "id": "8b43c80c-61e4-4b19-b319-320b5e4c1ec3",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1328,
        1296
      ],
      "parameters": {
        "color": 3,
        "width": 1088,
        "height": 1024,
        "content": "# Processing\n## Save the output in a database and collect the data of the last 7 days for viral topic identification. Filter out only the needed data and flatten the array for better AI consumption."
      },
      "typeVersion": 1
    },
    {
      "id": "53a79424-2145-4e7b-920d-2acd42ad2827",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2800,
        1296
      ],
      "parameters": {
        "color": 5,
        "width": 416,
        "height": 2064,
        "content": "# Dissemination\n## Disseminate the report over email and save it in a database for future usage."
      },
      "typeVersion": 1
    },
    {
      "id": "d0f4ecbd-5823-49dc-90f8-a90f092f63c4",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -592,
        1296
      ],
      "parameters": {
        "color": 7,
        "width": 640,
        "height": 1120,
        "content": "# AI Threat Intelligence: Compose Daily Digest & Viral Topics Reports \n## Process cybersecurity reports into an AI-generated daily threat intelligence digest and viral topic report.\nThis n8n workflow simplifies the process of digesting cybersecurity reports by summarizing, deduplicating, organizing, and identifying viral topics of interest into daily emails. \n\nIt will generate two types of emails:\n- A daily digest with summaries of deduplicated cybersecurity reports organized into various topics.\n- A daily viral topic report with summaries of recurring topics that have been identified over the last seven days. \n\n\n**This workflow template supports threat intelligence analysts digest the high number of cybersecurity reports they must analyse daily by decreasing the noise and tracking topics of importance with additional care, while providing customizability with regards to sources and output format.**\n\n## How it works\nThe workflow follows the threat intelligence lifecycle as labelled by the coloured notes.\n- Every morning, collect news articles from a set of RSS feeds.\n- Merge the feeds output and prepare them for LLM consumption.\n- Task an LLM with writing an intelligence briefing that summarizes, deduplicates, and organizes the topics.\n- Generate and send an email with the daily digest.\n- Collect the daily digests of the last seven days and prepare them for LLM consumption.\n- Task an LLM with writing a report that covers 'viral' topics that have appeared prominently in the news. \n- Store this report and send out over email.\n\n## How to use & customization\n- The workflow will trigger daily at 7am. \n- The workflow can be reused for other types of news as well. The RSS feeds can be swapped out and the AI prompts can easily be altered. \n- The parameters used for the viral topic identification process can easily be changed (number of previous days considered, requirements for a topic to be 'viral').\n\n## Requirements\n- The workflow leverages Gemini (free tier) for email content generation and Baserow for storing generated reports. The viral topic identification relies on the Gemini Pro model because of a higher data quantity and more complex task.\n- An SMTP email account must be provided to send the emails with. This can be through Gmail. "
      },
      "typeVersion": 1
    },
    {
      "id": "75fccadd-fb48-4d3c-9d8a-0332ed143572",
      "name": "Loop Over Items",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        320,
        2464
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 3
    },
    {
      "id": "21b5a74b-e7fa-4970-a1cb-227e0a924a77",
      "name": "RSS Read",
      "type": "n8n-nodes-base.rssFeedRead",
      "onError": "continueRegularOutput",
      "position": [
        320,
        2608
      ],
      "parameters": {
        "url": "={{ $json.url }}",
        "options": {
          "ignoreSSL": true
        }
      },
      "retryOnFail": true,
      "typeVersion": 1.2,
      "alwaysOutputData": true
    },
    {
      "id": "85630d43-4f0f-4d06-a154-aac3f6ce8c39",
      "name": "Aggregate",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        592,
        2256
      ],
      "parameters": {
        "options": {},
        "aggregate": "aggregateAllItemData"
      },
      "typeVersion": 1
    },
    {
      "id": "f8df553c-e0b5-4fec-be82-113452d99616",
      "name": "RSS feeds",
      "type": "n8n-nodes-base.code",
      "position": [
        272,
        2256
      ],
      "parameters": {
        "jsCode": "return [\n\t{\n\t\t// BleepingComputer\n\t\tjson: {\n\t\t\turl: 'https://www.bleepingcomputer.com/feed/',\n\t\t}\n\t},\n\t{\n\t\t// SecurityWeek\n\t\tjson: {\n\t\t\turl: 'http://feeds.feedburner.com/Securityweek',\n\t\t}\n\t},\n\t{\n\t\t// The Hacker News\n\t\tjson: {\n\t\t\turl: 'https://feeds.feedburner.com/TheHackersNews',\n\t\t}\n\t},\n\t{\n\t\t// Schneier on Security\n\t\tjson: {\n\t\t\turl: 'https://www.schneier.com/feed/atom/',\n\t\t}\n\t},\n\t{\n\t\t// Dark Reading\n\t\tjson: {\n\t\t\turl: 'https://www.darkreading.com/rss.xml',\n\t\t}\n\t},\n\t{\n\t\t// Kaspersky Securelist\n\t\tjson: {\n\t\t\turl: 'http://www.securelist.com/en/rss/allupdates',\n\t\t}\n\t},\n\t{\n\t\t// Mandiant Blog\n\t\tjson: {\n\t\t\turl: 'https://www.mandiant.com/resources/blog/rss.xml',\n\t\t}\n\t},\n\t{\n\t\t// Microsoft Security Blog\n\t\tjson: {\n\t\t\turl: 'https://www.microsoft.com/en-us/security/blog/feed/',\n\t\t}\n\t},\n\t{\n\t\t// Trend Micro Simply Security\n\t\tjson: {\n\t\t\turl: 'http://feeds.trendmicro.com/TrendMicroSimplySecurity',\n\t\t}\n\t},\n\t{\n\t\t// Recorded Future\n\t\tjson: {\n\t\t\turl: 'https://www.recordedfuture.com/feed/',\n\t\t}\n\t},\n\t{\n\t\t// The DFIR Report\n\t\tjson: {\n\t\t\turl: 'https://thedfirreport.com/feed/',\n\t\t}\n\t},\n\t{\n\t\t// Sophos News\n\t\tjson: {\n\t\t\turl: 'https://news.sophos.com/en-us/feed',\n\t\t}\n\t},\n\t{\n\t\t// Check Point Research\n\t\tjson: {\n\t\t\turl: 'https://research.checkpoint.com/feed',\n\t\t}\n\t},\n\t{\n\t\t// Cisco Talos (Sourcefire VRT blog)\n\t\tjson: {\n\t\t\turl: 'https://blog.talosintelligence.com/rss/',\n\t\t}\n\t},\n\t{\n\t\t// CloudSEK Blog\n\t\tjson: {\n\t\t\turl: 'https://www.cloudsek.com/blog/rss.xml',\n\t\t}\n\t},\n\t{\n\t\t// Coveware Blog\n\t\tjson: {\n\t\t\turl: 'https://www.coveware.com/blog?format=RSS',\n\t\t}\n\t},\n\t{\n\t\t// ESET Blog\n\t\tjson: {\n\t\t\turl: 'https://feeds.feedburner.com/eset/blog?format=xml',\n\t\t}\n\t},\n\t{\n\t\t// Eye Security Blog\n\t\tjson: {\n\t\t\turl: 'https://www.eye.security/blog/rss.xml',\n\t\t}\n\t},\n\t{\n\t\t// Fox-IT Blog\n\t\tjson: {\n\t\t\turl: 'http://blog.fox-it.com/feed/',\n\t\t}\n\t},\n\t{\n\t\t// Google Project Zero\n\t\tjson: {\n\t\t\turl: 'http://googleprojectzero.blogspot.com/feeds/posts/default',\n\t\t}\n\t},\n\t{\n\t\t// Google Threat Analysis Group\n\t\tjson: {\n\t\t\turl: 'https://blog.google/threat-analysis-group/rss',\n\t\t}\n\t},\n\t{\n\t\t// Huntress Blog\n\t\tjson: {\n\t\t\turl: 'https://www.huntress.com/blog/rss.xml',\n\t\t}\n\t},\n\t{\n\t\t// DoublePulsar\n\t\tjson: {\n\t\t\turl: 'https://doublepulsar.com/feed',\n\t\t}\n\t},\n\t{\n\t\t// Proofpoint Threat Insight\n\t\tjson: {\n\t\t\turl: 'https://www.proofpoint.com/us/threat-insight-blog.xml',\n\t\t}\n\t},\n\t{\n\t\t// Rapid7 Detection and Response\n\t\tjson: {\n\t\t\turl: 'https://blog.rapid7.com/tag/detection-and-response/rss/',\n\t\t}\n\t},\n\t{\n\t\t// SentinelOne Labs\n\t\tjson: {\n\t\t\turl: 'https://labs.sentinelone.com/feed/',\n\t\t}\n\t},\n\t{\n\t\t// Unit42 (Palo Alto Networks)\n\t\tjson: {\n\t\t\turl: 'http://feeds.feedburner.com/Unit42',\n\t\t}\n\t},\n\t{\n\t\t// WatchTowr Labs\n\t\tjson: {\n\t\t\turl: 'https://labs.watchtowr.com/rss/',\n\t\t}\n\t},\n\t{\n\t\t// Wiz Blog\n\t\tjson: {\n\t\t\turl: 'https://blog.wiz.io/rss/',\n\t\t}\n\t},\n\t{\n\t\t// Zscaler Research\n\t\tjson: {\n\t\t\turl: 'http://research.zscaler.com/feeds/posts/default',\n\t\t}\n\t},\n    {\n\t\t// Crowdstrike\n\t\tjson: {\n\t\t\turl: 'https://www.crowdstrike.com/blog/feed',\n\t\t}\n\t},\n];\n"
      },
      "typeVersion": 2
    },
    {
      "id": "c71a7512-e1e0-4080-adc6-3b7eb2cae0f9",
      "name": "Precook data",
      "type": "n8n-nodes-base.code",
      "position": [
        800,
        2256
      ],
      "parameters": {
        "jsCode": "// Get the current date and time\nconst now = new Date();\n\n// Combine the output from all RSS feed nodes into one array\n// Input structure: [ { \"data\": [ { RSS feed item } ] } ]\nconst allArticles = items.flatMap(item => item.json.data);\n\n// Filter out articles older than 24 hours\nconst filteredArticles = allArticles.filter(item => {\n    const pubDate = new Date(item.pubDate);\n    const diff = (now - pubDate) / (1000 * 60 * 60);\n    return diff <= 24;\n});\n\n// Extract key fields including publish date\nconst articlesText = filteredArticles.map(item => {\n    return `\\nTitle: ${item.title}\\nLink: ${item.link}\\nPublished: ${item.pubDate}\\nText snippet: ${item.contentSnippet}\\n---\\n`;\n}).join('');\n\n// Return the filtered and formatted articles\nreturn [{ json: { articlesText } }];\n"
      },
      "typeVersion": 2
    }
  ],
  "connections": {
    "Flatten": {
      "main": [
        [
          {
            "node": "Identify viral topics and write digest",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "RSS Read": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Aggregate": {
      "main": [
        [
          {
            "node": "Precook data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "RSS feeds": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Precook data": {
      "main": [
        [
          {
            "node": "Write basic digest for today",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Daily trigger": {
      "main": [
        [
          {
            "node": "RSS feeds",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "7 days ago date": {
      "main": [
        [
          {
            "node": "Get data of previous days",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Items": {
      "main": [
        [
          {
            "node": "Aggregate",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "RSS Read",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Baserow Push Data": {
      "main": [
        [
          {
            "node": "7 days ago date",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send daily digest email": {
      "main": [
        []
      ]
    },
    "Google Gemini Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Identify viral topics and write digest",
            "type": "ai_languageModel",
            "index": 0
          },
          {
            "node": "Write basic digest for today",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Process output into HTML": {
      "main": [
        [
          {
            "node": "Send daily digest email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser": {
      "ai_outputParser": [
        [
          {
            "node": "Write basic digest for today",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Get data of previous days": {
      "main": [
        [
          {
            "node": "Filter summaries and created date",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Process output into HTML1": {
      "main": [
        [
          {
            "node": "Send viral topics email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser1": {
      "ai_outputParser": [
        [
          {
            "node": "Identify viral topics and write digest",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Write basic digest for today": {
      "main": [
        [
          {
            "node": "Process output into HTML",
            "type": "main",
            "index": 0
          },
          {
            "node": "Baserow Push Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filter summaries and created date": {
      "main": [
        [
          {
            "node": "Flatten",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Identify viral topics and write digest": {
      "main": [
        [
          {
            "node": "Process output into HTML1",
            "type": "main",
            "index": 0
          },
          {
            "node": "Baserow Push Data1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}