{
  "name": "Generate weekly AI equity research reports with Google Sheets, FMP, NewsAPI, OpenAI, and Gmail",
  "nodes": [
    {
      "id": "8ba91d18-01b8-426f-a48f-cd431ebd5ec7",
      "name": "Weekly Equity Research Trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -96,
        0
      ]
    },
    {
      "id": "3c5ba0e3-ee70-4a08-9022-368dc51ef413",
      "name": "Fetch Company List",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        112,
        0
      ]
    },
    {
      "id": "1628fc88-b809-4ac3-a5c4-eb7a8dfaca42",
      "name": "Fetch Income Statement",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1072,
        -224
      ]
    },
    {
      "id": "4a3bd331-1c82-47f4-aa48-e2a44e37e8bd",
      "name": "Fetch Balance Sheet",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1056,
        -16
      ]
    },
    {
      "id": "cc3dd95e-cec9-4326-99ee-e118f6efe1ae",
      "name": "Fetch Cash Flow",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1040,
        208
      ]
    },
    {
      "id": "8713c97c-84e1-4fa1-ae93-8e2f674a0649",
      "name": "Fetch Market Data",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1040,
        448
      ]
    },
    {
      "id": "d7ebfa69-69d7-4543-93c4-8132a34b555f",
      "name": "Parse Risks and Growth Output",
      "type": "n8n-nodes-base.code",
      "position": [
        2672,
        224
      ]
    },
    {
      "id": "d9606f85-e284-4a04-896e-e1877d778854",
      "name": "Build Equity Research Report",
      "type": "n8n-nodes-base.code",
      "position": [
        3248,
        96
      ]
    },
    {
      "id": "8fe6ee7c-1af0-44d5-9c9d-c1d166a7149c",
      "name": "Filter Enabled Companies",
      "type": "n8n-nodes-base.if",
      "position": [
        320,
        0
      ]
    },
    {
      "id": "7c0d21eb-d7d3-4627-984a-34298c5a1d22",
      "name": "Iterate Companies",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        576,
        -16
      ]
    },
    {
      "id": "c336316a-32f2-4dce-ac59-3bbe7543aabf",
      "name": "Normalize Income Statement Data",
      "type": "n8n-nodes-base.code",
      "position": [
        1280,
        -224
      ]
    },
    {
      "id": "96fd276d-882f-4977-be51-7f5bfc72d4e7",
      "name": "Normalize Balance Sheet Data",
      "type": "n8n-nodes-base.code",
      "position": [
        1296,
        -16
      ]
    },
    {
      "id": "7473b880-a93d-4fcd-a41c-b3ce0d52d113",
      "name": "Normalize Cash Flow Data",
      "type": "n8n-nodes-base.code",
      "position": [
        1280,
        208
      ]
    },
    {
      "id": "5c365c91-e0c8-4268-bb17-edbcc6d98640",
      "name": "Normalize Market News Data",
      "type": "n8n-nodes-base.code",
      "position": [
        1280,
        448
      ]
    },
    {
      "id": "1b2300e2-164a-41ed-8702-b6746d4e2ad5",
      "name": "Merge Financials and News",
      "type": "n8n-nodes-base.merge",
      "position": [
        1808,
        64
      ]
    },
    {
      "id": "ef44be38-7acb-4e8b-a3a9-2b8bb5350ff4",
      "name": "Compute Financial and Market Signals",
      "type": "n8n-nodes-base.code",
      "position": [
        2016,
        96
      ]
    },
    {
      "id": "ed0d6bf4-3b0e-4efc-ac24-b3db27bd118f",
      "name": "LLM – SWOT Analysis Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        2304,
        48
      ]
    },
    {
      "id": "e6bc944b-fbc4-4cc8-8997-53bbc8cf0086",
      "name": "Generate SWOT Analysis",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        2304,
        -128
      ]
    },
    {
      "id": "f17c2007-0500-4b81-ad6e-28ce901ccb14",
      "name": "Parse SWOT Output",
      "type": "n8n-nodes-base.code",
      "position": [
        2672,
        -128
      ]
    },
    {
      "id": "afe5d9bd-8a0f-412c-996a-b9b8ada81223",
      "name": "LLM – Risk and Growth Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        2320,
        400
      ]
    },
    {
      "id": "0b183d35-b6ad-4dc4-8ad5-b936f716c1da",
      "name": "Generate Risks and Growth Outlook",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        2320,
        224
      ]
    },
    {
      "id": "06fd7960-2806-4c4f-b595-f52fa79977d8",
      "name": "Merge All AI Insights",
      "type": "n8n-nodes-base.merge",
      "position": [
        2992,
        96
      ]
    },
    {
      "id": "44902b8c-483f-44fd-83ac-a9ee67b7e0f7",
      "name": "Render Research Report to PDF",
      "type": "n8n-nodes-htmlcsstopdf.htmlcsstopdf",
      "position": [
        3520,
        96
      ]
    },
    {
      "id": "c3f4e60c-9786-4153-9c41-c8519dab017b",
      "name": "Validate PDF Generation",
      "type": "n8n-nodes-base.if",
      "position": [
        3728,
        96
      ]
    },
    {
      "id": "110a466a-abd8-4b4e-a69b-1b9c651effc8",
      "name": "Log Report Metadata",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        4096,
        -48
      ]
    },
    {
      "id": "e90a99b4-3609-4d8d-8a69-186d1b011adb",
      "name": "Send Email Equity Research Report",
      "type": "n8n-nodes-base.gmail",
      "position": [
        4080,
        224
      ]
    },
    {
      "id": "a295329e-3444-43d4-8e71-9d640d2724e1",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -160,
        -1072
      ],
      "parameters": {
        "width": 512,
        "height": 752,
        "content": "## Workflow Overview \n\n### How it works\n\nThis workflow automatically creates a professional equity research report for selected companies on a weekly basis. It begins by reading a list of companies fr"
      }
    },
    {
      "id": "2c6bb56b-b7c6-4586-9361-553bed73afdd",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -160,
        -176
      ],
      "parameters": {
        "width": 896,
        "height": 416,
        "content": "### Company Selection and Looping\n\nThese nodes load companies from Google Sheets, filters only enabled entries, and loops through each company one at a time. It ensures controlled execution and allows"
      }
    },
    {
      "id": "57eaaf05-32fc-453e-90fb-2f041e9b482f",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        880,
        -400
      ],
      "parameters": {
        "width": 816,
        "height": 1024,
        "content": "### Financial and News Data Collection\n\nThese nodes fetch financial statements and recent market news from external APIs. Keeping data collection separate helps maintain clarity, simplifies troublesho"
      }
    },
    {
      "id": "b3e5364a-f0db-4b26-a0d4-0b1e3dc7041e",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1728,
        -400
      ],
      "parameters": {
        "width": 1408,
        "height": 1024,
        "content": "### AI Analysis and Signal Generation\n\nThis group calculates financial signals and uses AI to generate SWOT insights, risks, and growth outlook. The AI relies only on computed metrics and recent news,"
      }
    },
    {
      "id": "47343c7f-5a6b-47fb-bdae-0dfaf6844ad6",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        3200,
        -160
      ],
      "parameters": {
        "width": 1200,
        "height": 560,
        "content": "### Report Generation and Delivery \n\nThese nodes assemble the final report, convert it into a PDF, log key details in Google Sheets, and send the report link by email once generation is confirmed succ"
      }
    }
  ],
  "connections": {
    "Fetch Cash Flow": {
      "main": [
        [
          {
            "node": "Normalize Cash Flow Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Market Data": {
      "main": [
        [
          {
            "node": "Normalize Market News Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Iterate Companies": {
      "main": [
        [],
        [
          {
            "node": "Fetch Income Statement",
            "type": "main",
            "index": 0
          },
          {
            "node": "Fetch Balance Sheet",
            "type": "main",
            "index": 0
          },
          {
            "node": "Fetch Cash Flow",
            "type": "main",
            "index": 0
          },
          {
            "node": "Fetch Market Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Parse SWOT Output": {
      "main": [
        [
          {
            "node": "Merge All AI Insights",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Company List": {
      "main": [
        [
          {
            "node": "Filter Enabled Companies",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Balance Sheet": {
      "main": [
        [
          {
            "node": "Normalize Balance Sheet Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge All AI Insights": {
      "main": [
        [
          {
            "node": "Build Equity Research Report",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Income Statement": {
      "main": [
        [
          {
            "node": "Normalize Income Statement Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate SWOT Analysis": {
      "main": [
        [
          {
            "node": "Parse SWOT Output",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Validate PDF Generation": {
      "main": [
        [
          {
            "node": "Log Report Metadata",
            "type": "main",
            "index": 0
          },
          {
            "node": "Send Email Equity Research Report",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filter Enabled Companies": {
      "main": [
        [
          {
            "node": "Iterate Companies",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Normalize Cash Flow Data": {
      "main": [
        [
          {
            "node": "Merge Financials and News",
            "type": "main",
            "index": 2
          }
        ]
      ]
    },
    "Merge Financials and News": {
      "main": [
        [
          {
            "node": "Compute Financial and Market Signals",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Normalize Market News Data": {
      "main": [
        [
          {
            "node": "Merge Financials and News",
            "type": "main",
            "index": 3
          }
        ]
      ]
    },
    "LLM – SWOT Analysis Model": {
      "ai_languageModel": [
        [
          {
            "node": "Generate SWOT Analysis",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Build Equity Research Report": {
      "main": [
        [
          {
            "node": "Render Research Report to PDF",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Normalize Balance Sheet Data": {
      "main": [
        [
          {
            "node": "Merge Financials and News",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "LLM – Risk and Growth Model": {
      "ai_languageModel": [
        [
          {
            "node": "Generate Risks and Growth Outlook",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Parse Risks and Growth Output": {
      "main": [
        [
          {
            "node": "Merge All AI Insights",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Render Research Report to PDF": {
      "main": [
        [
          {
            "node": "Validate PDF Generation",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Weekly Equity Research Trigger": {
      "main": [
        [
          {
            "node": "Fetch Company List",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Normalize Income Statement Data": {
      "main": [
        [
          {
            "node": "Merge Financials and News",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Risks and Growth Outlook": {
      "main": [
        [
          {
            "node": "Parse Risks and Growth Output",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Email Equity Research Report": {
      "main": [
        [
          {
            "node": "Iterate Companies",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Compute Financial and Market Signals": {
      "main": [
        [
          {
            "node": "Generate SWOT Analysis",
            "type": "main",
            "index": 0
          },
          {
            "node": "Generate Risks and Growth Outlook",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}