{
  "name": "Automated stock sentiment analysis with Google Gemini and EODHD News API",
  "nodes": [
    {
      "id": "0d063cec-e739-48b6-9698-0ac586f147ad",
      "name": "AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        1040,
        1620
      ]
    },
    {
      "id": "a9bec4e8-b9df-4868-b6c3-072316fe1ed9",
      "name": "Google Gemini Chat Model1",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        1028,
        1840
      ]
    },
    {
      "id": "0b197810-0002-4f2c-8122-1db9a6a81558",
      "name": "Get articles from EODHD",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        160,
        1520
      ]
    },
    {
      "id": "392f7ccd-aba3-4911-859a-556535f45eea",
      "name": "loop_over_tickers",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        -200,
        1640
      ]
    },
    {
      "id": "6e5b9817-b6ec-4c0a-98fd-b41340ab6230",
      "name": "Read_tickers_from_Sheet",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -420,
        1640
      ]
    },
    {
      "id": "e68be220-53b9-4b3d-a543-98a916382d42",
      "name": "If_ticker_not_valid",
      "type": "n8n-nodes-base.if",
      "position": [
        380,
        1520
      ]
    },
    {
      "id": "bfc2cc77-5fc2-41ae-9e2a-22fed368c852",
      "name": "Write_in_google_sheets_invalid_ticker",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        600,
        1420
      ]
    },
    {
      "id": "81a16d3a-cdc4-4ad3-8769-b858a999f0ed",
      "name": "join_articles_into_1",
      "type": "n8n-nodes-base.code",
      "position": [
        600,
        1620
      ]
    },
    {
      "id": "9c05ff30-59c7-45e0-8079-e3a0f01547bd",
      "name": "format_output_as_json",
      "type": "n8n-nodes-base.code",
      "position": [
        1600,
        1520
      ]
    },
    {
      "id": "c5817f1f-8e79-4c13-9807-fd5176c2773f",
      "name": "if_format_succesful",
      "type": "n8n-nodes-base.if",
      "position": [
        1840,
        1620
      ]
    },
    {
      "id": "0dc93919-fb1a-46df-b316-1044f11cd791",
      "name": "write_sentiment_to_sheets",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        2360,
        1740
      ]
    },
    {
      "id": "3cbf7b55-50ae-4d1c-8f9e-56941441ef00",
      "name": "Schedule Trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -640,
        1640
      ]
    },
    {
      "id": "ce8d9b54-2026-4faa-9ee1-c261170c8426",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -620,
        660
      ],
      "parameters": {
        "width": 480,
        "height": 440,
        "content": "# Workflow Overview \n**This workflow automates the process of analyzing the sentiment of stock market news.**\n\n- retrieves a list of stock tickers from a Google Sheet \n- fetches recent news articles f"
      }
    },
    {
      "id": "efaee1f9-e57a-4640-a1d6-eb5bc5f341af",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -680,
        1200
      ],
      "parameters": {
        "width": 640,
        "height": 640,
        "content": "# 1. Daily Trigger and Stock Ticker Retrieval\n- **Schedule Trigger:** This workflow is set to run automatically every day at 4:00 PM (Asia/Jerusalem time). This ensures that the script runs just befor"
      }
    },
    {
      "id": "eaca666d-2830-4e98-bfe4-44c15d452939",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        80,
        1020
      ],
      "parameters": {
        "width": 680,
        "height": 940,
        "content": "# 2. News Article Retrieval and Validation\n\n- **Get articles from EODHD:** For each ticker, this node makes an HTTP request to the EODHD API to fetch the 10 most recent news articles.\n\n- **If_ticker_n"
      }
    },
    {
      "id": "92a8b9e8-cdca-4584-938f-b478b8136867",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        880,
        1180
      ],
      "parameters": {
        "width": 500,
        "height": 800,
        "content": "# 3. Sentiment Analysis with AI\n\n- **AI Agent & Google Gemini Chat Model:** This is the core of the sentiment analysis. The \"AI Agent\" node is configured with a detailed prompt that instructs the \"Goo"
      }
    },
    {
      "id": "aa4c0dfb-0e02-4f74-b908-27b6b81bbef1",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1500,
        980
      ],
      "parameters": {
        "width": 560,
        "height": 860,
        "content": "# 4. Output Formatting and Error Handling\n\n- **format_output_as_json:** The output from the AI model is a raw string that includes a JSON object. This code node extracts the clean JSON from the string"
      }
    },
    {
      "id": "cd441252-7867-40e4-9fb9-aa1e6fd53fb9",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2160,
        1300
      ],
      "parameters": {
        "width": 520,
        "height": 600,
        "content": "# 5. Storing the Results\n\n\n- **write_sentiment_to_sheets:** Once a valid sentiment analysis result is obtained and formatted, this node appends the data to \"Sheet1\" of the \"Stock Sentiment\" Google She"
      }
    }
  ],
  "connections": {
    "AI Agent": {
      "main": [
        [
          {
            "node": "format_output_as_json",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "Read_tickers_from_Sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "loop_over_tickers": {
      "main": [
        [],
        [
          {
            "node": "Get articles from EODHD",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If_ticker_not_valid": {
      "main": [
        [
          {
            "node": "Write_in_google_sheets_invalid_ticker",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "join_articles_into_1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "if_format_succesful": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "write_sentiment_to_sheets",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "join_articles_into_1": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "format_output_as_json": {
      "main": [
        [
          {
            "node": "if_format_succesful",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get articles from EODHD": {
      "main": [
        [
          {
            "node": "If_ticker_not_valid",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Read_tickers_from_Sheet": {
      "main": [
        [
          {
            "node": "loop_over_tickers",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model1": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "write_sentiment_to_sheets": {
      "main": [
        [
          {
            "node": "loop_over_tickers",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}