{
  "name": "AI PreMarket Brief",
  "nodes": [
    {
      "parameters": {
        "mode": "custom",
        "cronExpression": "0 6 * * 1-5"
      },
      "name": "Daily Trigger",
      "type": "n8n-nodes-base.cron",
      "typeVersion": 1,
      "position": [
        250,
        300
      ]
    },
    {
      "parameters": {
        "values": {
          "string": [
            {
              "name": "url",
              "value": "https://venturebeat.com/category/ai/feed/"
            },
            {
              "name": "url",
              "value": "https://techcrunch.com/tag/artificial-intelligence/feed/"
            },
            {
              "name": "url",
              "value": "https://www.theverge.com/artificial-intelligence/rss/index.xml"
            },
            {
              "name": "url",
              "value": "https://nvidianews.nvidia.com/newsreleases?format=rss"
            },
            {
              "name": "url",
              "value": "https://openai.com/blog/rss.xml"
            }
          ]
        },
        "options": {
          "keepOnlySet": true
        }
      },
      "name": "Set RSS List",
      "type": "n8n-nodes-base.set",
      "typeVersion": 1,
      "position": [
        250,
        450
      ]
    },
    {
      "parameters": {
        "batchSize": 1
      },
      "name": "Split In Batches",
      "type": "n8n-nodes-base.splitInBatches",
      "typeVersion": 1,
      "position": [
        450,
        450
      ]
    },
    {
      "parameters": {
        "url": "={{$json[\"url\"]}}",
        "responseFormat": "string",
        "options": {}
      },
      "name": "Fetch AI News",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 1,
      "position": [
        650,
        450
      ]
    },
    {
      "parameters": {
        "functionCode": "\nconst xml2js = require('xml2js');\nconst parseString = xml2js.parseStringPromise;\nconst result = await parseString(items[0].json.body);\nreturn result.rss.channel[0].item.slice(0, 5).map(news => ({\n  json: {\n    title: news.title[0],\n    link: news.link[0],\n    pubDate: news.pubDate[0]\n  }\n}));\n"
      },
      "name": "Parse RSS",
      "type": "n8n-nodes-base.function",
      "typeVersion": 1,
      "position": [
        850,
        450
      ]
    },
    {
      "parameters": {
        "authentication": "oAuth2",
        "resource": "page",
        "operation": "create",
        "databaseId": "={{$env.NOTION_PREMARKET_DB_ID}}",
        "properties": {
          "title": [
            {
              "text": "Automated AI Pre-Market Brief"
            }
          ]
        },
        "content": "={{$json[\"title\"] + \"\\n\" + $json[\"link\"]}}"
      },
      "name": "Write to Notion",
      "type": "n8n-nodes-base.notion",
      "typeVersion": 1,
      "position": [
        1050,
        450
      ]
    }
  ],
  "connections": {
    "Daily Trigger": {
      "main": [
        [
          "Set RSS List"
        ]
      ]
    },
    "Set RSS List": {
      "main": [
        [
          "Split In Batches"
        ]
      ]
    },
    "Split In Batches": {
      "main": [
        [
          "Fetch AI News"
        ]
      ]
    },
    "Fetch AI News": {
      "main": [
        [
          "Parse RSS"
        ]
      ]
    },
    "Parse RSS": {
      "main": [
        [
          "Write to Notion"
        ]
      ]
    }
  },
  "active": false,
  "settings": {},
  "id": "1"
}