{
  "name": "Generate intraday AAPL trade signals using live data, OpenAI, Telegram and Notion",
  "nodes": [
    {
      "id": "fe300ea2-e997-4b1f-b4ea-a1dda21015ad",
      "name": "Schedule Market Data Polling (AAPL 5-Min)",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -832,
        -512
      ]
    },
    {
      "id": "215d79e7-d32e-4dc4-802c-4a06ba262171",
      "name": "Fetch AAPL 5-Minute Price & Volume Series",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -608,
        -512
      ]
    },
    {
      "id": "4b8972b5-1f3d-414b-ac57-5d5e7356e3ea",
      "name": "Fetch AAPL 20-Period EMA (5-Minute)1",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -608,
        -304
      ]
    },
    {
      "id": "c2eede50-3250-4ca1-a372-a52fd16fc8bb",
      "name": "Fetch AAPL 14-Period RSI (5-Minute)",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -608,
        -704
      ]
    },
    {
      "id": "3396c1d2-136d-4589-a1d6-8dc8e93be6c4",
      "name": "Merge RSI, Price, and EMA Streams",
      "type": "n8n-nodes-base.merge",
      "position": [
        -384,
        -528
      ]
    },
    {
      "id": "92ebb1cc-433c-401b-9697-dffe89999637",
      "name": "Compute Trend & Momentum Signals ",
      "type": "n8n-nodes-base.code",
      "position": [
        0,
        -496
      ]
    },
    {
      "id": "beb65838-cf2c-4215-b5ca-e2190310a76d",
      "name": "Evaluate Trade Decision from Signals (AI)",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        448,
        -496
      ]
    },
    {
      "id": "cf8fed0f-b4bf-4393-91eb-18d51c83cbda",
      "name": "LLM Engine for Trade Decision Reasoning",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        416,
        -272
      ]
    },
    {
      "id": "85318c06-30f0-472e-96e3-67dd7e502959",
      "name": "Structured Trade Decision Output Parser ",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        592,
        -256
      ]
    },
    {
      "id": "883aa353-5b9d-449c-8294-08621c184849",
      "name": "Route Trade Based on Verdict = APPROVE",
      "type": "n8n-nodes-base.if",
      "position": [
        928,
        -160
      ]
    },
    {
      "id": "04ae0b3f-f55b-4246-87bd-58897a2e35b0",
      "name": "Send Trade Alert — APPROVED Path (Telegram)",
      "type": "n8n-nodes-base.telegram",
      "position": [
        1296,
        -496
      ]
    },
    {
      "id": "7553db69-30ab-427a-b51a-ccec36696751",
      "name": "Send Trade Alert — NON-APPROVED Path (Telegram)",
      "type": "n8n-nodes-base.telegram",
      "position": [
        1344,
        -256
      ]
    },
    {
      "id": "0082819c-14e1-496e-86e4-78e3a961c594",
      "name": "Log Trade Decision to Notion (Market Signals DB)",
      "type": "n8n-nodes-base.notion",
      "position": [
        928,
        -544
      ]
    },
    {
      "id": "20960ae3-ddef-4013-8251-dc44dcb7a3c1",
      "name": "Workflow Error Handler",
      "type": "n8n-nodes-base.errorTrigger",
      "position": [
        -576,
        128
      ]
    },
    {
      "id": "ce6ccbc8-fee5-4442-847b-80073a9c8290",
      "name": "Send a message1",
      "type": "n8n-nodes-base.gmail",
      "position": [
        -352,
        128
      ]
    },
    {
      "id": "cda88f11-28df-4749-aa2d-677f7adc1edb",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -752,
        -48
      ],
      "parameters": {
        "width": 672,
        "height": 336,
        "content": "## Error Handling\nSends alerts when the workflow fails\n"
      }
    },
    {
      "id": "c712e0a0-a5af-4cf3-918d-21d14f27cf8b",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1888,
        -928
      ],
      "parameters": {
        "width": 736,
        "height": 640,
        "content": "## 📈 Automated Stock Trade Signals Using Live Market Data and Telegram Alerts\n\n### How it works\nThis workflow runs on a scheduled 5-minute interval to analyze short-term market conditions for AAPL usi"
      }
    },
    {
      "id": "c183eb1a-9225-4c8d-a1e9-ca501bdea3c4",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -944,
        -976
      ],
      "parameters": {
        "width": 688,
        "height": 896,
        "content": "## Market Data Polling\nRuns on a fixed 5-minute schedule and pulls the latest\nAAPL price, volume, RSI, and EMA data from Twelve Data.\nThis ensures all downstream logic works on fresh,\nsynchronized mar"
      }
    },
    {
      "id": "dfb29082-3423-46b6-9b6b-7a1f253d4861",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -192,
        -736
      ],
      "parameters": {
        "width": 464,
        "height": 512,
        "content": "## Signal Computation\nCombines RSI, price, volume, and EMA into a single\nmarket snapshot. Applies deterministic logic to\nderive trend and momentum signals before AI evaluation.\n"
      }
    },
    {
      "id": "3cd430fb-9901-437d-96e8-0c59c9724714",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        336,
        -800
      ],
      "parameters": {
        "width": 400,
        "height": 736,
        "content": "## AI Trade Decision\nUses a strict, rule-based AI agent to evaluate computed\nsignals and return a structured trade verdict with\nconfidence and a concise reasoning statement.\n"
      }
    },
    {
      "id": "5bd9a6b2-39e4-4faf-a553-04415e7fef0d",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        816,
        -352
      ],
      "parameters": {
        "width": 320,
        "height": 400,
        "content": "## Trade Routing & Alerts\nRoutes trades based on the AI verdict and sends\nreal-time alerts to Telegram so decisions are visible\nimmediately without opening n8n.\n"
      }
    },
    {
      "id": "2ff30517-8d8c-4cbc-9a33-0827d489c945",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1680,
        -224
      ],
      "parameters": {
        "width": 320,
        "height": 320,
        "content": "## 🔐 Required Credentials & Security\n\n- Twelve Data API (market data)\n- OpenAI API (decision evaluation)\n- Telegram Bot API (trade alerts)\n- Notion API (signal logging)\n\nUse environment variables or n"
      }
    },
    {
      "id": "020d4a5a-e4db-4ea3-8c9f-95c07ac2ef5e",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1232,
        -816
      ],
      "parameters": {
        "width": 336,
        "height": 752,
        "content": "## Telegram Trade Alerts\nDelivers real-time trade verdicts directly to Telegram.\nBoth approved and non-approved decisions are sent,\nensuring visibility without opening n8n. Ideal for\nfast reaction and"
      }
    },
    {
      "id": "aeb326b5-c81c-497a-b160-aff414e40bea",
      "name": "Sticky Note8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        848,
        -816
      ],
      "parameters": {
        "width": 272,
        "height": 400,
        "content": "## Audit Logging\nStores all trade decisions for analysis and traceability.\n"
      }
    }
  ],
  "connections": {
    "Workflow Error Handler": {
      "main": [
        [
          {
            "node": "Send a message1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Compute Trend & Momentum Signals ": {
      "main": [
        [
          {
            "node": "Evaluate Trade Decision from Signals (AI)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge RSI, Price, and EMA Streams": {
      "main": [
        [
          {
            "node": "Compute Trend & Momentum Signals ",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch AAPL 14-Period RSI (5-Minute)": {
      "main": [
        [
          {
            "node": "Merge RSI, Price, and EMA Streams",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch AAPL 20-Period EMA (5-Minute)1": {
      "main": [
        [
          {
            "node": "Merge RSI, Price, and EMA Streams",
            "type": "main",
            "index": 2
          }
        ]
      ]
    },
    "Route Trade Based on Verdict = APPROVE": {
      "main": [
        [
          {
            "node": "Send Trade Alert — APPROVED Path (Telegram)",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Send Trade Alert — NON-APPROVED Path (Telegram)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "LLM Engine for Trade Decision Reasoning": {
      "ai_languageModel": [
        [
          {
            "node": "Evaluate Trade Decision from Signals (AI)",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Structured Trade Decision Output Parser ": {
      "ai_outputParser": [
        [
          {
            "node": "Evaluate Trade Decision from Signals (AI)",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Evaluate Trade Decision from Signals (AI)": {
      "main": [
        [
          {
            "node": "Route Trade Based on Verdict = APPROVE",
            "type": "main",
            "index": 0
          },
          {
            "node": "Log Trade Decision to Notion (Market Signals DB)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch AAPL 5-Minute Price & Volume Series": {
      "main": [
        [
          {
            "node": "Merge RSI, Price, and EMA Streams",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Schedule Market Data Polling (AAPL 5-Min)": {
      "main": [
        [
          {
            "node": "Fetch AAPL 20-Period EMA (5-Minute)1",
            "type": "main",
            "index": 0
          },
          {
            "node": "Fetch AAPL 5-Minute Price & Volume Series",
            "type": "main",
            "index": 0
          },
          {
            "node": "Fetch AAPL 14-Period RSI (5-Minute)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}