{
  "name": "Generate daily stock buy/sell signals using technical indicators and Google Sheets",
  "nodes": [
    {
      "id": "7fcd3413-8b4f-4481-a0b5-76b734d48f6f",
      "name": "Schedule Trigger – Run Daily",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        1936,
        -16
      ]
    },
    {
      "id": "4f5a74b0-95a9-4f5c-8f66-70c07344212f",
      "name": "Define Stock List",
      "type": "n8n-nodes-base.code",
      "position": [
        2128,
        -16
      ]
    },
    {
      "id": "ef71e8d6-c3a2-46c7-a82a-d247c9f21ac4",
      "name": "Loop Through Stocks",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        2304,
        -16
      ]
    },
    {
      "id": "3377ae52-5493-49b2-9073-e53c2cc3c8ce",
      "name": "Check Price Data Exists",
      "type": "n8n-nodes-base.if",
      "position": [
        3024,
        -16
      ]
    },
    {
      "id": "f5aec965-5210-4d9d-bba2-4543c3db13a7",
      "name": "Prepare Price Series",
      "type": "n8n-nodes-base.code",
      "position": [
        2800,
        -16
      ]
    },
    {
      "id": "0356cf69-e5ef-4000-9b14-ee644b6bff5e",
      "name": "Calculate RSI, MA & MACD",
      "type": "n8n-nodes-base.code",
      "position": [
        3248,
        -16
      ]
    },
    {
      "id": "ecdadd34-30d8-424b-9e0d-21ae3e59fdb0",
      "name": "Store Indicator Signals in Google Sheets",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        3504,
        -16
      ]
    },
    {
      "id": "56b4cc06-a538-4d8e-8d33-38e6e1fb51bc",
      "name": "Fetch Historical Prices (Alpha Vantage)",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        2560,
        -16
      ]
    },
    {
      "id": "75ee587e-4ff2-45d5-bca8-112704694a81",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1232,
        -944
      ],
      "parameters": {
        "width": 528,
        "height": 656,
        "content": "## Workflow Overview\n\n### How it works\n\nThis workflow calculates technical indicators for selected stocks and stores\nthe results in a Google Sheets dashboard.\n\nIt runs once per day and processes each "
      }
    },
    {
      "id": "77b0bd5c-0b48-4eb4-b04c-392886bad77c",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2464,
        -208
      ],
      "parameters": {
        "width": 688,
        "height": 368,
        "content": "### Market data retrieval\n\nFetches historical daily price data from Alpha Vantage and prepares clean price series for indicator calculations."
      }
    },
    {
      "id": "3586ab64-2efb-495d-a569-a3707ec87ddd",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        3168,
        -208
      ],
      "parameters": {
        "width": 528,
        "height": 368,
        "content": "### Indicator Calculation and Dashboard Update\n\nCalculates RSI, moving averages, and MACD using standard formulas. Simple rules classify each stock as Buy, Sell, or Neutral. And stores indicator value"
      }
    },
    {
      "id": "8dc62eb7-03a9-405d-bd03-45227e3f0432",
      "name": "Error Handler Trigger",
      "type": "n8n-nodes-base.errorTrigger",
      "position": [
        1280,
        592
      ]
    },
    {
      "id": "3e1dda4a-46f7-4246-99c6-bbcb40313998",
      "name": "Sticky Note8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1184,
        432
      ],
      "parameters": {
        "width": 672,
        "height": 336,
        "content": "## 🚨 Error Handling \n\n \nCatches any workflow failure and posts an alert to Email.  \nIncludes node name, error message, and timestamp for quick debugging.\n"
      }
    },
    {
      "id": "82046edc-0c18-421e-9c92-f44a438a9d2e",
      "name": "Send Error Alert",
      "type": "n8n-nodes-base.gmail",
      "position": [
        1600,
        592
      ]
    },
    {
      "id": "1f1fc112-3238-4851-87aa-87bb41b0eeae",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1872,
        -192
      ],
      "parameters": {
        "width": 576,
        "height": 336,
        "content": "### Stock Selection and Scheduling\n\nThis workflow runs daily and defines the list of stock symbols to analyze. Each stock is processed individually to avoid API limits and ensure stable execution.\n"
      }
    }
  ],
  "connections": {
    "Define Stock List": {
      "main": [
        [
          {
            "node": "Loop Through Stocks",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Through Stocks": {
      "main": [
        [],
        [
          {
            "node": "Fetch Historical Prices (Alpha Vantage)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prepare Price Series": {
      "main": [
        [
          {
            "node": "Check Price Data Exists",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Error Handler Trigger": {
      "main": [
        [
          {
            "node": "Send Error Alert",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check Price Data Exists": {
      "main": [
        [
          {
            "node": "Calculate RSI, MA & MACD",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Calculate RSI, MA & MACD": {
      "main": [
        [
          {
            "node": "Store Indicator Signals in Google Sheets",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger – Run Daily": {
      "main": [
        [
          {
            "node": "Define Stock List",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Historical Prices (Alpha Vantage)": {
      "main": [
        [
          {
            "node": "Prepare Price Series",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Store Indicator Signals in Google Sheets": {
      "main": [
        []
      ]
    }
  }
}