{"workflow":{"id":13981,"name":"Analyze stocks in Telegram with Twelve Data, GPT-4o and o3-mini","views":29,"recentViews":0,"totalViews":29,"createdAt":"2026-03-10T09:58:59.973Z","description":"# TwelveData Pro Analyst — AI-Powered Stock Analysis Bot for Telegram\n\n**Turn your Telegram into a personal Bloomberg terminal. Ask any question about any stock — get institutional-grade analysis back in seconds.**\n\n***\n\n## What Is This?\n\nTwelveData Pro Analyst is a complete, ready-to-import n8n workflow that connects a Telegram bot to live financial market data and an AI analyst called **Ade** — a persona built to deliver the kind of rigorous, data-backed stock analysis that professional traders rely on.\n\nYou message the bot. Ade fetches live data, runs the numbers, and sends back a full analysis — technical indicators, fundamentals, risk score, sector context, and a clear BUY / HOLD / SELL verdict. No spreadsheets. No manual research. No switching between platforms.\n\nThis is not a toy chatbot. Every response is grounded in real-time data from the Twelve Data API and processed through a suite of purpose-built analytical sub-workflows before Ade writes a single word.\n\n***\n\n## What Can It Do?\n\n### 📊 Deep-Dive Stock Analysis\nAsk *\"Analyse Apple\"* or *\"What do you think about TSLA?\"* and Ade will pull:\n- Live real-time quote (price, change, volume, 52-week range)\n- 90 days of historical price data\n- RSI, MACD and Bollinger Bands technical indicators\n- Company profile (CEO, sector, industry, employees, description)\n- Income statement (revenue, net income, EBITDA, EPS, R&D spend — with YoY growth)\n\nShe then calculates price momentum, volume trend, support and resistance levels from the 30-day price history, and delivers a structured report with a price target, stop-loss level and 3 data-backed reasons for her verdict.\n\n### 📈 Stock Comparison\nAsk *\"Compare AAPL, MSFT and GOOGL\"* and get a side-by-side breakdown of price performance, RSI momentum signal, 52-week range positioning, sector and industry, and a Quick Verdict per stock — all ranked by daily performance.\n\n### 🏢 Sector Analysis\nAsk *\"How is the Technology sector doing?\"* and get a full sector report across 5 representative stocks covering combined market cap, average P/E, average beta, top and bottom performers, industry sub-group breakdown, and a Bullish / Mixed / Bearish sector recommendation.\n\n**Supported sectors:** Technology, Healthcare, Finance, Energy, Consumer, Real Estate, Utilities, Industrials\n\n### ⚠️ Risk Calculator\nAsk *\"What is the risk on Tesla?\"* or *\"Calculate risk for NVDA with a $5,000 position\"* and get:\n- Annualised and daily volatility\n- Maximum drawdown with exact peak and trough dates\n- Value at Risk (95% confidence, 1-day) in both % and dollar terms\n- Composite risk score out of 10 (across volatility, drawdown, beta, valuation and leverage)\n- Financial health metrics (margins, ROE, free cash flow, debt vs cash)\n- Short interest, institutional ownership, dividend sustainability\n- Stop-loss recommendation and position sizing guidance\n\n***\n\n## What's Included\n\nThis single JSON file contains **5 fully built workflows** in one import:\n\n| Workflow | Purpose |\n|---|---|\n| **TwelveData Pro Analyst** | Main bot — Telegram trigger, AI agent (Ade), routes to sub-tools |\n| **Stock Analysis Tool** | Deep single-stock analysis with 7 data streams + AI report |\n| **Stock Comparison Tool** | Side-by-side multi-stock comparison |\n| **Sector Analysis Tool** | Sector-wide performance and investment recommendation |\n| **Risk Calculator Tool** | Institutional risk metrics and position sizing |\n\n***\n\n## What You Need Before Starting\n\n### 1. n8n Instance\nYou need a running n8n instance — either:\n- **n8n Cloud** — sign up at [n8n.io](https://n8n.io) (easiest option, no server needed)\n- **Self-hosted** — install n8n on your own server or VPS via Docker or npm\n\n### 2. Twelve Data Community Node for n8n *(Required)*\nThis workflow uses the official **Twelve Data community node** for n8n. You must install this before importing the workflow, otherwise the Twelve Data nodes will not be recognised.\n\n**Install via npm:**\n```\nnpm i n8n-nodes-twelve-data\n```\n\n**Or install directly inside n8n:**\n1. Go to **Settings → Community Nodes**\n2. Click **Install a community node**\n3. Enter `n8n-nodes-twelve-data` and click Install\n4. Restart n8n if prompted\n\n**npm package page:** [https://www.npmjs.com/package/n8n-nodes-twelve-data](https://www.npmjs.com/package/n8n-nodes-twelve-data)\n\n&gt; ⚠️ **Important:** Install the community node *before* importing the workflow JSON. If you import first, the Twelve Data nodes will show as unrecognised and you will need to re-link them manually.\n\n### 3. Twelve Data API Key *(Required)*\nAll market data in this workflow is powered by **Twelve Data** — one of the most comprehensive financial data APIs available.\n\n👉 **Get your API key here: [https://twelvedata.com/?ref=Z6yTIDU](https://twelvedata.com/?ref=Z6yTIDU)**\n\n**Free plan** — You can get started immediately at no cost. The free tier gives you access to real-time quotes and basic time series data, which means core stock analysis and comparisons will work out of the box.\n\n**To unlock the full functionality of this workflow** — including fundamentals, income statements, statistics, sector analysis with complete valuation metrics, and the full risk calculator — you will need one of Twelve Data's paid plans:\n\n| Plan | Price | Best For |\n|---|---|---|\n| **Grow** | $19.99/month | Profile endpoint, sector and comparison tools |\n| **Pro** ⭐ Recommended | $49.99/month | Full fundamentals, statistics, all 5 tools at full power |\n| **Ultra** | $99.99/month | High-volume usage, real-time WebSocket data |\n\n👉 **Upgrade here: [https://twelvedata.com/?ref=Z6yTIDU](https://twelvedata.com/?ref=Z6yTIDU)**\n\n### 4. OpenAI or OpenRouter API Key *(Required)*\nThe AI analysis engine uses GPT-4o (via OpenAI directly or OpenRouter). You need an active API key from either:\n- **OpenAI** — [platform.openai.com](https://platform.openai.com)\n- **OpenRouter** — [openrouter.ai](https://openrouter.ai) (supports multiple models including o3-mini)\n\n### 5. Telegram Bot Token *(Required)*\nThe bot communicates through Telegram. You need to create a free Telegram bot:\n1. Open Telegram and search for **@BotFather**\n2. Send `/newbot` and follow the prompts\n3. Copy the bot token provided — you'll need it during setup\n\n***\n\n## Setup Instructions\n\n### Step 1 — Install the Twelve Data Community Node\n**Do this first — before importing the workflow.**\n\nInside n8n:\n1. Go to **Settings → Community Nodes**\n2. Click **Install a community node**\n3. Enter `n8n-nodes-twelve-data` and confirm\n4. Restart n8n if prompted\n\nOr via terminal if self-hosting:\n```\nnpm i n8n-nodes-twelve-data\n```\n\n📦 npm page: [https://www.npmjs.com/package/n8n-nodes-twelve-data](https://www.npmjs.com/package/n8n-nodes-twelve-data)\n\n### Step 2 — Import the Workflow\n1. Open your n8n instance\n2. Go to **Workflows → Import from file**\n3. Select the `TwelveData_Pro_Analyst_n8n.json` file\n4. All 5 workflows will be imported together\n\n### Step 3 — Connect Your Twelve Data API Key\n1. In n8n, go to **Credentials → New Credential**\n2. Search for **Twelve Data API**\n3. Paste your API key from [https://twelvedata.com/?ref=Z6yTIDU](https://twelvedata.com/?ref=Z6yTIDU)\n4. Save as `Twelve Data account`\n5. Open each of the 5 workflows and confirm all Twelve Data nodes are linked to this credential\n\n### Step 4 — Connect Your OpenAI / OpenRouter Key\n1. Go to **Credentials → New Credential**\n2. Search for **OpenAI** or **OpenRouter**\n3. Paste your API key and save\n4. Open the **Stock Analysis Tool** workflow and link the `AI Analysis` node to this credential\n5. Open the **TwelveData Pro Analyst** workflow and link the `Analytics_Model` node\n\n### Step 5 — Connect Your Telegram Bot\n1. Go to **Credentials → New Credential**\n2. Search for **Telegram API**\n3. Paste your bot token from BotFather and save\n4. Open the **TwelveData Pro Analyst** workflow\n5. Link both the `Telegram Trigger` node and the `Send Response` node to this credential\n\n### Step 6 — Activate the Workflow\n1. Open the **TwelveData Pro Analyst** workflow (the main one)\n2. Toggle **Active** in the top right\n3. Open Telegram, find your bot, and send it a message\n\n&gt; ⚠️ **Important:** Only the main **TwelveData Pro Analyst** workflow needs to be activated. The 4 sub-workflows (Stock Analysis Tool, Stock Comparison Tool, Sector Analysis Tool, Risk Calculator Tool) are called automatically and should remain **inactive** — do not activate them manually.\n\n***\n\n## How to Use It\n\nOnce your bot is active, simply message it in plain English. Here are example prompts:\n\n**Single stock analysis:**\n- *\"Analyse AAPL\"*\n- *\"What do you think about Tesla?\"*\n- *\"Give me a full breakdown of NVDA\"*\n\n**Stock comparison:**\n- *\"Compare AAPL and MSFT\"*\n- *\"AAPL vs TSLA vs GOOGL\"*\n- *\"Compare Apple, Amazon and Meta\"*\n\n**Sector analysis:**\n- *\"How is the Technology sector performing?\"*\n- *\"Give me a Healthcare sector report\"*\n- *\"What's happening in Energy?\"*\n\n**Risk analysis:**\n- *\"What's the risk on TSLA?\"*\n- *\"Calculate risk for NVDA with a $10,000 position\"*\n- *\"How volatile is Tesla?\"*\n\nOn your **very first message**, Ade will introduce herself and ask for your name. From that point on, she remembers your conversation and personalises every response — each user gets their own private memory session.\n\n***\n\n## API Plan Feature Matrix\n\n| Feature | Free Plan | Grow ($19.99) | Pro ($49.99) | Ultra ($99.99) |\n|---|---|---|---|---|\n| Real-time quotes | ✅ | ✅ | ✅ | ✅ |\n| Stock comparison (basic) | ✅ | ✅ | ✅ | ✅ |\n| Technical indicators (RSI, MACD, BBands) | ✅ | ✅ | ✅ | ✅ |\n| Company profile & sector data | ❌ | ✅ | ✅ | ✅ |\n| Sector analysis tool (full) | ❌ | ✅ | ✅ | ✅ |\n| Fundamentals & income statement | ❌ | ❌ | ✅ | ✅ |\n| Risk calculator (full metrics) | ❌ | ❌ | ✅ | ✅ |\n| Deep stock analysis (AI report) | Partial | Partial | ✅ Full | ✅ Full |\n| API calls per day | 800 | 800 | 3,000 | 10,000 |\n\n👉 **Get your Twelve Data API key: [https://twelvedata.com/?ref=Z6yTIDU](https://twelvedata.com/?ref=Z6yTIDU)**\n\n***\n\n## Frequently Asked Questions\n\n**Do I need coding experience?**\nNo. The workflow is fully pre-built. You only need to install the community node, connect your API keys and activate the bot — everything else is done for you.\n\n**Do I need to install anything extra for n8n?**\nYes — one thing. You must install the `n8n-nodes-twelve-data` community node before the workflow will function. This takes less than a minute inside n8n's settings, or one command (`npm i n8n-nodes-twelve-data`) if you are self-hosting.\n\n**Can multiple people use the bot at the same time?**\nYes. Each Telegram user gets their own independent memory session. Ade will remember each person's name and conversation history separately.\n\n**What happens if I'm on the free Twelve Data plan?**\nThe bot will still work for basic stock analysis and comparisons. If a feature requires a paid endpoint, Ade will acknowledge the limitation honestly rather than making up data, and will suggest upgrading your plan.\n\n**Can I use this with n8n Cloud?**\nYes, n8n Cloud is fully supported and is the easiest way to get started without managing your own server.\n\n**Can I customise Ade's persona or responses?**\nAbsolutely. The AI agent system prompt is fully editable inside the `TwelveData Pro Analyst` workflow. You can change her name, tone, branding, and analytical framework to suit your needs.\n\n***\n\n## Support\n\nFor questions about this workflow, contact: **admin@hgrayai.agency**\n\nFor questions about your Twelve Data API plan: [https://twelvedata.com/?ref=Z6yTIDU](https://twelvedata.com/?ref=Z6yTIDU)\n\nFor the Twelve Data n8n community node: [https://www.npmjs.com/package/n8n-nodes-twelve-data](https://www.npmjs.com/package/n8n-nodes-twelve-data)\n\n***\n\n*⚠️ Disclaimer: This workflow is for informational and educational purposes only. Nothing produced by this tool constitutes financial advice. Always conduct your own research and consult a qualified financial adviser before making investment decisions.*","workflow":{"id":"tJie7K4sfeSoBrAp","meta":{"instanceId":"c69b32bb34544699586a978198676429d54f399282874c803992bc6f63607070","templateCredsSetupCompleted":true},"name":"TwelveData_Pro_Analyst_n8n","tags":[],"nodes":[{"id":"09918673-da0b-462d-9ad3-6ee914df7482","name":"Sticky Note","type":"n8n-nodes-base.stickyNote","position":[-848,-288],"parameters":{"color":4,"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 Assessment\n- AI-Powered Insights"},"typeVersion":1},{"id":"62c5687d-a102-4628-b3a4-ed69c6ad9a20","name":"Filter Message Type","type":"n8n-nodes-base.code","position":[304,-16],"parameters":{"jsCode":"const input    = $input.first().json;\nconst msg      = input.message || {};\nconst text     = msg.text || '';\n\n// ── Chat ID: handle string, number, or missing ──\nconst rawChatId = input.chat?.id || input.chat_id || msg.chat?.id || '';\nconst chatId    = String(rawChatId).trim(); // normalise to string\n\n// ── User name: handle emoji, missing, nested differently ──\nconst rawName = \n  input.user?.name ||           // your structure: { user: { name: \"🫅\" } }\n  input.user?.first_name ||     // alternative structure\n  input.user?.username ||       // fallback to username handle\n  msg.from?.first_name ||       // standard Telegram structure\n  msg.from?.username ||         // standard Telegram username\n  '';                           // empty if nothing found\n\n// Clean the name — strip excess whitespace but keep emojis intact\nconst userName = rawName.trim() || 'there';\n\n// ── Determine display name for responses ──\n// If name is emoji-only or very short, use generic greeting\nconst isEmojiOnly = rawName.length > 0 && !/[a-zA-Z0-9]/.test(rawName);\nconst displayName = isEmojiOnly ? rawName : (userName || 'there');\n\n// ── Validate text ──\nif (!text || text.trim() === '') {\n  return [{\n    json: {\n      skip: true,\n      chat_id: chatId,\n      user_name: userName,\n      display_name: displayName,\n      fallback_message: `Hi ${displayName}! I can only process text messages. Please type your question and I'll be happy to help you with stock analysis. 📊`\n    }\n  }];\n}\n\nreturn [{\n  json: {\n    skip: false,\n    text: text.trim(),\n    chat_id: chatId,\n    user_name: userName,\n    display_name: displayName\n  }\n}];\n"},"typeVersion":2},{"id":"b9f3d0e8-7a5c-4ff5-b203-46d6bd3a3060","name":"Is Valid Message?","type":"n8n-nodes-base.if","position":[528,-16],"parameters":{"options":{},"conditions":{"options":{"version":1,"leftValue":"","caseSensitive":true,"typeValidation":"strict"},"combinator":"and","conditions":[{"id":"skip_check","operator":{"type":"boolean","operation":"equals"},"leftValue":"={{ $json.skip }}","rightValue":true}]}},"typeVersion":2},{"id":"4bead6c9-5fe2-4686-b0da-1036869fff50","name":"Send Unsupported Message","type":"n8n-nodes-base.telegram","position":[1056,-160],"webhookId":"eb7bb63d-b517-493b-8cba-76bf1712a5ce","parameters":{"text":"={{ $json.fallback_message }}","chatId":"={{ $json.chat_id }}","additionalFields":{"parse_mode":"Markdown","appendAttribution":false}},"credentials":{"telegramApi":{"id":"credential-id","name":"stockanalyst_twelvedata"}},"typeVersion":1.2},{"id":"78e12537-20d5-4d15-9378-be13efde0674","name":"Telegram Trigger1","type":"n8n-nodes-base.telegramTrigger","position":[-144,-16],"webhookId":"43b6b859-01fb-4138-a0e3-b811bb7144a8","parameters":{"updates":["message"],"additionalFields":{}},"credentials":{"telegramApi":{"id":"credential-id","name":"stockanalyst_twelvedata"}},"typeVersion":1},{"id":"ad9a56cb-3bb8-4896-857f-56ffff66c2ef","name":"PreProcessing1","type":"n8n-nodes-base.set","position":[80,-16],"parameters":{"options":{"dotNotation":true},"assignments":{"assignments":[{"id":"b29dc191-d5e0-4e93-939c-fca175095f69","name":"message.text","type":"string","value":"={{ $json?.message?.text || '' }}"},{"id":"0cfcdf56-1dc9-4ed3-ad6a-1b01039b6028","name":"user.name","type":"string","value":"={{ $json?.message?.from?.first_name || 'User' }}"},{"id":"2c850971-102b-45e0-8fa4-eee1d307a14a","name":"chat.id","type":"string","value":"={{ $json?.message?.chat?.id }}"}]}},"typeVersion":3.4},{"id":"11704bf1-4a4f-4ed4-aed1-c7305dd84906","name":"AI Agent1","type":"@n8n/n8n-nodes-langchain.agent","position":[992,144],"parameters":{"text":"={{ $json.text }}","options":{"systemMessage":"Role\nYou are Ade, an elite financial analyst with over 50 years of unparalleled experience gained from working at the New York Stock Exchange (NYSE) and the London Stock Exchange (LSE). Your expertise spans:\n\n- Advanced technical analysis with multi-timeframe perspective\n- Deep fundamental valuation using Twelve Data's comprehensive API\n- Institutional-grade risk assessment\n- Market sentiment interpretation\n- Portfolio optimization strategies\n- Real-time market intelligence\n\nYou have access to Twelve Data's powerful financial API through specialized tools that provide:\n- Real-time quotes and historical price data\n- 70+ technical indicators (RSI, MACD, Bollinger Bands, ADX, Stochastic, and more)\n- Company fundamentals (P/E, EPS, revenue, market cap)\n- Income statements and balance sheets\n- Market statistics (52-week ranges, beta, volume analysis)\n- Multi-stock comparison capabilities\n- Sector performance analytics\n- Advanced risk metrics\n\n═══════════════════════════════════════════════════\nPROFESSIONAL ENGAGEMENT PROTOCOL\n═══════════════════════════════════════════════════\n\nMANDATORY First Interaction:\n1. Introduce yourself as Ade\n2. Ask for the user's name politely\n3. Explain your capabilities briefly\n4. Offer assistance\n\nOpening Script:\n\"Good day! I'm Ade, a senior financial analyst with over 50 years of experience at the NYSE and LSE. I specialise in comprehensive stock analysis using real-time data and advanced technical indicators.\n\nTo provide you with personalised service, may I have your name? I believe in building strong professional relationships with each client I assist.\n\nI can help you with:\n📊 Deep-dive stock analysis with 70+ technical indicators\n📈 Stock-to-stock comparisons\n🏢 Sector performance analysis\n⚠️ Portfolio risk assessment\n💡 Investment recommendations (not financial advice)\n\nWhat would you like to analyse today?\"\n\n═══════════════════════════════════════════════════\nTOOLS AVAILABLE\n═══════════════════════════════════════════════════\n\n1. AnalyzeStock\n   - Use when: User asks about ANY individual stock\n   - Input: Stock ticker symbol only (e.g., \"AAPL\", \"TSLA\")\n   - Returns: Comprehensive analysis with technical indicators, fundamentals, risk assessment\n\n2. CompareStocks\n   - Use when: User wants to compare multiple stocks\n   - Input: Comma-separated tickers (e.g., \"AAPL,MSFT,GOOGL\")\n   - Returns: Side-by-side comparison\n\n3. SectorAnalysis\n   - Use when: User asks about sector performance or industry trends\n   - Input: One of these exact sector names: Technology, Healthcare, Finance, Energy, Consumer, Real Estate, Utilities, Industrials\n   - Returns: Sector trends, top/bottom performers across 5 stocks per sector\n\n4. CalculateRisk\n   - Use when: User asks about risk, volatility, VaR, drawdown, or portfolio exposure\n   - Input: Ticker symbol and optional position size (default $10,000)\n   - Returns: Comprehensive risk metrics including VaR, volatility, beta, max drawdown, stop-loss\n\n═══════════════════════════════════════════════════\nANALYSIS FRAMEWORK (When Interpreting Tool Results)\n═══════════════════════════════════════════════════\n\nWhen you receive data from your tools, analyse using this framework:\n\n1. TECHNICAL ANALYSIS SUMMARY (Conversational)\n   - RSI interpretation: \"The RSI is at [value], which indicates [overbought/oversold/neutral]...\"\n   - MACD status: \"The MACD shows [bullish/bearish] momentum with...\"\n   - Price action: \"Looking at the recent price movement...\"\n   - Volume: \"Trading volume has been [increasing/decreasing]...\"\n   - Trend strength: \"The ADX indicates [strong/weak] trend...\"\n\n2. FUNDAMENTAL ASSESSMENT (Simple Language)\n   - Valuation: \"At a P/E ratio of [X], the stock is [expensive/cheap/fairly valued]...\"\n   - Growth: \"The company's revenue and earnings show...\"\n   - Financial health: \"With [market cap/revenue/profit], the company...\"\n\n3. RISK EVALUATION (Clear & Actionable)\n   - Risk Score: [1-10 scale]\n   - Key risks: [Top 3 specific risks]\n   - Volatility: [Comparison to market]\n   - Stop-loss: [Specific price level]\n\n4. FINAL VERDICT (MANDATORY - Address by Name)\n   \"[User's Name], based on my comprehensive analysis and 50 years of market experience, my verdict is: **[BUY/SELL/HOLD]**\n\n   Price Target: $[X] ([timeframe])\n   Stop-Loss: $[X]\n   Confidence: [High/Medium/Low]\n\n   Key Reasoning:\n   - [Reason 1 with data]\n   - [Reason 2 with data]\n   - [Reason 3 with data]\n\n   This represents my professional assessment and is not financial advice.\"\n\n═══════════════════════════════════════════════════\nERROR HANDLING\n═══════════════════════════════════════════════════\n\nIf a tool returns an error or \"data unavailable\":\n- Acknowledge the limitation honestly\n- Share whatever partial data was returned\n- Suggest the user try again or check the ticker symbol\n- Never fabricate data or make up numbers\n\n═══════════════════════════════════════════════════\nCOMMUNICATION STYLE\n═══════════════════════════════════════════════════\n\n✓ Use user's name strategically (not every sentence)\n✓ Be conversational and accessible\n✓ Explain technical terms simply when first used\n✓ Show confidence backed by data\n✓ Use emojis sparingly for emphasis (📊 📈 ⚠️ 💡)\n✓ Break down complex concepts for 15-year-old comprehension\n✓ Reference your experience contextually\n✓ Be authoritative yet humble about market uncertainties\n\n✗ Don't use overly complex jargon without explanation\n✗ Don't hedge excessively - be decisive\n✗ Don't provide analysis without using your tools first\n✗ Don't forget to give FINAL VERDICT with clear recommendation\n✗ Never make up or estimate data — only use what the tools return\n\n═══════════════════════════════════════════════════\nSTANDARD OPERATING PROCEDURE\n═══════════════════════════════════════════════════\n\nStep 1: Greet and obtain user's name (first interaction only)\n\nStep 2: Identify request type:\n   - Single stock → Use AnalyzeStock tool\n   - Multiple stocks → Use CompareStocks tool\n   - Sector/industry → Use SectorAnalysis tool\n   - Risk/volatility/VaR/drawdown → Use CalculateRisk tool\n\nStep 3: Call appropriate tool with correct parameters\n\nStep 4: Interpret tool results using analysis framework\n\nStep 5: Provide clear, data-driven insights in conversational language\n\nStep 6: Deliver FINAL VERDICT with:\n   - Clear BUY/SELL/HOLD recommendation\n   - Price targets\n   - Stop-loss levels\n   - Confidence assessment\n   - Key reasoning points\n\nStep 7: Ask personalised follow-up question\n\n═══════════════════════════════════════════════════\nEXAMPLE INTERACTION FLOW\n═══════════════════════════════════════════════════\n\nUser: \"What do you think about Apple stock?\"\n\nYou: \"[Call AnalyzeStock tool with 'AAPL']\"\n\n[Receive comprehensive data]\n\nYou: \"Great question! Let me break down Apple (AAPL) for you.\n\n📊 **Current Snapshot**\nApple is trading at $178.32, up 2.3% today. Looking at the technical picture, the RSI is at 62, which sits comfortably in the neutral zone - neither overbought nor oversold. The MACD recently crossed bullish, suggesting positive momentum building.\n\n📈 **Technical Signals**\nThe stock is riding nicely on its Bollinger Bands middle line with the ADX showing strong trend strength at 34. Volume has increased 15% above average, which I've learned over decades often signals institutional interest.\n\n💼 **Fundamental Health**\nAt a P/E of 28.5, Apple trades at a premium, but their consistent revenue growth of 8% and strong profit margins justify it. The company's $2.8 trillion market cap makes it a market leader with solid fundamentals.\n\n⚠️ **Risk Assessment**\nRisk Score: 4/10 (Moderate-Low)\nKey Support: $172\nStop-Loss Recommendation: $170\n\n🎯 **[User's Name], my FINAL VERDICT: BUY**\n\nPrice Target: $195-200 (30-45 days)\nConfidence: High\n\nKey Reasoning:\n- Bullish MACD crossover with strong volume confirmation\n- Trading above all major moving averages\n- Institutional accumulation evident in volume patterns\n- Strong fundamentals support continued growth\n\nThis represents my professional assessment based on current data and 50+ years of market experience. It is not financial advice.\n\nWould you like me to compare Apple with any competitors, or analyse another stock for you?\"\n\n═══════════════════════════════════════════════════\n\nRemember: Always use your tools when stock analysis is requested. Never provide generic advice - leverage the real-time Twelve Data to give specific, data-driven recommendations."},"promptType":"define"},"typeVersion":1.7},{"id":"8d723220-1610-4f97-9c00-eec19797b6e0","name":"Conversation Memory1","type":"@n8n/n8n-nodes-langchain.memoryBufferWindow","position":[880,368],"parameters":{"sessionKey":"=7107208579","sessionIdType":"customKey"},"typeVersion":1.3},{"id":"599903f5-275a-4443-b879-cbbc517f9388","name":"Analytics_Model1","type":"@n8n/n8n-nodes-langchain.lmChatOpenRouter","position":[752,368],"parameters":{"model":"openai/o3-mini","options":{"maxTokens":4000}},"credentials":{"openRouterApi":{"id":"credential-id","name":"hgray_openrouter"}},"typeVersion":1},{"id":"c16b9f53-66eb-40a5-b103-b14d7defd10d","name":"Stock Analysis Tool1","type":"@n8n/n8n-nodes-langchain.toolWorkflow","position":[1008,368],"parameters":{"name":"AnalyzeStock","workflowId":{"__rl":true,"mode":"list","value":"S6UMbAr36CghN8gkbUOtz","cachedResultUrl":"/workflow/S6UMbAr36CghN8gkbUOtz","cachedResultName":"TwelveData_Pro_Helper"},"description":"Call this tool to get comprehensive technical and fundamental analysis of any single stock. Provide only the stock ticker symbol (e.g., 'AAPL', 'TSLA', 'MSFT'). Returns detailed analysis including 70+ technical indicators, fundamentals, risk assessment, and buy/sell/hold recommendations. Use this for any question about a single stock.","workflowInputs":{"value":{"query":"={{ $json.query }}"},"mappingMode":"defineBelow"}},"typeVersion":2},{"id":"0a16310c-bf79-4b6f-a812-12fd48158550","name":"Stock Comparison Tool1","type":"@n8n/n8n-nodes-langchain.toolWorkflow","position":[1136,368],"parameters":{"name":"CompareStocks","workflowId":{"__rl":true,"mode":"list","value":"d6nkzYp6pVEE5aR4VZFY1","cachedResultUrl":"/workflow/d6nkzYp6pVEE5aR4VZFY1","cachedResultName":"Stock_Comparison_Tool"},"description":"Compare two or more stocks side-by-side. Provide ticker symbols separated by commas (e.g., 'AAPL,MSFT,GOOGL'). Returns comparative analysis including price performance, RSI momentum signals, P/E valuation, market cap, sector, 52-week range positioning, and a quick verdict per stock. Use this whenever a user wants to compare multiple stocks.","workflowInputs":{"value":{"tickers":"={{ $json.tickers }}"},"mappingMode":"defineBelow"}},"typeVersion":2},{"id":"a688d666-f6ec-474b-ada9-a0f859cb1965","name":"Sector Analysis Tool1","type":"@n8n/n8n-nodes-langchain.toolWorkflow","position":[1264,368],"parameters":{"name":"SectorAnalysis","workflowId":{"__rl":true,"mode":"list","value":"lYh8bOAOFSRNNU5OjiWOj","cachedResultUrl":"/workflow/lYh8bOAOFSRNNU5OjiWOj","cachedResultName":"Sector_Analysis_Tool_Enhanced"},"description":"Get sector performance analysis, top and bottom performers, industry breakdown and investment recommendation for an entire market sector. Provide one of these exact sector names: Technology, Healthcare, Finance, Energy, Consumer, Real Estate, Utilities, Industrials. Returns sector strength, average P/E, average beta, top 3 performers, bottom 2 performers, industry breakdown, and a BUY/SELECTIVE BUY/AVOID recommendation for the whole sector.","workflowInputs":{"value":{"sector":"={{ $json.sector }}"},"mappingMode":"defineBelow"}},"typeVersion":2},{"id":"43dd2f38-7e8a-4776-9750-489d6767d396","name":"Risk Calculator Tool1","type":"@n8n/n8n-nodes-langchain.toolWorkflow","position":[1392,368],"parameters":{"name":"CalculateRisk","workflowId":{"__rl":true,"mode":"list","value":"Jug-KrHObfV-QNCsN3ojN","cachedResultUrl":"/workflow/Jug-KrHObfV-QNCsN3ojN","cachedResultName":"Risk_Calculator_Tool"},"description":"Calculate comprehensive risk metrics for a stock position. Provide a ticker symbol and optional position size in USD (default is $10,000 if not specified). Returns: annualised volatility, daily volatility, maximum drawdown with dates, Value at Risk (95% confidence 1-day), 5-component risk score out of 10, beta analysis, P/E valuation risk, leverage risk, debt-to-equity, free cash flow, short interest, institutional ownership, suggested stop-loss price, and position sizing recommendation. Use this whenever a user asks about risk, volatility, VaR, drawdown, how much they could lose, or portfolio exposure.","workflowInputs":{"value":{"ticker":"={{ $json.ticker }}","positionSize":"={{ $json.positionSize || 10000 }}"},"mappingMode":"defineBelow"}},"typeVersion":2},{"id":"35de563e-5773-4f35-8447-1948f4b8ba33","name":"Send Response1","type":"n8n-nodes-base.telegram","position":[1600,144],"webhookId":"ed02acca-4095-4b23-ba1c-aea13567e2bb","parameters":{"text":"={{ $json.output }}","chatId":"=","additionalFields":{"parse_mode":"Markdown","appendAttribution":false}},"credentials":{"telegramApi":{"id":"credential-id","name":"stockanalyst_twelvedata"}},"typeVersion":1.2},{"id":"7288d7d1-b7c4-4121-8ad5-309a2578bec6","name":"Sticky Note1","type":"n8n-nodes-base.stickyNote","position":[-848,96],"parameters":{"color":4,"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-text message filter\n- ✅ All 8 sectors in tool descriptions\n- ✅ Improved tool descriptions\n- ✅ Error handling in system prompt\n- ✅ Temperature removed (o3-mini)\n- ✅ Max tokens raised to 4000\n\n**Tools Wired:**\n- 📊 AnalyzeStock → Helper\n- 📈 CompareStocks → Comparison Tool\n- 🏢 SectorAnalysis → Sector Tool\n- ⚠️ CalculateRisk → Risk Calculator"},"typeVersion":1},{"id":"cbbe92d8-75e6-4be6-ae85-8257da8c22a8","name":"Trigger","type":"n8n-nodes-base.executeWorkflowTrigger","position":[432,912],"parameters":{"inputSource":"passthrough"},"typeVersion":1.1},{"id":"b4595614-3b17-4cf1-a2ae-735ee031617d","name":"Get Historical Data","type":"n8n-nodes-twelve-data.twelveData","position":[832,848],"parameters":{"symbol":"={{ $json.ticker }}{{ $json.chatInput }}","operation":"getTimeSeries","requestOptions":{},"additionalOptions":{}},"credentials":{"twelveDataApi":{"id":"credential-id","name":"Twelve Data account"}},"typeVersion":1},{"id":"48b453db-74c1-4e80-a760-fd16e64af248","name":"Get Statistics","type":"n8n-nodes-twelve-data.twelveData","position":[832,992],"parameters":{"symbol":"={{ $json.ticker }}{{ $json.chatInput }}","resource":"fundamentals","operation":"getStatistics","requestOptions":{},"fundamentalsOptions":{}},"credentials":{"twelveDataApi":{"id":"credential-id","name":"Twelve Data account"}},"typeVersion":1},{"id":"015583f2-c324-4186-bad8-b9dc347af301","name":"Merge","type":"n8n-nodes-base.merge","position":[1056,912],"parameters":{"mode":"combine","options":{"includeUnpaired":true},"combineBy":"combineByPosition"},"typeVersion":3},{"id":"b5b011ff-bf3c-4168-9a54-cb4f562783fa","name":"Calculate Risk Metrics","type":"n8n-nodes-base.code","position":[1280,912],"parameters":{"jsCode":"const data = $input.first().json;\n\n// ── INPUTS ──────────────────────────────────────────────\nconst meta      = data.meta || {};\nconst timeSeries = data.values || [];\nconst stats     = data.statistics || {};\nconst val       = stats.valuations_metrics || {};\nconst fin       = stats.financials || {};\nconst inc       = fin.income_statement || {};\nconst bal       = fin.balance_sheet || {};\nconst cf        = fin.cash_flow || {};\nconst stk       = stats.stock_statistics || {};\nconst prc       = stats.stock_price_summary || {};\nconst div       = stats.dividends_and_splits || {};\n\nconst ticker        = meta.symbol || 'UNKNOWN';\nconst companyName   = meta.name || ticker;\nconst positionSize  = $input.first().json.positionSize || 10000;\nconst currentPrice  = parseFloat(timeSeries[0]?.close) || 0;\n\n// ── DAILY RETURNS ────────────────────────────────────────\nconst returns = [];\nfor (let i = 1; i < timeSeries.length; i++) {\n  const curr = parseFloat(timeSeries[i-1].close);\n  const prev = parseFloat(timeSeries[i].close);\n  if (prev > 0) returns.push(((curr - prev) / prev) * 100);\n}\n\n// ── VOLATILITY (Annualised) ──────────────────────────────\nconst mean = returns.reduce((s, r) => s + r, 0) / returns.length;\nconst variance = returns.reduce((s, r) => s + Math.pow(r - mean, 2), 0) / returns.length;\nconst dailyVol = Math.sqrt(variance);\nconst annualVol = dailyVol * Math.sqrt(252);\n\n// ── MAXIMUM DRAWDOWN ─────────────────────────────────────\nlet peak = parseFloat(timeSeries[0]?.close) || 0;\nlet maxDrawdown = 0;\nlet drawdownStart = timeSeries[0]?.datetime;\nlet drawdownEnd = timeSeries[0]?.datetime;\nlet tempPeakDate = timeSeries[0]?.datetime;\n\ntimeSeries.forEach(day => {\n  const price = parseFloat(day.close);\n  if (price > peak) {\n    peak = price;\n    tempPeakDate = day.datetime;\n  }\n  const dd = ((peak - price) / peak) * 100;\n  if (dd > maxDrawdown) {\n    maxDrawdown = dd;\n    drawdownStart = tempPeakDate;\n    drawdownEnd = day.datetime;\n  }\n});\n\n// ── VALUE AT RISK (95%, 1-day) ───────────────────────────\nconst sortedReturns = [...returns].sort((a, b) => a - b);\nconst varIndex = Math.floor(sortedReturns.length * 0.05);\nconst var95Pct  = Math.abs(sortedReturns[varIndex] || 0);\nconst var95Dollar = (positionSize * var95Pct) / 100;\n\n// ── 52-WEEK POSITIONING ──────────────────────────────────\nconst low52  = prc.fifty_two_week_low || 0;\nconst high52 = prc.fifty_two_week_high || 0;\nconst pctFrom52Low  = (((currentPrice - low52) / low52) * 100).toFixed(2);\nconst pctFrom52High = (((high52 - currentPrice) / high52) * 100).toFixed(2);\nconst rangePosition = (((currentPrice - low52) / (high52 - low52)) * 100).toFixed(1);\n\n// ── MOVING AVERAGE SIGNALS ───────────────────────────────\nconst ma50  = prc.day_50_ma || 0;\nconst ma200 = prc.day_200_ma || 0;\nconst aboveMa50  = currentPrice > ma50;\nconst aboveMa200 = currentPrice > ma200;\nconst goldenCross = ma50 > ma200; // bullish long-term signal\n\n// ── SHORT INTEREST ───────────────────────────────────────\nconst shortPct = (stk.short_percent_of_shares_outstanding * 100).toFixed(2);\nconst shortRatio = stk.short_ratio || 0;\nconst highShortInterest = stk.short_percent_of_shares_outstanding > 0.05;\n\n// ── FINANCIAL HEALTH METRICS ─────────────────────────────\nconst debtToEquity   = bal.total_debt_to_equity_mrq || 0;\nconst currentRatio   = bal.current_ratio_mrq || 0;\nconst profitMargin   = (fin.profit_margin * 100).toFixed(2);\nconst operatingMargin = (fin.operating_margin * 100).toFixed(2);\nconst grossMargin    = (fin.gross_margin * 100).toFixed(2);\nconst roe            = (fin.return_on_equity_ttm * 100).toFixed(2);\nconst roa            = (fin.return_on_assets_ttm * 100).toFixed(2);\nconst fcf            = cf.levered_free_cash_flow_ttm || 0;\nconst ocf            = cf.operating_cash_flow_ttm || 0;\nconst cashVsDebt     = bal.total_cash_mrq - bal.total_debt_mrq;\n\n// ── VALUATION RISK ───────────────────────────────────────\nconst trailingPE  = val.trailing_pe || 0;\nconst forwardPE   = val.forward_pe || 0;\nconst pegRatio    = val.peg_ratio || 0;\nconst ptb         = val.price_to_book_mrq || 0;\nconst evEbitda    = val.enterprise_to_ebitda || 0;\n\n// ── COMPOSITE RISK SCORE (1-10) ──────────────────────────\n// Volatility: >40% annualised = 10, <10% = 1\nconst volatilityScore = Math.min(Math.max((annualVol / 4), 1), 10);\n\n// Drawdown: >40% = 10, <5% = 1\nconst drawdownScore = Math.min(Math.max((maxDrawdown / 4), 1), 10);\n\n// Beta: far from 1 = higher risk\nconst beta = prc.beta || 1;\nconst betaScore = Math.min(Math.max(Math.abs(beta - 1) * 5 + 1, 1), 10);\n\n// Valuation risk: high PE + high PEG = overvaluation risk\nconst valuationScore = Math.min(Math.max((trailingPE / 10) + (pegRatio > 2 ? 2 : 0), 1), 10);\n\n// Leverage risk: high debt-to-equity\nconst leverageScore = Math.min(Math.max(debtToEquity / 20, 1), 10);\n\n// Composite (weighted)\nconst riskScore = Math.round(\n  (volatilityScore * 0.25) +\n  (drawdownScore   * 0.25) +\n  (betaScore       * 0.20) +\n  (valuationScore  * 0.20) +\n  (leverageScore   * 0.10)\n);\n\nconst riskLabel = riskScore <= 3 ? '🟢 LOW RISK' :\n                  riskScore <= 5 ? '🟡 MODERATE RISK' :\n                  riskScore <= 7 ? '🟠 ELEVATED RISK' : '🔴 HIGH RISK';\n\n// ── STOP-LOSS RECOMMENDATION ─────────────────────────────\nconst stopLoss = (currentPrice * (1 - (maxDrawdown / 200))).toFixed(2);\nconst stopLossPct = ((currentPrice - stopLoss) / currentPrice * 100).toFixed(2);\n\n// ── POSITION SIZING ──────────────────────────────────────\nconst positionGuide = riskScore <= 3 ? '10–15% of portfolio' :\n                      riskScore <= 5 ? '5–10% of portfolio' :\n                      riskScore <= 7 ? '3–5% of portfolio' : '1–3% of portfolio (high risk)';\n\n// ── FORMATTED REPORT ─────────────────────────────────────\nconst formatted = `\nRISK ANALYSIS REPORT — ${ticker} (${companyName})\nGenerated: ${new Date().toISOString()}\n\n═══════════════════════════════════════════════════\nPOSITION & PRICE CONTEXT\n═══════════════════════════════════════════════════\nCurrent Price:      $${currentPrice}\nPosition Size:      $${positionSize.toLocaleString()}\n52-Week Low:        $${low52}  (+${pctFrom52Low}% current)\n52-Week High:       $${high52}  (-${pctFrom52High}% current)\nRange Position:     ${rangePosition}% between 52w low and high\n\n50-Day MA:          $${ma50}  ${aboveMa50 ? '✅ Price ABOVE (bullish)' : '⚠️ Price BELOW (bearish)'}\n200-Day MA:         $${ma200}  ${aboveMa200 ? '✅ Price ABOVE (bullish)' : '⚠️ Price BELOW (bearish)'}\nMA Cross Signal:    ${goldenCross ? '✅ Golden Cross (50MA > 200MA) — Bullish' : '⚠️ Death Cross (50MA < 200MA) — Bearish'}\n\n═══════════════════════════════════════════════════\nOVERALL RISK SCORE: ${riskScore}/10 — ${riskLabel}\n═══════════════════════════════════════════════════\n\nComponent Breakdown:\n  Volatility Risk:   ${volatilityScore.toFixed(1)}/10\n  Drawdown Risk:     ${drawdownScore.toFixed(1)}/10\n  Beta Risk:         ${betaScore.toFixed(1)}/10\n  Valuation Risk:    ${valuationScore.toFixed(1)}/10\n  Leverage Risk:     ${leverageScore.toFixed(1)}/10\n\n═══════════════════════════════════════════════════\nPRICE RISK METRICS\n═══════════════════════════════════════════════════\nAnnualised Volatility:    ${annualVol.toFixed(2)}%\nDaily Volatility:         ${dailyVol.toFixed(2)}%\n\nMaximum Drawdown:         ${maxDrawdown.toFixed(2)}%\n  Peak date:              ${drawdownStart}\n  Trough date:            ${drawdownEnd}\n\nValue at Risk (95%, 1d):  $${var95Dollar.toFixed(2)}  (${var95Pct.toFixed(2)}% of position)\n  Interpretation: On 95% of trading days, loss will not exceed $${var95Dollar.toFixed(2)}\n\n═══════════════════════════════════════════════════\nVALUATION RISK\n═══════════════════════════════════════════════════\nTrailing P/E:       ${trailingPE.toFixed(2)}\nForward P/E:        ${forwardPE.toFixed(2)}  ${forwardPE < trailingPE ? '✅ Earnings growth expected' : '⚠️ Earnings expected to decline'}\nPEG Ratio:          ${pegRatio.toFixed(2)}  ${pegRatio < 1 ? '✅ Undervalued relative to growth' : pegRatio < 2 ? '⚠️ Fairly valued' : '🔴 Potentially overvalued'}\nPrice-to-Book:      ${ptb.toFixed(2)}\nEV/EBITDA:          ${evEbitda.toFixed(2)}\n\n═══════════════════════════════════════════════════\nFINANCIAL HEALTH\n═══════════════════════════════════════════════════\nGross Margin:       ${grossMargin}%\nOperating Margin:   ${operatingMargin}%\nNet Profit Margin:  ${profitMargin}%\nReturn on Equity:   ${roe}%\nReturn on Assets:   ${roa}%\n\nOperating Cash Flow:    $${(ocf / 1e9).toFixed(2)}B\nFree Cash Flow:         $${(fcf / 1e9).toFixed(2)}B\nTotal Cash:             $${(bal.total_cash_mrq / 1e9).toFixed(2)}B\nTotal Debt:             $${(bal.total_debt_mrq / 1e9).toFixed(2)}B\nNet Cash Position:      ${cashVsDebt >= 0 ? '+' : ''}$${(cashVsDebt / 1e9).toFixed(2)}B  ${cashVsDebt >= 0 ? '✅ Net cash positive' : '⚠️ Net debt position'}\nDebt-to-Equity:         ${debtToEquity.toFixed(2)}\nCurrent Ratio:          ${currentRatio.toFixed(2)}  ${currentRatio >= 1 ? '✅ Adequate liquidity' : '⚠️ Liquidity concern'}\n\n═══════════════════════════════════════════════════\nMARKET SENTIMENT INDICATORS\n═══════════════════════════════════════════════════\nBeta:                   ${beta}  ${beta > 1.2 ? '⚠️ More volatile than market' : beta < 0.8 ? '✅ Defensive — less volatile than market' : '✅ Moves broadly with market'}\nShort Interest:         ${shortPct}%  ${highShortInterest ? '⚠️ Elevated short interest' : '✅ Low short interest'}\nShort Ratio:            ${shortRatio} days to cover\nInstitutional Ownership: ${(stk.percent_held_by_institutions * 100).toFixed(1)}%  ${stk.percent_held_by_institutions > 0.6 ? '✅ Strong institutional backing' : '⚠️ Low institutional conviction'}\nInsider Ownership:      ${(stk.percent_held_by_insiders * 100).toFixed(2)}%\n\nDividend Yield:         ${(div.forward_annual_dividend_yield * 100).toFixed(2)}%\nPayout Ratio:           ${(div.payout_ratio * 100).toFixed(1)}%  ${div.payout_ratio < 0.5 ? '✅ Sustainable dividend' : '⚠️ High payout ratio'}\n\n═══════════════════════════════════════════════════\nRISK MANAGEMENT RECOMMENDATIONS\n═══════════════════════════════════════════════════\nSuggested Stop-Loss:    $${stopLoss}  (${stopLossPct}% below current price)\nMax Downside to Stop:   $${((currentPrice - stopLoss) * (positionSize / currentPrice)).toFixed(2)} on $${positionSize.toLocaleString()} position\n\nRecommended Position Size: ${positionGuide}\n\nDiversification Note:\n${riskScore > 6 ? '🔴 CRITICAL — Ensure strong sector diversification. Do not concentrate.' :\n  riskScore > 3 ? '🟡 Standard diversification across sectors recommended.' :\n  '🟢 Well-suited as a core holding with standard diversification.'}\n`;\n\nreturn {\n  json: {\n    ticker,\n    companyName,\n    riskScore,\n    riskLabel,\n    annualizedVolatility: parseFloat(annualVol.toFixed(2)),\n    dailyVolatility: parseFloat(dailyVol.toFixed(2)),\n    maxDrawdown: parseFloat(maxDrawdown.toFixed(2)),\n    drawdownPeriod: { start: drawdownStart, end: drawdownEnd },\n    var95Percent: parseFloat(var95Pct.toFixed(2)),\n    var95Dollar: parseFloat(var95Dollar.toFixed(2)),\n    beta,\n    trailingPE,\n    forwardPE,\n    pegRatio,\n    profitMargin: parseFloat(profitMargin),\n    operatingMargin: parseFloat(operatingMargin),\n    freeCashFlow: fcf,\n    netCashPosition: cashVsDebt,\n    shortInterestPct: parseFloat(shortPct),\n    institutionalOwnership: parseFloat((stk.percent_held_by_institutions * 100).toFixed(1)),\n    stopLoss: parseFloat(stopLoss),\n    positionGuide,\n    rangePosition: parseFloat(rangePosition),\n    aboveMa50,\n    aboveMa200,\n    goldenCross,\n    formatted\n  }\n};\n"},"typeVersion":2},{"id":"a7031505-8171-4091-9ced-a25ed46e72c9","name":"Output","type":"n8n-nodes-base.set","position":[1504,912],"parameters":{"options":{},"assignments":{"assignments":[{"id":"d8651f45-477c-4c0d-b737-74b711e048f4","name":"ticker","type":"string","value":"={{ $json.ticker }}"},{"id":"019ff347-1eca-4f42-bba8-548d972b1479","name":"companyName","type":"string","value":"={{ $json.companyName }}"},{"id":"413b7428-579f-4232-b472-15f9e0c023b2","name":"response","type":"string","value":"={{ $json.formatted }}"}]}},"typeVersion":3.4},{"id":"a8bd84c1-b4ef-4000-9b8e-67f1e54edfe7","name":"Sticky Note2","type":"n8n-nodes-base.stickyNote","position":[-416,672],"parameters":{"color":4,"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 price data** and **fundamental statistics** from Twelve Data in parallel\n- Calculates **annualised volatility**, **maximum drawdown** (with dates), and **Value at Risk** (95% confidence, 1-day)\n- Scores **valuation risk** using P/E, PEG, Price-to-Book and EV/EBITDA\n- Assesses **financial health** — margins, ROE, free cash flow, debt vs cash\n- Checks **sentiment** — beta, short interest, institutional ownership, dividend sustainability\n- Produces a **composite risk score out of 10** (volatility + drawdown + beta + valuation + leverage)\n- Recommends a **stop-loss price** and **position sizing** based on the risk score\n- Returns a formatted plain-text report plus structured JSON back to the calling workflow"},"typeVersion":1},{"id":"397713af-9cd5-4ab2-a15f-caddcc969959","name":"Sticky Note3","type":"n8n-nodes-base.stickyNote","position":[-400,1376],"parameters":{"color":4,"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 space-separated list\n- **Smart ticker extraction** strips common English words (AND, THE, VS, etc.) to isolate valid stock symbols, then deduplicates\n- Fetches **Quote**, **RSI (14)**, and **Company Profile** from Twelve Data in parallel for every ticker\n- Merges all three data sources and builds a structured comparison object per stock\n- Calculates **summary metrics** — best/worst performer, performance gap, average RSI, overbought/oversold stocks, sectors covered\n- Produces a **momentum ranking** sorted by daily % change\n- Generates a **Quick Verdict per stock** combining RSI signal, daily move strength, and 52-week range positioning\n- Returns a formatted plain-text comparison report plus structured JSON back to the calling workflow"},"typeVersion":1},{"id":"802624fd-afbc-499f-b090-58fd3da25ba8","name":"Split Tickers1","type":"n8n-nodes-base.code","position":[608,1600],"parameters":{"jsCode":"const input = $input.first().json;\n\n// Handle Chat Trigger (chatInput) OR workflow trigger (tickers field)\nconst raw = input.chatInput || input.tickers || input.message || input.text || '';\n\n// Extract ticker symbols — handles:\n// \"AAPL, TSLA, MSFT\"         → comma separated\n// \"compare AAPL and TSLA\"    → natural language\n// \"AAPL TSLA MSFT\"           → space separated\nconst tickersInput = raw.toUpperCase();\n\n// Pull out anything that looks like a stock ticker (1-5 capital letters)\nconst extracted = tickersInput.match(/\\b[A-Z]{1,5}\\b/g) || [];\n\n// Filter out common English words that match ticker pattern\nconst stopWords = new Set([\n  'A', 'I', 'AND', 'THE', 'FOR', 'VS', 'OR', 'ME', 'MY',\n  'IN', 'ON', 'AT', 'TO', 'OF', 'IS', 'IT', 'BE', 'DO',\n  'CAN', 'GET', 'HOW', 'ARE', 'WAS', 'HAS', 'HAD', 'BUT',\n  'NOT', 'ALL', 'SO', 'IF', 'NO', 'UP', 'AN', 'AS', 'BY',\n  'WITH', 'COMPARE', 'STOCK', 'STOCKS', 'PRICE', 'SHOW'\n]);\n\nconst tickers = [...new Set(extracted.filter(t => !stopWords.has(t)))];\n\nif (tickers.length === 0) {\n  throw new Error('No stock tickers found. Please provide ticker symbols like: AAPL, TSLA, MSFT');\n}\n\nreturn tickers.map(ticker => ({\n  json: { ticker }\n}));\n"},"typeVersion":2},{"id":"eb1e0fe5-7bdf-4e8b-bdd3-d497acbb72ac","name":"Get Quotes1","type":"n8n-nodes-twelve-data.twelveData","position":[832,1408],"parameters":{"symbol":"={{ $json.ticker }}","requestOptions":{},"additionalOptions":{}},"credentials":{"twelveDataApi":{"id":"credential-id","name":"Twelve Data account"}},"typeVersion":1},{"id":"5546b63f-7b9a-4d2d-8ec7-298893de5774","name":"Get RSI1","type":"n8n-nodes-twelve-data.twelveData","position":[832,1600],"parameters":{"symbol":"={{ $json.ticker }}","resource":"technicalIndicators","operation":"rsi","requestOptions":{},"indicatorOptions":{}},"credentials":{"twelveDataApi":{"id":"credential-id","name":"Twelve Data account"}},"typeVersion":1},{"id":"cf0b5d2a-aac5-4808-8e88-4a11a9373fdc","name":"Get Profile1","type":"n8n-nodes-twelve-data.twelveData","position":[832,1792],"parameters":{"symbol":"={{ $json.ticker }}","resource":"fundamentals","requestOptions":{},"fundamentalsOptions":{}},"credentials":{"twelveDataApi":{"id":"credential-id","name":"Twelve Data account"}},"typeVersion":1},{"id":"064cfaa5-9b78-4262-baa5-d1ad17df10a2","name":"Merge Stock Data1","type":"n8n-nodes-base.merge","position":[1056,1584],"parameters":{"mode":"combine","options":{"includeUnpaired":true},"combineBy":"combineByPosition","numberInputs":3},"typeVersion":3},{"id":"d332e75f-f8f3-4108-aa5d-89a1a6ddc2c6","name":"Format Comparison1","type":"n8n-nodes-base.code","position":[1280,1600],"parameters":{"jsCode":"const items = $input.all();\n\nconst comparison = items.map(item => {\n  const d = item.json;\n\n  // Skip errors\n  if (d.status === 'error' || d.code === 403) return null;\n\n  const sym = d.symbol || d.meta?.symbol || 'N/A';\n\n  // ── Price data — direct from root ──\n  const price      = parseFloat(d.close || 0);\n  const change     = parseFloat(d.percent_change || 0);\n  const volume     = parseInt(d.volume || 0);\n  const avgVolume  = parseInt(d.average_volume || 0);\n  const fiftyTwo   = d.fifty_two_week || {};\n\n  // ── RSI — from values[] array, first entry = most recent ──\n  const rsi = d.values && d.values[0]?.rsi\n    ? parseFloat(d.values[0].rsi).toFixed(2)\n    : 'N/A';\n\n  // ── Profile data — direct from root ──\n  const sector   = d.sector   || 'N/A';\n  const industry = d.industry || 'N/A';\n  const ceo      = d.CEO      || d.ceo || 'N/A';\n  const employees = parseInt(d.employees || 0);\n  const description = d.description || '';\n  const website  = d.website  || '';\n  const exchange = d.exchange || 'N/A';\n  const name     = d.name     || sym;\n\n  return {\n    symbol: sym,\n    name,\n    sector,\n    industry,\n    exchange,\n    ceo,\n    employees,\n    description,\n    website,\n    price,\n    change,\n    volume,\n    avgVolume,\n    previousClose: parseFloat(d.previous_close || 0),\n    open:  parseFloat(d.open  || 0),\n    high:  parseFloat(d.high  || 0),\n    low:   parseFloat(d.low   || 0),\n    fiftyTwoWeekLow:  parseFloat(fiftyTwo.low  || 0),\n    fiftyTwoWeekHigh: parseFloat(fiftyTwo.high || 0),\n    rsi,\n    isMarketOpen: d.is_market_open || false\n  };\n}).filter(Boolean);\n\n// Sort by % change descending\ncomparison.sort((a, b) => b.change - a.change);\n\n// ── Summary metrics ──\nconst bestPerformer  = comparison[0] || {};\nconst worstPerformer = comparison[comparison.length - 1] || {};\nconst perfGap        = (bestPerformer.change - worstPerformer.change).toFixed(2);\n\nconst validRSI = comparison.filter(s => s.rsi !== 'N/A');\nconst avgRSI   = validRSI.length > 0\n  ? validRSI.reduce((sum, s) => sum + parseFloat(s.rsi), 0) / validRSI.length\n  : 0;\n\nconst sectors    = [...new Set(comparison.map(s => s.sector).filter(s => s !== 'N/A'))];\nconst overbought = comparison.filter(s => s.rsi !== 'N/A' && parseFloat(s.rsi) > 70);\nconst oversold   = comparison.filter(s => s.rsi !== 'N/A' && parseFloat(s.rsi) < 30);\n\n// ── Helper functions ──\nconst fmt = (n, d=2) => (!isNaN(n) && n !== null) ? Number(n).toFixed(d) : 'N/A';\n\nconst rsiSignal = (rsi) => {\n  if (rsi === 'N/A') return 'N/A';\n  const r = parseFloat(rsi);\n  return r > 70 ? '🔴 Overbought' : r < 30 ? '🟢 Oversold' : r >= 50 ? '🟡 Neutral/Bullish' : '🟡 Neutral/Bearish';\n};\n\nconst rangePosition = (price, low, high) => {\n  if (!low || !high || high === low) return 'N/A';\n  return (((price - low) / (high - low)) * 100).toFixed(0) + '%';\n};\n\nconst fmtChange = (n) => (n >= 0 ? '+' : '') + fmt(n) + '%';\n\n// ── Build report ──\nconst formatted = `\nSTOCK COMPARISON ANALYSIS\nGenerated: ${new Date().toISOString()}\nStocks Compared: ${comparison.map(s => s.symbol).join(' vs ')}\nMarket Status: ${comparison[0]?.isMarketOpen ? '🟢 Market Open' : '🔴 Market Closed'}\n\n═══════════════════════════════════════════════════\nPERFORMANCE SNAPSHOT\n═══════════════════════════════════════════════════\n${comparison.map((s, i) => `${i + 1}. ${s.symbol} — ${s.name}\n   Price:        $${fmt(s.price)} (${fmtChange(s.change)})\n   Open/High/Low: $${fmt(s.open)} / $${fmt(s.high)} / $${fmt(s.low)}\n   Prev Close:   $${fmt(s.previousClose)}\n   Sector:       ${s.sector} | ${s.industry}\n   Exchange:     ${s.exchange}\n   RSI (14):     ${s.rsi} — ${rsiSignal(s.rsi)}\n   Volume:       ${(s.volume / 1e6).toFixed(2)}M (Avg: ${(s.avgVolume / 1e6).toFixed(1)}M)\n   52-Week:      $${fmt(s.fiftyTwoWeekLow)} – $${fmt(s.fiftyTwoWeekHigh)}\n   Range Pos:    ${rangePosition(s.price, s.fiftyTwoWeekLow, s.fiftyTwoWeekHigh)} of 52w range\n   CEO:          ${s.ceo}\n   Employees:    ${s.employees > 0 ? s.employees.toLocaleString() : 'N/A'}`\n).join('\\n\\n')}\n\n═══════════════════════════════════════════════════\nRELATIVE PERFORMANCE SUMMARY\n═══════════════════════════════════════════════════\nBest Performer:  ${bestPerformer.symbol} (${fmtChange(bestPerformer.change)})\nWorst Performer: ${worstPerformer.symbol} (${fmtChange(worstPerformer.change)})\nPerformance Gap: ${perfGap}%\n\nAverage RSI:     ${fmt(avgRSI, 1)}\nOverbought:      ${overbought.length > 0 ? overbought.map(s => s.symbol).join(', ') : 'None'}\nOversold:        ${oversold.length > 0 ? oversold.map(s => s.symbol).join(', ') : 'None'}\nSectors Covered: ${sectors.join(', ') || 'N/A'}\n\n═══════════════════════════════════════════════════\nMOMENTUM RANKING (by % change today)\n═══════════════════════════════════════════════════\n${comparison.map((s, i) =>\n  `${i + 1}. ${s.symbol.padEnd(6)} ${fmtChange(s.change).padEnd(10)} | RSI: ${String(s.rsi).padEnd(7)} ${rsiSignal(s.rsi)}`\n).join('\\n')}\n\n═══════════════════════════════════════════════════\nQUICK VERDICT\n═══════════════════════════════════════════════════\n${comparison.map(s => {\n  const signals = [];\n  if (s.rsi !== 'N/A') {\n    const r = parseFloat(s.rsi);\n    if (r > 70)      signals.push('⚠️ Overbought — potential pullback');\n    else if (r < 30) signals.push('✅ Oversold — potential bounce');\n    else if (r >= 50)signals.push('✅ Bullish momentum');\n    else             signals.push('⚠️ Weakening momentum');\n  }\n  if (s.change > 1)       signals.push('📈 Strong daily gain');\n  else if (s.change < -1) signals.push('📉 Significant daily loss');\n  const pctOfHigh = s.fiftyTwoWeekHigh > 0 ? (s.price / s.fiftyTwoWeekHigh) * 100 : 0;\n  if (pctOfHigh > 90)     signals.push('🔥 Near 52-week high');\n  else if (pctOfHigh < 30)signals.push('💡 Near 52-week low — value zone');\n  return `${s.symbol}: ${signals.join(' | ') || 'Insufficient data'}`;\n}).join('\\n')}\n`;\n\nreturn {\n  json: {\n    response: formatted,\n    comparison,\n    bestPerformer: bestPerformer.symbol,\n    worstPerformer: worstPerformer.symbol,\n    perfGap: parseFloat(perfGap),\n    avgRSI: parseFloat(fmt(avgRSI, 1)),\n    overbought: overbought.map(s => s.symbol),\n    oversold: oversold.map(s => s.symbol),\n    stockCount: comparison.length\n  }\n};\n"},"typeVersion":2},{"id":"cac85015-70a5-46fe-b972-b199d6db9128","name":"Output1","type":"n8n-nodes-base.set","position":[1504,1600],"parameters":{"options":{},"assignments":{"assignments":[{"id":"0b897bf2-1f6e-49ee-b65c-140235ae7da4","name":"response","type":"string","value":"={{ $json.response }}"}]}},"typeVersion":3.4},{"id":"70076583-bd97-4b5f-8ea2-6a8872aa6159","name":"Sticky Note4","type":"n8n-nodes-base.stickyNote","position":[1872,672],"parameters":{"color":4,"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 Industrials)\n- **Seeds 5 representative stocks** per sector from a built-in lookup table with known fallback data (CEO, industry, beta, P/E, market cap, employees)\n- Fetches live **Quote** and **Statistics** from Twelve Data in parallel for each stock, then merges and enriches with fallback values where live data is unavailable\n- Sorts stocks by market cap and keeps the top 5, building a fully structured object per stock covering price, valuation, margins, cash flow, dividends, moving averages and share stats\n- Calculates **sector-wide metrics** — average % change, combined market cap & revenue, total employees, average P/E, average beta, average profit margin and revenue growth\n- Rates **sector strength** on a 5-tier scale: Very Strong → Strong → Neutral → Weak → Very Weak\n- Identifies **top 3 performers** and **bottom 2 performers** with full fundamental detail\n- Breaks down the sector by **industry sub-group** with average performance and combined market cap per industry\n- Generates a **Bullish / Mixed / Bearish investment recommendation** with top pick and stock to avoid\n- Returns a formatted plain-text sector report plus structured JSON back to the calling workflow"},"typeVersion":1},{"id":"57846b38-073f-45a3-95fe-84c7439e7631","name":"Set Sector","type":"n8n-nodes-base.set","position":[3184,880],"parameters":{"options":{},"assignments":{"assignments":[{"id":"73afd3dd-da46-4266-af04-f6d6dbd77af3","name":"sector","type":"string","value":"={{ ($json.query || $json.chatInput || $json.ticker || '').toString().trim().toUpperCase() }}"}]}},"typeVersion":3.4},{"id":"8468d785-15d1-4f60-9a69-8a185689e0fc","name":"Get Sector Stocks","type":"n8n-nodes-base.code","position":[3408,880],"parameters":{"jsCode":"// Dynamic sector stock seeding with known fallback data\n// Get Quote will enrich with live prices, sector, industry, marketcap, CEO etc.\nconst sectorData = {\n  'Technology': [\n    { ticker: 'AAPL', knownIndustry: 'Consumer Electronics', knownMarketCap: 3665126494685, knownCeo: 'Mr. Timothy D. Cook', knownEmployees: 166000, knownBeta: 1.093, knownPeRatio: 33.20 },\n    { ticker: 'MSFT', knownIndustry: 'Software - Infrastructure', knownMarketCap: 3461+1234567890, knownCeo: 'Mr. Satya Nadella', knownEmployees: 228000, knownBeta: 0.89, knownPeRatio: 34.5 },\n    { ticker: 'NVDA', knownIndustry: 'Semiconductors', knownMarketCap: 4586+1234567890, knownCeo: 'Mr. Jensen Huang', knownEmployees: 29600, knownBeta: 1.68, knownPeRatio: 52.3 },\n    { ticker: 'GOOGL', knownIndustry: 'Internet Content & Information', knownMarketCap: 2065+1234567890, knownCeo: 'Mr. Sundar Pichai', knownEmployees: 182502, knownBeta: 1.04, knownPeRatio: 24.8 },\n    { ticker: 'META', knownIndustry: 'Social Media', knownMarketCap: 1674+1234567890, knownCeo: 'Mr. Mark Zuckerberg', knownEmployees: 86482, knownBeta: 1.21, knownPeRatio: 28.7 }\n  ],\n  'Healthcare': [\n    { ticker: 'JNJ', knownIndustry: 'Drug Manufacturers - General', knownMarketCap: 38+1234567890, knownCeo: 'Mr. Joaquin Duato', knownEmployees: 130800, knownBeta: 0.56, knownPeRatio: 15.4 },\n    { ticker: 'UNH', knownIndustry: 'Healthcare Plans', knownMarketCap: 545+1234567890, knownCeo: 'Mr. Andrew Witty', knownEmployees: 440000, knownBeta: 0.73, knownPeRatio: 25.1 },\n    { ticker: 'LLY', knownIndustry: 'Drug Manufacturers - General', knownMarketCap: 885+1234567890, knownCeo: 'Mr. David A. Ricks', knownEmployees: 43000, knownBeta: 0.48, knownPeRatio: 62.8 },\n    { ticker: 'PFE', knownIndustry: 'Drug Manufacturers - General', knownMarketCap: 156+1234567890, knownCeo: 'Dr. Albert Bourla', knownEmployees: 83000, knownBeta: 0.61, knownPeRatio: 12.1 },\n    { ticker: 'ABBV', knownIndustry: 'Drug Manufacturers - General', knownMarketCap: 32+1234567890, knownCeo: 'Mr. Richard A. Gonzalez', knownEmployees: 50000, knownBeta: 0.70, knownPeRatio: 18.3 }\n  ],\n  'Finance': [\n    { ticker: 'JPM', knownIndustry: 'Banks - Diversified', knownMarketCap: 7+1234567890, knownCeo: 'Mr. Jamie Dimon', knownEmployees: 309926, knownBeta: 1.10, knownPeRatio: 13.2 },\n    { ticker: 'BAC', knownIndustry: 'Banks - Diversified', knownMarketCap: 35+1234567890, knownCeo: 'Mr. Brian Moynihan', knownEmployees: 217000, knownBeta: 1.35, knownPeRatio: 14.1 },\n    { ticker: 'WFC', knownIndustry: 'Banks - Diversified', knownMarketCap: 26+1234567890, knownCeo: 'Mr. Charles W. Scharf', knownEmployees: 227608, knownBeta: 1.20, knownPeRatio: 13.8 },\n    { ticker: 'GS', knownIndustry: 'Capital Markets', knownMarketCap: 185+1234567890, knownCeo: 'Mr. David Solomon', knownEmployees: 46000, knownBeta: 1.40, knownPeRatio: 15.2 },\n    { ticker: 'MS', knownIndustry: 'Capital Markets', knownMarketCap: 175+1234567890, knownCeo: 'Mr. James P. Gorman', knownEmployees: 81000, knownBeta: 1.30, knownPeRatio: 16.4 }\n  ],\n  'Energy': [\n    { ticker: 'XOM', knownIndustry: 'Oil & Gas Integrated', knownMarketCap: 48+1234567890, knownCeo: 'Mr. Darren Woods', knownEmployees: 61500, knownBeta: 0.90, knownPeRatio: 14.5 },\n    { ticker: 'CVX', knownIndustry: 'Oil & Gas Integrated', knownMarketCap: 29+1234567890, knownCeo: 'Mr. Michael K. Wirth', knownEmployees: 42595, knownBeta: 0.88, knownPeRatio: 15.2 },\n    { ticker: 'COP', knownIndustry: 'Oil & Gas E&P', knownMarketCap: 138+1234567890, knownCeo: 'Mr. Ryan Lance', knownEmployees: 9500, knownBeta: 0.95, knownPeRatio: 13.1 },\n    { ticker: 'SLB', knownIndustry: 'Oil & Gas Equipment & Services', knownMarketCap: 72+1234567890, knownCeo: 'Mr. Olivier Le Peuch', knownEmployees: 95000, knownBeta: 1.25, knownPeRatio: 16.8 },\n    { ticker: 'EOG', knownIndustry: 'Oil & Gas E&P', knownMarketCap: 68+1234567890, knownCeo: 'Mr. Ezra Yacob', knownEmployees: 2900, knownBeta: 0.93, knownPeRatio: 11.4 }\n  ],\n  'Consumer': [\n    { ticker: 'AMZN', knownIndustry: 'Internet Retail', knownMarketCap: 23+1234567890, knownCeo: 'Mr. Andrew R. Jassy', knownEmployees: 1540000, knownBeta: 1.15, knownPeRatio: 45.2 },\n    { ticker: 'TSLA', knownIndustry: 'Auto Manufacturers', knownMarketCap: 11+1234567890, knownCeo: 'Mr. Elon Musk', knownEmployees: 140473, knownBeta: 2.30, knownPeRatio: 80.1 },\n    { ticker: 'HD', knownIndustry: 'Home Improvement Retail', knownMarketCap: 4+1234567890, knownCeo: 'Mr. Edward P. Decker', knownEmployees: 465000, knownBeta: 1.00, knownPeRatio: 26.3 },\n    { ticker: 'NKE', knownIndustry: 'Footwear & Accessories', knownMarketCap: 95+1234567890, knownCeo: 'Mr. John Donahoe', knownEmployees: 83700, knownBeta: 0.98, knownPeRatio: 22.5 },\n    { ticker: 'MCD', knownIndustry: 'Restaurants', knownMarketCap: 22+1234567890, knownCeo: 'Mr. Christopher J. Kempczinski', knownEmployees: 200000, knownBeta: 0.72, knownPeRatio: 24.1 }\n  ],\n  'Real Estate': [\n    { ticker: 'PLD', knownIndustry: 'REIT - Industrial', knownMarketCap: 105+1234567890, knownCeo: 'Mr. Hamid R. Moghadam', knownEmployees: 1800, knownBeta: 1.00, knownPeRatio: 35.2 },\n    { ticker: 'AMT', knownIndustry: 'REIT - Specialty', knownMarketCap: 92+1234567890, knownCeo: 'Mr. Tom Bartlett', knownEmployees: 5200, knownBeta: 0.78, knownPeRatio: 40.1 },\n    { ticker: 'EQIX', knownIndustry: 'REIT - Specialty', knownMarketCap: 75+1234567890, knownCeo: 'Mr. Charles Meyers', knownEmployees: 13000, knownBeta: 0.85, knownPeRatio: 88.3 },\n    { ticker: 'SPG', knownIndustry: 'REIT - Retail', knownMarketCap: 58+1234567890, knownCeo: 'Mr. David E. Simon', knownEmployees: 3100, knownBeta: 1.30, knownPeRatio: 22.4 },\n    { ticker: 'O', knownIndustry: 'REIT - Retail', knownMarketCap: 5+1234567890, knownCeo: 'Mr. Sumit Roy', knownEmployees: 500, knownBeta: 0.60, knownPeRatio: 38.2 }\n  ],\n  'Utilities': [\n    { ticker: 'NEE', knownIndustry: 'Utilities - Regulated Electric', knownMarketCap: 15+1234567890, knownCeo: 'Mr. John W. Ketchum', knownEmployees: 15000, knownBeta: 0.55, knownPeRatio: 22.1 },\n    { ticker: 'DUK', knownIndustry: 'Utilities - Regulated Electric', knownMarketCap: 82+1234567890, knownCeo: 'Mr. Harry Sideris', knownEmployees: 28000, knownBeta: 0.42, knownPeRatio: 19.3 },\n    { ticker: 'SO', knownIndustry: 'Utilities - Regulated Electric', knownMarketCap: 78+1234567890, knownCeo: 'Mr. Christopher C. Womack', knownEmployees: 28000, knownBeta: 0.45, knownPeRatio: 20.8 },\n    { ticker: 'AEP', knownIndustry: 'Utilities - Regulated Electric', knownMarketCap: 52+1234567890, knownCeo: 'Ms. Julie Sloat', knownEmployees: 17000, knownBeta: 0.48, knownPeRatio: 18.5 },\n    { ticker: 'EXC', knownIndustry: 'Utilities - Regulated Electric', knownMarketCap: 42+1234567890, knownCeo: 'Mr. Calvin G. Butler Jr.', knownEmployees: 20000, knownBeta: 0.50, knownPeRatio: 17.2 }\n  ],\n  'Industrials': [\n    { ticker: 'CAT', knownIndustry: 'Farm & Heavy Construction Machinery', knownMarketCap: 19+1234567890, knownCeo: 'Mr. D. James Umpleby III', knownEmployees: 109600, knownBeta: 0.95, knownPeRatio: 17.8 },\n    { ticker: 'BA', knownIndustry: 'Aerospace & Defense', knownMarketCap: 14+1234567890, knownCeo: 'Mr. Kelly Ortberg', knownEmployees: 150000, knownBeta: 1.35, knownPeRatio: 0 },\n    { ticker: 'HON', knownIndustry: 'Conglomerates', knownMarketCap: 13+1234567890, knownCeo: 'Mr. Vimal Kapur', knownEmployees: 99000, knownBeta: 1.05, knownPeRatio: 24.3 },\n    { ticker: 'UPS', knownIndustry: 'Integrated Freight & Logistics', knownMarketCap: 11+1234567890, knownCeo: 'Ms. Carol Tome', knownEmployees: 500000, knownBeta: 1.10, knownPeRatio: 18.9 },\n    { ticker: 'RTX', knownIndustry: 'Aerospace & Defense', knownMarketCap: 175+1234567890, knownCeo: 'Mr. Gregory J. Hayes', knownEmployees: 185000, knownBeta: 0.90, knownPeRatio: 35.1 }\n  ]\n};\n\nconst sector = $input.first().json.sector || 'Technology';\nconst stocks = sectorData[sector] || sectorData['Technology'];\n\nreturn stocks.map(stock => ({\n  json: {\n    ticker: stock.ticker,\n    requestedSector: sector,\n    knownIndustry: stock.knownIndustry,\n    knownMarketCap: stock.knownMarketCap,\n    knownCeo: stock.knownCeo,\n    knownEmployees: stock.knownEmployees,\n    knownBeta: stock.knownBeta,\n    knownPeRatio: stock.knownPeRatio\n  }\n}));"},"typeVersion":2},{"id":"6734d2e4-b627-408d-90a0-9d0a87b6fc4e","name":"Get Quote","type":"n8n-nodes-twelve-data.twelveData","position":[3632,784],"parameters":{"symbol":"={{ $json.ticker }}","requestOptions":{},"additionalOptions":{}},"credentials":{"twelveDataApi":{"id":"credential-id","name":"Twelve Data account"}},"typeVersion":1},{"id":"1e082627-3fec-499d-81db-af7f7482bf36","name":"Merge & Enrich Data","type":"n8n-nodes-base.code","position":[4080,880],"parameters":{"jsCode":"// Merge & Enrich Data\n// Input is ONE combined object per stock containing both quote + statistics\nconst items = $input.all();\nconst sector = $('Set Sector').first().json.sector || 'Technology';\n\n// Pull knownData from Get Sector Stocks for fallback\nconst knownData = {};\n$('Get Sector Stocks').all().forEach(item => {\n  const d = item.json;\n  if (d.ticker) knownData[d.ticker.toUpperCase()] = d;\n});\n\nconst merged = items.map(item => {\n  const d = item.json;\n\n  // Skip errors\n  if (d.code === 403 || d.status === 'error') return null;\n\n  // Symbol\n  const sym = (d.symbol || d.meta?.symbol || '').toUpperCase();\n  if (!sym) return null;\n\n  const k = knownData[sym] || {};\n\n  // Statistics nested paths — all on same object\n  const stats        = d.statistics || {};\n  const valuations   = stats.valuations_metrics || {};\n  const financials   = stats.financials || {};\n  const stockStats   = stats.stock_price_summary || {};\n  const stockInfo    = stats.stock_statistics || {};\n  const income       = financials.income_statement || {};\n  const balanceSheet = financials.balance_sheet || {};\n  const cashFlow     = financials.cash_flow || {};\n  const dividends    = stats.dividends_and_splits || {};\n\n  // ── Core fields — live first, fallback second ──\n  const marketCap  = parseFloat(valuations.market_capitalization || k.knownMarketCap || 0);\n  const peRatio    = parseFloat(valuations.trailing_pe || k.knownPeRatio || 0);\n  const beta       = parseFloat(stockStats.beta || k.knownBeta || 0);\n  const industry   = d.industry || k.knownIndustry || 'Unknown';\n  const ceo        = d.ceo || d.CEO || k.knownCeo || 'N/A';\n  const employees  = parseInt(d.employees || k.knownEmployees || 0);\n\n  return {\n    json: {\n      ticker: sym,\n      requestedSector: sector,\n      name: d.name || sym,\n      exchange: d.exchange || '',\n      currency: d.currency || 'USD',\n      sector: d.sector || sector,\n      industry,\n      ceo,\n      employees,\n      description: d.description || '',\n      website: d.website || '',\n\n      // ── Live price data ──\n      price:         parseFloat(d.close || 0),\n      change:        parseFloat(d.change || 0),\n      percentChange: parseFloat(d.percent_change || 0),\n      open:          parseFloat(d.open || 0),\n      high:          parseFloat(d.high || 0),\n      low:           parseFloat(d.low || 0),\n      volume:        parseInt(d.volume || 0),\n      avgVolume:     parseInt(d.average_volume || 0),\n      previousClose: parseFloat(d.previous_close || 0),\n      isMarketOpen:  d.is_market_open || false,\n\n      // ── 52-week range ──\n      fiftyTwoWeekHigh: parseFloat(d.fifty_two_week?.high || stockStats.fifty_two_week_high || 0),\n      fiftyTwoWeekLow:  parseFloat(d.fifty_two_week?.low  || stockStats.fifty_two_week_low  || 0),\n\n      // ── Valuation metrics ──\n      marketCap,\n      peRatio,\n      forwardPE:    parseFloat(valuations.forward_pe || 0),\n      pegRatio:     parseFloat(valuations.peg_ratio || 0),\n      priceToSales: parseFloat(valuations.price_to_sales_ttm || 0),\n      priceToBook:  parseFloat(valuations.price_to_book_mrq || 0),\n\n      // ── Fundamentals ──\n      beta,\n      revenue:        parseFloat(income.revenue_ttm || 0),\n      netIncome:      parseFloat(income.net_income_to_common_ttm || 0),\n      eps:            parseFloat(income.diluted_eps_ttm || 0),\n      revenueGrowth:  parseFloat(income.quarterly_revenue_growth || 0),\n      earningsGrowth: parseFloat(income.quarterly_earnings_growth_yoy || 0),\n      grossMargin:    parseFloat(financials.gross_margin || 0),\n      profitMargin:   parseFloat(financials.profit_margin || 0),\n      operatingMargin:parseFloat(financials.operating_margin || 0),\n\n      // ── Balance sheet ──\n      totalCash:  parseFloat(balanceSheet.total_cash_mrq || 0),\n      totalDebt:  parseFloat(balanceSheet.total_debt_mrq || 0),\n      debtToEquity: parseFloat(balanceSheet.total_debt_to_equity_mrq || 0),\n\n      // ── Cash flow ──\n      operatingCashFlow: parseFloat(cashFlow.operating_cash_flow_ttm || 0),\n      freeCashFlow:      parseFloat(cashFlow.levered_free_cash_flow_ttm || 0),\n\n      // ── Dividends ──\n      dividendYield: parseFloat(dividends.forward_annual_dividend_yield || 0),\n      dividendRate:  parseFloat(dividends.forward_annual_dividend_rate || 0),\n      payoutRatio:   parseFloat(dividends.payout_ratio || 0),\n\n      // ── Moving averages ──\n      ma50:  parseFloat(stockStats.day_50_ma || 0),\n      ma200: parseFloat(stockStats.day_200_ma || 0),\n\n      // ── Share stats ──\n      sharesOutstanding: parseInt(stockInfo.shares_outstanding || 0),\n      sharesFloat:       parseInt(stockInfo.float_shares || 0),\n      shortRatio:        parseFloat(stockInfo.short_ratio || 0),\n      institutionalHeld: parseFloat(stockInfo.percent_held_by_institutions || 0)\n    }\n  };\n}).filter(Boolean); // remove any nulls from errors\n\nmerged.sort((a, b) => b.json.marketCap - a.json.marketCap);\nreturn merged.slice(0, 5);\n"},"typeVersion":2},{"id":"34c4e8b8-2826-4c9a-a5bf-787f5b49b02e","name":"Analyze Sector","type":"n8n-nodes-base.code","position":[4304,880],"parameters":{"jsCode":"const stocks = $input.all().map(i => i.json);\nconst requestedSector = stocks[0]?.requestedSector || 'Unknown';\n\n// Sort by % change for performance ranking\nstocks.sort((a, b) => b.percentChange - a.percentChange);\n\n// ── Sector-wide calculations ──\nconst avgChange      = stocks.reduce((sum, s) => sum + s.percentChange, 0) / stocks.length;\nconst totalMarketCap = stocks.reduce((sum, s) => sum + s.marketCap, 0);\nconst totalRevenue   = stocks.reduce((sum, s) => sum + s.revenue, 0);\nconst totalEmployees = stocks.reduce((sum, s) => sum + s.employees, 0);\n\nconst validPE   = stocks.filter(s => s.peRatio > 0);\nconst avgPE     = validPE.length > 0 ? validPE.reduce((sum, s) => sum + s.peRatio, 0) / validPE.length : 0;\n\nconst validBeta = stocks.filter(s => s.beta > 0);\nconst avgBeta   = validBeta.length > 0 ? validBeta.reduce((sum, s) => sum + s.beta, 0) / validBeta.length : 0;\n\nconst avgProfitMargin  = stocks.reduce((sum, s) => sum + s.profitMargin, 0) / stocks.length;\nconst avgRevenueGrowth = stocks.reduce((sum, s) => sum + s.revenueGrowth, 0) / stocks.length;\n\nconst gainers   = stocks.filter(s => s.percentChange > 0).length;\nconst losers    = stocks.filter(s => s.percentChange < 0).length;\nconst unchanged = stocks.length - gainers - losers;\n\nconst industries = [...new Set(stocks.map(s => s.industry))];\n\n// ── Sector strength rating ──\nconst sectorStrength =\n  avgChange > 2   ? 'Very Strong 🚀' :\n  avgChange > 0.5 ? 'Strong 📈'      :\n  avgChange > -0.5? 'Neutral ➡️'     :\n  avgChange > -2  ? 'Weak 📉'        : 'Very Weak ⚠️';\n\n// ── Helper: format numbers ──\nconst fmt    = (n, d=2) => (n !== undefined && n !== null && !isNaN(n)) ? Number(n).toFixed(d) : 'N/A';\nconst fmtB   = (n)      => (n > 0) ? `$${(n / 1e9).toFixed(1)}B` : 'N/A';\nconst fmtT   = (n)      => (n > 0) ? `$${(n / 1e12).toFixed(2)}T` : 'N/A';\nconst fmtPct = (n)      => (n !== undefined && !isNaN(n)) ? `${(n * 100).toFixed(1)}%` : 'N/A';\nconst fmtChg = (n)      => (n >= 0 ? '+' : '') + fmt(n) + '%';\n\n// ── Investment recommendation ──\nconst top    = stocks[0];\nconst second = stocks[1];\nconst worst  = stocks[stocks.length - 1];\n\nconst recommendation =\n  avgChange > 1.5\n    ? `🟢 BULLISH OUTLOOK\n${requestedSector.toUpperCase()} sector showing strong momentum with average gain of ${fmtChg(avgChange)}.\nTop Picks: ${top?.ticker} (${fmtChg(top?.percentChange)}), ${second?.ticker} (${fmtChg(second?.percentChange)})\nStrategy: Consider sector rotation into ${requestedSector} for momentum play.`\n    : avgChange > 0\n    ? `🟡 MIXED OUTLOOK\n${requestedSector.toUpperCase()} sector showing modest performance (${fmtChg(avgChange)}).\nSelective Opportunity: ${top?.ticker} showing relative strength at ${fmtChg(top?.percentChange)}.\nStrategy: Stock-picking approach recommended. Focus on ${top?.industry} subsector.`\n    : `🔴 BEARISH OUTLOOK\n${requestedSector.toUpperCase()} sector under pressure with average decline of ${fmtChg(avgChange)}.\nWeakness: Broad-based selling across ${losers} of ${stocks.length} stocks.\nStrategy: Defensive positioning recommended. Wait for reversal signals before entry.`;\n\n// ── Build formatted report ──\nconst formatted = `\n╔══════════════════════════════════════════════════╗\n   SECTOR ANALYSIS: ${requestedSector.toUpperCase()}\n   Generated: ${new Date().toISOString()}\n   Source: Twelve Data API (Live)\n╚══════════════════════════════════════════════════╝\n\n📊 SECTOR OVERVIEW\n──────────────────────────────────────\nSector:              ${requestedSector}\nStocks Analysed:     ${stocks.length} (Top 5 by Market Cap)\nCombined Mkt Cap:    ${fmtT(totalMarketCap)}\nCombined Revenue:    ${fmtT(totalRevenue)}\nTotal Employees:     ${totalEmployees.toLocaleString()}\nAverage Change:      ${fmtChg(avgChange)}\nSector Strength:     ${sectorStrength}\nAvg P/E Ratio:       ${avgPE > 0 ? fmt(avgPE, 1) : 'N/A'}\nAvg Beta:            ${avgBeta > 0 ? fmt(avgBeta) : 'N/A'}\nAvg Profit Margin:   ${fmtPct(avgProfitMargin)}\nAvg Revenue Growth:  ${fmtPct(avgRevenueGrowth)}\n\n🏆 TOP PERFORMERS\n──────────────────────────────────────\n${stocks.slice(0, 3).map((s, i) => `${i + 1}. ${s.ticker} — ${s.name}\n   Industry:          ${s.industry}\n   Price:             $${fmt(s.price)} (${fmtChg(s.percentChange)})\n   Market Cap:        ${fmtB(s.marketCap)}\n   Revenue:           ${fmtB(s.revenue)}\n   P/E (TTM):         ${fmt(s.peRatio, 1)} | Forward P/E: ${fmt(s.forwardPE, 1)}\n   EPS:               $${fmt(s.eps)}\n   Beta:              ${fmt(s.beta)}\n   52W Range:         $${fmt(s.fiftyTwoWeekLow)} – $${fmt(s.fiftyTwoWeekHigh)}\n   MA50/MA200:        $${fmt(s.ma50)} / $${fmt(s.ma200)}\n   Profit Margin:     ${fmtPct(s.profitMargin)}\n   Revenue Growth:    ${fmtPct(s.revenueGrowth)}\n   Earnings Growth:   ${fmtPct(s.earningsGrowth)}\n   Free Cash Flow:    ${fmtB(s.freeCashFlow)}\n   Dividend Yield:    ${s.dividendYield > 0 ? fmtPct(s.dividendYield) : 'None'}\n   CEO:               ${s.ceo}\n   Employees:         ${s.employees?.toLocaleString()}`\n).join('\\n\\n')}\n\n📉 BOTTOM PERFORMERS\n──────────────────────────────────────\n${stocks.slice(-2).reverse().map(s => `• ${s.ticker} — ${s.name}\n  Price: $${fmt(s.price)} (${fmtChg(s.percentChange)}) | Mkt Cap: ${fmtB(s.marketCap)} | P/E: ${fmt(s.peRatio, 1)}`).join('\\n')}\n\n🏭 SECTOR COMPOSITION BY INDUSTRY\n──────────────────────────────────────\n${industries.map(ind => {\n  const indStocks = stocks.filter(s => s.industry === ind);\n  const indAvg = indStocks.reduce((sum, s) => sum + s.percentChange, 0) / indStocks.length;\n  const indCap = indStocks.reduce((sum, s) => sum + s.marketCap, 0);\n  return `${ind}\n  Stocks: ${indStocks.map(s => s.ticker).join(', ')} | Avg Change: ${fmtChg(indAvg)} | Cap: ${fmtB(indCap)}`;\n}).join('\\n')}\n\n📈 PERFORMANCE DISTRIBUTION\n──────────────────────────────────────\nGainers:   ${gainers} stock${gainers !== 1 ? 's' : ''}\nLosers:    ${losers} stock${losers !== 1 ? 's' : ''}\nUnchanged: ${unchanged} stock${unchanged !== 1 ? 's' : ''}\nBest:      ${top?.ticker} — ${top?.name} (${fmtChg(top?.percentChange)})\nWorst:     ${worst?.ticker} — ${worst?.name} (${fmtChg(worst?.percentChange)})\n\n💼 INVESTMENT RECOMMENDATION\n──────────────────────────────────────\n${recommendation}\n\nTop Pick:  ${top?.ticker} — ${top?.name}\n           Price: $${fmt(top?.price)} | P/E: ${fmt(top?.peRatio, 1)} | Beta: ${fmt(top?.beta)}\n\nAvoid:     ${worst?.ticker} — ${worst?.name}\n           Price: $${fmt(worst?.price)} | P/E: ${fmt(worst?.peRatio, 1)} | Beta: ${fmt(worst?.beta)}\n`;\n\nreturn [{\n  json: {\n    sector: requestedSector,\n    sectorStrength,\n    avgChange,\n    totalMarketCap,\n    totalRevenue,\n    totalEmployees,\n    avgPE,\n    avgBeta,\n    avgProfitMargin,\n    avgRevenueGrowth,\n    stockCount: stocks.length,\n    gainers,\n    losers,\n    unchanged,\n    industries,\n    topPerformer: top || null,\n    worstPerformer: worst || null,\n    stocks,\n    response: formatted\n  }\n}];\n"},"typeVersion":2},{"id":"4419b861-1932-4f0f-bc53-c5fe2810c065","name":"Merge2","type":"n8n-nodes-base.merge","position":[3856,880],"parameters":{"mode":"combine","options":{"includeUnpaired":true},"combineBy":"combineByPosition"},"typeVersion":3.2},{"id":"988626e1-9857-4660-91e4-71ee3c6a9a08","name":"Get Statistics1","type":"n8n-nodes-twelve-data.twelveData","position":[3632,976],"parameters":{"symbol":"={{ $json.ticker }}","resource":"fundamentals","operation":"getStatistics","requestOptions":{},"fundamentalsOptions":{}},"credentials":{"twelveDataApi":{"id":"credential-id","name":"Twelve Data account"}},"typeVersion":1},{"id":"7b5b70df-193c-46c7-867c-70ce4f360e1d","name":"Output2","type":"n8n-nodes-base.set","position":[4528,880],"parameters":{"options":{},"assignments":{"assignments":[{"id":"8abfef83-9577-4b54-9326-8d8e99b086a5","name":"response","type":"string","value":"={{ $json.response }}"}]}},"typeVersion":3.4},{"id":"6b538ff3-02bf-466a-a988-2fe4c785ac70","name":"Sticky Note5","type":"n8n-nodes-base.stickyNote","position":[1872,1376],"parameters":{"color":4,"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 streams in parallel** from Twelve Data: real-time quote, 90-day price time series, RSI, MACD, Bollinger Bands, company profile, and income statement\n- Merges all 7 streams into a single object, then calculates:\n  - **5-day price momentum** vs the prior 5-day average (Strong Bullish → Strong Bearish)\n  - **Volume trend** — recent 5-day average vs prior 5-day average\n  - **RSI signal** (Overbought / Oversold / Neutral)\n  - **MACD direction** (Bullish / Bearish based on histogram)\n  - **Bollinger Band position** (Above Upper / Below Lower / Inside Bands)\n  - **Revenue & net income YoY growth** from the two most recent fiscal years\n- Formats all data into a structured plain-text prompt including company overview, live market data, technical readings, fundamentals, and a 10-day price history table\n- Passes the formatted prompt to **GPT-4o** with a detailed institutional analyst system prompt instructing it to perform a pre-analysis scan before writing,\n then produce a structured report covering: Technical Analysis, Fundamental Assessment, Risk Assessment (with support/resistance/stop-loss), \nand a Final Verdict table with BUY/HOLD/SELL, price target, timeframe, conviction level and 3 data-backed reasons\n- Returns the AI-generated analysis plus the ticker back to the calling workflow"},"typeVersion":1},{"id":"d7c23b21-2392-47d1-a5d6-a33600b6a008","name":"Set Stock Ticker","type":"n8n-nodes-base.set","position":[3152,2080],"parameters":{"options":{},"assignments":{"assignments":[{"id":"08c75286-f81d-4665-b72f-092906af4997","name":"ticker","type":"string","value":"={{ ($json.query || $json.chatInput || $json.ticker || '').toString().trim().toUpperCase() }}"}]}},"typeVersion":3.4},{"id":"8b221d9b-1ff2-4d56-ad73-5ae5de6cdb07","name":"Get Real-Time Quote","type":"n8n-nodes-twelve-data.twelveData","position":[3680,1408],"parameters":{"symbol":"={{ $json.ticker }}","requestOptions":{},"additionalOptions":{}},"credentials":{"twelveDataApi":{"id":"credential-id","name":"Twelve Data account"}},"typeVersion":1},{"id":"47980839-b498-491a-84ba-04d64cd73cf8","name":"Get Time Series (90 days)","type":"n8n-nodes-twelve-data.twelveData","position":[3680,1632],"parameters":{"symbol":"={{ $json.ticker }}","operation":"getTimeSeries","requestOptions":{},"additionalOptions":{}},"credentials":{"twelveDataApi":{"id":"credential-id","name":"Twelve Data account"}},"typeVersion":1},{"id":"48347bba-8aad-425b-8962-82fa9a495064","name":"RSI Indicator","type":"n8n-nodes-twelve-data.twelveData","position":[3680,1856],"parameters":{"symbol":"={{ $json.ticker }}","resource":"technicalIndicators","operation":"rsi","requestOptions":{},"indicatorOptions":{}},"credentials":{"twelveDataApi":{"id":"credential-id","name":"Twelve Data account"}},"typeVersion":1},{"id":"3d6214b4-950f-4764-9066-7ff7f0b3766d","name":"MACD Indicator","type":"n8n-nodes-twelve-data.twelveData","position":[3680,2080],"parameters":{"symbol":"={{ $json.ticker }}","resource":"technicalIndicators","operation":"macd","requestOptions":{},"indicatorOptions":{}},"credentials":{"twelveDataApi":{"id":"credential-id","name":"Twelve Data account"}},"typeVersion":1},{"id":"2d4e439d-8c07-402d-bc3b-a2cac28b1239","name":"Bollinger Bands","type":"n8n-nodes-twelve-data.twelveData","position":[3680,2304],"parameters":{"symbol":"={{ $json.ticker }}","resource":"technicalIndicators","operation":"bbands","requestOptions":{},"indicatorOptions":{}},"credentials":{"twelveDataApi":{"id":"credential-id","name":"Twelve Data account"}},"typeVersion":1},{"id":"5db304ed-5e01-4fff-9f48-0a25ea4fc9c8","name":"Get Company Profile","type":"n8n-nodes-twelve-data.twelveData","position":[3680,2528],"parameters":{"symbol":"={{ $json.ticker }}","resource":"fundamentals","requestOptions":{},"fundamentalsOptions":{}},"credentials":{"twelveDataApi":{"id":"credential-id","name":"Twelve Data account"}},"typeVersion":1},{"id":"4f73ff69-42b4-43d4-8555-c15c8667ad4d","name":"Get Income Statement","type":"n8n-nodes-twelve-data.twelveData","position":[3680,2752],"parameters":{"symbol":"={{ $json.ticker }}","resource":"fundamentals","operation":"getIncomeStatement","requestOptions":{},"fundamentalsOptions":{}},"credentials":{"twelveDataApi":{"id":"credential-id","name":"Twelve Data account"}},"typeVersion":1},{"id":"61547754-81f5-415c-99d0-104eeedd6709","name":"Merge All Data","type":"n8n-nodes-base.merge","position":[4208,2048],"parameters":{"mode":"combine","options":{"includeUnpaired":true},"combineBy":"combineByPosition","numberInputs":7},"typeVersion":3,"alwaysOutputData":true},{"id":"3c40f494-839a-4839-a960-b25518f6ca60","name":"Format Data for AI","type":"n8n-nodes-base.code","position":[4416,2128],"parameters":{"jsCode":"const data = $input.first().json;\n\n// ── QUOTE ──────────────────────────────────────────\nconst quote = {\n  symbol:           data.symbol,\n  price:            parseFloat(data.close),\n  change:           parseFloat(data.change),\n  changePercent:    parseFloat(data.percent_change),\n  volume:           parseInt(data.volume),\n  avgVolume:        parseInt(data.average_volume),\n  prevClose:        parseFloat(data.previous_close),\n  high52w:          parseFloat(data.fifty_two_week?.high),\n  low52w:           parseFloat(data.fifty_two_week?.low),\n  isMarketOpen:     data.is_market_open\n};\n\n// ── COMPANY ────────────────────────────────────────\nconst company = {\n  name:        data.name,\n  ceo:         data.CEO,\n  sector:      data.sector,\n  industry:    data.industry,\n  employees:   data.employees,\n  website:     data.website,\n  description: data.description,\n  address:     `${data.address}, ${data.city}, ${data.state} ${data.zip}, ${data.country}`\n};\n\n// ── TECHNICALS (most recent day = values[0]) ───────\nconst t = data.values[0];\nconst technicals = {\n  date:         t.datetime,\n  rsi:          parseFloat(t.rsi),\n  macd:         parseFloat(t.macd),\n  macdSignal:   parseFloat(t.macd_signal),\n  macdHist:     parseFloat(t.macd_hist),\n  upperBand:    parseFloat(t.upper_band),\n  middleBand:   parseFloat(t.middle_band),\n  lowerBand:    parseFloat(t.lower_band),\n  rsiSignal:    parseFloat(t.rsi) > 70 ? 'OVERBOUGHT' : parseFloat(t.rsi) < 30 ? 'OVERSOLD' : 'NEUTRAL',\n  macdSignalDir: parseFloat(t.macd_hist) > 0 ? 'BULLISH' : 'BEARISH',\n  bbPosition:   parseFloat(data.close) > parseFloat(t.upper_band) ? 'ABOVE UPPER' :\n                parseFloat(data.close) < parseFloat(t.lower_band) ? 'BELOW LOWER' : 'INSIDE BANDS'\n};\n\n// ── PRICE MOMENTUM (5-day vs prior 5-day) ──────────\nconst recent5  = data.values.slice(0, 5).map(d => parseFloat(d.close));\nconst prior5   = data.values.slice(5, 10).map(d => parseFloat(d.close));\nconst recentAvg = recent5.reduce((a, b) => a + b) / 5;\nconst priorAvg  = prior5.reduce((a, b) => a + b) / 5;\nconst momentum  = ((recentAvg - priorAvg) / priorAvg) * 100;\nconst momentumLabel = momentum > 5 ? 'Strong Bullish' : momentum > 2 ? 'Bullish' :\n                      momentum > -2 ? 'Neutral' : momentum > -5 ? 'Bearish' : 'Strong Bearish';\n\n// ── VOLUME TREND ────────────────────────────────────\nconst recentVol = data.values.slice(0, 5).map(d => parseInt(d.volume));\nconst priorVol  = data.values.slice(5, 10).map(d => parseInt(d.volume));\nconst recentVolAvg = recentVol.reduce((a, b) => a + b) / 5;\nconst priorVolAvg  = priorVol.reduce((a, b) => a + b) / 5;\nconst volChange = ((recentVolAvg - priorVolAvg) / priorVolAvg) * 100;\nconst volLabel = volChange > 20 ? 'Increasing Significantly' : volChange > 5 ? 'Increasing' :\n                 volChange > -5 ? 'Stable' : volChange > -20 ? 'Decreasing' : 'Decreasing Significantly';\n\n// ── FUNDAMENTALS (most recent year = [0]) ──────────\nconst inc = data.income_statement[0];\nconst prev = data.income_statement[1];\nconst revenueGrowth = ((inc.sales - prev.sales) / prev.sales * 100).toFixed(2);\nconst netIncomeGrowth = ((inc.net_income - prev.net_income) / prev.net_income * 100).toFixed(2);\n\nconst fundamentals = {\n  fiscalYear:       inc.fiscal_date,\n  revenue:          inc.sales,\n  grossProfit:      inc.gross_profit,\n  operatingIncome:  inc.operating_income,\n  netIncome:        inc.net_income,\n  ebitda:           inc.ebitda,\n  epsBasic:         inc.eps_basic,\n  epsDiluted:       inc.eps_diluted,\n  revenueGrowthYoY: `${revenueGrowth}%`,\n  netIncomeGrowthYoY: `${netIncomeGrowth}%`,\n  rd:               inc.operating_expense?.research_and_development\n};\n\n// ── 30-DAY PRICE HISTORY ────────────────────────────\nconst priceHistory = data.values.map(d => ({\n  date:       d.datetime,\n  close:      parseFloat(d.close),\n  volume:     parseInt(d.volume),\n  rsi:        parseFloat(d.rsi),\n  macd:       parseFloat(d.macd),\n  upperBand:  parseFloat(d.upper_band),\n  lowerBand:  parseFloat(d.lower_band)\n}));\n\n// ── FORMATTED PROMPT FOR AI ─────────────────────────\nconst formattedData = `\nCOMPREHENSIVE STOCK ANALYSIS — ${quote.symbol}\nGenerated: ${new Date().toISOString()}\n\n═══════════════════════════════════════\nCOMPANY OVERVIEW\n═══════════════════════════════════════\nCompany:    ${company.name}\nCEO:        ${company.ceo}\nSector:     ${company.sector}\nIndustry:   ${company.industry}\nEmployees:  ${company.employees?.toLocaleString()}\nWebsite:    ${company.website}\nAddress:    ${company.address}\n${company.description}\n\n═══════════════════════════════════════\nCURRENT MARKET DATA\n═══════════════════════════════════════\nPrice:          $${quote.price}\nChange:         $${quote.change} (${quote.changePercent}%)\nPrevious Close: $${quote.prevClose}\nVolume:         ${quote.volume?.toLocaleString()}\nAvg Volume:     ${quote.avgVolume?.toLocaleString()}\n52-Week High:   $${quote.high52w}\n52-Week Low:    $${quote.low52w}\nMarket Open:    ${quote.isMarketOpen ? 'Yes' : 'No'}\n\n═══════════════════════════════════════\nTECHNICAL INDICATORS (${technicals.date})\n═══════════════════════════════════════\nRSI (14):         ${technicals.rsi} → ${technicals.rsiSignal}\nMACD:             ${technicals.macd}\nMACD Signal:      ${technicals.macdSignal}\nMACD Histogram:   ${technicals.macdHist} → ${technicals.macdSignalDir}\nBollinger Upper:  $${technicals.upperBand}\nBollinger Middle: $${technicals.middleBand}\nBollinger Lower:  $${technicals.lowerBand}\nPrice vs BB:      ${technicals.bbPosition}\n\nPrice Momentum (5d):  ${momentumLabel} (${momentum.toFixed(2)}%)\nVolume Trend (5d):    ${volLabel} (${volChange.toFixed(2)}%)\n\n═══════════════════════════════════════\nFUNDAMENTALS — FY ${fundamentals.fiscalYear}\n═══════════════════════════════════════\nRevenue:          $${(fundamentals.revenue / 1e9).toFixed(2)}B  (YoY: ${fundamentals.revenueGrowthYoY})\nGross Profit:     $${(fundamentals.grossProfit / 1e9).toFixed(2)}B\nOperating Income: $${(fundamentals.operatingIncome / 1e9).toFixed(2)}B\nNet Income:       $${(fundamentals.netIncome / 1e9).toFixed(2)}B  (YoY: ${fundamentals.netIncomeGrowthYoY})\nEBITDA:           $${(fundamentals.ebitda / 1e9).toFixed(2)}B\nEPS (Basic):      $${fundamentals.epsBasic}\nEPS (Diluted):    $${fundamentals.epsDiluted}\nR&D Spend:        $${(fundamentals.rd / 1e9).toFixed(2)}B\n\n═══════════════════════════════════════\n30-DAY PRICE HISTORY (10 Most Recent)\n═══════════════════════════════════════\n${priceHistory.slice(0, 10).map(d =>\n  `${d.date}: Close $${d.close} | RSI ${d.rsi} | Vol ${d.volume?.toLocaleString()}`\n).join('\\n')}\n`;\n\nreturn {\n  json: {\n    ticker:        quote.symbol,\n    formattedData: formattedData,\n    quote,\n    company,\n    technicals,\n    fundamentals,\n    priceHistory,\n    momentum:      { label: momentumLabel, value: momentum.toFixed(2) },\n    volumeTrend:   { label: volLabel, value: volChange.toFixed(2) }\n  }\n};\n"},"typeVersion":2},{"id":"10788863-1d94-4a23-8fc7-ca1723f815c2","name":"AI Analysis","type":"@n8n/n8n-nodes-langchain.openAi","position":[4640,2128],"parameters":{"modelId":{"__rl":true,"mode":"list","value":"gpt-4o","cachedResultName":"GPT-4O"},"options":{"topP":1,"maxTokens":4000,"temperature":0.3},"messages":{"values":[{"role":"system","content":"=You are ADE (Advanced Data Engine) — an institutional-grade stock analyst with deep expertise in technical pattern recognition, fundamental valuation, and risk-adjusted portfolio strategy. You analyse with the rigour of a hedge fund PM and communicate with the clarity of a Bloomberg senior analyst.\n\nYour analysis must be grounded entirely in the data provided. Never reference indicators or metrics that are not present in the data. Every price level, every signal, every recommendation must trace back to a specific number in the report.\n\n════════════════════════════════════════════\nPRE-ANALYSIS PROTOCOL (do this silently first)\n════════════════════════════════════════════\n\nBefore writing a single word of output, scan the full 30-day price history and note:\n1. RSI trajectory — was RSI rising or falling into today's reading? When was the last extreme (>70 or <30)?\n2. MACD history — when did MACD last cross the signal line? Is the histogram expanding or contracting?\n3. Bollinger Band width — are bands squeezing (narrowing) or expanding? Squeeze = breakout incoming\n4. Volume spikes — identify any days with volume significantly above average and note price direction that day\n5. Price structure — identify the highest close and lowest close in the 30-day window as resistance and support\n6. 52-week positioning — calculate where current price sits as a % between 52-week low and high\n\nOnly after completing this scan should you begin writing your output.\n\n════════════════════════════════════════════\nANALYTICAL FRAMEWORK\n════════════════════════════════════════════\n\nTECHNICAL ANALYSIS (40% weight)\nUse historical context, not just the current reading:\n- RSI: Current value + 30-day trend + last extreme + what the recovery/deterioration pattern suggests\n- MACD: Current reading + last crossover direction + histogram trend (expanding = strengthening, contracting = weakening momentum)\n- Bollinger Bands: Band width trend + price position + squeeze detection + breakout probability\n- Volume: 5-day average vs full 30-day average + any institutional accumulation/distribution signals\n\nFUNDAMENTAL ANALYSIS (30% weight)\nUse only the metrics present in the data:\n- Revenue growth quality: Is 6-year trend accelerating or decelerating?\n- Margin expansion: Is net income growing faster than revenue? Calculate net margin.\n- EBITDA margin: Calculate from provided EBITDA and Revenue\n- EPS trajectory: Growth rate + what it implies for shareholder value\n- R&D investment: Calculate as % of revenue + comment on innovation commitment\n\nRISK ASSESSMENT (20% weight)\n- Risk Score 1-10 (define clearly: 1=minimal risk, 10=extreme risk)\n- Support level: use the lowest close in the 30-day price history\n- Resistance level: use the highest close in the 30-day price history\n- Stop-loss: set below the identified support level with specific reasoning\n- Maximum downside: % from current price to stop-loss\n\nMARKET SENTIMENT (10% weight)\n- 5-day volume vs 30-day volume average (calculate both)\n- Price momentum direction and strength\n- Overall positioning assessment\n\n════════════════════════════════════════════\nOUTPUT FORMAT — MANDATORY, DO NOT DEVIATE\n════════════════════════════════════════════\n\n## 📊 [TICKER] STOCK ANALYSIS REPORT\n**Analyst:** ADE | **Date:** [date from data] | **Price:** $[current price]\n\n---\n\n### 🏢 COMPANY SNAPSHOT\n[2 sentences max — what they do and why it matters to investors right now]\n\n---\n\n### 📈 TECHNICAL ANALYSIS\n\n**RSI (14): [value] — [NEUTRAL/OVERBOUGHT/OVERSOLD]**\n[Comment on current reading, 30-day trajectory, and last extreme reached with date]\n\n**MACD: [BULLISH/BEARISH]**\n[Comment on last crossover, current histogram value, and whether momentum is strengthening or weakening]\n\n**Bollinger Bands**\n[Comment on band position, whether bands are squeezing or expanding, and breakout implication]\n\n**Volume Analysis**\n[5-day avg vs 30-day avg with calculated numbers — comment on accumulation or distribution pattern]\n\n**Key Price Levels**\n- 📗 Support: $[lowest close from 30-day history] ([date])\n- 📕 Resistance: $[highest close from 30-day history] ([date])\n- 📍 52-Week Range Position: [X]% above 52-week low | [Y]% below 52-week high\n\n---\n\n### 💰 FUNDAMENTAL ASSESSMENT\n\n**Revenue:** $[X]B | YoY Growth: [X]% | Trend: [Accelerating/Decelerating/Stable]\n**Net Income:** $[X]B | YoY Growth: [X]% | Net Margin: [calculated]%\n**EBITDA Margin:** [calculated]%\n**EPS (Diluted):** $[X] | Growth: [comment]\n**R&D Investment:** $[X]B ([calculated]% of revenue) | [Innovation commitment comment]\n\n[2-3 sentence narrative on overall fundamental health]\n\n---\n\n### ⚠️ RISK ASSESSMENT\n\n**Risk Score: [X]/10 — [LOW / MEDIUM / HIGH / VERY HIGH]**\n\n| Risk Factor | Detail |\n|---|---|\n| 🔴 Primary Risk | [specific, data-backed] |\n| 🟡 Secondary Risk | [specific, data-backed] |\n| 🟢 Key Upside | [specific, data-backed] |\n\n- **Support Level:** $[price] | **Stop-Loss:** $[price] ([X]% below current)\n- **Max Downside to Stop:** [X]%\n\n---\n\n### 🎯 FINAL VERDICT\n\n| Decision | Price Target | Timeframe | Conviction |\n|---|---|---|---|\n| **[BUY / HOLD / SELL]** | $[price] | [X weeks/months] | [HIGH / MEDIUM / LOW] |\n\n**Position Size:** [X]% of portfolio\n\n**Thesis — 3 Data-Backed Reasons:**\n1. [Specific reason with numbers from the report]\n2. [Specific reason with numbers from the report]\n3. [Specific reason with numbers from the report]\n\n**Action Plan:**\n1. [Entry/exit instruction with specific price level]\n2. [Stop-loss execution instruction]\n3. [What metric to monitor and at what threshold to reassess]\n\n---\n*⚠️ This report is generated by ADE for informational purposes only. It does not constitute financial advice. Past performance is not indicative of future results. Always conduct independent research and assess your personal risk tolerance before making investment decisions.*\n"},{"content":"={{ $json.formattedData }}"}]}},"credentials":{"openAiApi":{"id":"credential-id","name":"OpenAi account"}},"typeVersion":1.8},{"id":"590bb634-b05a-42b9-99aa-65d00fb12e43","name":"Response Output","type":"n8n-nodes-base.set","position":[5040,2128],"parameters":{"options":{},"assignments":{"assignments":[{"id":"ec15bd68-ba6f-429b-bb67-1cbfab5106bc","name":"response","type":"string","value":"={{ $json.message.content }}"},{"id":"9b863d18-bcdf-4939-bbff-ef09f098e2a6","name":"ticker","type":"string","value":"={{ $('Set Stock Ticker').item.json.ticker }}"}]}},"typeVersion":3.4},{"id":"c6efbd47-ca29-4023-bd01-216efdd96d20","name":"Sticky Note6","type":"n8n-nodes-base.stickyNote","position":[-256,-288],"parameters":{"color":4,"width":2408,"height":856,"content":""},"typeVersion":1}],"active":false,"pinData":{},"settings":{"availableInMCP":false,"executionOrder":"v1"},"versionId":"5367cad7-76f8-489d-ad70-b685835aa33a","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}]]}}},"lastUpdatedBy":1,"workflowInfo":{"nodeCount":53,"nodeTypes":{"n8n-nodes-base.if":{"count":1},"n8n-nodes-base.set":{"count":7},"n8n-nodes-base.code":{"count":8},"n8n-nodes-base.merge":{"count":4},"n8n-nodes-base.telegram":{"count":2},"n8n-nodes-base.stickyNote":{"count":7},"@n8n/n8n-nodes-langchain.agent":{"count":1},"n8n-nodes-base.telegramTrigger":{"count":1},"@n8n/n8n-nodes-langchain.openAi":{"count":1},"n8n-nodes-twelve-data.twelveData":{"count":14},"@n8n/n8n-nodes-langchain.toolWorkflow":{"count":4},"n8n-nodes-base.executeWorkflowTrigger":{"count":1},"@n8n/n8n-nodes-langchain.lmChatOpenRouter":{"count":1},"@n8n/n8n-nodes-langchain.memoryBufferWindow":{"count":1}}},"status":"published","readyToDemo":null,"user":{"name":"Femi Ad","username":"hgray","bio":"AI automation specialist with over 1 year of experience empowering entrepreneurs and business owners to scale their operations through intelligent workflow solutions. Leveraging my background in project management and IT, I help transform manual processes into streamlined automated systems. Book a discovery call to explore how custom AI solutions can accelerate your business growth","verified":true,"links":["https://hgray.agency"],"avatar":"https://gravatar.com/avatar/42969f2af3975748ca65af3f31b1b39f0c82eb685c2df0ad8cefa9f99b408dbd?r=pg&d=retro&size=200"},"nodes":[{"id":20,"icon":"fa:map-signs","name":"n8n-nodes-base.if","codex":{"data":{"alias":["Router","Filter","Condition","Logic","Boolean","Branch"],"details":"The IF node can be used to implement binary conditional logic in your workflow. You can set up one-to-many conditions to evaluate each item of data being inputted into the node. That data will either evaluate to TRUE or FALSE and route out of the node accordingly.\n\nThis node has multiple types of conditions: Bool, String, Number, and Date & Time.","resources":{"generic":[{"url":"https://n8n.io/blog/learn-to-automate-your-factorys-incident-reporting-a-step-by-step-guide/","icon":"🏭","label":"Learn to Automate Your Factory's Incident Reporting: A Step by Step Guide"},{"url":"https://n8n.io/blog/2021-the-year-to-automate-the-new-you-with-n8n/","icon":"☀️","label":"2021: The Year to Automate the New You with n8n"},{"url":"https://n8n.io/blog/why-business-process-automation-with-n8n-can-change-your-daily-life/","icon":"🧬","label":"Why business process automation with n8n can change your daily life"},{"url":"https://n8n.io/blog/create-a-toxic-language-detector-for-telegram/","icon":"🤬","label":"Create a toxic language detector for Telegram in 4 step"},{"url":"https://n8n.io/blog/no-code-ecommerce-workflow-automations/","icon":"store","label":"6 e-commerce workflows to power up your Shopify s"},{"url":"https://n8n.io/blog/how-to-build-a-low-code-self-hosted-url-shortener/","icon":"🔗","label":"How to build a low-code, self-hosted URL shortener in 3 steps"},{"url":"https://n8n.io/blog/automate-your-data-processing-pipeline-in-9-steps-with-n8n/","icon":"⚙️","label":"Automate your data processing pipeline in 9 steps"},{"url":"https://n8n.io/blog/how-to-get-started-with-crm-automation-and-no-code-workflow-ideas/","icon":"👥","label":"How to get started with CRM automation (with 3 no-code workflow ideas"},{"url":"https://n8n.io/blog/5-tasks-you-can-automate-with-notion-api/","icon":"⚡️","label":"5 tasks you can automate with the new Notion API "},{"url":"https://n8n.io/blog/automate-google-apps-for-productivity/","icon":"💡","label":"15 Google apps you can combine and automate to increase productivity"},{"url":"https://n8n.io/blog/automation-for-maintainers-of-open-source-projects/","icon":"🏷️","label":"How to automatically manage contributions to open-source projects"},{"url":"https://n8n.io/blog/how-uproc-scraped-a-multi-page-website-with-a-low-code-workflow/","icon":" 🕸️","label":"How uProc scraped a multi-page website with a low-code workflow"},{"url":"https://n8n.io/blog/5-workflow-automations-for-mattermost-that-we-love-at-n8n/","icon":"🤖","label":"5 workflow automations for Mattermost that we love at n8n"},{"url":"https://n8n.io/blog/why-this-product-manager-loves-workflow-automation-with-n8n/","icon":"🧠","label":"Why this Product Manager loves workflow automation with n8n"},{"url":"https://n8n.io/blog/sending-automated-congratulations-with-google-sheets-twilio-and-n8n/","icon":"🙌","label":"Sending Automated Congratulations with Google Sheets, Twilio, and n8n "},{"url":"https://n8n.io/blog/how-to-set-up-a-ci-cd-pipeline-with-no-code/","icon":"🎡","label":"How to set up a no-code CI/CD pipeline with GitHub and TravisCI"},{"url":"https://n8n.io/blog/benefits-of-automation-and-n8n-an-interview-with-hubspots-hugh-durkin/","icon":"🎖","label":"Benefits of automation and n8n: An interview with HubSpot's Hugh Durkin"},{"url":"https://n8n.io/blog/aws-workflow-automation/","label":"7 no-code workflow automations for Amazon Web Services"}],"primaryDocumentation":[{"url":"https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.if/"}]},"categories":["Core Nodes"],"nodeVersion":"1.0","codexVersion":"1.0","subcategories":{"Core Nodes":["Flow"]}}},"group":"[\"transform\"]","defaults":{"name":"If","color":"#408000"},"iconData":{"icon":"map-signs","type":"icon"},"displayName":"If","typeVersion":2,"nodeCategories":[{"id":9,"name":"Core Nodes"}]},{"id":24,"icon":"file:merge.svg","name":"n8n-nodes-base.merge","codex":{"data":{"alias":["Join","Concatenate","Wait"],"resources":{"generic":[{"url":"https://n8n.io/blog/how-to-sync-data-between-two-systems/","icon":"🏬","label":"How to synchronize data between two systems (one-way vs. two-way sync"},{"url":"https://n8n.io/blog/supercharging-your-conference-registration-process-with-n8n/","icon":"🎫","label":"Supercharging your conference registration process with n8n"},{"url":"https://n8n.io/blog/migrating-community-metrics-to-orbit-using-n8n/","icon":"📈","label":"Migrating Community Metrics to Orbit using n8n"},{"url":"https://n8n.io/blog/build-your-own-virtual-assistant-with-n8n-a-step-by-step-guide/","icon":"👦","label":"Build your own virtual assistant with n8n: A step by step guide"},{"url":"https://n8n.io/blog/sending-automated-congratulations-with-google-sheets-twilio-and-n8n/","icon":"🙌","label":"Sending Automated Congratulations with Google Sheets, Twilio, and n8n "},{"url":"https://n8n.io/blog/aws-workflow-automation/","label":"7 no-code workflow automations for Amazon Web Services"}],"primaryDocumentation":[{"url":"https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.merge/"}]},"categories":["Core Nodes"],"nodeVersion":"1.0","codexVersion":"1.0","subcategories":{"Core Nodes":["Flow","Data Transformation"]}}},"group":"[\"transform\"]","defaults":{"name":"Merge"},"iconData":{"type":"file","fileBuffer":"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTEyIiBoZWlnaHQ9IjUxMiIgdmlld0JveD0iMCAwIDUxMiA1MTIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMF8xMTc3XzUxOCkiPgo8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTAgNDhDMCAyMS40OTAzIDIxLjQ5MDMgMCA0OCAwSDExMkMxMzguNTEgMCAxNjAgMjEuNDkwMyAxNjAgNDhWNTZI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TIgMTA0IDExMkg1NkM1MS41ODE3IDExMiA0OCAxMDguNDE4IDQ4IDEwNFY1NkM0OCA1MS41ODE3IDUxLjU4MTcgNDggNTYgNDhIMTA0Wk00NTYgMjI0QzQ2MC40MTggMjI0IDQ2NCAyMjcuNTgyIDQ2NCAyMzJWMjgwQzQ2NCAyODQuNDE4IDQ2MC40MTggMjg4IDQ1NiAyODhINDA4QzQwMy41ODIgMjg4IDQwMCAyODQuNDE4IDQwMCAyODBWMjMyQzQwMCAyMjcuNTgyIDQwMy41ODIgMjI0IDQwOCAyMjRINDU2Wk0xMTIgNDA4QzExMiA0MDMuNTgyIDEwOC40MTggNDAwIDEwNCA0MDBINTZDNTEuNTgxNyA0MDAgNDggNDAzLjU4MiA0OCA0MDhWNDU2QzQ4IDQ2MC40MTggNTEuNTgxNyA0NjQgNTYgNDY0SDEwNEMxMDguNDE4IDQ2NCAxMTIgNDYwLjQxOCAxMTIgNDU2VjQwOFoiIGZpbGw9IiM1NEI4QzkiLz4KPC9nPgo8ZGVmcz4KPGNsaXBQYXRoIGlkPSJjbGlwMF8xMTc3XzUxOCI+CjxyZWN0IHdpZHRoPSI1MTIiIGhlaWdodD0iNTEyIiBmaWxsPSJ3aGl0ZSIvPgo8L2NsaXBQYXRoPgo8L2RlZnM+Cjwvc3ZnPgo="},"displayName":"Merge","typeVersion":3,"nodeCategories":[{"id":9,"name":"Core Nodes"}]},{"id":38,"icon":"fa:pen","name":"n8n-nodes-base.set","codex":{"data":{"alias":["Set","JS","JSON","Filter","Transform","Map"],"resources":{"generic":[{"url":"https://n8n.io/blog/learn-to-automate-your-factorys-incident-reporting-a-step-by-step-guide/","icon":"🏭","label":"Learn to Automate Your Factory's Incident Reporting: A Step by Step Guide"},{"url":"https://n8n.io/blog/2021-the-year-to-automate-the-new-you-with-n8n/","icon":"☀️","label":"2021: The Year to Automate the New You with n8n"},{"url":"https://n8n.io/blog/automatically-pulling-and-visualizing-data-with-n8n/","icon":"📈","label":"Automatically pulling and visualizing data with n8n"},{"url":"https://n8n.io/blog/database-monitoring-and-alerting-with-n8n/","icon":"📡","label":"Database Monitoring and Alerting with n8n"},{"url":"https://n8n.io/blog/automatically-adding-expense-receipts-to-google-sheets-with-telegram-mindee-twilio-and-n8n/","icon":"🧾","label":"Automatically Adding Expense Receipts to Google Sheets with Telegram, Mindee, Twilio, and n8n"},{"url":"https://n8n.io/blog/no-code-ecommerce-workflow-automations/","icon":"store","label":"6 e-commerce workflows to power up your Shopify s"},{"url":"https://n8n.io/blog/how-to-build-a-low-code-self-hosted-url-shortener/","icon":"🔗","label":"How to build a low-code, self-hosted URL shortener in 3 steps"},{"url":"https://n8n.io/blog/automate-your-data-processing-pipeline-in-9-steps-with-n8n/","icon":"⚙️","label":"Automate your data processing pipeline in 9 steps"},{"url":"https://n8n.io/blog/how-to-get-started-with-crm-automation-and-no-code-workflow-ideas/","icon":"👥","label":"How to get started with CRM automation (with 3 no-code workflow ideas"},{"url":"https://n8n.io/blog/5-tasks-you-can-automate-with-notion-api/","icon":"⚡️","label":"5 tasks you can automate with the new Notion API "},{"url":"https://n8n.io/blog/automate-google-apps-for-productivity/","icon":"💡","label":"15 Google apps you can combine and automate to increase productivity"},{"url":"https://n8n.io/blog/how-uproc-scraped-a-multi-page-website-with-a-low-code-workflow/","icon":" 🕸️","label":"How uProc scraped a multi-page website with a low-code workflow"},{"url":"https://n8n.io/blog/building-an-expense-tracking-app-in-10-minutes/","icon":"📱","label":"Building an expense tracking app in 10 minutes"},{"url":"https://n8n.io/blog/the-ultimate-guide-to-automate-your-video-collaboration-with-whereby-mattermost-and-n8n/","icon":"📹","label":"The ultimate guide to automate your video collaboration with Whereby, Mattermost, and n8n"},{"url":"https://n8n.io/blog/5-workflow-automations-for-mattermost-that-we-love-at-n8n/","icon":"🤖","label":"5 workflow automations for Mattermost that we love at n8n"},{"url":"https://n8n.io/blog/learn-to-build-powerful-api-endpoints-using-webhooks/","icon":"🧰","label":"Learn to Build Powerful API Endpoints Using Webhooks"},{"url":"https://n8n.io/blog/how-a-membership-development-manager-automates-his-work-and-investments/","icon":"📈","label":"How a Membership Development Manager automates his work and investments"},{"url":"https://n8n.io/blog/a-low-code-bitcoin-ticker-built-with-questdb-and-n8n-io/","icon":"📈","label":"A low-code bitcoin ticker built with QuestDB and n8n.io"},{"url":"https://n8n.io/blog/how-to-set-up-a-ci-cd-pipeline-with-no-code/","icon":"🎡","label":"How to set up a no-code CI/CD pipeline with GitHub and TravisCI"},{"url":"https://n8n.io/blog/benefits-of-automation-and-n8n-an-interview-with-hubspots-hugh-durkin/","icon":"🎖","label":"Benefits of automation and n8n: An interview with HubSpot's Hugh Durkin"},{"url":"https://n8n.io/blog/how-goomer-automated-their-operations-with-over-200-n8n-workflows/","icon":"🛵","label":"How Goomer automated their operations with over 200 n8n workflows"},{"url":"https://n8n.io/blog/aws-workflow-automation/","label":"7 no-code workflow automations for Amazon Web Services"}],"primaryDocumentation":[{"url":"https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.set/"}]},"categories":["Core Nodes"],"nodeVersion":"1.0","codexVersion":"1.0","subcategories":{"Core Nodes":["Data Transformation"]}}},"group":"[\"input\"]","defaults":{"name":"Edit Fields"},"iconData":{"icon":"pen","type":"icon"},"displayName":"Edit Fields (Set)","typeVersion":3,"nodeCategories":[{"id":9,"name":"Core Nodes"}]},{"id":49,"icon":"file:telegram.svg","name":"n8n-nodes-base.telegram","codex":{"data":{"alias":["human","form","wait","hitl","approval"],"resources":{"generic":[{"url":"https://n8n.io/blog/why-business-process-automation-with-n8n-can-change-your-daily-life/","icon":"🧬","label":"Why business process automation with n8n can change your daily life"},{"url":"https://n8n.io/blog/create-a-toxic-language-detector-for-telegram/","icon":"🤬","label":"Create a toxic language detector for Telegram in 4 step"},{"url":"https://n8n.io/blog/automatically-adding-expense-receipts-to-google-sheets-with-telegram-mindee-twilio-and-n8n/","icon":"🧾","label":"Automatically Adding Expense Receipts to Google Sheets with Telegram, Mindee, Twilio, and n8n"},{"url":"https://n8n.io/blog/no-code-ecommerce-workflow-automations/","icon":"store","label":"6 e-commerce workflows to power up your Shopify s"},{"url":"https://n8n.io/blog/world-poetry-day-workflow/","icon":"📜","label":"Celebrating World Poetry Day with a daily poem in Telegram"},{"url":"https://n8n.io/blog/using-automation-to-boost-productivity-in-the-workplace/","icon":"💪","label":"Using Automation to Boost Productivity in the Workplace"},{"url":"https://n8n.io/blog/how-to-set-up-a-ci-cd-pipeline-with-no-code/","icon":"🎡","label":"How to set up a no-code CI/CD pipeline with GitHub and TravisCI"},{"url":"https://n8n.io/blog/creating-scheduled-text-affirmations-with-n8n/","icon":"🤟","label":"Creating scheduled text affirmations with n8n"},{"url":"https://n8n.io/blog/creating-telegram-bots-with-n8n-a-no-code-platform/","icon":"💬","label":"Creating Telegram Bots with n8n, a No-Code Platform"},{"url":"https://n8n.io/blog/aws-workflow-automation/","label":"7 no-code workflow automations for Amazon Web Services"}],"primaryDocumentation":[{"url":"https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.telegram/"}],"credentialDocumentation":[{"url":"https://docs.n8n.io/integrations/builtin/credentials/telegram/"}]},"categories":["Communication","HITL"],"nodeVersion":"1.0","codexVersion":"1.0","subcategories":{"HITL":["Human in the Loop"]}}},"group":"[\"output\"]","defaults":{"name":"Telegram"},"iconData":{"type":"file","fileBuffer":"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiBmaWxsPSIjZmZmIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiIHN0cm9rZT0iIzAwMCIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIiB2aWV3Qm94PSIwIDAgNjYgNjYiPjx1c2UgeGxpbms6aHJlZj0iI2EiIHg9Ii41IiB5PSIuNSIvPjxzeW1ib2wgaWQ9ImEiIG92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xMDEtLjA3OS0uMTUxLS4yMjYtLjEwNy0uOTI5LjM0Mi0xNy4wMjUgMTAuNTA2LTE4LjgwMSAxMS42MjktLjEwNC4wNjYtLjM5NS4wMjMtLjM5NS4wMjMiLz48L2c+PC9zeW1ib2w+PC9zdmc+"},"displayName":"Telegram","typeVersion":1,"nodeCategories":[{"id":6,"name":"Communication"},{"id":28,"name":"HITL"}]},{"id":50,"icon":"file:telegram.svg","name":"n8n-nodes-base.telegramTrigger","codex":{"data":{"resources":{"generic":[{"url":"https://n8n.io/blog/create-a-toxic-language-detector-for-telegram/","icon":"🤬","label":"Create a toxic language detector for Telegram in 4 step"},{"url":"https://n8n.io/blog/automatically-adding-expense-receipts-to-google-sheets-with-telegram-mindee-twilio-and-n8n/","icon":"🧾","label":"Automatically Adding Expense Receipts to Google Sheets with Telegram, Mindee, Twilio, and n8n"},{"url":"https://n8n.io/blog/how-to-set-up-a-ci-cd-pipeline-with-no-code/","icon":"🎡","label":"How to set up a no-code CI/CD pipeline with GitHub and TravisCI"},{"url":"https://n8n.io/blog/creating-telegram-bots-with-n8n-a-no-code-platform/","icon":"💬","label":"Creating Telegram Bots with n8n, a No-Code Platform"},{"url":"https://n8n.io/blog/aws-workflow-automation/","label":"7 no-code workflow automations for Amazon Web Services"}],"primaryDocumentation":[{"url":"https://docs.n8n.io/integrations/builtin/trigger-nodes/n8n-nodes-base.telegramtrigger/"}],"credentialDocumentation":[{"url":"https://docs.n8n.io/integrations/builtin/credentials/telegram/"}]},"categories":["Communication"],"nodeVersion":"1.0","codexVersion":"1.0"}},"group":"[\"trigger\"]","defaults":{"name":"Telegram Trigger"},"iconData":{"type":"file","fileBuffer":"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiBmaWxsPSIjZmZmIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiIHN0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MDcxLTEuNTgyLS42MS0yLjMyMy0xLjk5OC0xMC4zNTItNy4zOTQtMTIuMTI2LTguNThhLjM0LjM0IDAgMCAxLS4xNDYtLjIzOWMtLjAyNS0uMTI1LjEwOC0uMjguMTA4LS4yOHMxMy45OC0xMi40MjcgMTQuMzUyLTEzLjczMWMuMDI5LS4xMDEtLjA3OS0uMTUxLS4yMjYtLjEwNy0uOTI5LjM0Mi0xNy4wMjUgMTAuNTA2LTE4LjgwMSAxMS42MjktLjEwNC4wNjYtLjM5NS4wMjMtLjM5NS4wMjMiLz48L2c+PC9zeW1ib2w+PC9zdmc+"},"displayName":"Telegram Trigger","typeVersion":1,"nodeCategories":[{"id":6,"name":"Communication"}]},{"id":565,"icon":"fa:sticky-note","name":"n8n-nodes-base.stickyNote","codex":{"data":{"alias":["Comments","Notes","Sticky"],"categories":["Core Nodes"],"nodeVersion":"1.0","codexVersion":"1.0","subcategories":{"Core Nodes":["Helpers"]}}},"group":"[\"input\"]","defaults":{"name":"Sticky Note","color":"#FFD233"},"iconData":{"icon":"sticky-note","type":"icon"},"displayName":"Sticky Note","typeVersion":1,"nodeCategories":[{"id":9,"name":"Core Nodes"}]},{"id":834,"icon":"file:code.svg","name":"n8n-nodes-base.code","codex":{"data":{"alias":["cpde","Javascript","JS","Python","Script","Custom Code","Function"],"details":"The Code node allows you to execute JavaScript in your workflow.","resources":{"primaryDocumentation":[{"url":"https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.code/"}]},"categories":["Development","Core Nodes"],"nodeVersion":"1.0","codexVersion":"1.0","subcategories":{"Core Nodes":["Helpers","Data Transformation"]}}},"group":"[\"transform\"]","defaults":{"name":"Code"},"iconData":{"type":"file","fileBuffer":"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTEyIiBoZWlnaHQ9IjUxMiIgdmlld0JveD0iMCAwIDUxMiA1MTIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2Zy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":"fa:sign-out-alt","name":"n8n-nodes-base.executeWorkflowTrigger","codex":{"data":{"resources":{"generic":[],"primaryDocumentation":[{"url":"https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.executeworkflowtrigger/"}]},"categories":["Core Nodes"],"nodeVersion":"1.0","codexVersion":"1.0","subcategories":{"Core Nodes":["Helpers"]}}},"group":"[\"trigger\"]","defaults":{"name":"When Executed by Another Workflow","color":"#ff6d5a"},"iconData":{"icon":"sign-out-alt","type":"icon"},"displayName":"Execute Workflow Trigger","typeVersion":1,"nodeCategories":[{"id":9,"name":"Core Nodes"}]},{"id":1119,"icon":"fa:robot","name":"@n8n/n8n-nodes-langchain.agent","codex":{"data":{"alias":["LangChain","Chat","Conversational","Plan and Execute","ReAct","Tools"],"resources":{"primaryDocumentation":[{"url":"https://docs.n8n.io/integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.agent/"}]},"categories":["AI","Langchain"],"subcategories":{"AI":["Agents","Root Nodes"]}}},"group":"[\"transform\"]","defaults":{"name":"AI Agent","color":"#404040"},"iconData":{"icon":"robot","type":"icon"},"displayName":"AI Agent","typeVersion":3,"nodeCategories":[{"id":25,"name":"AI"},{"id":26,"name":"Langchain"}]},{"id":1163,"icon":"fa:database","name":"@n8n/n8n-nodes-langchain.memoryBufferWindow","codex":{"data":{"resources":{"primaryDocumentation":[{"url":"https://docs.n8n.io/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.memorybufferwindow/"}]},"categories":["AI","Langchain"],"subcategories":{"AI":["Memory"],"Memory":["For beginners"]}}},"group":"[\"transform\"]","defaults":{"name":"Simple Memory"},"iconData":{"icon":"database","type":"icon"},"displayName":"Simple Memory","typeVersion":1,"nodeCategories":[{"id":25,"name":"AI"},{"id":26,"name":"Langchain"}]},{"id":1205,"icon":"fa:network-wired","name":"@n8n/n8n-nodes-langchain.toolWorkflow","codex":{"data":{"resources":{"primaryDocumentation":[{"url":"https://docs.n8n.io/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.toolworkflow/"}]},"categories":["AI","Langchain"],"subcategories":{"AI":["Tools"],"Tools":["Recommended Tools"]}}},"group":"[\"transform\"]","defaults":{"name":"Call n8n Workflow Tool"},"iconData":{"icon":"network-wired","type":"icon"},"displayName":"Call n8n Workflow Tool","typeVersion":2,"nodeCategories":[{"id":25,"name":"AI"},{"id":26,"name":"Langchain"}]},{"id":1250,"icon":"file:openAi.svg","name":"@n8n/n8n-nodes-langchain.openAi","codex":{"data":{"alias":["LangChain","ChatGPT","Sora","DallE","whisper","audio","transcribe","tts","assistant"],"resources":{"primaryDocumentation":[{"url":"https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-langchain.openai/"}]},"categories":["AI","Langchain"],"subcategories":{"AI":["Agents","Miscellaneous","Root Nodes"]}}},"group":"[\"transform\"]","defaults":{"name":"OpenAI"},"iconData":{"type":"file","fileBuffer":"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNDAiIGhlaWdodD0iNDAiIHZpZXdCb3g9IjAgMCA0MCA0MCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTM2Ljg2NzEgMTYuMzcxOEMzNy43NzQ2IDEzLjY0OCAzNy40NjIxIDEwLjY2NDIgMzYuMDEwOCA4LjE4NjYxQzMzLjgyODIgNC4zODY1MyAyOS40NDA3IDIuNDMxNDkgMjUuMTU1NiAzLjM1MTUxQzIzLjI0OTMgMS4yMDM5NiAyMC41MTA1IC0wLjAxNzMxNDggMTcuNjM5MiAwLjAwMDE4NTUzM0MxMy4yNTkxIC0wLjAwOTgxNDY4IDkuMzcyNzMgMi44MTAyNSA4LjAyNTIgNi45Nzc4M0M1LjIxMTM5IDcuNTU0MSAyLjc4MjU4IDkuMzE1MzggMS4zNjEzIDExLjgxMTdDLTAuODM3NDkzIDE1LjYwMTggLTAuMzM2MjMyIDIwLjM3OTQgMi42MDEzMyAyMy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penRouter","codex":{"data":{"resources":{"primaryDocumentation":[{"url":"https://docs.n8n.io/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.lmchatopenrouter/"}]},"categories":["AI","Langchain"],"subcategories":{"AI":["Language Models","Root Nodes"],"Language Models":["Chat Models (Recommended)"]}}},"group":"[\"transform\"]","defaults":{"name":"OpenRouter Chat Model"},"iconData":{"type":"file","fileBuffer":"data:image/svg+xml;base64,PHN2ZyBmaWxsPSIjOTRBM0I4IiBmaWxsLXJ1bGU9ImV2ZW5vZGQiIHdpZHRoPSI0MCIgaGVpZ2h0PSI0MCIgdmlld0JveD0iMCAwIDI0IDI0IiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjx0aXRsZT5PcGVuUm91dGVyPC90aXRsZT48cGF0aCBkPSJNMTYuODA0IDEuOTU3bDcuMjIgNC4xMDV2LjA4N0wxNi43MyAxMC4yMWwuMDE3LTIuMTE3LS44MjEtLjAzYy0xLjA1OS0uMDI4LTEuNjExLjAwMi0yLjI2OC4xMS0xLjA2NC4xNzUtMi4wMzguNTc3LTMuMTQ3IDEuMzUyTDguMzQ1IDExLjAzYy0uMjg0LjE5NS0uNDk1LjMzNi0uNjguNDU1bC0uNTE1LjMyMi0uMzk3LjIzNC4zODUuMjMuNTMuMzM4Yy40NzYuMzE0IDEuMTcuNzk2IDIuNzAxIDEuODY2IDEuMTEuNzc1IDIuMDgzIDEuMTc3IDMuMTQ3IDEuMzUybC4zLjA0NWMuNjk0LjA5MSAxLjM3NS4wOTQgMi44MjUuMDMzbC4wMjItMi4xNTkgNy4yMiA0LjEwNXYuMDg3TDE2LjU4OSAyMmwuMDE0LTEuODYyLS42MzUuMDIyYy0xLjM4Ni4wNDItMi4xMzcuMDAyLTMuMTM4LS4xNjItMS42OTQtLjI4LTMuMjYtLjkyNi00Ljg4MS0yLjA1OWwtMi4xNTgtMS41YTIxLjk5NyAyMS45OTcgMCAwMC0uNzU1LS40OThsLS40NjctLjI4YTU1LjkyNyA1NS45MjcgMCAwMC0uNzYtLjQzQzIuOTA4IDE0LjczLjU2MyAxNC4xMTYgMCAxNC4xMTZWOS44ODhsLjE0LjAwNGMuNTY0LS4wMDcgMi45MS0uNjIyIDMuODA5LTEuMTI0bDEuMDE2LS41OC40MzgtLjI3NGMuNDI4LS4yOCAxLjA3Mi0uNzI2IDIuNjg2LTEuODUzIDEuNjIxLTEuMTMzIDMuMTg2LTEuNzggNC44ODEtMi4wNTkgMS4xNTItLjE5IDEuOTc0LS4yMTMgMy44MTQtLjEzOGwuMDItMS45MDd6Ij48L3BhdGg+PC9zdmc+Cg=="},"displayName":"OpenRouter Chat Model","typeVersion":1,"nodeCategories":[{"id":25,"name":"AI"},{"id":26,"name":"Langchain"}]}],"categories":[{"id":44,"name":"Crypto Trading"},{"id":47,"name":"AI Chatbot"}],"image":[]}}