{
  "name": "Generate AI stock buy/no-buy signals using GPT‑4.1, Google Sheets and EODHD",
  "nodes": [
    {
      "id": "903c0cd1-5734-4a4d-99de-03acaf28595c",
      "name": "When clicking ‘Execute workflow’",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -1024,
        100
      ]
    },
    {
      "id": "53f2218c-55ce-4b2e-964b-a119fdabc486",
      "name": "Get row(s) in sheet",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -800,
        100
      ]
    },
    {
      "id": "dad4cbe0-e5b3-417e-8bba-5adaaf1cb570",
      "name": "Loop Over Items",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        -576,
        100
      ]
    },
    {
      "id": "edf3eaa2-5b9d-40f9-a0fe-b526fbc2c06b",
      "name": "Merge",
      "type": "n8n-nodes-base.merge",
      "position": [
        320,
        -24
      ]
    },
    {
      "id": "92132dbf-383f-47ca-a4e9-5a26d8631978",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        840,
        200
      ]
    },
    {
      "id": "ec661db6-824a-44e7-8e97-1e62bb472f1b",
      "name": "Code in JavaScript2",
      "type": "n8n-nodes-base.code",
      "position": [
        1120,
        -16
      ]
    },
    {
      "id": "cda8d21f-0612-41d7-a673-17d5abe93df7",
      "name": "Append row in sheet",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1568,
        100
      ]
    },
    {
      "id": "518a7800-ba5a-4198-b637-9c506ba1ef20",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1568,
        -928
      ],
      "parameters": {
        "width": 368,
        "height": 1456,
        "content": "## What this workflow does\nThis workflow automates **end-to-end stock analysis** using real market data and AI:\n\n- Reads a list of stock tickers from **Google Sheets**\n- Fetches **fundamental data** ("
      }
    },
    {
      "id": "55aad4d8-f82c-48e9-8b7b-023c4e17d384",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1072,
        -384
      ],
      "parameters": {
        "width": null,
        "height": 336,
        "content": "## INPUT\n\n![txt](https://ik.imagekit.io/agbb7sr41/eodhd_input.png)\n"
      }
    },
    {
      "id": "a57c2bd7-9f41-459e-9773-a9099c1de4b4",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1488,
        -368
      ],
      "parameters": {
        "width": 544,
        "height": 224,
        "content": "## AI Output\n- The merged data is sent to the **AI system**\n- The AI evaluates fundamentals, technicals, and risk\n- The final output includes:\n  - BUY / WATCH / SELL signal\n  - Entry, Stop Loss, Take "
      }
    },
    {
      "id": "2f850f00-2033-4cd8-95ea-25018a1d85dd",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        224,
        -320
      ],
      "parameters": {
        "width": 576,
        "height": 192,
        "content": "##  Transform & Merge\n\n- Raw market data is cleaned and normalized\n- Technical indicators are calculated\n- Fundamentals and price data are **merged into one dataset**\n\nAt the end of this step, each st"
      }
    },
    {
      "id": "6d48267a-78c8-4a2f-945e-a51fff6527fa",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -560,
        -352
      ],
      "parameters": {
        "width": 480,
        "height": 192,
        "content": "## Input (Data sources)\n- Stock tickers come from **Google Sheets**\n- Market data is fetched via **API calls**:\n  - Fundamentals\n  - Price candles (OHLCV)\n\nThis step collects all the raw data needed f"
      }
    },
    {
      "id": "98865136-2f82-442d-bb52-6c3972f2fc1f",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1792,
        112
      ],
      "parameters": {
        "width": 1008,
        "height": 208,
        "content": "## OUTPUT\n![txt](https://ik.imagekit.io/agbb7sr41/eodhd_ouput.png)"
      }
    },
    {
      "id": "26f88d6a-a455-48d5-9152-7e234544f503",
      "name": "Fetch stock fundamentals (EODHD)",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -352,
        -24
      ]
    },
    {
      "id": "82c09546-012a-448a-be08-93fdf69069c5",
      "name": "Fetch OHLC price data (EODHD)",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -128,
        -96
      ]
    },
    {
      "id": "68ab8847-eaab-46c1-9f68-42c92d86765c",
      "name": "Generate AI stock analysis",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        768,
        -24
      ]
    },
    {
      "id": "0194e08c-d067-40ef-bc35-fdb03e8d5097",
      "name": "Compute indicators and growth score",
      "type": "n8n-nodes-base.code",
      "position": [
        96,
        -96
      ]
    },
    {
      "id": "13f4df9f-2fca-40b5-9f2f-dacc837b0ad5",
      "name": "Normalize OHLC data",
      "type": "n8n-nodes-base.code",
      "position": [
        544,
        -24
      ]
    },
    {
      "id": "9a94c125-9a65-4443-b6f8-4e4b3c938e3a",
      "name": "Prepare data for Google Sheets",
      "type": "n8n-nodes-base.code",
      "position": [
        1344,
        -24
      ]
    },
    {
      "id": "b8a74613-dd1e-4016-9531-235547fa16d7",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1152,
        -464
      ],
      "parameters": {
        "width": 1136,
        "height": 816,
        "content": ""
      }
    },
    {
      "id": "d3948bf0-a52b-4476-bae4-94ee4dac0c3a",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        16,
        -472
      ],
      "parameters": {
        "width": 1280,
        "height": 816,
        "content": ""
      }
    },
    {
      "id": "6a6233df-23d1-4a68-a3eb-4be88087a17a",
      "name": "Sticky Note8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1312,
        -496
      ],
      "parameters": {
        "width": 1504,
        "height": 864,
        "content": ""
      }
    }
  ],
  "connections": {
    "Merge": {
      "main": [
        [
          {
            "node": "Normalize OHLC data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Items": {
      "main": [
        [],
        [
          {
            "node": "Fetch stock fundamentals (EODHD)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Generate AI stock analysis",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Append row in sheet": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Code in JavaScript2": {
      "main": [
        [
          {
            "node": "Prepare data for Google Sheets",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get row(s) in sheet": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Normalize OHLC data": {
      "main": [
        [
          {
            "node": "Generate AI stock analysis",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate AI stock analysis": {
      "main": [
        [
          {
            "node": "Code in JavaScript2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch OHLC price data (EODHD)": {
      "main": [
        [
          {
            "node": "Compute indicators and growth score",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prepare data for Google Sheets": {
      "main": [
        [
          {
            "node": "Append row in sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch stock fundamentals (EODHD)": {
      "main": [
        [
          {
            "node": "Fetch OHLC price data (EODHD)",
            "type": "main",
            "index": 0
          },
          {
            "node": "Merge",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Compute indicators and growth score": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When clicking ‘Execute workflow’": {
      "main": [
        [
          {
            "node": "Get row(s) in sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}