{
  "name": "Analyze stocks in Telegram with Twelve Data, GPT-4o and o3-mini",
  "nodes": [
    {
      "id": "09918673-da0b-462d-9ad3-6ee914df7482",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -848,
        -288
      ],
      "parameters": {
        "width": 568,
        "height": 360,
        "content": "## TwelveData Pro Analyst\n### Elite Financial Analysis with Real-Time Data\n\nFeatures:\n- 70+ Technical Indicators\n- Fundamental Analysis\n- Multi-Stock Comparison\n- Sector Analysis\n- Portfolio Risk Asse"
      }
    },
    {
      "id": "62c5687d-a102-4628-b3a4-ed69c6ad9a20",
      "name": "Filter Message Type",
      "type": "n8n-nodes-base.code",
      "position": [
        304,
        -16
      ]
    },
    {
      "id": "b9f3d0e8-7a5c-4ff5-b203-46d6bd3a3060",
      "name": "Is Valid Message?",
      "type": "n8n-nodes-base.if",
      "position": [
        528,
        -16
      ]
    },
    {
      "id": "4bead6c9-5fe2-4686-b0da-1036869fff50",
      "name": "Send Unsupported Message",
      "type": "n8n-nodes-base.telegram",
      "position": [
        1056,
        -160
      ]
    },
    {
      "id": "78e12537-20d5-4d15-9378-be13efde0674",
      "name": "Telegram Trigger1",
      "type": "n8n-nodes-base.telegramTrigger",
      "position": [
        -144,
        -16
      ]
    },
    {
      "id": "ad9a56cb-3bb8-4896-857f-56ffff66c2ef",
      "name": "PreProcessing1",
      "type": "n8n-nodes-base.set",
      "position": [
        80,
        -16
      ]
    },
    {
      "id": "11704bf1-4a4f-4ed4-aed1-c7305dd84906",
      "name": "AI Agent1",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        992,
        144
      ]
    },
    {
      "id": "8d723220-1610-4f97-9c00-eec19797b6e0",
      "name": "Conversation Memory1",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        880,
        368
      ]
    },
    {
      "id": "599903f5-275a-4443-b879-cbbc517f9388",
      "name": "Analytics_Model1",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter",
      "position": [
        752,
        368
      ]
    },
    {
      "id": "c16b9f53-66eb-40a5-b103-b14d7defd10d",
      "name": "Stock Analysis Tool1",
      "type": "@n8n/n8n-nodes-langchain.toolWorkflow",
      "position": [
        1008,
        368
      ]
    },
    {
      "id": "0a16310c-bf79-4b6f-a812-12fd48158550",
      "name": "Stock Comparison Tool1",
      "type": "@n8n/n8n-nodes-langchain.toolWorkflow",
      "position": [
        1136,
        368
      ]
    },
    {
      "id": "a688d666-f6ec-474b-ada9-a0f859cb1965",
      "name": "Sector Analysis Tool1",
      "type": "@n8n/n8n-nodes-langchain.toolWorkflow",
      "position": [
        1264,
        368
      ]
    },
    {
      "id": "43dd2f38-7e8a-4776-9750-489d6767d396",
      "name": "Risk Calculator Tool1",
      "type": "@n8n/n8n-nodes-langchain.toolWorkflow",
      "position": [
        1392,
        368
      ]
    },
    {
      "id": "35de563e-5773-4f35-8447-1948f4b8ba33",
      "name": "Send Response1",
      "type": "n8n-nodes-base.telegram",
      "position": [
        1600,
        144
      ]
    },
    {
      "id": "7288d7d1-b7c4-4121-8ad5-309a2578bec6",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -848,
        96
      ],
      "parameters": {
        "width": 560,
        "height": 472,
        "content": "## TwelveData Pro Analyst v2\n### Elite Financial Analysis — Ade AI\n\n**Fixes Applied:**\n- ✅ Dynamic chat.id (multi-user)\n- ✅ Dynamic memory per user\n- ✅ o3-mini model (upgraded from GPT-4o)\n- ✅ Non-tex"
      }
    },
    {
      "id": "cbbe92d8-75e6-4be6-ae85-8257da8c22a8",
      "name": "Trigger",
      "type": "n8n-nodes-base.executeWorkflowTrigger",
      "position": [
        432,
        912
      ]
    },
    {
      "id": "b4595614-3b17-4cf1-a2ae-735ee031617d",
      "name": "Get Historical Data",
      "type": "n8n-nodes-twelve-data.twelveData",
      "position": [
        832,
        848
      ]
    },
    {
      "id": "48b453db-74c1-4e80-a760-fd16e64af248",
      "name": "Get Statistics",
      "type": "n8n-nodes-twelve-data.twelveData",
      "position": [
        832,
        992
      ]
    },
    {
      "id": "015583f2-c324-4186-bad8-b9dc347af301",
      "name": "Merge",
      "type": "n8n-nodes-base.merge",
      "position": [
        1056,
        912
      ]
    },
    {
      "id": "b5b011ff-bf3c-4168-9a54-cb4f562783fa",
      "name": "Calculate Risk Metrics",
      "type": "n8n-nodes-base.code",
      "position": [
        1280,
        912
      ]
    },
    {
      "id": "a7031505-8171-4091-9ced-a25ed46e72c9",
      "name": "Output",
      "type": "n8n-nodes-base.set",
      "position": [
        1504,
        912
      ]
    },
    {
      "id": "a8bd84c1-b4ef-4000-9b8e-67f1e54edfe7",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -416,
        672
      ],
      "parameters": {
        "width": 2192,
        "height": 600,
        "content": "## Risk Calculator Tool\n### Elite Financial Analysis — Ade AI\n\n\n- Triggered by a parent workflow passing a **stock ticker** and optional **position size** (default $10,000)\n- Fetches **historical pric"
      }
    },
    {
      "id": "397713af-9cd5-4ab2-a15f-caddcc969959",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -400,
        1376
      ],
      "parameters": {
        "width": 2192,
        "height": 600,
        "content": "## Stock Comparison Tool\n### Elite Financial Analysis — Ade AI\n\n- Triggered by a parent workflow passing ticker symbols as a comma-separated string, natural language (e.g. \"compare AAPL and TSLA\"), or"
      }
    },
    {
      "id": "802624fd-afbc-499f-b090-58fd3da25ba8",
      "name": "Split Tickers1",
      "type": "n8n-nodes-base.code",
      "position": [
        608,
        1600
      ]
    },
    {
      "id": "eb1e0fe5-7bdf-4e8b-bdd3-d497acbb72ac",
      "name": "Get Quotes1",
      "type": "n8n-nodes-twelve-data.twelveData",
      "position": [
        832,
        1408
      ]
    },
    {
      "id": "5546b63f-7b9a-4d2d-8ec7-298893de5774",
      "name": "Get RSI1",
      "type": "n8n-nodes-twelve-data.twelveData",
      "position": [
        832,
        1600
      ]
    },
    {
      "id": "cf0b5d2a-aac5-4808-8e88-4a11a9373fdc",
      "name": "Get Profile1",
      "type": "n8n-nodes-twelve-data.twelveData",
      "position": [
        832,
        1792
      ]
    },
    {
      "id": "064cfaa5-9b78-4262-baa5-d1ad17df10a2",
      "name": "Merge Stock Data1",
      "type": "n8n-nodes-base.merge",
      "position": [
        1056,
        1584
      ]
    },
    {
      "id": "d332e75f-f8f3-4108-aa5d-89a1a6ddc2c6",
      "name": "Format Comparison1",
      "type": "n8n-nodes-base.code",
      "position": [
        1280,
        1600
      ]
    },
    {
      "id": "cac85015-70a5-46fe-b972-b199d6db9128",
      "name": "Output1",
      "type": "n8n-nodes-base.set",
      "position": [
        1504,
        1600
      ]
    },
    {
      "id": "70076583-bd97-4b5f-8ea2-6a8872aa6159",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1872,
        672
      ],
      "parameters": {
        "width": 2960,
        "height": 600,
        "content": "## Sector Analysis Tool\n### Elite Financial Analysis — Ade AI\n\n\n- Triggered by a parent workflow passing a sector name (Technology, Healthcare, Finance, Energy, Consumer, Real Estate, Utilities, or In"
      }
    },
    {
      "id": "57846b38-073f-45a3-95fe-84c7439e7631",
      "name": "Set Sector",
      "type": "n8n-nodes-base.set",
      "position": [
        3184,
        880
      ]
    },
    {
      "id": "8468d785-15d1-4f60-9a69-8a185689e0fc",
      "name": "Get Sector Stocks",
      "type": "n8n-nodes-base.code",
      "position": [
        3408,
        880
      ]
    },
    {
      "id": "6734d2e4-b627-408d-90a0-9d0a87b6fc4e",
      "name": "Get Quote",
      "type": "n8n-nodes-twelve-data.twelveData",
      "position": [
        3632,
        784
      ]
    },
    {
      "id": "1e082627-3fec-499d-81db-af7f7482bf36",
      "name": "Merge & Enrich Data",
      "type": "n8n-nodes-base.code",
      "position": [
        4080,
        880
      ]
    },
    {
      "id": "34c4e8b8-2826-4c9a-a5bf-787f5b49b02e",
      "name": "Analyze Sector",
      "type": "n8n-nodes-base.code",
      "position": [
        4304,
        880
      ]
    },
    {
      "id": "4419b861-1932-4f0f-bc53-c5fe2810c065",
      "name": "Merge2",
      "type": "n8n-nodes-base.merge",
      "position": [
        3856,
        880
      ]
    },
    {
      "id": "988626e1-9857-4660-91e4-71ee3c6a9a08",
      "name": "Get Statistics1",
      "type": "n8n-nodes-twelve-data.twelveData",
      "position": [
        3632,
        976
      ]
    },
    {
      "id": "7b5b70df-193c-46c7-867c-70ce4f360e1d",
      "name": "Output2",
      "type": "n8n-nodes-base.set",
      "position": [
        4528,
        880
      ]
    },
    {
      "id": "6b538ff3-02bf-466a-a988-2fe4c785ac70",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1872,
        1376
      ],
      "parameters": {
        "width": 3472,
        "height": 1576,
        "content": "## Sector Analysis Tool\n### Elite Financial Analysis — Ade AI\n\n\n## TwelveData_Pro_Helper (Stock Analysis Tool)\n\n- Triggered by a parent workflow passing a single stock ticker symbol\n- Fetches **7 data"
      }
    },
    {
      "id": "d7c23b21-2392-47d1-a5d6-a33600b6a008",
      "name": "Set Stock Ticker",
      "type": "n8n-nodes-base.set",
      "position": [
        3152,
        2080
      ]
    },
    {
      "id": "8b221d9b-1ff2-4d56-ad73-5ae5de6cdb07",
      "name": "Get Real-Time Quote",
      "type": "n8n-nodes-twelve-data.twelveData",
      "position": [
        3680,
        1408
      ]
    },
    {
      "id": "47980839-b498-491a-84ba-04d64cd73cf8",
      "name": "Get Time Series (90 days)",
      "type": "n8n-nodes-twelve-data.twelveData",
      "position": [
        3680,
        1632
      ]
    },
    {
      "id": "48347bba-8aad-425b-8962-82fa9a495064",
      "name": "RSI Indicator",
      "type": "n8n-nodes-twelve-data.twelveData",
      "position": [
        3680,
        1856
      ]
    },
    {
      "id": "3d6214b4-950f-4764-9066-7ff7f0b3766d",
      "name": "MACD Indicator",
      "type": "n8n-nodes-twelve-data.twelveData",
      "position": [
        3680,
        2080
      ]
    },
    {
      "id": "2d4e439d-8c07-402d-bc3b-a2cac28b1239",
      "name": "Bollinger Bands",
      "type": "n8n-nodes-twelve-data.twelveData",
      "position": [
        3680,
        2304
      ]
    },
    {
      "id": "5db304ed-5e01-4fff-9f48-0a25ea4fc9c8",
      "name": "Get Company Profile",
      "type": "n8n-nodes-twelve-data.twelveData",
      "position": [
        3680,
        2528
      ]
    },
    {
      "id": "4f73ff69-42b4-43d4-8555-c15c8667ad4d",
      "name": "Get Income Statement",
      "type": "n8n-nodes-twelve-data.twelveData",
      "position": [
        3680,
        2752
      ]
    },
    {
      "id": "61547754-81f5-415c-99d0-104eeedd6709",
      "name": "Merge All Data",
      "type": "n8n-nodes-base.merge",
      "position": [
        4208,
        2048
      ]
    },
    {
      "id": "3c40f494-839a-4839-a960-b25518f6ca60",
      "name": "Format Data for AI",
      "type": "n8n-nodes-base.code",
      "position": [
        4416,
        2128
      ]
    },
    {
      "id": "10788863-1d94-4a23-8fc7-ca1723f815c2",
      "name": "AI Analysis",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        4640,
        2128
      ]
    },
    {
      "id": "590bb634-b05a-42b9-99aa-65d00fb12e43",
      "name": "Response Output",
      "type": "n8n-nodes-base.set",
      "position": [
        5040,
        2128
      ]
    },
    {
      "id": "c6efbd47-ca29-4023-bd01-216efdd96d20",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -256,
        -288
      ],
      "parameters": {
        "width": 2408,
        "height": 856,
        "content": ""
      }
    }
  ],
  "connections": {
    "Merge": {
      "main": [
        [
          {
            "node": "Calculate Risk Metrics",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge2": {
      "main": [
        [
          {
            "node": "Merge & Enrich Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Trigger": {
      "main": [
        [
          {
            "node": "Get Historical Data",
            "type": "main",
            "index": 0
          },
          {
            "node": "Get Statistics",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get RSI1": {
      "main": [
        [
          {
            "node": "Merge Stock Data1",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "AI Agent1": {
      "main": [
        [
          {
            "node": "Send Response1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Quote": {
      "main": [
        [
          {
            "node": "Merge2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set Sector": {
      "main": [
        [
          {
            "node": "Get Sector Stocks",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Analysis": {
      "main": [
        [
          {
            "node": "Response Output",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Quotes1": {
      "main": [
        [
          {
            "node": "Merge Stock Data1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Profile1": {
      "main": [
        [
          {
            "node": "Merge Stock Data1",
            "type": "main",
            "index": 2
          }
        ]
      ]
    },
    "RSI Indicator": {
      "main": [
        [
          {
            "node": "Merge All Data",
            "type": "main",
            "index": 2
          }
        ]
      ]
    },
    "Analyze Sector": {
      "main": [
        [
          {
            "node": "Output2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Statistics": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "MACD Indicator": {
      "main": [
        [
          {
            "node": "Merge All Data",
            "type": "main",
            "index": 3
          }
        ]
      ]
    },
    "Merge All Data": {
      "main": [
        [
          {
            "node": "Format Data for AI",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "PreProcessing1": {
      "main": [
        [
          {
            "node": "Filter Message Type",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split Tickers1": {
      "main": [
        [
          {
            "node": "Get Quotes1",
            "type": "main",
            "index": 0
          },
          {
            "node": "Get RSI1",
            "type": "main",
            "index": 0
          },
          {
            "node": "Get Profile1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Bollinger Bands": {
      "main": [
        [
          {
            "node": "Merge All Data",
            "type": "main",
            "index": 4
          }
        ]
      ]
    },
    "Get Statistics1": {
      "main": [
        [
          {
            "node": "Merge2",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Analytics_Model1": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent1",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Set Stock Ticker": {
      "main": [
        [
          {
            "node": "Get Real-Time Quote",
            "type": "main",
            "index": 0
          },
          {
            "node": "Get Time Series (90 days)",
            "type": "main",
            "index": 0
          },
          {
            "node": "RSI Indicator",
            "type": "main",
            "index": 0
          },
          {
            "node": "MACD Indicator",
            "type": "main",
            "index": 0
          },
          {
            "node": "Bollinger Bands",
            "type": "main",
            "index": 0
          },
          {
            "node": "Get Company Profile",
            "type": "main",
            "index": 0
          },
          {
            "node": "Get Income Statement",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Sector Stocks": {
      "main": [
        [
          {
            "node": "Get Quote",
            "type": "main",
            "index": 0
          },
          {
            "node": "Get Statistics1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Is Valid Message?": {
      "main": [
        [
          {
            "node": "Send Unsupported Message",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "AI Agent1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge Stock Data1": {
      "main": [
        [
          {
            "node": "Format Comparison1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Telegram Trigger1": {
      "main": [
        [
          {
            "node": "PreProcessing1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Format Comparison1": {
      "main": [
        [
          {
            "node": "Output1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Format Data for AI": {
      "main": [
        [
          {
            "node": "AI Analysis",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filter Message Type": {
      "main": [
        [
          {
            "node": "Is Valid Message?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Company Profile": {
      "main": [
        [
          {
            "node": "Merge All Data",
            "type": "main",
            "index": 5
          }
        ]
      ]
    },
    "Get Historical Data": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Real-Time Quote": {
      "main": [
        [
          {
            "node": "Merge All Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge & Enrich Data": {
      "main": [
        [
          {
            "node": "Analyze Sector",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Conversation Memory1": {
      "ai_memory": [
        [
          {
            "node": "AI Agent1",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Get Income Statement": {
      "main": [
        [
          {
            "node": "Merge All Data",
            "type": "main",
            "index": 6
          }
        ]
      ]
    },
    "Stock Analysis Tool1": {
      "ai_tool": [
        [
          {
            "node": "AI Agent1",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Risk Calculator Tool1": {
      "ai_tool": [
        [
          {
            "node": "AI Agent1",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Sector Analysis Tool1": {
      "ai_tool": [
        [
          {
            "node": "AI Agent1",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Calculate Risk Metrics": {
      "main": [
        [
          {
            "node": "Output",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Stock Comparison Tool1": {
      "ai_tool": [
        [
          {
            "node": "AI Agent1",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Get Time Series (90 days)": {
      "main": [
        [
          {
            "node": "Merge All Data",
            "type": "main",
            "index": 1
          }
        ]
      ]
    }
  }
}