{
  "id": "US0rG4ZKxU9u1FTO",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "name": "Multi-Source Financial RSS to AI Daily Wealth Advisor Brief",
  "tags": [],
  "nodes": [
    {
      "id": "d05ae3da-e1ad-40e7-a45a-fb1a5824e683",
      "name": "02 - Fetch - Yahoo Finance RSS",
      "type": "n8n-nodes-base.rssFeedRead",
      "position": [
        -944,
        80
      ],
      "parameters": {
        "url": "https://finance.yahoo.com/news/rssindex",
        "options": {}
      },
      "typeVersion": 1.2
    },
    {
      "id": "68ea5f4a-f22f-4e7b-8a15-40367bfaf6f6",
      "name": "03 - Fetch - CoinDesk RSS",
      "type": "n8n-nodes-base.rssFeedRead",
      "position": [
        -944,
        272
      ],
      "parameters": {
        "url": "https://www.coindesk.com/arc/outboundfeeds/rss/",
        "options": {}
      },
      "typeVersion": 1.2
    },
    {
      "id": "90849b62-e9a0-47bf-b946-48ac093c2e43",
      "name": "04 - Fetch - Federal Reserve RSS",
      "type": "n8n-nodes-base.rssFeedRead",
      "position": [
        -944,
        464
      ],
      "parameters": {
        "url": "https://www.federalreserve.gov/feeds/press_all.xml",
        "options": {}
      },
      "typeVersion": 1.2
    },
    {
      "id": "5afdd1e6-5774-4e28-a96c-0a28817a7da4",
      "name": "05 - Merge - All News Sources",
      "type": "n8n-nodes-base.merge",
      "position": [
        -720,
        256
      ],
      "parameters": {
        "numberInputs": 3
      },
      "typeVersion": 3.2
    },
    {
      "id": "a7f81ce8-62f6-4d85-b79b-070bb841eeff",
      "name": "06 - Clean - Remove Duplicate News",
      "type": "n8n-nodes-base.code",
      "position": [
        -496,
        272
      ],
      "parameters": {
        "jsCode": "const seen = new Set();\n\nreturn items.filter(item => {\n  const title = item.json.title;\n  \n  if (seen.has(title)) return false;\n  seen.add(title);\n  \n  return true;\n});"
      },
      "typeVersion": 2
    },
    {
      "id": "f1fa717d-346d-4591-802f-aa6aa98b5500",
      "name": "07 - Filter - Remove Low Value News",
      "type": "n8n-nodes-base.code",
      "position": [
        -272,
        272
      ],
      "parameters": {
        "jsCode": "  const keywords = [\"bitcoin\", \"fed\", \"inflation\", \"stock\", \"market\", \"oil\",\"\"];\n\nreturn items.filter(item => {\n  const text = item.json.title.toLowerCase();\n  return keywords.some(k => text.includes(k));\n});"
      },
      "typeVersion": 2
    },
    {
      "id": "09366fee-b217-4ac2-8980-6bdaf63b1e06",
      "name": "08 - Limit - Top 15 News",
      "type": "n8n-nodes-base.limit",
      "position": [
        -48,
        272
      ],
      "parameters": {
        "maxItems": 15
      },
      "typeVersion": 1
    },
    {
      "id": "ce222c30-1189-4c70-8b97-c914feefda57",
      "name": "09 - Transform - Combine News Text",
      "type": "n8n-nodes-base.code",
      "position": [
        176,
        272
      ],
      "parameters": {
        "jsCode": "const combined = items.map(item => {\n  return `- ${item.json.title}`;\n}).join(\"\\n\");\n\nreturn [\n  {\n    json: {\n      news: combined\n    }\n  }\n];"
      },
      "typeVersion": 2
    },
    {
      "id": "29a35c0f-c68f-48ce-9b18-f3e40fbf58c8",
      "name": "10 - AI - Generate Wealth Summary",
      "type": "@n8n/n8n-nodes-langchain.googleGemini",
      "onError": "continueErrorOutput",
      "position": [
        400,
        272
      ],
      "parameters": {
        "modelId": {
          "__rl": true,
          "mode": "list",
          "value": "models/gemini-flash-latest",
          "cachedResultName": "models/gemini-flash-latest"
        },
        "options": {},
        "messages": {
          "values": [
            {
              "content": "=You are a professional financial advisor.\n\nFrom the following news, create a daily wealth briefing.\n\nRules:\n- Select top 5 most important updates\n- Focus on macro trends (crypto, inflation, interest rates, oil, major markets)\n- Ignore low-value stock-specific noise\n- Explain in simple terms (1\u20132 lines each)\n-Do not use any emojis in the response\n- Make it actionable\n\nNews:\n{{ $json.news }}"
            }
          ]
        },
        "builtInTools": {}
      },
      "credentials": {
        "googlePalmApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.1
    },
    {
      "id": "ca855f1c-daa6-42f0-93c8-d4881afd25db",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1008,
        -208
      ],
      "parameters": {
        "color": 7,
        "width": 448,
        "height": 832,
        "content": "## Data collection & merge layer\n\nThis section fetches financial news from multiple trusted sources:\n- yahoo finance \u2192 general market news\n- coindesk \u2192 crypto updates\n- federal reserve \u2192 macroeconomic signals\n\ngoal: collect diverse, high-quality financial data for analysis"
      },
      "typeVersion": 1
    },
    {
      "id": "5491e3d6-0df1-4818-8400-71d7375880ea",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -552,
        16
      ],
      "parameters": {
        "color": 7,
        "width": 432,
        "height": 416,
        "content": "## Data cleaning & filtering\n\nThis section improves data quality:\n- remove duplicate news (same titles)\n- filter only important topics (crypto, inflation, market, fed, oil)\n- reduce noise and irrelevant content\n\ngoal: keep only high-signal financial insights"
      },
      "typeVersion": 1
    },
    {
      "id": "7f6c3c84-c4a6-435f-918c-3ba335ec0e05",
      "name": "11 | format for Discord message",
      "type": "n8n-nodes-base.code",
      "position": [
        752,
        176
      ],
      "parameters": {
        "jsCode": "let text = $input.first().json.content.parts[0].text;\n\n// Headings\ntext = text.replace(/### (.*)/g, '**$1**');\n\n// Bold sections \u2192 keep\n\n// Add spacing\ntext = text.replace(/\\n/g, '\\n');\n\n// Add numbering highlight\ntext = text.replace(/\\*\\*(\\d+\\..*?)\\*\\*/g, '**$1**');\n\n\nreturn [\n  {\n    json: {\n      content: text.slice(0, 1900)\n    }\n  }\n];"
      },
      "typeVersion": 2
    },
    {
      "id": "8b38ba75-a5a2-4a80-8edc-5d7ff469e008",
      "name": "13 | Send a Error message",
      "type": "n8n-nodes-base.discord",
      "position": [
        752,
        368
      ],
      "parameters": {
        "content": "AI service is currently unavailable. Unable to generate summary.",
        "guildId": {
          "__rl": true,
          "mode": "list",
          "value": "1485935158350712862",
          "cachedResultUrl": "https://discord.com/channels/1485935158350712862",
          "cachedResultName": "Demo Server"
        },
        "options": {},
        "resource": "message",
        "channelId": {
          "__rl": true,
          "mode": "list",
          "value": "1486968496590946404",
          "cachedResultUrl": "https://discord.com/channels/1485935158350712862/1486968496590946404",
          "cachedResultName": "market-news"
        }
      },
      "credentials": {
        "discordBotApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2
    },
    {
      "id": "24fe2d17-5884-40a7-aac8-9f1305db074a",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -96,
        -144
      ],
      "parameters": {
        "color": 7,
        "width": 1440,
        "height": 672,
        "content": "## AI analysis & delivery\n\nThis section converts raw news into actionable insights:\n- limit to top 15 important news\n- combine into structured input\n- ai generates daily wealth brief\n- format output for readability\n- send to discord channel\n\nfallback: send error message if ai fails"
      },
      "typeVersion": 1
    },
    {
      "id": "67d299be-e2f6-4b10-9a16-96b37e5a1ce1",
      "name": "12 | Final answer",
      "type": "n8n-nodes-base.set",
      "position": [
        976,
        176
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "9033a5bb-884b-4af3-920d-023a3f2e1536",
              "name": "final_response",
              "type": "string",
              "value": "={{ $json.content }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "f4af76af-f744-4597-bd04-be1f7d495ae1",
      "name": "13 | Send a message",
      "type": "n8n-nodes-base.discord",
      "position": [
        1200,
        176
      ],
      "parameters": {
        "content": "={{ $json.final_response }}",
        "guildId": {
          "__rl": true,
          "mode": "list",
          "value": "1485935158350712862",
          "cachedResultUrl": "https://discord.com/channels/1485935158350712862",
          "cachedResultName": "Demo Server"
        },
        "options": {},
        "resource": "message",
        "channelId": {
          "__rl": true,
          "mode": "list",
          "value": "1486968496590946404",
          "cachedResultUrl": "https://discord.com/channels/1485935158350712862/1486968496590946404",
          "cachedResultName": "market-news"
        }
      },
      "typeVersion": 2
    },
    {
      "id": "5f805fa2-bc92-4413-9df4-aa9e76e5e001",
      "name": "01 | Click to Start Workflow",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -1168,
        272
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "5477f127-ba3d-4b44-a082-7f9227edc1be",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1600,
        -544
      ],
      "parameters": {
        "width": 432,
        "height": 544,
        "content": "### Overview\nThis workflow automatically generates a daily financial wealth briefing using multiple trusted news sources. It is designed to deliver concise, actionable insights by combining real-time financial data with AI-powered analysis.\n\n### How It Works\nThe workflow aggregates financial news from Yahoo Finance, CoinDesk and Federal Reserve RSS feeds into a unified dataset. It removes duplicates and low-value items, keeping only relevant macroeconomic topics like inflation, crypto, interest rates and markets. The top 15 news items are then structured and analyzed by Google Gemini AI to generate a clear, actionable wealth summary, which is formatted and sent to Discord. If the AI service fails, a fallback error message is delivered.\n\n### Setup steps\n1. Import the workflow into n8n  \n2. Replace Manual Trigger with a **Schedule Trigger (e.g., daily at 8 AM)**  \n3. Add your **Google Gemini API credentials (Google AI Studio)**  \n4. Connect your **Discord Bot credentials**  \n5. Activate the workflow  "
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "availableInMCP": false,
    "executionOrder": "v1"
  },
  "versionId": "96be046f-c05a-48ca-972b-bc6d899241ca",
  "connections": {
    "12 | Final answer": {
      "main": [
        [
          {
            "node": "13 | Send a message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "08 - Limit - Top 15 News": {
      "main": [
        [
          {
            "node": "09 - Transform - Combine News Text",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "03 - Fetch - CoinDesk RSS": {
      "main": [
        [
          {
            "node": "05 - Merge - All News Sources",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "01 | Click to Start Workflow": {
      "main": [
        [
          {
            "node": "03 - Fetch - CoinDesk RSS",
            "type": "main",
            "index": 0
          },
          {
            "node": "02 - Fetch - Yahoo Finance RSS",
            "type": "main",
            "index": 0
          },
          {
            "node": "04 - Fetch - Federal Reserve RSS",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "05 - Merge - All News Sources": {
      "main": [
        [
          {
            "node": "06 - Clean - Remove Duplicate News",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "02 - Fetch - Yahoo Finance RSS": {
      "main": [
        [
          {
            "node": "05 - Merge - All News Sources",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "11 | format for Discord message": {
      "main": [
        [
          {
            "node": "12 | Final answer",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "04 - Fetch - Federal Reserve RSS": {
      "main": [
        [
          {
            "node": "05 - Merge - All News Sources",
            "type": "main",
            "index": 2
          }
        ]
      ]
    },
    "10 - AI - Generate Wealth Summary": {
      "main": [
        [
          {
            "node": "11 | format for Discord message",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "13 | Send a Error message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "06 - Clean - Remove Duplicate News": {
      "main": [
        [
          {
            "node": "07 - Filter - Remove Low Value News",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "09 - Transform - Combine News Text": {
      "main": [
        [
          {
            "node": "10 - AI - Generate Wealth Summary",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "07 - Filter - Remove Low Value News": {
      "main": [
        [
          {
            "node": "08 - Limit - Top 15 News",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}