{
  "name": "Control AlphaInsider stock and crypto portfolios from Telegram text and voice",
  "nodes": [
    {
      "id": "af3f3bd0-31c5-4ca9-870d-2fa6c757d5f3",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2768,
        -1808
      ],
      "parameters": {
        "width": 1328,
        "height": 960,
        "content": "## Telegram Chat Bot\n\n## How it works\nThis workflow monitors Telegram channels and direct messages for trading signals. When a message arrives, it routes through message type detection, transcribes vo"
      }
    },
    {
      "id": "7aeb44f6-0aad-474b-a43c-aa8a94205f77",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        4112,
        -1808
      ],
      "parameters": {
        "width": 464,
        "height": 960,
        "content": "## Global Settings\n\n## How it works\nCentralizes workflow configuration including strategy ID, security whitelist, session tracking, and message input. All downstream nodes reference these global setti"
      }
    },
    {
      "id": "f0c4e73f-8a54-439a-8923-0d7f779f18dc",
      "name": "Transcribe Voice Message",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        3920,
        -1232
      ]
    },
    {
      "id": "cf8dbe6c-8e07-40fc-9287-bb6951f3bd90",
      "name": "Get Voice Message",
      "type": "n8n-nodes-base.telegram",
      "position": [
        3728,
        -1232
      ]
    },
    {
      "id": "5a27bb57-2bbb-4ef4-b760-78f9402bc601",
      "name": "Channel Check",
      "type": "n8n-nodes-base.if",
      "position": [
        3216,
        -1248
      ]
    },
    {
      "id": "b495763a-8f5a-433d-8e82-00a706da455f",
      "name": "Global Settings",
      "type": "n8n-nodes-base.set",
      "position": [
        4288,
        -1376
      ]
    },
    {
      "id": "56a10c97-c688-4e0d-a1c7-2a7df688473e",
      "name": "Message Details",
      "type": "n8n-nodes-base.set",
      "position": [
        3392,
        -1360
      ]
    },
    {
      "id": "d30047d3-dcba-452c-9697-16b864a9c61b",
      "name": "Message Details Check",
      "type": "n8n-nodes-base.switch",
      "position": [
        3568,
        -1360
      ]
    },
    {
      "id": "9412299e-1546-4349-80e5-976bb9c57d5e",
      "name": "Message Check",
      "type": "n8n-nodes-base.switch",
      "position": [
        3040,
        -1344
      ]
    },
    {
      "id": "1e041af0-14fa-4cf8-9041-d389c2816bab",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        4592,
        -1808
      ],
      "parameters": {
        "width": 1616,
        "height": 960,
        "content": "## AlphaInsider Position Manager\n\n## How it works\nFetches current portfolio positions from AlphaInsider, calculates allocation percentages with leverage, then uses OpenAI GPT-5.2-pro to analyze tradin"
      }
    },
    {
      "id": "d4cbabc5-41c4-48ce-9db9-de0f2f5f4794",
      "name": "Get Positions",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        4720,
        -1376
      ]
    },
    {
      "id": "2056d925-15d7-43ea-8705-041c8857a85d",
      "name": "Parse Position Percents",
      "type": "n8n-nodes-base.code",
      "position": [
        4992,
        -1376
      ]
    },
    {
      "id": "988e2959-b203-4671-89bc-7d5791e74ae3",
      "name": "Parse Stock Allocations",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        5264,
        -1376
      ]
    },
    {
      "id": "173f0b65-0367-478a-ba09-3b56a0f388d9",
      "name": "OpenAI Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        5040,
        -1136
      ]
    },
    {
      "id": "e7889255-41f2-4e57-9270-761f6f62f3ee",
      "name": "Simple Memory",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        5200,
        -1136
      ]
    },
    {
      "id": "12c275bf-918a-4fe9-9e2d-59998b5c43b1",
      "name": "Search Stocks",
      "type": "n8n-nodes-base.httpRequestTool",
      "position": [
        5296,
        -1008
      ]
    },
    {
      "id": "9ddbeab4-4d40-489c-9dd1-0c7bed58b799",
      "name": "Calculator",
      "type": "@n8n/n8n-nodes-langchain.toolCalculator",
      "position": [
        5424,
        -1008
      ]
    },
    {
      "id": "091449dd-0342-4d23-b169-b5efc9782485",
      "name": "ParseOutput",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        5488,
        -1152
      ]
    },
    {
      "id": "db9675ea-1d41-4670-9308-cf7f017b0460",
      "name": "Parse Orders Allocations",
      "type": "n8n-nodes-base.code",
      "position": [
        5744,
        -1552
      ]
    },
    {
      "id": "86e2840a-538a-4f81-9e89-0d374f1ce3ee",
      "name": "Create Orders",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        5968,
        -1552
      ]
    },
    {
      "id": "562bd695-a98b-45ba-8c5b-df1d79986f3f",
      "name": "Switch",
      "type": "n8n-nodes-base.switch",
      "position": [
        5568,
        -1392
      ]
    },
    {
      "id": "8c2ef217-3dea-4a1e-8d06-35f2b83b0c11",
      "name": "Create Post",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        5968,
        -1376
      ]
    },
    {
      "id": "cd900175-a26d-4f63-a45a-48aff09cc884",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        6224,
        -1808
      ],
      "parameters": {
        "width": 592,
        "height": 960,
        "content": "## Telegram Reply\n\n## How it works\nDetects if the incoming message was a direct message (DM) to the bot. If yes, sends the AI-generated response back to the user via Telegram with trade confirmations,"
      }
    },
    {
      "id": "956e7836-36a7-4fc9-aac5-62d621d64d5e",
      "name": "User Reply",
      "type": "n8n-nodes-base.telegram",
      "position": [
        6560,
        -1088
      ]
    },
    {
      "id": "a14dfefa-8610-42fe-8565-930a8517448b",
      "name": "If DM",
      "type": "n8n-nodes-base.if",
      "position": [
        6288,
        -1072
      ]
    },
    {
      "id": "2bc4f369-7374-42ce-b710-8a09d7f33275",
      "name": "Telegram Channel Listener",
      "type": "n8n-nodes-base.telegramTrigger",
      "position": [
        2832,
        -1344
      ]
    }
  ],
  "connections": {
    "If DM": {
      "main": [
        [
          {
            "node": "User Reply",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Switch": {
      "main": [
        [
          {
            "node": "Parse Orders Allocations",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Create Post",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "If DM",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Calculator": {
      "ai_tool": [
        [
          {
            "node": "Parse Stock Allocations",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Create Post": {
      "main": [
        [
          {
            "node": "If DM",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "ParseOutput": {
      "ai_outputParser": [
        [
          {
            "node": "Parse Stock Allocations",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Model": {
      "ai_languageModel": [
        [
          {
            "node": "Parse Stock Allocations",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Channel Check": {
      "main": [
        [
          {
            "node": "Message Details",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create Orders": {
      "main": [
        [
          {
            "node": "If DM",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Positions": {
      "main": [
        [
          {
            "node": "Parse Position Percents",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Message Check": {
      "main": [
        [
          {
            "node": "Message Details",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Channel Check",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Search Stocks": {
      "ai_tool": [
        [
          {
            "node": "Parse Stock Allocations",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Simple Memory": {
      "ai_memory": [
        [
          {
            "node": "Parse Stock Allocations",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Global Settings": {
      "main": [
        [
          {
            "node": "Get Positions",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Message Details": {
      "main": [
        [
          {
            "node": "Message Details Check",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Voice Message": {
      "main": [
        [
          {
            "node": "Transcribe Voice Message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Message Details Check": {
      "main": [
        [
          {
            "node": "Global Settings",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Get Voice Message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Parse Position Percents": {
      "main": [
        [
          {
            "node": "Parse Stock Allocations",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Parse Stock Allocations": {
      "main": [
        [
          {
            "node": "Switch",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Parse Orders Allocations": {
      "main": [
        [
          {
            "node": "Create Orders",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Transcribe Voice Message": {
      "main": [
        [
          {
            "node": "Global Settings",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Telegram Channel Listener": {
      "main": [
        [
          {
            "node": "Message Check",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}