# templates

name: Automated Investor Intelligence: CrunchBase to Google Sheets Data Harvester
author_name: Yaron Been
author_username: yaron-nofluff
nodes_used: ["n8n-nodes-base.googleSheets","n8n-nodes-base.httpRequest","n8n-nodes-base.code"]
categories: []
created_at: 2025-06-06T13:41:28.967Z
updated_at: 2025-06-06T13:41:28.967Z
url: https://n8n.io/workflows/4731
scraped_at: 2025-06-19 22:48:38
description:
  🚀 Automated Investor Intelligence: CrunchBase to Google Sheets Data Harvester!

  Workflow Overview
  This cutting-edge n8n automation is a sophisticated investor intelligence tool designed to transform market research into actionable insights. By intelligently connecting CrunchBase, data processing, and Google Sheets, this workflow:

  Discovers Investor Insights: 
     Automatically retrieves latest investor data
     Tracks key investment organizations
     Eliminates manual market research efforts

  Intelligent Data Processing:
     Filters investor-specific organizations
     Extracts critical investment metrics
     Ensures comprehensive market intelligence

  Seamless Data Logging:
     Automatically updates Google Sheets
     Creates real-time investor database
     Enables rapid market trend analysis

  Scheduled Intelligence Gathering:
     Daily automated tracking
     Consistent investor insight updates
     Zero manual intervention required

  Key Benefits
  🤖 Full Automation: Zero-touch investor research
  💡 Smart Filtering: Targeted investment insights
  📊 Comprehensive Tracking: Detailed investor intelligence
  🌐 Multi-Source Synchronization: Seamless data flow

  Workflow Architecture

  🔹 Stage 1: Investor Discovery
  Scheduled Trigger**: Daily market scanning
  CrunchBase API Integration**
  Intelligent Filtering**:
    Investor-specific organizations
    Key investment metrics
    Most recent data

  🔹 Stage 2: Data Extraction
  Comprehensive Metadata Parsing**
  Key Information Retrieval**
  Structured Data Preparation**

  🔹 Stage 3: Data Logging
  Google Sheets Integration**
  Automatic Row Appending**
  Real-Time Database Updates**

  Potential Use Cases
  Venture Capitalists**: Investment ecosystem mapping
  Startup Scouts**: Investor trend analysis
  Market Researchers**: Comprehensive investment insights
  Business Development**: Strategic partnership identification
  Investment Analysts**: Market intelligence gathering

  Setup Requirements
  CrunchBase API
     API credentials
     Configured access permissions
     Investor organization tracking setup

  Google Sheets
     Connected Google account
     Prepared tracking spreadsheet
     Appropriate sharing settings

  n8n Installation
     Cloud or self-hosted instance
     Workflow configuration
     API credential management

  Future Enhancement Suggestions
  🤖 Advanced investment trend analysis
  📊 Multi-source investor aggregation
  🔔 Customizable alert mechanisms
  🌐 Expanded investment stage tracking
  🧠 Machine learning insights generation

  Technical Considerations
  Implement robust error handling
  Use secure API authentication
  Maintain flexible data processing
  Ensure compliance with API usage guidelines

  Ethical Guidelines
  Respect business privacy
  Use data for legitimate research
  Maintain transparent information gathering
  Provide proper attribution

  Hashtag Performance Boost 🚀
  #InvestorIntelligence #VentureCapital #MarketResearch #AIWorkflow #DataAutomation #StartupEcosystem #InvestmentTracking #BusinessIntelligence #TechInnovation #StartupFunding

  Workflow Visualization

  [Daily Trigger]
      ⬇️
  [Fetch Investor Data]
      ⬇️
  [Extract Investor Fields]
      ⬇️
  [Log to Google Sheets]

  Connect With Me

  Ready to revolutionize your investor research?

  📧 Email: Yaron@nofluff.online

  🎥 YouTube: @YaronBeen

  💼 LinkedIn: Yaron Been

  Transform your market intelligence with intelligent, automated workflows!

workflow_json:
  {"id":"8hRFK0iEjVKmthLq","meta":{"instanceId":"84ad02d6104594179f43f1ce9cfe3a81637b2faedb57dafcb9e649b7542988db","templateCredsSetupCompleted":true},"name":"CrunchBase Invester Data","tags":[],"nodes":[{"id":"49130296-ad2e-43f6-8ec4-7f72161a3a1b","name":"Daily Investor Data Trigger","type":"n8n-nodes-base.scheduleTrigger","position":[0,0],"parameters":{"rule":{"interval":[{"triggerAtHour":9}]}},"typeVersion":1.2},{"id":"24caa890-abba-435d-a385-18cdef03dfe2","name":"Fetch Crunchbase Investor Data","type":"n8n-nodes-base.httpRequest","position":[220,0],"parameters":{"url":"https://api.crunchbase.com/api/v4/searches/organizations","method":"POST","options":{},"jsonBody":"{\n  \"field_ids\": [\n    \"identifier\",\n    \"name\",\n    \"short_description\",\n    \"location_identifiers\",\n    \"investment_stage\"\n  ],\n  \"query\": [\n    {\n      \"type\": \"predicate\",\n      \"field_id\": \"organization_types\",\n      \"operator_id\": \"includes\",\n      \"values\": [\n        \"investor\"\n      ]\n    }\n  ],\n  \"limit\": 5\n}","sendBody":true,"sendHeaders":true,"specifyBody":"json","headerParameters":{"parameters":[{"name":"Authorization","value":"Bearer YOUR_CRUNCHBASE_API_KEY"},{"name":"Authorization","value":"Bearer YOUR_CRUNCHBASE_API_KEY"}]}},"typeVersion":4.2},{"id":"4de0847b-6e11-457d-b04b-d03b4fb1e3c1","name":"Extract Investor Fields","type":"n8n-nodes-base.code","position":[540,0],"parameters":{"jsCode":"const entities = items[0].json.entities;\n\nreturn entities.map(entity => {\n  return {\n    json: {\n      name: entity.name,\n      short_description: entity.short_description,\n      location_identifiers: entity.location_identifiers,\n      investment_stage: entity.investment_stage\n    }\n  };\n});\n"},"typeVersion":2},{"id":"a7d08f10-1fde-4e99-9127-bf12926d4197","name":"Append to Investor Sheet","type":"n8n-nodes-base.googleSheets","position":[780,0],"parameters":{"columns":{"value":{"Name":"={{ $json.name }}","Location":"={{ $json.location_identifiers }}","Investment Stage":"={{ $json.investment_stage }}","Short description":"={{ $json.short_description }}"},"schema":[{"id":"Name","type":"string","display":true,"required":false,"displayName":"Name","defaultMatch":false,"canBeUsedToMatch":true},{"id":"Short description","type":"string","display":true,"required":false,"displayName":"Short description","defaultMatch":false,"canBeUsedToMatch":true},{"id":"Location","type":"string","display":true,"required":false,"displayName":"Location","defaultMatch":false,"canBeUsedToMatch":true},{"id":"Investment Stage","type":"string","display":true,"removed":false,"required":false,"displayName":"Investment Stage","defaultMatch":false,"canBeUsedToMatch":true}],"mappingMode":"defineBelow","matchingColumns":[],"attemptToConvertTypes":false,"convertFieldsToString":false},"options":{},"operation":"append","sheetName":{"__rl":true,"mode":"list","value":"gid=0","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1XOUvOgrhDdOorEj0-TL4EiVygMd1wpD3cktI2_bm-Ww/edit#gid=0","cachedResultName":"Sheet1"},"documentId":{"__rl":true,"mode":"list","value":"1XOUvOgrhDdOorEj0-TL4EiVygMd1wpD3cktI2_bm-Ww","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1XOUvOgrhDdOorEj0-TL4EiVygMd1wpD3cktI2_bm-Ww/edit?usp=drivesdk","cachedResultName":"CrunchBase Invester List"}},"credentials":{"googleSheetsOAuth2Api":{"id":"Rp7XiR3hxJfv03ZO","name":"Google Sheets account"}},"typeVersion":4.5},{"id":"45c6eb29-4d24-49a6-b849-938b178b66c9","name":"Sticky Note","type":"n8n-nodes-base.stickyNote","position":[-40,-1700],"parameters":{"color":5,"width":420,"height":1900,"content":"### 🔷 **SECTION 1: Getting the Data from Crunchbase**\n\n#### 🧩 Nodes:\n\n1. 🕒 **Daily Investor Data Trigger**\n2. 🌐 **Fetch Crunchbase Investor Data**\n\n---\n\n#### 🔍 What Happens in This Section?\n\nThis section is all about **automatically pulling investor data from Crunchbase** on a scheduled basis, without any manual effort.\n\n---\n\n#### 🕒 1. **Daily Investor Data Trigger**\n\n> *\"When should the automation run?\"*\n\n* This **Schedule Trigger** node starts your workflow automatically at your chosen time.\n* For example, it could run every day at 8 AM.\n* It removes the need to remember to check Crunchbase manually.\n\n✅ *Beginner Benefit:*\n\n> Even if you’re not technical, you just set the schedule and let n8n run this job every day while you sleep ☕📊\n\n---\n\n#### 🌐 2. **Fetch Crunchbase Investor Data**\n\n> *\"Where do we get the data from?\"*\n\n* This **HTTP Request** node sends a **POST request** to [Crunchbase’s API](https://data.crunchbase.com/docs).\n\n* It includes a **filter** for organization types like `investor` and requests fields like:\n\n  * `name`\n  * `short_description`\n  * `location_identifiers`\n  * `investment_stage`\n\n* Crunchbase replies with a **JSON** file full of matching investors.\n\n✅ *Beginner Benefit:*\n\n> You don’t need to open a browser or search anything. This step collects live investor data from Crunchbase and brings it into your workflow for you 🚀\n\n---\n\n### ✅ What This Section Gives You:\n\nA **live, up-to-date snapshot** of investor information, **automatically pulled** from Crunchbase, without coding or clicking.\n\n---\n\n"},"typeVersion":1},{"id":"2dd2de36-770c-4833-884b-1525c1411d46","name":"Sticky Note1","type":"n8n-nodes-base.stickyNote","position":[480,-1400],"parameters":{"color":6,"width":460,"height":1600,"content":"### 🔷 **SECTION 2: Processing and Saving the Data**\n\n#### 🧩 Nodes:\n\n3. 🧮 **Extract Investor Fields**\n4. 📄 **Append to Investor Sheet**\n\n---\n\n#### 🔍 What Happens in This Section?\n\nNow that we have raw investor data, this section **cleans it up** and **stores it in a Google Sheet** for easy access and analysis.\n\n---\n\n#### 🧮 3. **Extract Investor Fields**\n\n> *\"Let’s clean and format the response.\"*\n\n* This **Code** node uses JavaScript to loop through the list of investors and extract just what you care about:\n\n  * ✅ Name\n  * 📝 Short description\n  * 🌍 Location\n  * 💰 Investment stage\n\n* Each investor becomes a **separate row-ready item** for Google Sheets.\n\n✅ *Beginner Benefit:*\n\n> You don’t need to look at messy data. This step reshapes it into a clean format automatically ✨\n\n---\n\n#### 📄 4. **Append to Investor Sheet**\n\n> *\"Store it somewhere useful.\"*\n\n* This **Google Sheets** node takes the cleaned data and **adds it to a selected sheet**.\n* It works like a magic assistant, typing the investor data into your spreadsheet row-by-row.\n* You now have a **running list** of investors to use for:\n\n  * 📈 Market research\n  * 🎯 Outreach planning\n  * 💡 Competitor benchmarking\n\n"},"typeVersion":1},{"id":"75231f28-c911-4bdc-a6a2-c6255d293eb3","name":"Sticky Note9","type":"n8n-nodes-base.stickyNote","position":[-1820,-1680],"parameters":{"color":4,"width":1300,"height":320,"content":"=======================================\n            WORKFLOW ASSISTANCE\n=======================================\nFor any questions or support, please contact:\n    Yaron@nofluff.online\n\nExplore more tips and tutorials here:\n   - YouTube: https://www.youtube.com/@YaronBeen/videos\n   - LinkedIn: https://www.linkedin.com/in/yaronbeen/\n=======================================\n"},"typeVersion":1},{"id":"c8a8156f-946e-4a50-8789-aff9c66bd9b6","name":"Sticky Note4","type":"n8n-nodes-base.stickyNote","position":[-1820,-1340],"parameters":{"color":4,"width":1289,"height":3278,"content":"## ✨ n8n Workflow: Investor Data Automation from Crunchbase to Google Sheets\n\n---\n\n### 🔷 **SECTION 1: Getting the Data from Crunchbase**\n\n#### 🧩 Nodes:\n\n1. 🕒 **Daily Investor Data Trigger**\n2. 🌐 **Fetch Crunchbase Investor Data**\n\n---\n\n#### 🔍 What Happens in This Section?\n\nThis section is all about **automatically pulling investor data from Crunchbase** on a scheduled basis, without any manual effort.\n\n---\n\n#### 🕒 1. **Daily Investor Data Trigger**\n\n> *\"When should the automation run?\"*\n\n* This **Schedule Trigger** node starts your workflow automatically at your chosen time.\n* For example, it could run every day at 8 AM.\n* It removes the need to remember to check Crunchbase manually.\n\n✅ *Beginner Benefit:*\n\n> Even if you’re not technical, you just set the schedule and let n8n run this job every day while you sleep ☕📊\n\n---\n\n#### 🌐 2. **Fetch Crunchbase Investor Data**\n\n> *\"Where do we get the data from?\"*\n\n* This **HTTP Request** node sends a **POST request** to [Crunchbase’s API](https://data.crunchbase.com/docs).\n\n* It includes a **filter** for organization types like `investor` and requests fields like:\n\n  * `name`\n  * `short_description`\n  * `location_identifiers`\n  * `investment_stage`\n\n* Crunchbase replies with a **JSON** file full of matching investors.\n\n✅ *Beginner Benefit:*\n\n> You don’t need to open a browser or search anything. This step collects live investor data from Crunchbase and brings it into your workflow for you 🚀\n\n---\n\n### ✅ What This Section Gives You:\n\nA **live, up-to-date snapshot** of investor information, **automatically pulled** from Crunchbase, without coding or clicking.\n\n---\n\n<br/>\n\n---\n\n### 🔷 **SECTION 2: Processing and Saving the Data**\n\n#### 🧩 Nodes:\n\n3. 🧮 **Extract Investor Fields**\n4. 📄 **Append to Investor Sheet**\n\n---\n\n#### 🔍 What Happens in This Section?\n\nNow that we have raw investor data, this section **cleans it up** and **stores it in a Google Sheet** for easy access and analysis.\n\n---\n\n#### 🧮 3. **Extract Investor Fields**\n\n> *\"Let’s clean and format the response.\"*\n\n* This **Code** node uses JavaScript to loop through the list of investors and extract just what you care about:\n\n  * ✅ Name\n  * 📝 Short description\n  * 🌍 Location\n  * 💰 Investment stage\n\n* Each investor becomes a **separate row-ready item** for Google Sheets.\n\n✅ *Beginner Benefit:*\n\n> You don’t need to look at messy data. This step reshapes it into a clean format automatically ✨\n\n---\n\n#### 📄 4. **Append to Investor Sheet**\n\n> *\"Store it somewhere useful.\"*\n\n* This **Google Sheets** node takes the cleaned data and **adds it to a selected sheet**.\n* It works like a magic assistant, typing the investor data into your spreadsheet row-by-row.\n* You now have a **running list** of investors to use for:\n\n  * 📈 Market research\n  * 🎯 Outreach planning\n  * 💡 Competitor benchmarking\n\n✅ *Beginner Benefit:*\n\n> You don’t copy-paste anything — n8n writes investor data into your sheet for you. It’s like having a personal assistant with no salary 📊🤖\n\n---\n\n### ✅ What This Section Gives You:\n\nA fully automated process that **cleans up Crunchbase data** and **stores it neatly** in Google Sheets — ready for analysis, dashboards, or reporting.\n\n---\n\n### 🎁 Final Outcome\n\n✅ No coding needed\n✅ Runs on autopilot\n✅ Clean data in your sheet\n✅ Use for strategy, marketing, or VC tracking\n\n---\n\n\n"},"typeVersion":1}],"active":false,"pinData":{"Fetch Crunchbase Investor Data":[{"json":{"paging":{"next_page":"cursor_string","total_items":1250,"current_page":1},"entities":[{"name":"Sequoia Capital","identifier":{"uuid":"12345","permalink":"sequoia-capital"},"investment_stage":["early_stage","seed"],"short_description":"Venture capital firm investing in early-stage companies.","location_identifiers":["united_states"]},{"name":"Andreessen Horowitz","identifier":{"uuid":"67890","permalink":"andreesen-horowitz"},"investment_stage":["seed","growth_stage"],"short_description":"Venture capital firm in Silicon Valley.","location_identifiers":["united_states"]}]}}]},"settings":{"executionOrder":"v1"},"versionId":"daeaf695-d4ae-460d-84b1-b4cdba520d28","connections":{"Extract Investor Fields":{"main":[[{"node":"Append to Investor Sheet","type":"main","index":0}]]},"Daily Investor Data Trigger":{"main":[[{"node":"Fetch Crunchbase Investor Data","type":"main","index":0}]]},"Fetch Crunchbase Investor Data":{"main":[[{"node":"Extract Investor Fields","type":"main","index":0}]]}}}


name: Daily Startup Intelligence: Crunchbase Updates to Email Digest with GPT
author_name: Yaron Been
author_username: yaron-nofluff
categories: []
created_at: 2025-06-06T13:43:04.848Z
updated_at: 2025-06-06T13:43:04.848Z
url: https://n8n.io/workflows/4732
scraped_at: 2025-06-19 22:48:58
description:
  🚀 Automated Startup Intelligence: CrunchBase Updates to Email Digest Workflow!

  Workflow Overview
  This cutting-edge n8n automation is a sophisticated startup intelligence tool designed to transform market research into actionable insights. By intelligently connecting CrunchBase, AI processing, and Gmail, this workflow:

  Discovers Startup Updates: 
     Automatically retrieves latest company information
     Tracks recent organizational changes
     Eliminates manual market research efforts

  Intelligent Data Processing:
     Filters and extracts key company details
     Generates AI-powered summaries
     Ensures comprehensive market intelligence

  Smart Summarization:
     Uses AI to create readable company updates
     Transforms complex data into digestible insights
     Provides professional, context-rich summaries

  Seamless Email Distribution:
     Automatically sends daily update digests
     Delivers insights directly to your inbox
     Enables rapid market awareness

  Key Benefits
  🤖 Full Automation: Zero-touch startup research
  💡 Smart Filtering: Targeted company insights
  📊 Comprehensive Tracking: Detailed market intelligence
  🌐 Multi-Source Synchronization: Seamless data flow

  Workflow Architecture

  🔹 Stage 1: Company Discovery
  Manual/Scheduled Trigger**: Market scanning
  CrunchBase API Integration**
  Intelligent Filtering**:
    Recent updates
    Specific time frames
    Key organizational information

  🔹 Stage 2: Data Extraction
  Comprehensive Metadata Parsing**
  Key Information Retrieval**
  Structured Data Preparation**

  🔹 Stage 3: AI Summarization
  OpenAI GPT Processing**
  Professional Summary Generation**
  Contextual Insight Creation**

  🔹 Stage 4: Email Distribution
  Gmail Integration**
  Automated Update Digest**
  Personalized Delivery**

  Potential Use Cases
  Venture Capitalists**: Startup ecosystem tracking
  Market Researchers**: Industry trend analysis
  Startup Founders**: Competitive intelligence
  Business Strategists**: Market opportunity identification
  Investors**: Real-time company insights

  Setup Requirements
  CrunchBase API
     API credentials
     Configured access permissions
     Company update tracking setup

  OpenAI API
     GPT model access
     Summarization configuration
     API key management

  Gmail Account
     Connected email
     Digest email configuration
     Appropriate sending permissions

  n8n Installation
     Cloud or self-hosted instance
     Workflow configuration
     API credential management

  Future Enhancement Suggestions
  🤖 Advanced company trend analysis
  📊 Multi-source intelligence gathering
  🔔 Customizable alert mechanisms
  🌐 Expanded industry tracking
  🧠 Machine learning insights generation

  Technical Considerations
  Implement robust error handling
  Use secure API authentication
  Maintain flexible data processing
  Ensure compliance with API usage guidelines

  Ethical Guidelines
  Respect business privacy
  Use data for legitimate research
  Maintain transparent information gathering
  Provide proper attribution

  Hashtag Performance Boost 🚀
  #StartupIntelligence #MarketResearch #AIWorkflow #CompanyUpdates #BusinessIntelligence #TechInnovation #DataAutomation #StartupEcosystem #InvestorInsights #TrendTracking

  Workflow Visualization

  [Manual/Scheduled Trigger]
      ⬇️
  [Fetch Crunchbase Updates]
      ⬇️
  [Extract Company Details]
      ⬇️
  [AI Summarization]
      ⬇️
  [Send Email Digest]

  Connect With Me

  Ready to revolutionize your startup intelligence?

  📧 Email: Yaron@nofluff.online

  🎥 YouTube: @YaronBeen

  💼 LinkedIn: Yaron Been

  Transform your market research with intelligent, automated workflows!

nodes_used:
  ["n8n-nodes-base.httpRequest","n8n-nodes-base.gmail","@n8n/n8n-nodes-langchain.agent","@n8n/n8n-nodes-langchain.lmChatOpenAi","@n8n/n8n-nodes-langchain.outputParserStructured"]

workflow_json:
  {"id":"wqZWgW8ymv4cC0Dk","meta":{"instanceId":"84ad02d6104594179f43f1ce9cfe3a81637b2faedb57dafcb9e649b7542988db","templateCredsSetupCompleted":true},"name":"Crunchbase Startup Activity Monitor","tags":[],"nodes":[{"id":"99e036b3-48e2-401d-91aa-e16a3b1951c2","name":"OpenAI Chat Model","type":"@n8n/n8n-nodes-langchain.lmChatOpenAi","position":[760,260],"parameters":{"model":{"__rl":true,"mode":"list","value":"gpt-4o-mini"},"options":{}},"credentials":{"openAiApi":{"id":"wYwTjEv45IzlAOAu","name":"OpenAi account 2"}},"typeVersion":1.2},{"id":"815b5136-f670-4302-afd2-48bb799a6085","name":"Structured Output Parser","type":"@n8n/n8n-nodes-langchain.outputParserStructured","position":[1000,260],"parameters":{"jsonSchemaExample":"{\n  \"subject\": \"🚀 Crunchbase Company Updates - June 5, 2025\",\n  \"body\": \"🚀 Here's a summary of recent company updates from Crunchbase:\\n\\n🔹 **OpenAI**\\nAI research and deployment company.\\nIndustry: Artificial Intelligence, Machine Learning\\nLocation: San Francisco, USA\\nLast Updated: June 5, 2025\\n\\n🔹 **DeepMind**\\nSolving intelligence to benefit humanity.\\nIndustry: Deep Learning, Healthcare\\nLocation: London, GBR\\nLast Updated: June 5, 2025\"\n}\n"},"typeVersion":1.2},{"id":"c11c92e9-6ec1-42a9-885a-636677735131","name":"Trigger Manual Test","type":"n8n-nodes-base.manualTrigger","position":[0,0],"parameters":{},"typeVersion":1},{"id":"18b76b77-e9ec-4f57-a2d5-74d80daeaa14","name":"Fetch Crunchbase Updates","type":"n8n-nodes-base.httpRequest","position":[220,0],"parameters":{"url":"https://api.crunchbase.com/api/v4/entities/organizations","options":{},"sendQuery":true,"sendHeaders":true,"queryParameters":{"parameters":[{"name":"user_key","value":"YOUR_API_KEY"},{"name":"updated_since","value":"2025-06-05"}]},"headerParameters":{"parameters":[{"name":"Accept","value":"application/json"}]}},"typeVersion":4.2},{"id":"5a5391e9-99f2-4658-879f-8e3c29d10511","name":"Extract Company Details","type":"n8n-nodes-base.set","position":[440,0],"parameters":{"options":{},"assignments":{"assignments":[{"id":"4bebf879-2d02-4fa8-ac71-91b7d83d3ed9","name":"data.items[0].properties.name","type":"string","value":"={{ $json.data.items[0].properties.name }}"},{"id":"31995946-952d-4dc3-ad4d-1bd925c11716","name":"data.items[0].properties.short_description","type":"string","value":"={{ $json.data.items[0].properties.short_description }}"},{"id":"2e3bd9f3-0c2a-49f5-b556-a392bb221790","name":"data.items[0].properties.categories","type":"string","value":"={{ $json.data.items[0].properties.categories }}"},{"id":"6af96090-ee35-49bd-9c08-a41b7f0c2e64","name":"data.items[0].properties.city_name","type":"string","value":"={{ $json.data.items[0].properties.city_name }}"},{"id":"ccb2b151-9184-4a50-8c80-b12ba95a13b3","name":"data.items[0].properties.country_code","type":"string","value":"={{ $json.data.items[0].properties.country_code }}"},{"id":"839bd2ea-e287-4fb7-902c-b7ea702692aa","name":"data.items[0].properties.updated_at","type":"string","value":"={{ $json.data.items[0].properties.updated_at }}"}]}},"typeVersion":3.4},{"id":"76b02289-ec75-4fc1-887e-b2ba0bc4d814","name":"Summarizer Agent","type":"@n8n/n8n-nodes-langchain.agent","position":[800,0],"parameters":{"text":"=Name: {{ $json.data.items[0].properties.name }}\nDescription: {{ $json.data.items[0].properties.short_description }}\ncategories: {{ $json.data.items[0].properties.categories }}\ncity name: {{ $json.data.items[0].properties.city_name }}\ncountry name: {{ $json.data.items[0].properties.country_code }}\nupdated at: {{ $json.data.items[0].properties.updated_at }}","options":{"systemMessage":"You are a helpful assistant that writes email-ready summaries of recent company updates from Crunchbase. \n\nThe input contains data about recently updated organizations including their name, description, categories, location, and update time.\n\nSummarize the companies clearly in a professional tone. Include:\n- Company name (bold or highlighted)\n- One-line description\n- Industry/categories (comma-separated)\n- Location (City, Country)\n- Last updated time (formatted)\n\nFormat it for a human reader in plain text or HTML for email use. Use line breaks or bullet points to separate companies.\nAvoid repeating keys or technical jargon.\n"},"promptType":"define","hasOutputParser":true},"typeVersion":1.9},{"id":"a6cd42af-6785-4b25-bdd9-f66badc98a65","name":"Send Email with Summary","type":"n8n-nodes-base.gmail","position":[1340,0],"webhookId":"99a34399-48a4-4133-a5d0-9852d7e383de","parameters":{"sendTo":"shahkar.genai@gmail.com","message":"={{ $json.output.body }}","options":{"appendAttribution":false},"subject":"={{ $json.output.subject }}"},"credentials":{"gmailOAuth2":{"id":"noKcKj5FEpHHvboL","name":"Gmail account"}},"typeVersion":2.1},{"id":"1036ea4c-3106-406f-b0c4-6b40b70a47f1","name":"Sticky Note","type":"n8n-nodes-base.stickyNote","position":[-40,-1280],"parameters":{"color":3,"width":640,"height":1460,"content":"## 🔹 **SECTION 1: Data Collection & Preprocessing**\n\n### 📍 Nodes Involved:\n\n* ✅ `Trigger Manual Test`\n* 🌐 `Fetch Crunchbase Updates`\n* ✏️ `Extract Company Details`\n\n---\n\n### 🧩 1. `Trigger Manual Test` 🖱️\n\n**Purpose:** This node is just for testing. It lets you **manually start** your workflow with a click.\n\n> 💡 In production, replace this with a **cron node** ⏰ if you want this workflow to run **automatically every day**.\n\n---\n\n### 🌐 2. `Fetch Crunchbase Updates` (HTTP Request)\n\n**Purpose:** This node sends a request to the [Crunchbase API](https://data.crunchbase.com/docs) to **fetch companies updated in the last 24 hours**.\n\n🔧 Here's what it does:\n\n* Makes a **GET request** to:\n  `https://api.crunchbase.com/api/v4/entities/organizations`\n* Adds parameters:\n\n  * `user_key`: Your Crunchbase API key 🔐\n  * `updated_since`: Yesterday’s date 📅\n\n> ✅ It returns a **list of updated companies** including names, descriptions, locations, and industries.\n\n---\n\n### ✏️ 3. `Extract Company Details`\n\n**Purpose:** Crunchbase API data can be complex. This node simplifies things.\n\n🛠 It:\n\n* Extracts **essential fields only** like:\n\n  * Name 🏢\n  * Description 📖\n  * Location 📍\n  * Industry 🏭\n  * Last Updated Date 🗓️\n* Prepares this data for the AI summarizer in a clean format.\n\n> 💡 This step ensures only the relevant information is passed forward, saving processing time and cost.\n\n---\n\n"},"typeVersion":1},{"id":"ccbc1ef4-0dbe-40c1-9a33-e6f6787d64d1","name":"Sticky Note1","type":"n8n-nodes-base.stickyNote","position":[680,-1220],"parameters":{"color":5,"width":500,"height":1640,"content":"## 🧠 **SECTION 2: AI Summary + Email Delivery**\n\n### 🤖 Nodes Involved:\n\n* 🧠 `Summarize Company Updates`\n* 💬 `OpenAI Chat (GPT-4 or GPT-3.5)`\n* 🔎 `Parse JSON Email Summary`\n\n---\n\n### 🤖 4. `Summarize Company Updates` (AI Agent)\n\n**Purpose:** This is where the **magic happens**. It takes the company data and feeds it to an AI to generate a **plain-English summary**.\n\n🛠 It connects with:\n\n* `OpenAI Chat Model` (GPT-4 / 3.5):\n  Generates clear, readable summaries.\n* `Structured Output Parser`:\n  Forces the AI to return a **valid JSON object** with:\n\n  * `subject`: for the email subject line\n  * `body`: the plain text of the email\n\n📜 **System Prompt Used**:\n\n```txt\nYou are a helpful assistant that summarizes Crunchbase company updates.\n\nOutput your response strictly as valid JSON with two properties: \n- \"subject\": a string for the email subject line.\n- \"body\": a string for the email content formatted in plain text. Use \"\\n\" for new lines inside the string.\n\nDo NOT output anything other than the JSON object.  \nEnsure the JSON is well-formed with no trailing commas or syntax errors.\n```\n\n---\n\n### 🔎 5. `Parse JSON Email Summary` (Structured Output Parser)\n\n**Purpose:** Ensures that the response from the AI is valid JSON and separates `subject` and `body`.\n\n✅ Without this, n8n can't reliably extract the email content from the AI's response.\n\n---\n\n\n"},"typeVersion":1},{"id":"4688303f-35a1-4f0c-bdf8-c66326c46eea","name":"Sticky Note2","type":"n8n-nodes-base.stickyNote","position":[1260,-360],"parameters":{"color":6,"width":300,"height":540,"content":"## 🧠 **SECTION 3: Send email with summary (Gmail)\n\n**Purpose:** Finally, this node sends you an email 📨 with the Crunchbase update summaries.\n\n🛠 It uses:\n\n* `{{$json.subject}}` for the email subject\n* `{{$json.body}}` for the content\n\n"},"typeVersion":1},{"id":"735ec384-c931-4ccd-8f10-5140beee552a","name":"Sticky Note9","type":"n8n-nodes-base.stickyNote","position":[-1460,-1280],"parameters":{"color":4,"width":1300,"height":320,"content":"=======================================\n            WORKFLOW ASSISTANCE\n=======================================\nFor any questions or support, please contact:\n    Yaron@nofluff.online\n\nExplore more tips and tutorials here:\n   - YouTube: https://www.youtube.com/@YaronBeen/videos\n   - LinkedIn: https://www.linkedin.com/in/yaronbeen/\n=======================================\n"},"typeVersion":1},{"id":"208f299f-4fe1-406e-8014-82e47d0a9a2f","name":"Sticky Note4","type":"n8n-nodes-base.stickyNote","position":[-1460,-940],"parameters":{"color":4,"width":1289,"height":3278,"content":" 🧠 Automating Crunchbase Insights with n8n\n\n### 📈 Get Daily Company Updates → 🤖 Summarize → 📧 Email Digest\n\nThis workflow helps you stay informed on the latest company activity (from Crunchbase) by automating the entire process — fetching updates, summarizing them with AI, and emailing them to you daily.\n\n---\n\n## 🔹 **SECTION 1: Data Collection & Preprocessing**\n\n### 📍 Nodes Involved:\n\n* ✅ `Trigger Manual Test`\n* 🌐 `Fetch Crunchbase Updates`\n* ✏️ `Extract Company Details`\n\n---\n\n### 🧩 1. `Trigger Manual Test` 🖱️\n\n**Purpose:** This node is just for testing. It lets you **manually start** your workflow with a click.\n\n> 💡 In production, replace this with a **cron node** ⏰ if you want this workflow to run **automatically every day**.\n\n---\n\n### 🌐 2. `Fetch Crunchbase Updates` (HTTP Request)\n\n**Purpose:** This node sends a request to the [Crunchbase API](https://data.crunchbase.com/docs) to **fetch companies updated in the last 24 hours**.\n\n🔧 Here's what it does:\n\n* Makes a **GET request** to:\n  `https://api.crunchbase.com/api/v4/entities/organizations`\n* Adds parameters:\n\n  * `user_key`: Your Crunchbase API key 🔐\n  * `updated_since`: Yesterday’s date 📅\n\n> ✅ It returns a **list of updated companies** including names, descriptions, locations, and industries.\n\n---\n\n### ✏️ 3. `Extract Company Details`\n\n**Purpose:** Crunchbase API data can be complex. This node simplifies things.\n\n🛠 It:\n\n* Extracts **essential fields only** like:\n\n  * Name 🏢\n  * Description 📖\n  * Location 📍\n  * Industry 🏭\n  * Last Updated Date 🗓️\n* Prepares this data for the AI summarizer in a clean format.\n\n> 💡 This step ensures only the relevant information is passed forward, saving processing time and cost.\n\n---\n\n## 🧠 **SECTION 2: AI Summary + Email Delivery**\n\n### 🤖 Nodes Involved:\n\n* 🧠 `Summarize Company Updates`\n* 💬 `OpenAI Chat (GPT-4 or GPT-3.5)`\n* 🔎 `Parse JSON Email Summary`\n* 📬 `Send Email with Summary`\n\n---\n\n### 🤖 4. `Summarize Company Updates` (AI Agent)\n\n**Purpose:** This is where the **magic happens**. It takes the company data and feeds it to an AI to generate a **plain-English summary**.\n\n🛠 It connects with:\n\n* `OpenAI Chat Model` (GPT-4 / 3.5):\n  Generates clear, readable summaries.\n* `Structured Output Parser`:\n  Forces the AI to return a **valid JSON object** with:\n\n  * `subject`: for the email subject line\n  * `body`: the plain text of the email\n\n📜 **System Prompt Used**:\n\n```txt\nYou are a helpful assistant that summarizes Crunchbase company updates.\n\nOutput your response strictly as valid JSON with two properties: \n- \"subject\": a string for the email subject line.\n- \"body\": a string for the email content formatted in plain text. Use \"\\n\" for new lines inside the string.\n\nDo NOT output anything other than the JSON object.  \nEnsure the JSON is well-formed with no trailing commas or syntax errors.\n```\n\n---\n\n### 🔎 5. `Parse JSON Email Summary` (Structured Output Parser)\n\n**Purpose:** Ensures that the response from the AI is valid JSON and separates `subject` and `body`.\n\n✅ Without this, n8n can't reliably extract the email content from the AI's response.\n\n---\n\n### 📧 6. `Send Email with Summary` (Gmail)\n\n**Purpose:** Finally, this node sends you an email 📨 with the Crunchbase update summaries.\n\n🛠 It uses:\n\n* `{{$json.subject}}` for the email subject\n* `{{$json.body}}` for the content\n\n> 💡 You can configure this to send it to your **team**, **investors**, or even yourself daily to stay updated.\n\n---\n\n## 🏁 What This Workflow Does for You\n\n✨ **Effortlessly monitor industry trends**\n📬 **Get a beautifully summarized digest every day**\n⏳ **Save hours of manual research**\n💡 **Perfect for startup founders, analysts, investors, and marketers**\n\n---\n\n## ✅ Bonus Tip for Beginners\n\nTo make this **run automatically every day**, add this node at the top:\n\n* 🕒 `Cron Node`\n  Set schedule: every day at 8 AM (or whenever you like)\n\n---\n"},"typeVersion":1}],"active":false,"pinData":{"Fetch Crunchbase Updates":[{"json":{"data":{"items":[{"type":"Organization","uuid":"123abc-456def","properties":{"name":"OpenAI","city_name":"San Francisco","categories":[{"name":"Artificial Intelligence"},{"name":"Machine Learning"}],"identifier":{"uuid":"123abc-456def","value":"OpenAI","image_id":"abcd1234","permalink":"openai"},"updated_at":"2025-06-05T12:34:56Z","country_code":"USA","short_description":"AI research and deployment company."}},{"type":"Organization","uuid":"789ghi-101jkl","properties":{"name":"DeepMind","city_name":"London","categories":[{"name":"Deep Learning"},{"name":"Healthcare"}],"identifier":{"uuid":"789ghi-101jkl","value":"DeepMind","image_id":"efgh5678","permalink":"deepmind"},"updated_at":"2025-06-05T09:12:45Z","country_code":"GBR","short_description":"Solving intelligence, to advance science and benefit humanity."}}],"paging":{"total_items":2,"current_page":1,"number_of_pages":1}}}}]},"settings":{"executionOrder":"v1"},"versionId":"5812b502-7fa9-4497-bcaa-3d0866c70c89","connections":{"Summarizer Agent":{"main":[[{"node":"Send Email with Summary","type":"main","index":0}]]},"OpenAI Chat Model":{"ai_languageModel":[[{"node":"Summarizer Agent","type":"ai_languageModel","index":0}]]},"Trigger Manual Test":{"main":[[{"node":"Fetch Crunchbase Updates","type":"main","index":0}]]},"Extract Company Details":{"main":[[{"node":"Summarizer Agent","type":"main","index":0}]]},"Fetch Crunchbase Updates":{"main":[[{"node":"Extract Company Details","type":"main","index":0}]]},"Structured Output Parser":{"ai_outputParser":[[{"node":"Summarizer Agent","type":"ai_outputParser","index":0}]]}}}


name: Automated Job Hunter: Upwork Opportunity Aggregator & AI-Powered Notifier
author_name: Yaron Been
author_username: yaron-nofluff
categories: []
created_at: 2025-06-06T13:44:04.045Z
updated_at: 2025-06-06T13:44:04.045Z
url: https://n8n.io/workflows/4733
scraped_at: 2025-06-19 22:48:40
description:
  🚀 Automated Job Hunter: Upwork Opportunity Aggregator & AI-Powered Notifier!

  Workflow Overview
  This cutting-edge n8n automation is a sophisticated job discovery and notification tool designed to transform freelance job hunting into a seamless, intelligent process. By intelligently connecting Apify, OpenAI, Google Sheets, and Gmail, this workflow:

  Discovers Job Opportunities: 
     Automatically scrapes Upwork job listings
     Tracks recent freelance opportunities
     Eliminates manual job searching efforts

  Intelligent Data Processing:
     Filters and extracts key job details
     Structures job information
     Ensures comprehensive opportunity tracking

  AI-Powered Summarization:
     Generates concise job summaries
     Creates human-readable job digests
     Provides quick, actionable insights

  Seamless Notification:
     Automatically logs jobs to Google Sheets
     Sends personalized email digests
     Enables rapid opportunity assessment

  Key Benefits
  🤖 Full Automation: Zero-touch job discovery
  💡 Smart Filtering: Targeted job opportunities
  📊 Comprehensive Tracking: Detailed job market insights
  🌐 Multi-Platform Synchronization: Seamless data flow

  Workflow Architecture

  🔹 Stage 1: Job Discovery
  Scheduled Trigger**: Daily job scanning
  Apify Integration**: Upwork job scraping
  Intelligent Filtering**:
    Recent job postings
    Specific keywords
    Relevant opportunities

  🔹 Stage 2: Data Extraction
  Comprehensive Job Metadata Parsing**
  Key Information Retrieval**
  Structured Data Preparation**

  🔹 Stage 3: AI Summarization
  OpenAI GPT Processing**
  Professional Summary Generation**
  Contextual Job Insight Creation**

  🔹 Stage 4: Multi-Platform Distribution
  Google Sheets Logging**
  Gmail Integration**
  Automated Job Digest Delivery**

  Potential Use Cases
  Freelancers**: Opportunity tracking
  Job Seekers**: Automated job discovery
  Recruitment Agencies**: Market intelligence
  Skill Development Professionals**: Trend monitoring
  Career Coaches**: Client opportunity identification

  Setup Requirements
  Apify
     Upwork scraping actor
     API token
     Configured scraping parameters

  OpenAI API
     GPT model access
     Summarization configuration
     API key management

  Google Sheets
     Connected Google account
     Prepared job tracking spreadsheet
     Appropriate sharing settings

  Gmail Account
     Connected email
     Job digest configuration
     Appropriate sending permissions

  n8n Installation
     Cloud or self-hosted instance
     Workflow configuration
     API credential management

  Future Enhancement Suggestions
  🤖 Advanced job matching algorithms
  📊 Multi-platform job aggregation
  🔔 Customizable alert mechanisms
  🌐 Expanded job category tracking
  🧠 Machine learning job recommendation

  Technical Considerations
  Implement robust error handling
  Use secure API authentication
  Maintain flexible data processing
  Ensure compliance with platform guidelines

  Ethical Guidelines
  Respect job poster privacy
  Use data for legitimate job searching
  Maintain transparent information gathering
  Provide proper attribution

  Hashtag Performance Boost 🚀
  #FreelanceJobHunting #CareerAutomation #JobDiscovery #AIJobSearch #WorkflowAutomation #FreelanceTech #CareerIntelligence #JobMarketInsights #ProfessionalNetworking #TechJobSearch

  Workflow Visualization

  [Daily Trigger]
      ⬇️
  [Fetch Upwork Jobs]
      ⬇️
  [Format Job Fields]
      ⬇️
  [Log to Google Sheets]
      ⬇️
  [AI Summarization]
      ⬇️
  [Send Email Digest]

  Connect With Me

  Ready to revolutionize your job hunting strategy?

  📧 Email: Yaron@nofluff.online

  🎥 YouTube: @YaronBeen

  💼 LinkedIn: Yaron Been

  Transform your job search with intelligent, automated workflows!

nodes_used:
  ["n8n-nodes-base.googleSheets","n8n-nodes-base.httpRequest","n8n-nodes-base.gmail","@n8n/n8n-nodes-langchain.agent","@n8n/n8n-nodes-langchain.lmChatOpenAi","@n8n/n8n-nodes-langchain.outputParserStructured"]

workflow_json:
  {"id":"Q4LhFRDraaQuorBs","meta":{"instanceId":"84ad02d6104594179f43f1ce9cfe3a81637b2faedb57dafcb9e649b7542988db","templateCredsSetupCompleted":true},"name":"Upwork Job Aggregator & Notifier","tags":[],"nodes":[{"id":"834d0a42-1398-4cd4-aaf3-b1164e00b4a8","name":"Daily Upwork Job Trigger","type":"n8n-nodes-base.scheduleTrigger","position":[0,0],"parameters":{"rule":{"interval":[{"triggerAtHour":9}]}},"typeVersion":1.2},{"id":"a0d54dfe-fc68-4020-b2ed-d191a57d5897","name":"Fetch Upwork Jobs (Apify)","type":"n8n-nodes-base.httpRequest","position":[220,0],"parameters":{"url":"https://api.apify.com/v2/actor-tasks/<YOUR_TASK_ID>/run-sync-get-dataset-items?token=<YOUR_API_TOKEN>","method":"POST","options":{}},"typeVersion":4.2},{"id":"a9812fc7-0fa5-492a-91aa-392d0c8ee43b","name":"Format Job Fields","type":"n8n-nodes-base.set","position":[440,0],"parameters":{"options":{},"assignments":{"assignments":[{"id":"24bd782a-a34f-4b98-8d8f-21763181677b","name":"title","type":"string","value":"={{ $json.title }}"},{"id":"ee879b3d-339a-44c2-9e11-f653edab2e7f","name":"url","type":"string","value":"={{ $json.url }}"},{"id":"b5ff7975-667b-4997-ac8f-acbe9a3b3b85","name":"description","type":"string","value":"={{ $json.description }}"},{"id":"29051fc3-e4f8-4e39-a024-d7b943271acc","name":"budget","type":"string","value":"={{ $json.budget }}"},{"id":"a6492128-a58a-4735-b427-12265f81da3a","name":"datePosted","type":"string","value":"={{ $json.datePosted }}"}]}},"typeVersion":3.4},{"id":"a996aa35-8f0d-4e1a-997b-4aadd402f65c","name":"Log Jobs to Google Sheet","type":"n8n-nodes-base.googleSheets","position":[740,0],"parameters":{"columns":{"value":{"url":"={{ $json.url }}","title":"={{ $json.title }}","budget":"={{ $json.budget }}","datePosted":"={{ $json.datePosted }}","description":"={{ $json.description }}"},"schema":[{"id":"title","type":"string","display":true,"required":false,"displayName":"title","defaultMatch":false,"canBeUsedToMatch":true},{"id":"url","type":"string","display":true,"required":false,"displayName":"url","defaultMatch":false,"canBeUsedToMatch":true},{"id":"description","type":"string","display":true,"required":false,"displayName":"description","defaultMatch":false,"canBeUsedToMatch":true},{"id":"budget","type":"string","display":true,"required":false,"displayName":"budget","defaultMatch":false,"canBeUsedToMatch":true},{"id":"datePosted","type":"string","display":true,"required":false,"displayName":"datePosted","defaultMatch":false,"canBeUsedToMatch":true}],"mappingMode":"defineBelow","matchingColumns":[],"attemptToConvertTypes":false,"convertFieldsToString":false},"options":{},"operation":"append","sheetName":{"__rl":true,"mode":"list","value":"gid=0","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1dEU6uMB4ehiGXjIExjtFQHvUjANRODawKMBGKDaTcEc/edit#gid=0","cachedResultName":"Sheet1"},"documentId":{"__rl":true,"mode":"list","value":"1dEU6uMB4ehiGXjIExjtFQHvUjANRODawKMBGKDaTcEc","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1dEU6uMB4ehiGXjIExjtFQHvUjANRODawKMBGKDaTcEc/edit?usp=drivesdk","cachedResultName":"Upwork Scraper"}},"credentials":{"googleSheetsOAuth2Api":{"id":"v021NCWuTwSSSXPP","name":"Google Sheets account 2"}},"typeVersion":4.5},{"id":"e0cd68e5-4d6d-479a-8a48-1faccc9f3ff7","name":"Summarize Job Listings","type":"@n8n/n8n-nodes-langchain.agent","position":[960,0],"parameters":{"text":"=Provide a summary of the upwork jobs. It should be in email format\n\nTitle: {{ $json.title }}\nURL: {{ $json.url }}\nDescription:{{ $json.description }}\nBudget:{{ $json.budget }}\nDate posted: {{ $json.datePosted }}","options":{},"promptType":"define","hasOutputParser":true},"typeVersion":1.9},{"id":"30002e32-6046-4e5c-a27f-a0d58f380ae9","name":"Send Job Summary Email","type":"n8n-nodes-base.gmail","position":[1500,0],"webhookId":"6937d724-5ede-4c56-83fd-fde84496eabd","parameters":{"sendTo":"shahkar.genai@gmail.com","message":"={{ $json.output.Summary }}","options":{},"subject":"={{ $json.output.subject }}"},"credentials":{"gmailOAuth2":{"id":"YMHjS2nJsRGP7svY","name":"Gmail account"}},"typeVersion":2.1},{"id":"a1fb5d66-b780-4b6b-96be-3391b6196301","name":"OpenAI Job Summarizer","type":"@n8n/n8n-nodes-langchain.lmChatOpenAi","position":[900,260],"parameters":{"model":{"__rl":true,"mode":"list","value":"gpt-4o-mini"},"options":{}},"credentials":{"openAiApi":{"id":"wYwTjEv45IzlAOAu","name":"OpenAi account 2"}},"typeVersion":1.2},{"id":"f79a7336-80fc-4832-862b-51d0d737d5a3","name":"Parse Summary Output","type":"@n8n/n8n-nodes-langchain.outputParserStructured","position":[1160,260],"parameters":{"jsonSchemaExample":"{\n  \"subject\": \"Upwork Job Opportunity: Webflow Expert Needed for Portfolio Website\",\n  \"Summary\": \"The client is seeking a designer with strong experience in Webflow to create a responsive and elegant portfolio site.\"\n}\n"},"typeVersion":1.2},{"id":"85465ead-0a06-455c-9308-866c092d8ef5","name":"Sticky Note","type":"n8n-nodes-base.stickyNote","position":[-60,-560],"parameters":{"color":3,"width":640,"height":760,"content":"### 🔁 **Section 1: Job Fetch & Preparation**\n\n📦 **Group Name**: `📥 Fetch & Prepare Upwork Jobs`\n\n#### ✅ **Included Nodes:**\n\n1. `🕒 Daily Upwork Job Trigger`\n2. `🌐 Fetch Upwork Jobs (Apify)`\n3. `🛠️ Format Job Fields`\n\n#### 📋 **What this group does:**\n\nThis group is responsible for automatically triggering the job search, pulling fresh job data from Upwork (via Apify), and formatting that data into a clean, structured format.\n\n#### 📌 **Highlights:**\n\n* Uses Apify’s `run-sync-get-dataset-items` to ensure you get fresh job results in one go.\n* Ensures only the required fields (like title, URL, budget) are passed forward.\n* Keeps your data clean and minimal for logging and summarization.\n\n---"},"typeVersion":1},{"id":"3699ba73-75ee-4bf2-91eb-8d0d05143321","name":"Sticky Note1","type":"n8n-nodes-base.stickyNote","position":[680,-620],"parameters":{"color":5,"width":620,"height":1040,"content":"### 📊 **Section 2: Data Logging & Summary Generation**\n\n📦 **Group Name**: `🧾 Log & Summarize Jobs`\n\n#### ✅ **Included Nodes:**\n\n1. `📈 Log Jobs to Google Sheet`\n2. `🤖 Summarize Job Listings`\n\n   * `🧠 OpenAI Job Summarizer`\n   * `📄 Parse Summary Output`\n\n#### 📋 **What this group does:**\n\nThis group handles the dual responsibility of:\n\n* Persistently logging all job entries to a **Google Sheet**\n* Generating a human-friendly **natural language summary** of the fetched jobs using the OpenAI model and parsing the result into clean output\n\n#### 💡 **Why this matters:**\n\n* Keeps historical records in Sheets ✅\n* Makes email digest more meaningful and less overwhelming for the reader 🧠\n\n---\n\n"},"typeVersion":1},{"id":"2289feb5-9ab1-4dbb-a77e-f4742f0f341d","name":"Sticky Note2","type":"n8n-nodes-base.stickyNote","position":[1400,-420],"parameters":{"color":6,"width":340,"height":600,"content":"## 📤 **Section 3: Job Summary Notification**\n\n📦 **Group Name**: `✉️ Notify via Email`\n\n#### ✅ **Included Node:**\n\n1. `📧 Send Job Summary Email`\n\n#### 📋 **What this group does:**\n\nSends a **summary email** to the desired recipient(s) with the content generated by the AI agent.\n\n"},"typeVersion":1},{"id":"95727922-4856-4481-acff-519638ac5d23","name":"Sticky Note9","type":"n8n-nodes-base.stickyNote","position":[-1520,-560],"parameters":{"color":4,"width":1300,"height":320,"content":"=======================================\n            WORKFLOW ASSISTANCE\n=======================================\nFor any questions or support, please contact:\n    Yaron@nofluff.online\n\nExplore more tips and tutorials here:\n   - YouTube: https://www.youtube.com/@YaronBeen/videos\n   - LinkedIn: https://www.linkedin.com/in/yaronbeen/\n=======================================\n"},"typeVersion":1},{"id":"c161b105-70a6-431a-91e2-9031ccba8fe4","name":"Sticky Note4","type":"n8n-nodes-base.stickyNote","position":[-1520,-220],"parameters":{"color":4,"width":1289,"height":3058,"content":"# ✅ n8n Automation: \"Upwork Job Aggregator & Notifier\"\n\n> **Purpose**: Automatically fetch job postings from Upwork with specific keywords, save them in Google Sheets, summarize them using AI, and email the results daily (or at any interval you want).\n\n---\n\n## 🧱 HIGH-LEVEL OVERVIEW\n\n| Feature         | Description                                          |\n| --------------- | ---------------------------------------------------- |\n| 🕐 Trigger      | Scheduled (e.g., every 6 hours)                      |\n| 🌐 Source       | [Apify](https://apify.com) actor for Upwork scraping |\n| 📄 Storage      | Google Sheets                                        |\n| 🧠 Summary      | OpenAI model with structured output                  |\n| 📬 Notification | Gmail with formatted job summary                     |\n\n---\n\n## 🧠 GROUP 1: 📥 Fetch & Prepare Upwork Jobs\n\n### 🟢 Nodes:\n\n1. `🕒 Daily Upwork Job Trigger`\n\n   * **Type**: Cron Trigger\n   * **Purpose**: Runs the flow automatically at your set interval (e.g., every 6 hours or daily)\n\n2. `🌐 Fetch Upwork Jobs (Apify)`\n\n   * **Type**: HTTP Request\n   * **Method**: POST\n   * **URL**: `https://api.apify.com/v2/actor-tasks/<TASK_ID>/run-sync-get-dataset-items?token=<API_TOKEN>`\n   * **Purpose**: Calls your Apify Upwork Scraper task to get the latest job listings\n   * **Output**: JSON array of job objects\n\n3. `🛠️ Format Job Fields`\n\n   * **Type**: Edit Fields (Set or Function Node)\n   * **Purpose**: Extracts needed job fields like `title`, `url`, `description`, `budget`, and `datePosted`\n   * **Reason**: Makes data uniform for Sheet storage and AI summary\n\n---\n\n## 📊 GROUP 2: 🧾 Log & Summarize Jobs\n\n### 🟢 Nodes:\n\n4. `📈 Log Jobs to Google Sheet`\n\n   * **Type**: Google Sheets → Append Sheet\n   * **Sheet Setup**: Must have headers like `Title`, `URL`, `Description`, `Budget`, `Date`\n   * **Purpose**: Appends each new job as a row in the sheet for historical tracking\n\n5. `🤖 Summarize Job Listings` (AI Agent node group)\n\n   * **Type**: Tools Agent (LangChain / OpenAI Integration)\n   * **Connected Sub-Nodes**:\n\n     * `🧠 OpenAI Job Summarizer` (OpenAI Chat Model)\n\n       * **Prompt** example:\n\n         ```\n         You are an assistant summarizing freelance job postings. Summarize each job in 1-2 lines. Include title, budget, and a short description.\n         ```\n     * `📄 Parse Summary Output` (Structured Output Parser)\n\n       * **Purpose**: Converts the AI response into structured n8n items\n   * **Input**: Job data from Google Sheets\n   * **Output**: A clear, natural language summary of all jobs\n\n---\n\n## 📤 GROUP 3: ✉️ Notify via Email\n\n### 🟢 Node:\n\n6. `📧 Send Job Summary Email`\n\n   * **Type**: Gmail → Send Message\n\n   * **Authentication**: Google OAuth2\n\n   * **To**: Yourself or your team\n\n   * **Subject**: `\"🚀 New Upwork Jobs Found!\"`\n\n   * **Body**:\n\n     ```\n     Hello,\n\n     Here’s a summary of the latest Upwork jobs matching your criteria:\n\n     {{summary from AI}}\n\n     ➕ View full job list here: [Google Sheet Link]\n\n     Best,  \n     Your Automation Bot 🤖\n     ```\n\n   * **Error Handling**: Add an IF node to prevent email if no jobs were returned (optional)\n\n---\n\n## 🗂 Suggested Color-Coded Groups in n8n:\n\n| Group                          | Nodes                                | Color     | Description                     |\n| ------------------------------ | ------------------------------------ | --------- | ------------------------------- |\n| 📥 Fetch & Prepare Upwork Jobs | Trigger, HTTP Request, Format Fields | 🟢 Green  | Gets data and prepares it       |\n| 🧾 Log & Summarize Jobs        | Google Sheets, AI Agent, Parser      | 🟡 Yellow | Logs + creates smart summaries  |\n| ✉️ Notify via Email            | Gmail                                | 🔴 Red    | Notifies you with clean summary |\n\n---\n\n## 🚀 ADVANTAGES\n\n✅ Completely automated\n✅ Saves all job history\n✅ AI-enhanced summaries\n✅ Instant email alerts\n✅ Easy to expand or customize\n\n---\n\n## 🧩 Bonus Enhancements (Optional)\n\n| Idea                      | Description                                                   |\n| ------------------------- | ------------------------------------------------------------- |\n| 🔍 Add keyword filters    | Add filters before saving to Sheets (e.g., only “React” jobs) |\n| 🕵️‍♂️ Prevent duplicates | Store job IDs and check before saving                         |\n| 📣 Add Slack alerts       | Add Slack node for team notification                          |\n| 📊 Dashboard              | Build Google Data Studio report over the Sheet                |\n\n---\n\n\n"},"typeVersion":1}],"active":false,"pinData":{"Fetch Upwork Jobs (Apify)":[{"json":{"url":"https://www.upwork.com/job/Looking-Webflow-Expert-Build-Portfolio-Website_~01abcd123456efghij","title":"Looking for a Webflow Expert to Build a Portfolio Website","budget":"$300","datePosted":"2025-06-03T08:45:00Z","description":"Need a designer with strong Webflow experience to create a responsive and elegant portfolio site."}},{"json":{"url":"https://www.upwork.com/job/React-Developer-Needed-SaaS-Dashboard_~0123abcd4567efghij","title":"React Developer Needed for SaaS Dashboard","budget":"$500","datePosted":"2025-06-03T06:30:00Z","description":"Looking for an experienced React developer to work on our SaaS product dashboard UI. Experience with Tailwind is a plus."}},{"json":{"url":"https://www.upwork.com/job/Copywriter-Landing-Page-Finance_~0a1b2c3d4e5f67890","title":"Copywriter for Landing Page Content (Finance Industry)","budget":"$150","datePosted":"2025-06-02T21:15:00Z","description":"We need SEO-optimized copy for a fintech landing page. Prior experience in finance writing preferred."}}]},"settings":{"executionOrder":"v1"},"versionId":"8c929fc6-2198-4adf-89c3-ff0a2b296fdd","connections":{"Format Job Fields":{"main":[[{"node":"Log Jobs to Google Sheet","type":"main","index":0}]]},"Parse Summary Output":{"ai_outputParser":[[{"node":"Summarize Job Listings","type":"ai_outputParser","index":0}]]},"OpenAI Job Summarizer":{"ai_languageModel":[[{"node":"Summarize Job Listings","type":"ai_languageModel","index":0}]]},"Summarize Job Listings":{"main":[[{"node":"Send Job Summary Email","type":"main","index":0}]]},"Daily Upwork Job Trigger":{"main":[[{"node":"Fetch Upwork Jobs (Apify)","type":"main","index":0}]]},"Log Jobs to Google Sheet":{"main":[[{"node":"Summarize Job Listings","type":"main","index":0}]]},"Fetch Upwork Jobs (Apify)":{"main":[[{"node":"Format Job Fields","type":"main","index":0}]]}}}


name: Automated Job Market Tracker: Upwork Scraper to Google Sheets Workflow
author_name: Yaron Been
author_username: yaron-nofluff
nodes_used: ["n8n-nodes-base.googleSheets","n8n-nodes-base.httpRequest"]
categories: []
created_at: 2025-06-06T13:45:01.910Z
updated_at: 2025-06-06T13:45:01.910Z
url: https://n8n.io/workflows/4734
scraped_at: 2025-06-19 22:49:46
description:
  🚀 Automated Job Market Tracker: Upwork Scraper to Google Sheets Workflow!

  Workflow Overview
  This cutting-edge n8n automation is a sophisticated job market intelligence tool designed to transform freelance job tracking into a seamless, data-driven process. By intelligently connecting Apify, data processing, and Google Sheets, this workflow:

  Discovers Job Opportunities: 
     Automatically scrapes Upwork job listings
     Tracks recent freelance postings
     Eliminates manual job market research

  Intelligent Data Processing:
     Filters and extracts key job details
     Structures job information
     Ensures comprehensive opportunity tracking

  Seamless Data Logging:
     Automatically updates Google Sheets
     Creates real-time job market database
     Enables rapid market trend analysis

  Scheduled Intelligence Gathering:
     Periodic automated tracking
     Consistent job listing updates
     Zero manual intervention required

  Key Benefits
  🤖 Full Automation: Zero-touch job market research
  💡 Smart Filtering: Targeted job opportunity insights
  📊 Comprehensive Tracking: Detailed freelance market intelligence
  🌐 Multi-Source Synchronization: Seamless data flow

  Workflow Architecture

  🔹 Stage 1: Job Discovery
  Scheduled Trigger**: Periodic market scanning
  Apify Integration**: Upwork job scraping
  Intelligent Filtering**:
    Recent job postings
    Specific keywords
    Relevant opportunities

  🔹 Stage 2: Data Extraction
  Comprehensive Job Metadata Parsing**
  Key Information Retrieval**
  Structured Data Preparation**

  🔹 Stage 3: Data Logging
  Google Sheets Integration**
  Automatic Row Appending**
  Real-Time Database Updates**

  Potential Use Cases
  Freelancers**: Market trend tracking
  Job Seekers**: Opportunity intelligence
  Recruitment Agencies**: Market analysis
  Skill Development Professionals**: Skill demand monitoring
  Business Strategists**: Labor market insights

  Setup Requirements
  Apify
     Upwork scraping actor
     API token
     Configured scraping parameters

  Google Sheets
     Connected Google account
     Prepared job tracking spreadsheet
     Appropriate sharing settings

  n8n Installation
     Cloud or self-hosted instance
     Workflow configuration
     API credential management

  Future Enhancement Suggestions
  🤖 Advanced job matching algorithms
  📊 Multi-platform job aggregation
  🔔 Customizable alert mechanisms
  🌐 Expanded job category tracking
  🧠 Machine learning job recommendation

  Technical Considerations
  Implement robust error handling
  Use secure API authentication
  Maintain flexible data processing
  Ensure compliance with platform guidelines

  Ethical Guidelines
  Respect job poster privacy
  Use data for legitimate research
  Maintain transparent information gathering
  Provide proper attribution

  Hashtag Performance Boost 🚀
  #FreelanceJobTracking #JobMarketIntelligence #WorkflowAutomation #CareerTech #MarketResearch #JobInsights #SkillsDemand #TechInnovation #DataDrivenCareer #ProfessionalGrowth

  Workflow Visualization

  [Scheduled Trigger]
      ⬇️
  [Fetch Upwork Jobs]
      ⬇️
  [Format Job Data]
      ⬇️
  [Log to Google Sheets]

  Connect With Me

  Ready to revolutionize your job market research?

  📧 Email: Yaron@nofluff.online

  🎥 YouTube: @YaronBeen

  💼 LinkedIn: Yaron Been

  Transform your job market intelligence with intelligent, automated workflows!

workflow_json:
  {"id":"s1PkxgZZchk3npwR","meta":{"instanceId":"84ad02d6104594179f43f1ce9cfe3a81637b2faedb57dafcb9e649b7542988db","templateCredsSetupCompleted":true},"name":"Upwork Jobs to google sheets","tags":[],"nodes":[{"id":"e08c753e-7d88-4f0b-889e-100291f0a3c7","name":"Check Upwork Jobs - Trigger","type":"n8n-nodes-base.scheduleTrigger","position":[0,0],"parameters":{"rule":{"interval":[{"field":"hours"}]}},"typeVersion":1.2},{"id":"ffcc4ad0-7787-40a6-a78d-d3a03b1dc23b","name":"Fetch Upwork Jobs using Apify","type":"n8n-nodes-base.httpRequest","position":[260,0],"parameters":{"url":"https://api.apify.com/v2/actor-tasks/<TASK_ID>/run-sync-get-dataset-items?token=<YOUR_API_TOKEN>","method":"POST","options":{},"sendBody":true,"bodyParameters":{"parameters":[{}]}},"typeVersion":4.2},{"id":"4d0d8fb6-ad2e-4dff-8d04-b100721e33ee","name":"Format scrape Data","type":"n8n-nodes-base.set","position":[660,0],"parameters":{"options":{},"assignments":{"assignments":[{"id":"404d06e0-d3a0-448d-98f5-35fe87405e87","name":"title","type":"string","value":"={{ $json.title }}"},{"id":"1d0e9a1d-e5f9-413b-9ab4-f20ae7260b65","name":"description","type":"string","value":"={{ $json.description }}"},{"id":"c8d60809-8747-4321-ac97-a44a12ae91d5","name":"postedDate","type":"string","value":"={{ $json.postedDate }}"},{"id":"e55fbecc-a984-49b7-80a7-8c7a6d10b32a","name":"skills","type":"array","value":"={{ $json.skills }}"},{"id":"45f77f6b-c436-490c-8970-c9cb8b9949ea","name":"link","type":"string","value":"={{ $json.link }}"}]}},"typeVersion":3.4},{"id":"c1f6c43c-f962-48f7-818b-638105720cad","name":"Log Jobs to Google Sheets","type":"n8n-nodes-base.googleSheets","position":[960,0],"parameters":{"columns":{"value":{"link":"={{ $json.link }}","title":"={{ $json.title }}","skills":"={{ $json.skills }}","postedDate":"={{ $json.postedDate }}","description":"={{ $json.description }}"},"schema":[{"id":"title","type":"string","display":true,"required":false,"displayName":"title","defaultMatch":false,"canBeUsedToMatch":true},{"id":"description","type":"string","display":true,"required":false,"displayName":"description","defaultMatch":false,"canBeUsedToMatch":true},{"id":"postedDate","type":"string","display":true,"required":false,"displayName":"postedDate","defaultMatch":false,"canBeUsedToMatch":true},{"id":"skills","type":"string","display":true,"required":false,"displayName":"skills","defaultMatch":false,"canBeUsedToMatch":true},{"id":"link","type":"string","display":true,"required":false,"displayName":"link","defaultMatch":false,"canBeUsedToMatch":true}],"mappingMode":"defineBelow","matchingColumns":[],"attemptToConvertTypes":false,"convertFieldsToString":false},"options":{},"operation":"append","sheetName":{"__rl":true,"mode":"list","value":"gid=0","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1u9TeIArgJPwLn-MV77-lwDwNiZ8qZscZnkuK1xev6YA/edit#gid=0","cachedResultName":"Sheet1"},"documentId":{"__rl":true,"mode":"list","value":"1u9TeIArgJPwLn-MV77-lwDwNiZ8qZscZnkuK1xev6YA","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1u9TeIArgJPwLn-MV77-lwDwNiZ8qZscZnkuK1xev6YA/edit?usp=drivesdk","cachedResultName":"Upwork job scraper"}},"credentials":{"googleSheetsOAuth2Api":{"id":"Rp7XiR3hxJfv03ZO","name":"Google Sheets account"}},"typeVersion":4.5},{"id":"0e05d038-bb10-4cd2-847c-c38ecafe47f4","name":"Sticky Note","type":"n8n-nodes-base.stickyNote","position":[-40,-1420],"parameters":{"color":5,"width":480,"height":1620,"content":"## 🌐 **Section 1: Data Scraping Automation**\n\n> 🧠 *“Tell me what’s trending!”*\n\n### 🔁 Nodes Combined:\n\n* 🕒 `Check Upwork Jobs - Trigger`\n* 🌐 `Fetch Upwork Jobs from Apify`\n\n---\n\n### ⚙️ What This Section Does:\n\nThis section automates the process of **scraping fresh job listings from Upwork** using Apify.\n\n### 🧩 Step-by-Step Breakdown:\n\n#### 🕒 1. `Check Upwork Jobs - Trigger`\n\n🕰 **Trigger Type**: Scheduled\nThis node automatically **starts the workflow at specific times** (e.g., every hour, daily, etc.).\n\n📌 **Why this matters**:\nYou don’t have to manually run anything! Just set it once, and n8n will check for new job listings on its own — like a robot assistant.\n\n---\n\n#### 🌐 2. `Fetch Upwork Jobs from Apify`\n\n📤 **HTTP Request** → **Apify API**\n\nThis node sends a `POST` request to [Apify](https://apify.com), where you've configured a **web scraping actor** to collect data from **Upwork job listings**.\n\n📥 **Response**: A JSON array of job data, including:\n\n* 📌 `title` – What the job is about\n* 📝 `description` – A short job overview\n* 🎯 `skills` – Required skills\n* 🗓 `postedDate` – When it was posted\n* 🔗 `link` – Direct link to the job\n\n✅ **Why Apify?**\nBecause Upwork’s API is **not public**, Apify acts as your friendly bot that **scrapes the job board safely and returns structured data**.\n\n💡 **Pro Tip**: You can customize your Apify actor to filter by keyword (e.g., `AI`, `Python`, `Design`, etc.).\n\n---\n\n"},"typeVersion":1},{"id":"d5ef38cd-796c-48bf-ac16-7180b22dea39","name":"Sticky Note1","type":"n8n-nodes-base.stickyNote","position":[620,-1500],"parameters":{"color":6,"width":480,"height":1700,"content":"## 📊 **Section 2: Data Transformation & Logging**\n\n> 🧠 *“Let’s clean this up and put it somewhere useful.”*\n\n### 🔁 Nodes Combined:\n\n* ✏️ `Format Job Data`\n* 📄 `Log Jobs to Google Sheets`\n\n---\n\n### 🧩 Step-by-Step Breakdown:\n\n#### ✏️ 3. `Format Job Data`\n\n🧹 **Field Cleaner / Formatter**\n\nThis node helps you:\n\n* Extract only **relevant fields** from the Apify response\n* Optionally **rename or restructure fields** (like mapping `postedDate` to `Date Posted`)\n* Prepare the data in a clean format so it's ready for Google Sheets\n\n📌 Example Output:\n\n```json\n{\n  \"Job Title\": \"Build AI chatbot\",\n  \"Skills\": \"LangChain, Python\",\n  \"Posted Date\": \"2025-06-06\",\n  \"Link\": \"https://upwork.com/jobs/...\"\n}\n```\n\n💡 **Why This Matters**: Raw data isn’t always useful. This node ensures that what goes into Google Sheets is **clean, consistent, and human-readable**.\n\n---\n\n#### 📄 4. `Log Jobs to Google Sheets`\n\n📑 **Append Data to Sheet**\n\nThis node takes the formatted job data and **adds it to a Google Sheet** row by row.\n\n📌 Each job becomes a row with columns:\n\n| Job Title    | Skills            | Posted Date | Link                                                    |\n| ------------ | ----------------- | ----------- | ------------------------------------------------------- |\n| Build AI Bot | Python, LangChain | 2025-06-06  | [https://upwork.com/jobs/](https://upwork.com/jobs/)... |\n\n✅ **Why Use Google Sheets?**\n\n* You can **analyze market trends** easily\n* Share with your team\n* Build charts, dashboards, or even connect to Looker Studio\n\n"},"typeVersion":1},{"id":"8af7a509-a4a9-480b-b687-49a3056e27e1","name":"Sticky Note9","type":"n8n-nodes-base.stickyNote","position":[-1920,-1400],"parameters":{"color":4,"width":1300,"height":320,"content":"=======================================\n            WORKFLOW ASSISTANCE\n=======================================\nFor any questions or support, please contact:\n    Yaron@nofluff.online\n\nExplore more tips and tutorials here:\n   - YouTube: https://www.youtube.com/@YaronBeen/videos\n   - LinkedIn: https://www.linkedin.com/in/yaronbeen/\n=======================================\n"},"typeVersion":1},{"id":"773ea8c5-702e-4080-818b-12f0dc93579f","name":"Sticky Note4","type":"n8n-nodes-base.stickyNote","position":[-1920,-1060],"parameters":{"color":4,"width":1289,"height":3058,"content":"## 🌐 **Section 1: Data Scraping Automation**\n\n> 🧠 *“Tell me what’s trending!”*\n\n### 🔁 Nodes Combined:\n\n* 🕒 `Check Upwork Jobs - Trigger`\n* 🌐 `Fetch Upwork Jobs from Apify`\n\n---\n\n### ⚙️ What This Section Does:\n\nThis section automates the process of **scraping fresh job listings from Upwork** using Apify.\n\n### 🧩 Step-by-Step Breakdown:\n\n#### 🕒 1. `Check Upwork Jobs - Trigger`\n\n🕰 **Trigger Type**: Scheduled\nThis node automatically **starts the workflow at specific times** (e.g., every hour, daily, etc.).\n\n📌 **Why this matters**:\nYou don’t have to manually run anything! Just set it once, and n8n will check for new job listings on its own — like a robot assistant.\n\n---\n\n#### 🌐 2. `Fetch Upwork Jobs from Apify`\n\n📤 **HTTP Request** → **Apify API**\n\nThis node sends a `POST` request to [Apify](https://apify.com), where you've configured a **web scraping actor** to collect data from **Upwork job listings**.\n\n📥 **Response**: A JSON array of job data, including:\n\n* 📌 `title` – What the job is about\n* 📝 `description` – A short job overview\n* 🎯 `skills` – Required skills\n* 🗓 `postedDate` – When it was posted\n* 🔗 `link` – Direct link to the job\n\n✅ **Why Apify?**\nBecause Upwork’s API is **not public**, Apify acts as your friendly bot that **scrapes the job board safely and returns structured data**.\n\n💡 **Pro Tip**: You can customize your Apify actor to filter by keyword (e.g., `AI`, `Python`, `Design`, etc.).\n\n---\n\n## 📊 **Section 2: Data Transformation & Logging**\n\n> 🧠 *“Let’s clean this up and put it somewhere useful.”*\n\n### 🔁 Nodes Combined:\n\n* ✏️ `Format Job Data`\n* 📄 `Log Jobs to Google Sheets`\n\n---\n\n### 🧩 Step-by-Step Breakdown:\n\n#### ✏️ 3. `Format Job Data`\n\n🧹 **Field Cleaner / Formatter**\n\nThis node helps you:\n\n* Extract only **relevant fields** from the Apify response\n* Optionally **rename or restructure fields** (like mapping `postedDate` to `Date Posted`)\n* Prepare the data in a clean format so it's ready for Google Sheets\n\n📌 Example Output:\n\n```json\n{\n  \"Job Title\": \"Build AI chatbot\",\n  \"Skills\": \"LangChain, Python\",\n  \"Posted Date\": \"2025-06-06\",\n  \"Link\": \"https://upwork.com/jobs/...\"\n}\n```\n\n💡 **Why This Matters**: Raw data isn’t always useful. This node ensures that what goes into Google Sheets is **clean, consistent, and human-readable**.\n\n---\n\n#### 📄 4. `Log Jobs to Google Sheets`\n\n📑 **Append Data to Sheet**\n\nThis node takes the formatted job data and **adds it to a Google Sheet** row by row.\n\n📌 Each job becomes a row with columns:\n\n| Job Title    | Skills            | Posted Date | Link                                                    |\n| ------------ | ----------------- | ----------- | ------------------------------------------------------- |\n| Build AI Bot | Python, LangChain | 2025-06-06  | [https://upwork.com/jobs/](https://upwork.com/jobs/)... |\n\n✅ **Why Use Google Sheets?**\n\n* You can **analyze market trends** easily\n* Share with your team\n* Build charts, dashboards, or even connect to Looker Studio\n\n💡 **Bonus Tip**: Add filters or conditional formatting to highlight certain keywords or top-paying jobs!\n\n---\n\n## 🎯 Why This Workflow is Powerful (Even for Beginners)\n\n✅ **No coding required** – You’re using no-code tools like n8n, Apify, and Google Sheets\n✅ **Automated** – Runs while you sleep 🌙\n✅ **Real-time market insights** – Know what clients are looking for (great for freelancers, agencies, product devs)\n✅ **Extendable** – Add Telegram alerts, Airtable dashboards, or link it with Notion or CRMs!\n\n---\n\n## 📌 What You Can Do Next:\n\n| Task                      | Tool                              | Outcome                                   |\n| ------------------------- | --------------------------------- | ----------------------------------------- |\n| ✅ Add deduplication logic | Google Sheets or n8n `IF` node    | Avoid storing duplicate jobs              |\n| ✅ Filter by skill/keyword | Apify task input                  | Focus on niche markets                    |\n| ✅ Connect to Airtable     | Replace Sheets with Airtable node | Richer dashboards and tagging             |\n| ✅ Set alerts              | Email/Telegram node               | Be the first to apply or inform your team |\n\n---\n\n\n"},"typeVersion":1}],"active":false,"pinData":{"Fetch Upwork Jobs using Apify":[{"json":{"link":"https://www.upwork.com/jobs/~01a2b3c4d5e6f7g8h9","title":"Build AI-based chatbot with RAG","skills":["Python","LangChain","AI","RAG","LLM"],"postedDate":"2025-06-05T12:00:00Z","description":"Need a developer experienced in LangChain and vector DBs to build a chatbot..."}},{"json":{"link":"https://www.upwork.com/jobs/~09h8g7f6e5d4c3b2a1","title":"Fine-tune Llama-3 for sentiment analysis","skills":["NLP","Llama","Fine-tuning","Transformers"],"postedDate":"2025-06-04T09:30:00Z","description":"Looking for someone to fine-tune Meta’s Llama-3 model on our custom dataset..."}}]},"settings":{"executionOrder":"v1"},"versionId":"ad7a638f-061a-4ab9-aa96-9d2b13f67c5c","connections":{"Format scrape Data":{"main":[[{"node":"Log Jobs to Google Sheets","type":"main","index":0}]]},"Check Upwork Jobs - Trigger":{"main":[[{"node":"Fetch Upwork Jobs using Apify","type":"main","index":0}]]},"Fetch Upwork Jobs using Apify":{"main":[[{"node":"Format scrape Data","type":"main","index":0}]]}}}


name: AI Blog Generator for Shopify Product listings: Using GPT-4o and Google Sheets
author_name: Kumar Shivam
author_username: shivam840708
categories: []
created_at: 2025-06-06T15:00:32.038Z
updated_at: 2025-06-06T15:00:32.038Z
url: https://n8n.io/workflows/4735
scraped_at: 2025-06-19 22:48:49
description:
  🧠 AI Blog Generator for Shopify Products using GPT-4o

  The AI Blog Generator is an advanced automation workflow powered by n8n, integrating GPT-4o and Google Sheets to generate SEO-rich blog articles for Shopify products. It automates the entire process — from pulling product data, analyzing images for nutritional information, to producing structured HTML content ready for publishing — with zero manual writing.

  💡 Key Advantages

  🔗 Shopify Product Sync**  
    Automatically pulls product data (title, description, images, etc.) via Shopify API.

  🤖 AI-Powered Nutrition Extraction**  
    Uses GPT-4o to intelligently analyze product images and extract nutritional information.

  ✍️ SEO Blog Generation**  
    GPT-4o generates blog titles, meta descriptions, and complete articles using both product metadata and extracted nutritional info.

  🗂️ Structured Content Output**  
    Produces well-formatted HTML with headers, bullet points, and nutrition tables for seamless Shopify blog integration.

  📄 Google Sheets Integration**  
    Tracks blog creation, manages retries, and prevents duplicate publishing using a centralized Google Sheet.

  📤 Shopify Blog API Integration**  
    Publishes the generated blog to Shopify using a two-step blog + article API call.

  ⚙️ How It Works

  Manual Trigger  
     Initiate the process using a test trigger or a scheduler.

  Fetch Products from Shopify  
     Retrieves all product details including descriptions and images.

  Extract Product Images  
     Splits and processes each image individually.

  OCR + Nutrition AI  
     GPT-4o reads nutrition facts from product images. Skips items without valid info.

  Check Existing Logs  
     References a Google Sheet to avoid duplicates and determine retry status.

  AI Blog Generation  
     Creates a blog with headings, bullet points, intro, and a nutrition table.

  Shopify Blog + Article Posting  
     Uses the Shopify API to publish the blog and its content.

  Update Google Sheet  
     Logs the blog URL, HTML content, errors, and status for future reference.

  🛠️ Setup Steps

  Shopify Node**: Connects to your Shopify store and fetches product data.  
  Split Out Node**: Divides product images for individual OCR processing.  
  OpenAI Node**: Uses GPT-4o to extract nutrition data from images.  
  If Node**: Filters for entries with valid nutrition information.  
  Edit Fields Node**: Formats the product data for AI processing.  
  AI Agent Node**: Generates SEO blog content.  
  Google Sheets Nodes**: Reads and updates blog creation status.  
  HTTP Request Nodes**: Posts the blog and article via Shopify’s API.

  🔐 Credentials Required

  Shopify Access Token** – For retrieving product data and posting blogs  
  OpenAI API Key** – For GPT-4o-based AI generation and image processing  
  Google Sheets OAuth** – For accessing the log sheet

  👤 Ideal For

  Ecommerce teams looking to automate content for hundreds of products  
  Shopify store owners aiming to boost organic traffic through blogging  
  Marketing teams building scalable, AI-driven content workflows

  💬 Bonus Tip

  The workflow is modular. You can easily extend it with internal linking, language translation, or even social media sharing — all within the same n8n flow.

nodes_used:
  ["n8n-nodes-base.shopify","@n8n/n8n-nodes-langchain.agent","@n8n/n8n-nodes-langchain.lmChatOpenAi","@n8n/n8n-nodes-langchain.memoryBufferWindow","@n8n/n8n-nodes-langchain.openAi"]

workflow_json:
  {"meta":{"instanceId":"d73282515b90623d4a8783919a2d772c706425d649e1512792f37ac51e07e4a8","templateCredsSetupCompleted":true},"nodes":[{"id":"096ccd11-0ae4-4e3d-aeac-d180c09512ae","name":"When clicking ‘Test workflow’","type":"n8n-nodes-base.manualTrigger","position":[300,180],"parameters":{},"typeVersion":1},{"id":"c95491ab-6e4e-4671-bfaf-b8a362d2ec01","name":"Shopify","type":"n8n-nodes-base.shopify","position":[580,180],"parameters":{"resource":"product","operation":"getAll","returnAll":true,"authentication":"accessToken","additionalFields":{}},"credentials":{"shopifyAccessTokenApi":{"id":"oPLCxaUiftgs7Mna","name":"Shopify Access Token account"}},"typeVersion":1},{"id":"1620e19b-cd01-4798-858c-8f2fb3d58087","name":"Split Out","type":"n8n-nodes-base.splitOut","position":[840,180],"parameters":{"options":{},"fieldToSplitOut":"images"},"typeVersion":1},{"id":"944ab8ba-6e41-4e04-b442-9468ff341ba0","name":"OpenAI","type":"@n8n/n8n-nodes-langchain.openAi","position":[1060,180],"parameters":{"text":"=You are an expert OCR and nutrition facts extractor. You carefully extract only the exact nutritional data present in the image without fabricating or guessing. You can recognize nutritional facts tables, and you know how to distinguish between actual nutrition data and promotional or partial text. You return null if no clear nutrition facts table or readable nutritional information is present.\n\n\nYou will analyze an image containing a product's nutritional information. Extract all nutritional data exactly as shown in the image, including nutrient names, amounts, units, and daily values if present.\n\n- If the image clearly contains a nutritional facts table or full nutritional data, output it in clean JSON format, where each nutrient is a key and the value contains the amount, unit, and daily value if available.\n- If the image shows only partial, blurry, or promotional text like \"20% protein\" or any incomplete nutritional data, do NOT fabricate any values; instead, return null.\n- If there is no clear nutritional facts table or nutritional data visible in the image, return null.\n- Do not guess or invent any numbers.\n- Only include information that is confidently present and readable in the image.\n\nExample output when nutrition facts are present:\n\n{\n  \"Calories\": \"190\",\n  \"Total Fat\": {\n    \"amount\": \"8g\",\n    \"daily_value\": \"10%\"\n  },\n  \"Cholesterol\": {\n    \"amount\": \"0mg\",\n    \"daily_value\": \"0%\"\n  },\n  ...\n}\n\nExample output when no valid nutritional facts table or data is visible:\n\nnull\n","modelId":{"__rl":true,"mode":"list","value":"chatgpt-4o-latest","cachedResultName":"CHATGPT-4O-LATEST"},"options":{"detail":"auto","maxTokens":900},"resource":"image","imageUrls":"={{ $json.src }}","operation":"analyze"},"credentials":{"openAiApi":{"id":"OizdHUANhz9NIHyd","name":"OpenAi account"}},"typeVersion":1.8},{"id":"390bd7e4-b7bc-4575-9fe4-36a81445c7d3","name":"OpenAI Chat Model","type":"@n8n/n8n-nodes-langchain.lmChatOpenAi","position":[1480,580],"parameters":{"model":{"__rl":true,"mode":"list","value":"gpt-4o-mini"},"options":{}},"credentials":{"openAiApi":{"id":"OizdHUANhz9NIHyd","name":"OpenAi account"}},"typeVersion":1.2},{"id":"de84b88d-e96e-4c3c-a9f9-71cfc413022e","name":"If","type":"n8n-nodes-base.if","position":[1240,180],"parameters":{"options":{},"conditions":{"options":{"version":2,"leftValue":"","caseSensitive":true,"typeValidation":"strict"},"combinator":"and","conditions":[{"id":"6aa4dfe1-d907-47e8-b97e-3a77bb30c1d0","operator":{"type":"string","operation":"notEquals"},"leftValue":"={{ $json.content }}","rightValue":"null"}]}},"typeVersion":2.2},{"id":"9ef20e21-7ad8-409f-a13e-e1088ec4e4a3","name":"No Operation, do nothing","type":"n8n-nodes-base.noOp","position":[1240,440],"parameters":{},"typeVersion":1},{"id":"0cfadf47-06c7-4b00-b660-87241cc4bf4c","name":"Create Blog id","type":"n8n-nodes-base.httpRequestTool","position":[2500,620],"parameters":{"url":"=https://smartworkflow.myshopify.com/admin/api/2024-01/blogs.json","method":"POST","options":{},"jsonBody":"={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('JSON', ``, 'json') }}","sendBody":true,"specifyBody":"json","authentication":"predefinedCredentialType","nodeCredentialType":"shopifyAccessTokenApi"},"credentials":{"shopifyAccessTokenApi":{"id":"oPLCxaUiftgs7Mna","name":"Shopify Access Token account"}},"typeVersion":4.2},{"id":"059199d7-0f80-40fc-9f45-ee4ef8d6475b","name":"Create Articles","type":"n8n-nodes-base.httpRequestTool","position":[2060,620],"parameters":{"url":"={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('URL', ``, 'string') }}","method":"POST","options":{},"jsonBody":"={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('JSON', ``, 'json') }}","sendBody":true,"specifyBody":"json","authentication":"predefinedCredentialType","nodeCredentialType":"shopifyAccessTokenApi"},"credentials":{"shopifyAccessTokenApi":{"id":"oPLCxaUiftgs7Mna","name":"Shopify Access Token account"}},"typeVersion":4.2},{"id":"60d74f7d-cc66-4af6-bb8d-686c3eb320cb","name":"Read Sheet","type":"n8n-nodes-base.googleSheetsTool","position":[1880,600],"parameters":{"options":{},"sheetName":{"__rl":true,"mode":"list","value":"gid=0","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1m4yPuz7d0HYJQ1nC-v_oTN5jmYMoDy38beDGLB273B8/edit#gid=0","cachedResultName":"blog_details"},"documentId":{"__rl":true,"mode":"list","value":"1m4yPuz7d0HYJQ1nC-v_oTN5jmYMoDy38beDGLB273B8","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1m4yPuz7d0HYJQ1nC-v_oTN5jmYMoDy38beDGLB273B8/edit?usp=drivesdk","cachedResultName":"Blog update sheet"}},"credentials":{"googleSheetsOAuth2Api":{"id":"0RSJGMBcFzxY9GkS","name":"Google Sheets account"}},"typeVersion":4.5},{"id":"75976a59-7017-4e2c-ab12-d2e3448b6566","name":"Update Sheet","type":"n8n-nodes-base.googleSheetsTool","position":[2280,600],"parameters":{"columns":{"value":{"Error":"={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Error', ``, 'string') }}","Retry":"={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Retry', ``, 'string') }}","Blog url":"={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Blog_url', ``, 'string') }}","Blog Html":"={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Blog_Html', ``, 'string') }}","Timestamp":"={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Timestamp', ``, 'string') }}","Product Id":"={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Product_Id', ``, 'string') }}","Blog title ":"={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Blog_title_', ``, 'string') }}","Proudct name":"={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Proudct_name', ``, 'string') }}"},"schema":[{"id":"Timestamp","type":"string","display":true,"required":false,"displayName":"Timestamp","defaultMatch":false,"canBeUsedToMatch":true},{"id":"Product Id","type":"string","display":true,"removed":false,"required":false,"displayName":"Product Id","defaultMatch":false,"canBeUsedToMatch":true},{"id":"Proudct name","type":"string","display":true,"required":false,"displayName":"Proudct name","defaultMatch":false,"canBeUsedToMatch":true},{"id":"Blog title ","type":"string","display":true,"required":false,"displayName":"Blog title ","defaultMatch":false,"canBeUsedToMatch":true},{"id":"Blog url","type":"string","display":true,"required":false,"displayName":"Blog url","defaultMatch":false,"canBeUsedToMatch":true},{"id":"Blog Html","type":"string","display":true,"required":false,"displayName":"Blog Html","defaultMatch":false,"canBeUsedToMatch":true},{"id":"Retry","type":"string","display":true,"required":false,"displayName":"Retry","defaultMatch":false,"canBeUsedToMatch":true},{"id":"Error","type":"string","display":true,"removed":false,"required":false,"displayName":"Error","defaultMatch":false,"canBeUsedToMatch":true}],"mappingMode":"defineBelow","matchingColumns":["Product Id"],"attemptToConvertTypes":false,"convertFieldsToString":false},"options":{},"operation":"appendOrUpdate","sheetName":{"__rl":true,"mode":"list","value":"gid=0","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1m4yPuz7d0HYJQ1nC-v_oTN5jmYMoDy38beDGLB273B8/edit#gid=0","cachedResultName":"blog_details"},"documentId":{"__rl":true,"mode":"list","value":"1m4yPuz7d0HYJQ1nC-v_oTN5jmYMoDy38beDGLB273B8","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1m4yPuz7d0HYJQ1nC-v_oTN5jmYMoDy38beDGLB273B8/edit?usp=drivesdk","cachedResultName":"Blog update sheet"}},"credentials":{"googleSheetsOAuth2Api":{"id":"0RSJGMBcFzxY9GkS","name":"Google Sheets account"}},"typeVersion":4.5},{"id":"49448095-a73a-4fdb-9354-f3e442f100b4","name":"Simple Memory","type":"@n8n/n8n-nodes-langchain.memoryBufferWindow","position":[1700,580],"parameters":{"sessionKey":"={{ $('Main Product info').item.json.id }}","sessionIdType":"customKey","contextWindowLength":20},"typeVersion":1.3},{"id":"adc154d2-a1b0-4f27-b1fd-689484132308","name":"Sticky Note","type":"n8n-nodes-base.stickyNote","position":[500,40],"parameters":{"width":260,"height":360,"content":"## Get Products \n\n\nIt get all the product details from the shopify store"},"typeVersion":1},{"id":"d7de0bdd-2544-45fd-b4ac-264fed0d6c25","name":"Sticky Note1","type":"n8n-nodes-base.stickyNote","position":[780,-80],"parameters":{"color":3,"height":500,"content":"## Fetches Product Image url \n\nEach Product can have multiple images it fetches image url for further step."},"typeVersion":1},{"id":"f51c03f3-a137-48ae-9b44-dee4505d1bb8","name":"Sticky Note2","type":"n8n-nodes-base.stickyNote","position":[1040,-80],"parameters":{"color":6,"width":380,"height":500,"content":"## OCR :\nCollects Nutrients Facts \n\n* It collects Nutrients information from the product image and outputs in json format and send along the true branch of the if node.\n\n* If the image doesn't contain any related info it returns null."},"typeVersion":1},{"id":"486be3b5-dc25-4c5a-bde7-daaeff56308e","name":"Main Product info","type":"n8n-nodes-base.set","position":[1540,160],"parameters":{"options":{},"assignments":{"assignments":[{"id":"93cb8cc0-cdcd-44da-8187-9df85b770293","name":"title","type":"string","value":"={{ $('Shopify').item.json.title }}"},{"id":"95990abc-b64d-4cb4-8d4e-88145395a3fc","name":"id","type":"number","value":"={{ $('Shopify').item.json.id }}"},{"id":"d833cfa1-9abf-4a9d-86ed-a713acbc1974","name":"body_html","type":"string","value":"={{ $('Shopify').item.json.body_html }}"}]},"includeOtherFields":true},"typeVersion":3.4},{"id":"894b47e8-7da2-4a3c-b6ec-afe2e4d6f4cf","name":"Sticky Note3","type":"n8n-nodes-base.stickyNote","position":[1460,-140],"parameters":{"color":4,"width":920,"height":460,"content":"## Shopify Products Blog Mechanism:\n\n\n* It creates Seo Freindly Blog and Blog Title and post the content or article after creating blog of a       \n   specific category which can be seen on the Shopify blog section inside the store via http calls.\n\n* It first checks whether the product is already available or not in the sheet then checks whether      \n   there is need to retry the posting if there is any error. If there is error it retries posting it \n   change the retry value as no.\n* It takes two http tool call to make a blog one is Blog id creation and other is article posting via \n  Create Articles inside that particular Id.\n* Once the blog is posted all the details are updated via Update Sheet tool. If there is any error it updates it accordingly with the error message in error column"},"typeVersion":1},{"id":"6d708bbb-9c9c-419a-883b-d7e48e89e82a","name":"AI Blog Poster","type":"@n8n/n8n-nodes-langchain.agent","position":[1760,160],"parameters":{"text":"=Product id : {{ $json.id }}\nProduct title : {{ $json.title }}    \n\nProduct Description html : {{ $json.body_html }}\n\nProduct Nutrition Facts : {{ $json.content }}\n\n","options":{"systemMessage":"=You are an AI agent responsible for automating blog creation for Shopify products using Google Sheets as a tracking system.\n\n## Step-by-step Workflow:\n\n### 1. Read Google Sheet\nBefore doing anything, call the Read Sheet tool to check if a blog has already been created for the Product ID. The sheet contains columns:\n\n- Timestamp\n- Product Id\n- Product name\n- Blog title\n- Blog url\n- Blog Html\n- Retry\n- Error\n\nCall this tool first and look up the row with the same Product Id.\n\n### 2. Check Conditions:\n- If the Product Id exists and Retry = No, skip this item.\n- If Retry = Yes, retry blog creation from Step 3.\n- If the Product Id is not found, proceed to Step 3 to generate and post a new blog.\n\n---\n\n### 3. Generate Blog Content\nBased on the following provided in the user message:\n- Product ID\n- Product Title\n- Product Description HTML\n- Product Nutrition Facts \n\nGenerate:\n- SEO-Friendly Blog Title\n- Meta Description\n- Formatted Blog Content in clean, structured HTML:\n  - Introduction summary\n  - H2/H3 subheadings\n  - Bullet points (key benefits, nutrients)\n  - Nutrient callouts or tables (if available)\n  - Closing paragraph or CTA\n  - Add internal keywords (tags)\n\n---\n\n### 4. Create Blog (HTTP Tool Call)\nCall the Shopify API to create a blog:\n\njson\n{\n  \"tool_call\": {\n    \"tool\": \"http\",\n    \"name\": \"Create Blog\",\n    \"method\": \"POST\",\n    \"url\": \"https://smartworkflow.myshopify.com/admin/api/2024-01/blogs.json\",\n    \"body\": {\n      \"blog\": {\n        \"title\": \"[SEO Blog Title]\"\n      }\n    }\n  }\n}\nOnce the blog.id is returned, post the article to:\n\n\nhttps://smartworkflow.myshopify.com/admin/api/2024-01/blogs/{{blog.id}}/articles.json\njson\nCopy\nEdit\n{\n  \"tool_call\": {\n    \"tool\": \"http\",\n    \"name\": \"Create Article\",\n    \"method\": \"POST\",\n    \"url\": \"https://smartworkflow.myshopify.com/admin/api/2024-01/blogs/{{blog.id}}/articles.json\",\n    \"body\": {\n      \"article\": {\n        \"title\": \"[Same Blog Title]\",\n        \"body_html\": \"[Generated HTML content]\",\n        \"tags\": \"nutrition, wellness, product, shopify\",\n        \"published\": false\n      }\n    }\n  }\n}\n6. Update Google Sheet\nIf Blog is Posted Successfully\nCall Update Sheet tool and set:\n\n\n{\n  \"Timestamp\":{{ $now }} ,\n  \"Product Id\": \"{{ $json.id }}\",\n  \"Product name\": \"{{ $json.title }}\",\n  \"Blog title\": \"[SEO Blog Title]\",\n  \"Blog url\": \"[Generated URL from blog.id and article.id]\",\n  \"Blog Html\": \"[Generated HTML]\",\n  \"Retry\": \"No\",\n  \"Error\": \"\"\n}\nIf Blog or Article Fails\nLog the error in Error column and set Retry = Yes.\n\n\n{\n  \"Product Id\": \"{{ $json.id }}\",\n  \"Retry\": \"Yes\",\n  \"Error\": \"[Detailed error message]\"\n}\n\nNotes:\nAlways call Read Sheet first before blog generation.\n\nRetry logic is based strictly on the Retry column.\n\nAll tool call responses should be handled using proper try-catch/error-check patterns.\n\nEnsure HTML is clean and includes correct spacing, paragraphs, H2s, bullet lists, and optionally nutrient tables.\n"},"promptType":"define"},"typeVersion":1.9},{"id":"3538388e-7222-48e1-bec8-daf882e8c316","name":"Sticky Note4","type":"n8n-nodes-base.stickyNote","position":[-160,-100],"parameters":{"color":4,"width":380,"height":520,"content":"## Author \n## Kumar Shivam\n\n\nI'm an automation specialist who helps startups, agencies, and growth teams save time and scale faster using n8n. I design smart, reliable workflows that connect tools like HubSpot, Slack, OpenAI, Claude, Pipedrive, Google Ads, and vector databases (Qdrant, Pinecone). Whether it's auto-assigning leads, generating AI-powered reports, triggering Slack alerts, or syncing APIs — I build automations that just work. Let’s turn your manual processes into automated systems that scale.\n\nContact for any business enquiries :\n\nhttps://kumarshivam.link"},"typeVersion":1}],"pinData":{},"connections":{"If":{"main":[[{"node":"Main Product info","type":"main","index":0}],[{"node":"No Operation, do nothing","type":"main","index":0}]]},"OpenAI":{"main":[[{"node":"If","type":"main","index":0}]]},"Shopify":{"main":[[{"node":"Split Out","type":"main","index":0}]]},"Split Out":{"main":[[{"node":"OpenAI","type":"main","index":0}]]},"Read Sheet":{"ai_tool":[[{"node":"AI Blog Poster","type":"ai_tool","index":0}]]},"Update Sheet":{"ai_tool":[[{"node":"AI Blog Poster","type":"ai_tool","index":0}]]},"Simple Memory":{"ai_memory":[[{"node":"AI Blog Poster","type":"ai_memory","index":0}]]},"Create Blog id":{"ai_tool":[[{"node":"AI Blog Poster","type":"ai_tool","index":0}]]},"Create Articles":{"ai_tool":[[{"node":"AI Blog Poster","type":"ai_tool","index":0}]]},"Main Product info":{"main":[[{"node":"AI Blog Poster","type":"main","index":0}]]},"OpenAI Chat Model":{"ai_languageModel":[[{"node":"AI Blog Poster","type":"ai_languageModel","index":0}]]},"When clicking ‘Test workflow’":{"main":[[{"node":"Shopify","type":"main","index":0}]]}}}


name: Generate a Legal Website Accessibility Statement with AI and WAVE
author_name: Lukas Kunhardt
author_username: lukaskunhardt
categories: []
created_at: 2025-06-06T16:22:13.453Z
updated_at: 2025-06-06T16:22:13.453Z
url: https://n8n.io/workflows/4738
scraped_at: 2025-06-19 22:50:31
description:
  Who is this for?
  This template is for any website owner, digital agency, or compliance officer operating within the European Union. It's designed for users who need to comply with the upcoming European Accessibility Act (EAA) but may not have deep technical or legal expertise.

  Disclaimer
  This workflow uses an npm package called "cheerio" to work with the specified URLs HTML code. Installing packages is only possible in self hosting.

  What problem is this workflow solving? / Use Case
  Starting June 28, 2025, the European Accessibility Act (EAA) mandates that most websites offering products or services in the EU must be accessible and publish a formal Accessibility Statement. Manually creating this legal document is complex, requiring both a technical site analysis and knowledge of specific legal requirements. This workflow automates the generation of a compliant first draft, saving significant time and effort.

  What this workflow does
  After you input your details (like website URL and API key) in a central configuration node, this workflow automatically:
  Scans your live website for accessibility issues using the powerful WAVE API.
  Processes the scan results to identify the main problem areas.
  Instructs a Google Gemini AI agent with a specialized legal prompt based on the European Accessibility Act.
  Generates a formal Accessibility Statement in your desired language.
  Saves the statement as an .html file and sends it to you as an email attachment.

  Setup
  This workflow is designed for a quick setup:
  Configure All Variables: Click the 'CHANGE THESE: dependencies' node. This is your central control panel. Fill in all the values, including your WAVE API Key, the URL to analyze, company details, and desired output language.
  Set Up Credentials: You will need to connect your Google accounts for the workflow to run.
      Gemini: Click the 'gemini 2.5 pro' node, click the gear icon (⚙️) next to the "Credential" field, and connect your Google Gemini API credentials.
      Gmail: Click the 'Send report by email' node and connect your Gmail account to allow sending the final report.
  Activate & Execute: Make sure the workflow is active in the top-right corner, then click 'Execute Workflow' to run your first analysis.

  How to customize this workflow to your needs
  This template is a great starting point for any EU country. Here's how to adapt it:
  Localize for Your Country (Important!):* The generated statement contains a placeholder for the "Enforcement Procedure". You *must* edit the prompt in the *'Accessibility Statement Generator'** node to replace this placeholder with the name and link to your specific country's official enforcement body.
  Change the AI:** Swap the Google Gemini node for any other AI model, like OpenAI or Anthropic Claude, by replacing the node and connecting it to the agent.
  Change the Trigger:* Replace the *'When clicking ‘Execute workflow’'** node with a Form Trigger or Webhook Trigger to run this workflow based on external inputs, for example, to offer this analysis as a service to your clients.

nodes_used:
  ["n8n-nodes-base.httpRequest","n8n-nodes-base.gmail","n8n-nodes-base.code","n8n-nodes-base.html","@n8n/n8n-nodes-langchain.agent","@n8n/n8n-nodes-langchain.outputParserStructured","@n8n/n8n-nodes-langchain.lmChatGoogleGemini"]

workflow_json:
  {"meta":{"instanceId":"4970c3bf8a443f2d4c35b388ef96894f5ae52e32fa83fc8da098b824d939fbd9"},"nodes":[{"id":"7d80a2b6-225b-41c3-9723-b1c533176dcd","name":"Get Website HTML","type":"n8n-nodes-base.httpRequest","position":[-1680,180],"parameters":{"url":"={{ $json['URL to analyze'] }}","options":{}},"typeVersion":4.2},{"id":"598f30d8-ca38-469e-978b-c521b2163e6c","name":"Get WAVE Report","type":"n8n-nodes-base.httpRequest","position":[-1420,180],"parameters":{"url":"=https://wave.webaim.org/api/request?key={{ $('CHANGE THESE: dependencies').item.json.wave_api_key }}&reporttype=4&url={{ $('CHANGE THESE: dependencies').item.json['URL to analyze'] }}\n","options":{}},"typeVersion":4.2},{"id":"0e6c3a12-ad82-4b84-85b2-b0d5a3ebe055","name":"Structured Output Parser","type":"@n8n/n8n-nodes-langchain.outputParserStructured","position":[-600,400],"parameters":{"schemaType":"manual","inputSchema":"{\n\t\"type\": \"object\",\n\t\"properties\": {\n\t\t\"Accessibility Statement\": {\n\t\t\t\"type\": \"string\",\n            \"description\": \"output the HTML code for the accessibility statement here. The statement should use the specified language\"\n\t\t}\n\t}\n}"},"typeVersion":1.2},{"id":"3ceda0aa-662d-49c8-a009-520889c54332","name":"Accessibility Statement Generator","type":"@n8n/n8n-nodes-langchain.agent","position":[-860,180],"parameters":{"text":"=You are an expert legal-tech assistant. Your specialty is European digital accessibility law, specifically the **European Accessibility Act (EAA)** and the **Web Content Accessibility Guidelines (WCAG)**.\n\nYour task is to generate a formal **\"Accessibility Statement\"**.\n\nThe final statement must be written **in English** and formatted as a **clean, professional HTML document**. The content must be factually based on the provided data and compliant with the EAA's requirements.\n\n\nPlease generate a compliant Accessibility Statement by following these instructions precisely.\n\n**PART 1: INPUT DATA**\n\nYou will use the following information to construct the statement:\n\n* **Company Name:** `{{ $('CHANGE THESE: dependencies').item.json['Company Name'] }}`\n* **Company Country:** `{{ $('CHANGE THESE: dependencies').item.json['Country of the Company (used to apply local law)'] }}`\n* **Website URL:** `{{ $('CHANGE THESE: dependencies').item.json['URL to analyze'] }}`\n* **Accessibility Scan Results:** A JSON list of all accessibility problems detected on the website.\n    ```json\n    {{ $('Map WAVE Report Items to Website selectors.').item.json.analysisItems.toJsonString() }}\n    ```\n\n**PART 2: YOUR TASK & INSTRUCTIONS**\n\nCreate the HTML code for the \"Accessibility Statement\" by completing the following steps:\n\n**Step 1: Determine Compliance Status**\nAnalyze the `Accessibility Scan Results`. Since the data contains multiple items with an `issue_type` of \"error\", you **must** classify the website's status as **\"partially compliant\"**.\n\n**Step 2: Summarize Non-Accessible Content**\nFrom the `Accessibility Scan Results`, identify the main **categories** of problems. In the final statement, list 2-4 of these general categories. Do **not** list every single error. Good examples are:\n* \"Missing alternative text for images and graphics\"\n* \"Insufficient color contrasts between text and background\"\n* \"Form elements without associated labels\"\n* \"Menus or interactive elements not fully operable by keyboard\"\n\n**Step 3: Construct the Final HTML Document**\nGenerate a complete HTML document in English. The document **must** include the following sections, using the provided English titles:\n\n1.  **`Accessibility Statement`**: The main title of the page.\n2.  **`Commitment to Accessibility`**: A brief, professional introduction stating the company's commitment to digital accessibility in the name of `{{ $('CHANGE THESE: dependencies').item.json['Company Name'] }}`.\n3.  **`Conformance Status`**: State that the website is \"partially conformant with the Web Content Accessibility Guidelines (WCAG) 2.1 level AA\" due to the non-compliances listed below.\n4.  **`Non-Accessible Content`**: List the general problem categories you identified in Step 2.\n5.  **`Preparation of this Accessibility Statement`**: State that the assessment method was a `self-assessment` conducted with automated tools and that the statement was created on `{{ $now.toFormat('MMMM d, yyyy') }}`.\n6.  **`Feedback and Contact Information`**: Provide a section for users to report barriers. **Crucially, use a clear placeholder text** like `[Please insert your contact email address or a link to your contact form here]` so the end-user knows this part must be manually replaced.\n7.  **`Enforcement Procedure`**: This section is country-specific. **You must insert a clear placeholder** informing the user that they need to add the details of their country's official national enforcement body. Use placeholder text like: `[The website owner must insert the name, contact details, and web link for the official national enforcement/arbitration body for their country here.]`\n\n**Step 4: Final Output Requirement**\nYour final response must ONLY be the complete, raw HTML code for the statement in the required JSON format. The Accesibility Statement MUST be in {{ $('CHANGE THESE: dependencies').item.json['Desired Output Language'] }} language!!","options":{},"promptType":"define","hasOutputParser":true},"typeVersion":2},{"id":"70f20556-12de-4b43-8950-c3409be30e27","name":"gemini 2.5 pro","type":"@n8n/n8n-nodes-langchain.lmChatGoogleGemini","position":[-920,400],"parameters":{"options":{},"modelName":"models/gemini-2.5-pro-preview-06-05"},"credentials":{"googlePalmApi":{"id":"srw1vvQUiWhObvtc","name":"Google Gemini(PaLM) Api account"}},"typeVersion":1},{"id":"f16e7f9a-357f-4493-8b2f-677e5c3b3a97","name":"Parse output as html","type":"n8n-nodes-base.html","position":[-480,180],"parameters":{"html":"{{ $json.output['Accessibility Statement'] }}"},"typeVersion":1.2},{"id":"c71c1911-4de6-42f9-a804-477237962e47","name":"Create accesibility statement html file","type":"n8n-nodes-base.moveBinaryData","position":[-180,180],"parameters":{"mode":"jsonToBinary","options":{"fileName":"=accessibility_statement_{{ $('CHANGE THESE: dependencies').item.json['Company Name'].toSnakeCase() }}.html","mimeType":"text/html","useRawData":true},"sourceKey":"html","convertAllData":false},"typeVersion":1},{"id":"a7b3c3c8-f6b5-42ce-bf7e-b321cb68906c","name":"Map WAVE Report Items to Website selectors.","type":"n8n-nodes-base.code","position":[-1200,180],"parameters":{"jsCode":"// --- Corrected Script ---\n\nconsole.log(\"--- 1. SCRIPT INITIALIZING ---\");\nconst cheerio = require('cheerio');\nconsole.log(\"Cheerio library loaded.\");\n\nconst fullHtml = $('Get Website HTML').first().json.data;\nconst waveCategories = $('Get WAVE Report').first().json.categories;\nconsole.log(`Input data loaded. HTML Length: ${fullHtml.length}`);\n\n// --- 3. INITIALIZING CHEERIO ---\nconst $$ = cheerio.load(fullHtml);\nconsole.log(`Cheerio loaded HTML successfully. Document title: \"${$$('title').text()}\"`);\n\nconst analysisItems = [];\n\n// --- 4. PROCESSING LOOP ---\nif (waveCategories && typeof waveCategories === 'object') {\n  for (const categoryName in waveCategories) {\n    const category = waveCategories[categoryName];\n    if (category && category.items && typeof category.items === 'object') {\n      for (const itemId in category.items) {\n        const item = category.items[itemId];\n        if (item.selectors && Array.isArray(item.selectors)) {\n          \n          // Loop through the array of selector strings\n          for (const selectorString of item.selectors) {\n            \n            // --- THIS IS THE CORRECTED LINE ---\n            // The selector is the string itself from the array.\n            const selector = selectorString;\n\n            // Ensure the selector is a valid string before using it\n            if (typeof selector === 'string' && selector) {\n              console.log(`  -> Searching for selector: \"${selector.substring(0, 80)}...\"`);\n              const elementNode = $$(selector).first();\n              \n              if (elementNode.length > 0) {\n                console.log(`    -> SUCCESS: Found element!`);\n                let contextHtml = elementNode.parent().html();\n                \n                if (contextHtml && contextHtml.length > 2000) {\n                  contextHtml = $$.html(elementNode);\n                }\n\n                analysisItems.push({\n                  issue_type: categoryName,\n                  description: item.description,\n                  selector: selector,\n                  context_html: contextHtml ? contextHtml.trim() : \"\"\n                });\n              } else {\n                console.log(`    -> WARNING: Could not find element for selector.`);\n              }\n            }\n          }\n        }\n      }\n    }\n  }\n}\n\n// --- 5. FINAL OUTPUT ---\nconsole.log(`\\n--- PROCESSING COMPLETE ---`);\nconsole.log(`Total items collected for AI: ${analysisItems.length}`);\n\nreturn {\n  json: {\n    analysisItems\n  }\n};"},"typeVersion":2},{"id":"e8750f9c-778f-41fd-aead-270d33e255e4","name":"CHANGE THESE: dependencies","type":"n8n-nodes-base.set","position":[-1880,-100],"parameters":{"options":{},"assignments":{"assignments":[{"id":"678e5308-808a-46c5-89b4-c68b272e03c6","name":"wave_api_key","type":"string","value":""},{"id":"470042c1-8609-41ab-ab1e-bf817035d426","name":"URL to analyze","type":"string","value":"="},{"id":"d3c198ec-2bba-45d1-8687-b918fc2f2499","name":"Email for summary","type":"string","value":"example@gmail.com"},{"id":"f15f810e-ce67-463e-8b99-61de6f1bcb6c","name":"Desired Output Language","type":"string","value":"english"},{"id":"219c0199-a819-4e45-bd9e-aa7197060da1","name":"Company Name","type":"string","value":"Tiro"},{"id":"9423eed7-e169-4312-8293-149d305d156e","name":"Country of the Company (used to apply local law)","type":"string","value":"Germany"}]}},"typeVersion":3.4},{"id":"510ed358-75a8-4842-a8aa-0b2fa95144b6","name":"When clicking ‘Execute workflow’","type":"n8n-nodes-base.manualTrigger","position":[-2080,180],"parameters":{},"typeVersion":1},{"id":"1ebee155-5b9a-4da3-8e63-054bf14b945a","name":"Send accessibility statement by email","type":"n8n-nodes-base.gmail","position":[80,180],"webhookId":"69c88d00-ad22-4a8b-9f6a-f8d81f84c617","parameters":{"sendTo":"={{ $('CHANGE THESE: dependencies').item.json['Email for summary'] }}","message":"=This Email contains your Accessibility Statement. Check the attached files.","options":{"attachmentsUi":{"attachmentsBinary":[{}]}},"subject":"=Accessibility Statement for {{ $('CHANGE THESE: dependencies').item.json['Company Name'] }}"},"credentials":{"gmailOAuth2":{"id":"ExhDKVxieYxsG75E","name":"Gmail account"}},"typeVersion":2.1},{"id":"cdda9066-42d8-4d9f-97a8-9a5184bd58e6","name":"Sticky Note","type":"n8n-nodes-base.stickyNote","position":[-3020,-280],"parameters":{"color":5,"width":880,"height":920,"content":"# 🚀 Automatically Generate Your EU Accessibility Statement\n\n**What This Template Does:**\nThis workflow scans any website, analyzes its accessibility issues, and uses an AI agent to automatically generate a formal Accessibility Statement (Erklärung zur Barrierefreiheit). This document is a legal requirement for most EU businesses under the **European Accessibility Act (EAA)**, with a compliance deadline of **June 28, 2025**.\n\n**How It Works:**\nIt uses the **WAVE API** to find accessibility issues and **Google Gemini** to write the statement based on a specialized legal prompt, creating a ready-to-use `.html` file.\n\n---\n\n### **Setup in 3 Steps:**\n\n**1. Configure All Variables ✏️**\n* Click the **'CHANGE THESE: dependencies'** node. This is your central control panel.\n* Fill in all the values, including your WAVE API Key, the URL to analyze, company details, and desired output language.\n\n**2. Set Up Credentials ✨**\n* You need to connect your Google accounts for this workflow to run.\n* **Gemini:** Click the **'gemini2.5 pro'** node and connect your Google Gemini (or Google AI Studio) API credentials. You can swap this out for any other language model as well.\n* **Gmail:** Click the **'Send report by email'** node and connect your Gmail account to allow sending the final report.\n\n**3. Run the Workflow ▶️**\n* Click **'Execute workflow'** to run the analysis. The generated `.html` statement will be sent to the email address you specified."},"typeVersion":1},{"id":"f3a66efe-8bce-4f08-871d-9a9a70f8ab9e","name":"Sticky Note1","type":"n8n-nodes-base.stickyNote","position":[-1980,-380],"parameters":{"color":4,"width":320,"height":460,"content":"# ⚙️ Step 1: Start Here!\n\nThis is the main configuration node for the workflow.\n\nClick on this node and fill in all the required fields on the right-hand panel before running the workflow."},"typeVersion":1}],"pinData":{},"connections":{"gemini 2.5 pro":{"ai_languageModel":[[{"node":"Accessibility Statement Generator","type":"ai_languageModel","index":0}]]},"Get WAVE Report":{"main":[[{"node":"Map WAVE Report Items to Website selectors.","type":"main","index":0}]]},"Get Website HTML":{"main":[[{"node":"Get WAVE Report","type":"main","index":0}]]},"Parse output as html":{"main":[[{"node":"Create accesibility statement html file","type":"main","index":0}]]},"Structured Output Parser":{"ai_outputParser":[[{"node":"Accessibility Statement Generator","type":"ai_outputParser","index":0}]]},"CHANGE THESE: dependencies":{"main":[[{"node":"Get Website HTML","type":"main","index":0}]]},"Accessibility Statement Generator":{"main":[[{"node":"Parse output as html","type":"main","index":0}]]},"When clicking ‘Execute workflow’":{"main":[[{"node":"CHANGE THESE: dependencies","type":"main","index":0}]]},"Create accesibility statement html file":{"main":[[{"node":"Send accessibility statement by email","type":"main","index":0}]]},"Map WAVE Report Items to Website selectors.":{"main":[[{"node":"Accessibility Statement Generator","type":"main","index":0}]]}}}


name: Binance Spot Market Quant AI Agent | GPT-4o + Telegram (Main Interface)
author_name: Don Jayamaha Jr
author_username: don-the-gem-dealer
categories: []
created_at: 2025-06-06T17:51:04.546Z
updated_at: 2025-06-06T17:51:04.546Z
url: https://n8n.io/workflows/4739
scraped_at: 2025-06-19 22:48:46
description:
  A professional-grade AI automation system for spot market trading insights on Binance. It analyzes multi-timeframe technical indicators, live price/order data, and crypto sentiment, then delivers fully formatted Telegram-style trading reports.

  🎥 Live Demo:

  🧩 Required Workflows

  You must install and activate all of the following workflows for the system to function correctly:

  | ✅ Workflow Name                                    | 📌 Function Description                                                          |
  | -------------------------------------------------- | -------------------------------------------------------------------------------- |
  | Binance Spot Market Quant AI Agent                 | Final AI orchestrator. Parses user prompt and generates Telegram-ready reports.  |
  | Binance SM Financial Analyst Tool                  | Calls indicator tools and price/order data tools. Synthesizes structured inputs. |
  | Binance SM News and Sentiment Analyst Webhook Tool | Analyzes crypto sentiment, gives summary and headlines via POST webhook.         |
  | Binance SM Price/24hrStats/OrderBook/Kline Tool    | Pulls price, order book, 24h stats, and OHLCV klines for 15m–1d.                 |
  | Binance SM 15min Indicators Tool                   | Calculates 15m RSI, MACD, BBANDS, ADX, SMA/EMA from Binance kline data.          |
  | Binance SM 1hour Indicators Tool                   | Same as above but for 1h timeframe.                                              |
  | Binance SM 4hour Indicators Tool                   | Same as above but for 4h timeframe.                                              |
  | Binance SM 1day Indicators Tool                    | Same as above but for 1d timeframe.                                              |
  | Binance SM Indicators Webhook Tool                 | Technical backend. Handles all webhook logic for each timeframe tool.            |

  ⚙️ Installation Instructions

  Step 1: Import Workflows

  Open your n8n Editor UI
  Import each workflow JSON file one by one
  Activate them or ensure they're called via Execute Workflow

  Step 2: Set Credentials

  OpenAI API Key** (GPT-4o recommended)
  Binance endpoints** are public (no auth required)

  Step 3: Configure Webhook Endpoints

  Deploy Binance SM Indicators Webhook Tool
  Ensure the following paths are reachable:

    /webhook/15m
    /webhook/1h
    /webhook/4h
    /webhook/1d

  Step 4: Telegram Integration

  Create a Telegram bot using @BotFather
  Add your Telegram API token to n8n credentials
  Replace the Telegram ID placeholder with your own

  Step 5: Final Trigger

  Trigger the Binance Spot Market Quant AI Agent manually or from Telegram
  The agent:

    Extracts the trading pair (e.g. BTCUSDT)
    Calls all tools for market data and sentiment
    Generates a clean, HTML-formatted Telegram report

  💬 Telegram Report Output Format

  BTCUSDT Market Report

  Spot Strategy
  • Action: Buy
  • Entry: $63,800 | SL: $61,200 | TP: $66,500
  • Rationale:
   MACD Crossover (1h)
   RSI Rebound from Oversold (15m)
   Sentiment: Bullish

  Leverage Strategy
  • Position: Long 3x
  • Entry: $63,800
  • SL/TP zones same as above

  News Sentiment: Slightly Bullish  
  • "Bitcoin rallies as ETF inflows surge" – CoinDesk  
  • "Whales accumulate BTC at key support" – NewsBTC  

  🧠 System Overview

  [Telegram Trigger]
  → [Session + Auth Logic]
  → [Binance Spot Market Quant AI Agent]
  → [Financial Analyst Tool + News Tool]
  → [All Technical Indicator Tools (15m, 1h, 4h, 1d)]
  → [OrderBook/Price/Kline Fetcher]
  → [GPT-4o Reasoning]
  → [Split & Send Message to Telegram]

  🧾 Licensing & Attribution

  © 2025 Treasurium Capital Limited Company
  Architecture, prompts, and trade report structure are IP-protected.
  No unauthorized rebranding or resale permitted.

  🔗 For support: LinkedIn – Don Jayamaha

nodes_used:
  ["n8n-nodes-base.telegram","n8n-nodes-base.code","@n8n/n8n-nodes-langchain.agent","@n8n/n8n-nodes-langchain.lmChatOpenAi","@n8n/n8n-nodes-langchain.memoryBufferWindow","@n8n/n8n-nodes-langchain.toolWorkflow"]

workflow_json:
  {"id":"82r122lbmQPWishF","meta":{"instanceId":"a5283507e1917a33cc3ae615b2e7d5ad2c1e50955e6f831272ddd5ab816f3fb6","templateCredsSetupCompleted":true},"name":"Binance Spot Market Quant AI Agent","tags":[],"nodes":[{"id":"6c6238ec-ba3d-4c59-a612-c3b4e9ae8b73","name":"OpenAI Chat Model","type":"@n8n/n8n-nodes-langchain.lmChatOpenAi","position":[-440,620],"parameters":{"model":{"__rl":true,"mode":"list","value":"gpt-4o-mini"},"options":{}},"credentials":{"openAiApi":{"id":"yUizd8t0sD5wMYVG","name":"OpenAi account"}},"typeVersion":1.2},{"id":"b8b90061-9d5e-4e48-a0b0-bb6bdb193771","name":"Binance Spot Market Quant AI Agent","type":"@n8n/n8n-nodes-langchain.agent","position":[-80,160],"parameters":{"text":"={{ $json.message }}","options":{"systemMessage":"You are the **Binance Spot Market Quant AI Agent**, responsible for generating structured, professional swing-trading reports for **any trading pair** on the Binance Spot Market. You use **validated technical indicators**, **order flow data**, and **curated crypto sentiment** to create actionable trading strategies.\n\n---\n\n### 🔗 Connected Tools\n\n1. **🧠 Binance Financial Market Analyst Tool**\n\n   • Aggregates outputs from:\n\n   * `Binance 15min Indicators Tool`\n   * `Binance 1h Indicators Tool`\n   * `Binance 4h Indicators Tool`\n   * `Binance 1d Indicators Tool`\n   * `Binance Price/OrderBook/Kline Tool`\n\n   • Each indicator tool calculates:\n\n   * **RSI, BBANDS, SMA, EMA, ADX, MACD**\n   * Based on the **latest 20 klines** for its interval\n   * Returns both values and signal labels (e.g. overbought, divergence)\n\n   • The Price Tool provides:\n\n   * **Live price**\n   * **24h OHLCV**\n   * **Order book depth (top 100 bids/asks)**\n   * **Klines** for `15m`, `1h`, `4h`, and `1d` intervals\n\n2. **📰 Binance News and Sentiment Analyst Tool**\n\n   • Pulls from sources like:\n\n   * CoinDesk, Cointelegraph, BitcoinMagazine, NewsBTC, CryptoBriefing, and more\n\n   • Returns:\n\n   * **Sentiment Score**: Bullish / Bearish / Neutral\n   * **Summary**: 2–3 sentence market snapshot\n   * **Top 3–5 headlines** (with source links)\n\n---\n\n### 📊 Core Responsibilities\n\nYou always:\n\n1. **Call all tools concurrently** for each query\n\n   * Pass the extracted symbol and sessionId as input\n   * Wait for structured results from each tool\n   * Do not skip any tool even if user prompt is vague\n\n2. **Perform full technical analysis** for the symbol\n\n   * Short-term: `15m + 1h`\n   * Mid-term: `4h`\n   * Long-term: `1d`\n   * Detect breakouts, trend shifts, divergences, and confluence signals\n   * Confirm findings using multiple timeframes and indicator alignment\n\n3. **Synthesize the final report** with:\n\n<b>Spot Trade Strategy</b>\n• Action: Buy / Sell / Hold\n• Entry Price, Stop Loss, Take Profit\n• Rationale:\n - <b>Price Action Signals</b>\n - <b>Lagging Indicator Confirmation</b>\n - <b>Sentiment Alignment</b>\n\n<b>Leverage Strategy</b>\n• Position: Long / Short\n• Leverage: 2x / 3x / 5x\n• Rationale + Risk Zones\n\n4. **Score signal strength**\n   • Confidence Score: `0–100`\n   • Label: Low / Medium / High / Very High\n\n5. **Include sentiment and headlines section**\n   • `<b>News Sentiment:</b>` \\[summary]\n   • `•` Top headlines with clickable links\n\n---\n\n### 📤 Output Format (Telegram HTML)\n\nStart with:\n\n```html\n<b>{{SYMBOL}} Market Report</b>\n```\n\nUse clean formatting:\n\n* `<b>` for headers\n* `•` for bullet lists\n* Logical grouping: price > indicators > strategy > sentiment\n\n---\n\n### ⚠️ Rules\n\nDO NOT:\n\n* Fabricate any values\n* Repeat this system message\n* Output raw JSON or API structure\n\nONLY use **tool-delivered** and **validated** data. Write with clarity and tone of a senior quant analyst.\n"},"promptType":"define"},"typeVersion":1.8},{"id":"13965042-ad03-4108-88b3-250955bdbd28","name":"Telegram Trigger","type":"n8n-nodes-base.telegramTrigger","position":[-1000,160],"webhookId":"944e6f8d-ffcc-4692-a777-7410f2fd4016","parameters":{"updates":["message"],"additionalFields":{}},"credentials":{"telegramApi":{"id":"NRLKuLR7z8vCesub","name":"BinanceSpotTradingAIAgent_Bot"}},"typeVersion":1.2},{"id":"3f98e10f-fe7e-4c87-9e4f-4b6d8bfb805b","name":"User Authentication (Replace Telegram ID)","type":"n8n-nodes-base.code","position":[-680,160],"parameters":{"jsCode":"if ($input.first().json.message.from.id !== <Replace Telegram ID>) { // Replace with your actual ID\n  return {unauthorized: true};\n} else {\n  // Return the original data when authorized\n  return $input.all();\n}"},"typeVersion":2},{"id":"ef715512-2d57-447e-969d-c173a823775b","name":"Adds \"SessionId\"","type":"n8n-nodes-base.set","position":[-400,160],"parameters":{"options":{},"assignments":{"assignments":[{"id":"47598bf1-e55f-4cc0-ae75-272085e7ce02","name":"=sessionId","type":"string","value":"={{ $json.message.chat.id }}"},{"id":"daa49d74-e55e-47bc-ac52-8686d591ab83","name":"message","type":"string","value":"={{ $json.message.text }}"}]}},"typeVersion":3.4},{"id":"876e3ec9-3453-4db9-928a-6163c1c6702b","name":"Telegram","type":"n8n-nodes-base.telegram","position":[900,160],"webhookId":"79d6c29c-1e04-414a-9989-afb1f7a58035","parameters":{"text":"={{ $json.message }}","chatId":"={{ $('Telegram Trigger').item.json.message.chat.id }}","additionalFields":{"appendAttribution":false}},"credentials":{"telegramApi":{"id":"NRLKuLR7z8vCesub","name":"BinanceSpotTradingAIAgent_Bot"}},"typeVersion":1.2},{"id":"70c70549-1c58-478d-a39f-5bccc7b76b04","name":"Splits message is more than 4000 characters","type":"n8n-nodes-base.code","position":[480,160],"parameters":{"jsCode":"// Input: assumes incoming message in `item.json.message`\nconst input = $json.output;\nconst chunkSize = 4000;\n\n// Function to split text\nfunction splitMessage(text, size) {\n  const result = [];\n  for (let i = 0; i < text.length; i += size) {\n    result.push(text.substring(i, i + size));\n  }\n  return result;\n}\n\n// Logic\nif (input.length <= chunkSize) {\n  return [{ json: { message: input } }];\n} else {\n  const chunks = splitMessage(input, chunkSize);\n  return chunks.map(chunk => ({ json: { message: chunk } }));\n}"},"typeVersion":2},{"id":"85e0b819-f722-43ae-93b7-5317ff877804","name":"News and Sentiment Analysis Request","type":"n8n-nodes-base.httpRequestTool","position":[120,600],"parameters":{"url":"https://treasurium.app.n8n.cloud/webhook/newsanalyst","method":"POST","options":{},"sendBody":true,"bodyParameters":{"parameters":[{"name":"message","value":"=={{ $json.message }}"}]},"toolDescription":"It will post the name of the cryptocurrency to get the News and Sentiment Analysis for use in the Binance Quant AI Agent."},"typeVersion":4.2},{"id":"27c27a35-fe83-4c4b-b9b1-90f2e1de8602","name":"Binance SM Financial Analyst Tool","type":"@n8n/n8n-nodes-langchain.toolWorkflow","position":[380,580],"parameters":{"workflowId":{"__rl":true,"mode":"list","value":"Nm41n4i6VMhrixZs","cachedResultName":"Work Drive — Binance SM Financial Analyst Tool"},"workflowInputs":{"value":{"message":"={{ $fromAI(\"message\",\"Populate this with a relevant message to this subagent\")}}","sessionId":"={{ $json.sessionId }}"},"schema":[{"id":"message","type":"string","display":true,"required":false,"displayName":"message","defaultMatch":false,"canBeUsedToMatch":true},{"id":"sessionId","type":"string","display":true,"required":false,"displayName":"sessionId","defaultMatch":false,"canBeUsedToMatch":true}],"mappingMode":"defineBelow","matchingColumns":[],"attemptToConvertTypes":false,"convertFieldsToString":false}},"typeVersion":2.2},{"id":"78c6847a-8449-45dd-8aa6-1ce69e3d4e67","name":"Simple Memory","type":"@n8n/n8n-nodes-langchain.memoryBufferWindow","position":[-160,620],"parameters":{},"typeVersion":1.3},{"id":"7ded5880-cf83-483c-84b9-dfce5e11d616","name":"Sticky Note","type":"n8n-nodes-base.stickyNote","position":[-1060,-100],"parameters":{"color":4,"height":460,"content":"## Trigger Incoming Telegram Command\nNode: Telegram Trigger\n**Listens for new Telegram messages** from users.\nTriggers the full agent process and passes raw user input downstream."},"typeVersion":1},{"id":"dfb57705-77b8-4c88-a6b0-aa8128b08400","name":"Sticky Note1","type":"n8n-nodes-base.stickyNote","position":[-740,-100],"parameters":{"color":2,"height":460,"content":"## Validate User Access\nNode: User **Authentication\nChecks incoming Telegram ID** against the approved user list."},"typeVersion":1},{"id":"37372f5a-db8c-4335-81a4-de437aff4782","name":"Sticky Note2","type":"n8n-nodes-base.stickyNote","position":[-460,-100],"parameters":{"color":5,"height":460,"content":"## Generate Session Metadata\nNode: Add S**essionId\nCreates a sessionId using the Telegram chat_id**.\nThis is passed into all downstream tools for memory and workflow routing."},"typeVersion":1},{"id":"952adc52-49a1-49c8-8bd5-d31c8277af83","name":"Sticky Note3","type":"n8n-nodes-base.stickyNote","position":[-180,-220],"parameters":{"color":7,"width":480,"height":580,"content":"## Main AI Agent: Report Generator\nNode: Binance Spot Market Quant AI Agent\nThis is the **core orchestrator**. It uses OpenAI to reason over:\n\n**Multi-timeframe indicator outputs**\n\n**Order book + price data**\n\n**Sentiment and news**\n\nIt calls both tools in parallel:\n\n**Binance Financial Market Analyst Tool**\n\n**Binance News & Sentiment Analyst Tool**\n\nThen it synthesizes a final trading report."},"typeVersion":1},{"id":"a6475e05-c83a-4dce-acd1-19294077912f","name":"Sticky Note4","type":"n8n-nodes-base.stickyNote","position":[400,-100],"parameters":{"color":5,"width":260,"height":460,"content":"## Handle Telegram Message Limits\nNode: Code (split logic)\nChecks if the **GPT output exceeds 4000 characters**.\nIf so, it splits the message into safe chunks and passes them on sequentially."},"typeVersion":1},{"id":"413aff1b-43a3-4f81-b82d-eab2f18aed61","name":"Sticky Note5","type":"n8n-nodes-base.stickyNote","position":[840,-100],"parameters":{"color":4,"height":460,"content":"## Send Final Report to Telegram\nNode: Telegram sendMessage\nSends **formatted HTML report (or split chunks)** directly to the authenticated user via Telegram bot."},"typeVersion":1},{"id":"8b7687eb-9c5f-4745-8700-cc337a1a2505","name":"Sticky Note6","type":"n8n-nodes-base.stickyNote","position":[-520,520],"parameters":{"height":540,"content":"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n## GPT Model for Reasoning\nNode: OpenAI Chat Model\nModel: **gpt-4o-mini**\nUsed to:\n\nInterpret signal values\n\nGenerate structured HTML\n\n**Recommend spot and leverage trades**\n\n"},"typeVersion":1},{"id":"fc0fa082-96d7-4dda-8273-0aa44f6b1f97","name":"Sticky Note7","type":"n8n-nodes-base.stickyNote","position":[40,520],"parameters":{"color":6,"height":660,"content":"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n## Binance News & Sentiment Analyst Tool\nNode: ToolWebhook\nSends the symbol to:\n\nPOST https://treasurium.app.n8n.cloud/webhook/newsanalyst\nReturns:\n\n**📈 Sentiment (Bullish / Neutral / Bearish)**\n\n**📰 3–5 crypto headlines**\n\n**🧠 Summary paragraph (1–3 lines)**"},"typeVersion":1},{"id":"becbf326-b8d3-482e-b9c5-7a1bed58b112","name":"Sticky Note8","type":"n8n-nodes-base.stickyNote","position":[300,520],"parameters":{"color":6,"height":660,"content":"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n## Binance Financial Market Analyst Tool\nNode: ToolWorkflow\nCalls all connected indicator agents:\n\n**15m, 1h, 4h, 1d**\n\nPrice/Orderbook/Klines agent\n\n**Each indicator (RSI, MACD, BBANDS, SMA, EMA, ADX)** is returned per timeframe, plus order book depth and candle snapshots."},"typeVersion":1},{"id":"46cb7225-7ba9-4270-988e-74e4a30403fc","name":"Sticky Note9","type":"n8n-nodes-base.stickyNote","position":[-240,520],"parameters":{"color":3,"height":540,"content":"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n## Short-Term Memory Module\nNode: **Simple Memory\nStores the sessionId**, symbol, and other state data.\nUseful for:\n\nMulti-turn Telegram interactions\n\nTracking indicator agreement across timeframes\n\n"},"typeVersion":1},{"id":"238ff914-0c43-4cdf-9506-61e67306300f","name":"Sticky Note10","type":"n8n-nodes-base.stickyNote","position":[1400,-1340],"parameters":{"width":1780,"height":2540,"content":"# 🧠 Binance Spot Market Quant AI Agent – Full System Documentation\n\nA professional-grade AI automation system for **spot market trading insights** on Binance. It analyzes **multi-timeframe technical indicators**, **live price/order data**, and **crypto sentiment**, then delivers fully formatted **Telegram-style trading reports**.\n\n---\n\n## 🧩 Included Workflows\n\n> You must install and activate **all of the following workflows** for the system to function correctly:\n\n| ✅ Workflow Name                                    | 📌 Function Description                                                          |\n| -------------------------------------------------- | -------------------------------------------------------------------------------- |\n| Binance Spot Market Quant AI Agent                 | Final AI orchestrator. Parses user prompt and generates Telegram-ready reports.  |\n| Binance SM Financial Analyst Tool                  | Calls indicator tools and price/order data tools. Synthesizes structured inputs. |\n| Binance SM News and Sentiment Analyst Webhook Tool | Analyzes crypto sentiment, gives summary and headlines via POST webhook.         |\n| Binance SM Price/24hrStats/OrderBook/Kline Tool    | Pulls price, order book, 24h stats, and OHLCV klines for 15m–1d.                 |\n| Binance SM 15min Indicators Tool                   | Calculates 15m RSI, MACD, BBANDS, ADX, SMA/EMA from Binance kline data.          |\n| Binance SM 1hour Indicators Tool                   | Same as above but for 1h timeframe.                                              |\n| Binance SM 4hour Indicators Tool                   | Same as above but for 4h timeframe.                                              |\n| Binance SM 1day Indicators Tool                    | Same as above but for 1d timeframe.                                              |\n| Binance SM Indicators Webhook Tool                 | Technical backend. Handles all webhook logic for each timeframe tool.            |\n\n---\n\n## ⚙️ Installation Instructions\n\n### Step 1: Import Workflows\n\n* Open your **n8n Editor UI**\n* Import each workflow JSON file one by one\n* Activate them or ensure they're called via `Execute Workflow`\n\n### Step 2: Set Credentials\n\n* **OpenAI API Credential**: Add your OpenAI key for GPT-4o or GPT-4.1\n* **Binance Price Data**: No auth needed (public endpoint)\n\n### Step 3: Configure Webhook Endpoints\n\n* Deploy **Binance SM Indicators Webhook Tool**\n* Ensure the following routes are reachable:\n\n  * `/webhook/15m`\n  * `/webhook/1h`\n  * `/webhook/4h`\n  * `/webhook/1d`\n\n### Step 4: Telegram Integration\n\n* Add your Telegram Bot to n8n with correct API token\n* Update the **Telegram ID check node** with your own ID\n* Messages from your ID will trigger the agent\n\n### Step 5: Final Agent Execution\n\n* Trigger `Binance Spot Market Quant AI Agent` manually or from Telegram\n* The agent:\n\n  * Calls all connected tools with symbol and sessionId\n  * Waits for full indicator + sentiment response\n  * Returns a formatted multi-part trading report\n\n---\n\n## 🖥️ System Workflow Overview\n\n```\n[Telegram Trigger]\n→ [Session Memory + ID Check]\n→ [Quant Agent]\n→ [Financial Analyst Tool + Sentiment Tool]\n→ [All Indicators (15m, 1h, 4h, 1d)]\n→ [Price/Kline/OrderBook Tool]\n→ [News and Sentiment Webhook]\n→ [Signal Reasoning + Report Formatting]\n→ [Final Telegram HTML Message]\n```\n\n---\n\n## 📬 Telegram Output Style\n\n```html\n<b>BTCUSDT Market Report</b>\n\n<b>Spot Strategy</b>\n• Action: Buy\n• Entry: $63,800 | SL: $61,200 | TP: $66,500\n• Reason:\n - MACD Crossover (1h)\n - RSI Rebound from Oversold (15m)\n - Sentiment: Bullish\n\n<b>Leverage Strategy</b>\n• Position: Long 3x\n• Entry: $63,800\n• SL/TP zones same as above\n\n<b>News Sentiment:</b> Slightly Bullish\n• \"Bitcoin rallies as ETF inflows surge\" – CoinDesk\n• \"Whales accumulate BTC at key support\" – NewsBTC\n```\n\n---\n\n## 🚀 Support & Licensing\n\n🔗 **Don Jayamaha – LinkedIn**\n[linkedin.com/in/donjayamahajr](http://linkedin.com/in/donjayamahajr)\n\n© 2025 Treasurium Capital Limited Company. All rights reserved.\nThis system architecture, prompts, and workflow structure are proprietary and protected by **U.S. copyright law**. Reuse or resale prohibited without license.\n"},"typeVersion":1}],"active":false,"pinData":{},"settings":{"executionOrder":"v1"},"versionId":"bb69da16-db3d-4804-ad9d-a3d971f8fa36","connections":{"Simple Memory":{"ai_memory":[[{"node":"Binance Spot Market Quant AI Agent","type":"ai_memory","index":0}]]},"Adds \"SessionId\"":{"main":[[{"node":"Binance Spot Market Quant AI Agent","type":"main","index":0}]]},"Telegram Trigger":{"main":[[{"node":"User Authentication (Replace Telegram ID)","type":"main","index":0}]]},"OpenAI Chat Model":{"ai_languageModel":[[{"node":"Binance Spot Market Quant AI Agent","type":"ai_languageModel","index":0}]]},"Binance SM Financial Analyst Tool":{"ai_tool":[[{"node":"Binance Spot Market Quant AI Agent","type":"ai_tool","index":0}]]},"Binance Spot Market Quant AI Agent":{"main":[[{"node":"Splits message is more than 4000 characters","type":"main","index":0}]]},"News and Sentiment Analysis Request":{"ai_tool":[[{"node":"Binance Spot Market Quant AI Agent","type":"ai_tool","index":0}]]},"User Authentication (Replace Telegram ID)":{"main":[[{"node":"Adds \"SessionId\"","type":"main","index":0}]]},"Splits message is more than 4000 characters":{"main":[[{"node":"Telegram","type":"main","index":0}]]}}}


name: Analyze Crypto News Sentiment for Any Token with GPT-4o and Telegram Alerts
author_name: Don Jayamaha Jr
author_username: don-the-gem-dealer
categories: []
created_at: 2025-06-06T17:59:13.026Z
updated_at: 2025-06-06T17:59:13.026Z
url: https://n8n.io/workflows/4740
scraped_at: 2025-06-19 22:48:44
description:
  A sentiment intelligence sub-agent for the Binance Spot Market Quant AI Agent. It aggregates crypto news from major sources, filters by token keyword (e.g., BTC, ETH), and produces a Telegram-ready summary including market sentiment and top headlines—powered by GPT-4o.

  🎥 Live Demo:

  🛠️ Workflow Function

  This tool performs the following steps:

  | 🔧 Step                  | 📌 Description                                                                |
  | ------------------------ | ----------------------------------------------------------------------------- |
  | Webhook Input            | Accepts { "message": "symbol" } via HTTP POST                             |
  | Crypto Keyword Extractor | GPT model extracts the valid crypto symbol (e.g., "SOL", "DOGE", "ETH")       |
  | RSS News Aggregators     | Pulls latest headlines from 9+ crypto sources (CoinDesk, Cointelegraph, etc.) |
  | Merge & Filter Articles  | Keeps only articles containing the specified token                            |
  | Prompt Builder           | Creates prompt for GPT with filtered headlines                                |
  | GPT-4o Summarizer        | Summarizes news into 3-part response: Summary, Sentiment, Headline Links      |
  | Telegram Formatter       | Converts GPT output into a Telegram-friendly message                          |
  | Response Handler         | Returns formatted message to the caller via webhook                           |

  📥 Webhook Trigger Format

  {
    "message": "ETH"
  }

  This triggers a full execution of the workflow and returns output like:

  📣 ETH Sentiment: Neutral

  • BlackRock’s tokenized fund expands to Ethereum mainnet (CoinDesk)  
  • Ethereum fees remain high, analysts call for L2 migration (NewsBTC)  
  • Vitalik warns about centralized risks in staking (Cointelegraph)

  📚 Installation Guide

  1. Import & Enable

  Load the .json into your n8n Editor
  Enable webhook trigger in the top-right corner
  Ensure it's reachable via POST /webhook/custom-path

  2. Required Credentials

  OpenAI API Key** (GPT-4o capable)
  No API keys required for RSS feeds

  3. Connect to Quant Agent

  Add an HTTP Request node in your main AI agent
  Point to this workflow's webhook with body { "message": "symbol" }
  Capture the response to include in your Telegram output

  🔍 Real Use Cases

  | Scenario                           | Result                                                           |
  | ---------------------------------- | ---------------------------------------------------------------- |
  | BTC Sentiment before a key event   | Returns 8–12 filtered articles with bullish/neutral/bearish tone |
  | Daily pulse for altcoins like DOGE | Shows relevant headlines, helpful for intraday trading setups    |
  | Telegram chatbot integration       | Enables user to query sentiment via /sentiment ETH             |
  | Macro context for Quant AI outputs | Adds emotional/news context to technical-based trade decisions   |

  🧾 Licensing & Attribution

  © 2025 Treasurium Capital Limited Company
  Architecture, prompts, and trade report structure are IP-protected.
  No unauthorized rebranding or resale permitted.

  🔗 For support: LinkedIn – Don Jayamaha

nodes_used:
  ["n8n-nodes-base.code","@n8n/n8n-nodes-langchain.agent","@n8n/n8n-nodes-langchain.lmChatOpenAi","@n8n/n8n-nodes-langchain.openAi"]

workflow_json:
  {"id":"f8Zow3PmilvRq85m","meta":{"instanceId":"a5283507e1917a33cc3ae615b2e7d5ad2c1e50955e6f831272ddd5ab816f3fb6"},"name":"Binance SM News and Sentiment Analyst Webhook Tool","tags":[],"nodes":[{"id":"1d71285d-a4bf-456a-a356-b9fa8b74c9d3","name":"OpenAI Chat Model","type":"@n8n/n8n-nodes-langchain.lmChatOpenAi","position":[-1020,1220],"parameters":{"model":{"__rl":true,"mode":"list","value":"gpt-4o-mini"},"options":{}},"credentials":{"openAiApi":{"id":"yUizd8t0sD5wMYVG","name":"OpenAi account"}},"typeVersion":1.2},{"id":"300cab6c-63ee-4271-a63e-b3afb135bdcf","name":"Set Query","type":"n8n-nodes-base.set","position":[-460,1040],"parameters":{"options":{},"assignments":{"assignments":[{"id":"9128e9e7-d1b8-4e89-8422-849b8dd519d8","name":"query","type":"string","value":"={{ $json.output }}"}]}},"typeVersion":3.4},{"id":"d7307bc3-f7c2-4db1-8674-5c6025ce7e2a","name":"Crypto News & Sentiment Agent","type":"@n8n/n8n-nodes-langchain.agent","position":[-960,1040],"parameters":{"text":"={{$json.body.message}}","options":{"systemMessage":"Your job is to analyze the keyword of the question and output it as a single word.  The keyword will always be the name of a cryptocurrency."},"promptType":"define"},"typeVersion":1.8},{"id":"c4ad1805-cb48-45a3-b850-4960f59299f0","name":"RSS Cointelegraph","type":"n8n-nodes-base.rssFeedRead","position":[160,200],"parameters":{"url":"https://cointelegraph.com/rss","options":{}},"typeVersion":1.1},{"id":"5fc71ef5-a376-41a0-9213-15cc4527b049","name":"RSS Bitcoinmagazine","type":"n8n-nodes-base.rssFeedRead","position":[160,360],"parameters":{"url":"https://bitcoinmagazine.com/.rss/full/","options":{}},"typeVersion":1.1},{"id":"bdbf7bab-c3a6-4f65-bbb9-a6cd83763dc5","name":"RSS Coindesk","type":"n8n-nodes-base.rssFeedRead","position":[160,520],"parameters":{"url":"https://www.coindesk.com/arc/outboundfeeds/rss/","options":{}},"typeVersion":1.1},{"id":"836d7edd-62c5-4819-aa30-c48c4b1f005d","name":"RSS Bitcoinist","type":"n8n-nodes-base.rssFeedRead","position":[160,680],"parameters":{"url":"https://bitcoinist.com/feed/","options":{}},"typeVersion":1.1},{"id":"a0778852-e86b-41e5-a3f8-6d4352e397a1","name":"RSS Newsbtc","type":"n8n-nodes-base.rssFeedRead","position":[160,840],"parameters":{"url":"https://www.newsbtc.com/feed/","options":{}},"typeVersion":1.1},{"id":"d5c5cc4f-ef15-40af-be33-31ce2dbdc45e","name":"RSS Cryptopotato","type":"n8n-nodes-base.rssFeedRead","position":[160,1200],"parameters":{"url":"https://cryptopotato.com/feed/","options":{}},"typeVersion":1.1},{"id":"5f02ad60-9b0a-49fc-afd7-558ac5aeee2d","name":"RSS 99bitcoins","type":"n8n-nodes-base.rssFeedRead","position":[160,1380],"parameters":{"url":"https://99bitcoins.com/feed/","options":{}},"typeVersion":1.1},{"id":"cc5373ab-931a-4b95-a1d4-6d21fa18273a","name":"RSS Cryptobriefing","type":"n8n-nodes-base.rssFeedRead","position":[160,1560],"parameters":{"url":"https://cryptobriefing.com/feed/","options":{}},"typeVersion":1.1},{"id":"e5baa2ef-0455-42b0-a597-dedd551ae1aa","name":"RSS Crypto.news","type":"n8n-nodes-base.rssFeedRead","position":[160,1720],"parameters":{"url":"https://crypto.news/feed/","options":{}},"typeVersion":1.1},{"id":"2cb96040-0e47-41b5-9c32-8362d397333c","name":"Merge All Articles","type":"n8n-nodes-base.merge","position":[840,880],"parameters":{"numberInputs":10},"typeVersion":3.1},{"id":"a1f53681-504a-445a-9aa1-35c40f174e0c","name":"Filter by Query","type":"n8n-nodes-base.code","position":[1080,1020],"parameters":{"jsCode":"const term = $node[\"Set Query\"].json.query.toLowerCase();\nreturn items.filter(item => {\n  const j            = item.json;\n  const title        = (j.title || \"\").toLowerCase();\n  const snippet      = (j.contentSnippet || j.description || \"\").toLowerCase();\n  const fullContent  = (j.content || \"\").toLowerCase();\n  return title.includes(term)\n      || snippet.includes(term)\n      || fullContent.includes(term);\n});"},"typeVersion":2},{"id":"3b886f03-884f-4c9a-bb74-46be78c941fe","name":"Build Prompt","type":"n8n-nodes-base.code","position":[1400,1020],"parameters":{"jsCode":"const q   = $node[\"Set Query\"].json.query;\nconst list = items\n  .map(i => `- ${i.json.title} (${i.json.link})`)\n  .join(\"\\n\");\nconst prompt = `\nYou are a crypto-industry news analyst.\nSummarize current news and market sentiment for **${q}** based on these articles:\n${list}\n\nAnswer in 3 parts:\n1. Summary of News\n2. Market Sentiment\n3. Links to reference news articles\n`;\nreturn [{ json: { prompt } }];"},"typeVersion":2},{"id":"936b9c46-0ea4-498a-9dbb-b4f6b62cf70f","name":"Summarize News & Sentiment (GPT-4o)","type":"@n8n/n8n-nodes-langchain.openAi","position":[1680,1020],"parameters":{"modelId":{"__rl":true,"mode":"list","value":"gpt-4o","cachedResultName":"GPT-4O"},"options":{},"messages":{"values":[{"content":"={{ $node[\"Build Prompt\"].json.prompt }}"},{"role":"assistant","content":"You are a crypto‐industry news analyst. Summarize sentiment clearly and concisely."}]}},"credentials":{"openAiApi":{"id":"yUizd8t0sD5wMYVG","name":"OpenAi account"}},"typeVersion":1.8},{"id":"2c1b4212-3675-416d-a0f4-f1bce7b1581b","name":"Prepare Telegram Message","type":"n8n-nodes-base.set","position":[2100,1020],"parameters":{"options":{},"assignments":{"assignments":[{"id":"565fb705-ac83-4a96-9343-2e29e348cc4f","name":"summary","type":"string","value":"={{ $json.message.content }}"}]}},"typeVersion":3.4},{"id":"ae4eacc3-281d-4c40-a1c8-fbd580fb49a8","name":"Sticky Note3","type":"n8n-nodes-base.stickyNote","position":[-1120,900],"parameters":{"color":6,"width":600,"height":460,"content":"##  Extract Keyword \nThis AI agent parses the user input and returns a single-word keyword to help match relevant news articles."},"typeVersion":1},{"id":"ea8734d6-5f17-4587-88aa-fcd342a563c5","name":"Sticky Note4","type":"n8n-nodes-base.stickyNote","position":[0,0],"parameters":{"color":5,"width":460,"height":1980,"content":"## News Aggregators\nPulls articles from major crypto news sources. You can add more RSS feeds here to expand coverage."},"typeVersion":1},{"id":"214d3fa9-d3f2-4e8a-bfab-5d4deb2881cf","name":"Sticky Note5","type":"n8n-nodes-base.stickyNote","position":[760,680],"parameters":{"color":2,"width":480,"height":760,"content":"## Merge & Filter News\nCombines all RSS articles and filters them using the extracted keyword to match only relevant results."},"typeVersion":1},{"id":"c6942449-1e0b-4bca-b1e0-411a3deaf26d","name":"Sticky Note6","type":"n8n-nodes-base.stickyNote","position":[1320,840],"parameters":{"color":7,"width":260,"height":360,"content":"## Prepare AI Prompt\nConstructs the input prompt for GPT-4o with a list of filtered articles. Output includes summary, sentiment, and article links."},"typeVersion":1},{"id":"7f401bd0-f14d-49d6-9d4a-fcb6e01bd64c","name":"Sticky Note7","type":"n8n-nodes-base.stickyNote","position":[1640,800],"parameters":{"color":3,"width":340,"height":440,"content":"## Summarize News & Sentiment (GPT-4o)\nUses OpenAI GPT-4o to generate a concise summary of the news, analyze market sentiment, and return formatted results.\n\n"},"typeVersion":1},{"id":"f60cb8e4-8d3f-4112-a200-6affb3b80cb3","name":"Sticky Note8","type":"n8n-nodes-base.stickyNote","position":[2040,760],"parameters":{"color":6,"height":460,"content":"## Format for Telegram\n\nExtracts the AI summary and prepares it for Telegram delivery. Change the variable if you want to include other data.\n\n\n"},"typeVersion":1},{"id":"e19e48b4-36cb-4b0b-87c5-0bae7f6068d7","name":"Webhook","type":"n8n-nodes-base.webhook","position":[-1440,1040],"webhookId":"a41af97d-6bd6-44d2-b79e-dca6df1e6e7e","parameters":{"path":"a41af97d-6bd6-44d2-b79e-dca6df1e6e7e","options":{},"httpMethod":"POST","responseMode":"responseNode"},"typeVersion":2},{"id":"7fae635b-2c8d-44e5-ac2a-b8a458653905","name":"Respond to Webhook","type":"n8n-nodes-base.respondToWebhook","position":[2440,1020],"parameters":{"options":{},"respondWith":"allIncomingItems"},"typeVersion":1.2},{"id":"96b562cd-1a55-40ef-aa0c-5d553d7f9818","name":"Sticky Note","type":"n8n-nodes-base.stickyNote","position":[-1500,740],"parameters":{"color":4,"height":480,"content":"## Webhook Trigger\nNode: Webhook\nAccepts **incoming HTTP POST requests**.\nExpected body format:\n\njson\n{ \"message\": \"<symbol>\" }\n\nThis kicks off the **full news + sentiment analysis process** for a given crypto asset."},"typeVersion":1},{"id":"8422e6bb-320e-4b5b-b392-2ba3adb215b7","name":"Sticky Note1","type":"n8n-nodes-base.stickyNote","position":[2380,760],"parameters":{"color":4,"height":480,"content":"## Return Results to Caller\nNode: Respond to Webhook\n**Sends the final formatted message** back to the parent workflow that triggered the call."},"typeVersion":1},{"id":"f323030f-c92f-4bff-a5df-f498aa70d9c4","name":"Sticky Note2","type":"n8n-nodes-base.stickyNote","position":[2780,-360],"parameters":{"width":1340,"height":2360,"content":"# 📰 Binance SM News and Sentiment Analyst Webhook Tool – Documentation\n\nA sentiment intelligence sub-agent that aggregates crypto news from top-tier RSS feeds, filters it based on a given token, and generates a market sentiment summary + headline list formatted for Telegram.\n\n---\n\n## 🎯 Purpose\n\nThis tool is responsible for:\n\n* Accepting a webhook request with a token symbol (e.g., `DOGE`, `SOL`)\n* Aggregating recent articles from 9+ major crypto news feeds\n* Filtering for articles relevant to the symbol\n* Summarizing the sentiment and key headlines using GPT-4o\n* Returning a Telegram-friendly formatted response to the caller\n\n---\n\n## 🛠️ Architecture & Key Components\n\n| Component                          | Role                                                           |\n| ---------------------------------- | -------------------------------------------------------------- |\n| 🔗 `Webhook`                       | Triggered externally with `{ message: \"BTC\" }`                 |\n| 🧠 `Crypto News & Sentiment Agent` | Uses GPT to extract the correct crypto keyword                 |\n| 🔄 RSS Feed Readers                | Pull from Cointelegraph, Coindesk, NewsBTC, Bitcoinist, etc.   |\n| 📦 `Merge All Articles`            | Combines articles into one stream                              |\n| 🧹 `Filter by Query`               | Keeps only the news relevant to the requested token            |\n| 📝 `Build Prompt`                  | Builds natural-language prompt to send to GPT                  |\n| 🧠 `Summarize News & Sentiment`    | GPT-4o summarizes the filtered articles with sentiment scoring |\n| 🧾 `Prepare Telegram Message`      | Formats the final summary in clean, Telegram-readable style    |\n| 📤 `Respond to Webhook`            | Returns the message to the triggering parent workflow          |\n\n---\n\n## 📥 Webhook Input\n\n> Expects a simple HTTP POST to the webhook endpoint:\n\n```json\n{\n  \"message\": \"ETH\"\n}\n```\n\nThis triggers a full pipeline execution, resulting in a text summary like:\n\n---\n\n## 📤 Sample Output Format\n\n```\n📣 ETH Sentiment: Neutral\n\n• BlackRock’s tokenized fund expands to Ethereum mainnet (CoinDesk)  \n• Ethereum fees remain high, analysts call for L2 migration (NewsBTC)  \n• Vitalik warns about centralized risks in staking (Cointelegraph)\n```\n\n---\n\n## 🔍 Use Cases\n\n| Scenario                                   | Outcome                                              |\n| ------------------------------------------ | ---------------------------------------------------- |\n| Sentiment summary for BTC                  | Fetches 8–12 filtered headlines, extracts tone       |\n| Daily news pulse for SOL                   | Shows project-related news with brief sentiment flag |\n| Enhances technical analysis interpretation | Adds macro/emotional context to trend setups         |\n| Telegram bot asks for XRP sentiment        | Sends full response back to user instantly           |\n\n---\n\n## 📚 How to Install\n\n### 1. Import & Activate\n\n1. Load the `.json` into your n8n instance\n2. Enable the webhook\n3. Link to parent agent (`Financial Analyst`, `Quant Agent`)\n\n### 2. Set Credentials\n\n* Requires a working **OpenAI API Key** (for GPT-4o)\n* No authentication required for RSS sources\n\n### 3. Connect to Caller\n\nAny external workflow (like your `Quant AI Agent`) can call this by:\n\n* Using HTTP Request Node\n* POSTing to this webhook with `{ message: \"BTC\" }` in the body\n\n---\n\n## 🧾 Licensing & Support\n\n🔗 **Don Jayamaha – LinkedIn**\n[http://linkedin.com/in/donjayamahajr](http://linkedin.com/in/donjayamahajr)\n\n© 2025 Treasurium Capital Limited Company. All rights reserved.\nThis system—including workflow architecture, prompt design, and logic structure—is protected under U.S. copyright law. Unauthorized resale or reproduction is prohibited.\n\n"},"typeVersion":1}],"active":false,"pinData":{},"settings":{"executionOrder":"v1"},"versionId":"9c17a79d-f8a4-413e-a486-2e89229994cf","connections":{"Webhook":{"main":[[{"node":"Crypto News & Sentiment Agent","type":"main","index":0}]]},"Set Query":{"main":[[{"node":"RSS Cointelegraph","type":"main","index":0},{"node":"RSS Bitcoinmagazine","type":"main","index":0},{"node":"RSS Coindesk","type":"main","index":0},{"node":"RSS Bitcoinist","type":"main","index":0},{"node":"RSS Newsbtc","type":"main","index":0},{"node":"RSS Cryptopotato","type":"main","index":0},{"node":"RSS 99bitcoins","type":"main","index":0},{"node":"RSS Cryptobriefing","type":"main","index":0},{"node":"RSS Crypto.news","type":"main","index":0}]]},"RSS Newsbtc":{"main":[[{"node":"Merge All Articles","type":"main","index":4}]]},"Build Prompt":{"main":[[{"node":"Summarize News & Sentiment (GPT-4o)","type":"main","index":0}]]},"RSS Coindesk":{"main":[[{"node":"Merge All Articles","type":"main","index":2}]]},"RSS 99bitcoins":{"main":[[{"node":"Merge All Articles","type":"main","index":7}]]},"RSS Bitcoinist":{"main":[[{"node":"Merge All Articles","type":"main","index":3}]]},"Filter by Query":{"main":[[{"node":"Build Prompt","type":"main","index":0}]]},"RSS Crypto.news":{"main":[[{"node":"Merge All Articles","type":"main","index":9}]]},"RSS Cryptopotato":{"main":[[{"node":"Merge All Articles","type":"main","index":6}]]},"OpenAI Chat Model":{"ai_languageModel":[[{"node":"Crypto News & Sentiment Agent","type":"ai_languageModel","index":0}]]},"RSS Cointelegraph":{"main":[[{"node":"Merge All Articles","type":"main","index":0}]]},"Merge All Articles":{"main":[[{"node":"Filter by Query","type":"main","index":0}]]},"RSS Cryptobriefing":{"main":[[{"node":"Merge All Articles","type":"main","index":8}]]},"RSS Bitcoinmagazine":{"main":[[{"node":"Merge All Articles","type":"main","index":1}]]},"Prepare Telegram Message":{"main":[[{"node":"Respond to Webhook","type":"main","index":0}]]},"Crypto News & Sentiment Agent":{"main":[[{"node":"Set Query","type":"main","index":0}]]},"Summarize News & Sentiment (GPT-4o)":{"main":[[{"node":"Prepare Telegram Message","type":"main","index":0}]]}}}


name: Get Binance Spot Market Financial Analysis via Telegram with GPT-4o
author_name: Don Jayamaha Jr
author_username: don-the-gem-dealer
categories: []
created_at: 2025-06-06T18:03:54.629Z
updated_at: 2025-06-06T18:03:54.629Z
url: https://n8n.io/workflows/4741
scraped_at: 2025-06-19 22:49:01
description:
  This workflow powers the Binance Spot Market Quant AI Agent, acting as the Financial Market Analyst. It fuses real-time market structure data (price, volume, kline) with multiple timeframe technical indicators (15m, 1h, 4h, 1d) and returns a structured trading outlook—perfect for intraday and swing traders who want actionable analysis in Telegram.

  🔗 Requires the following sub-workflows to function:
  • Binance SM 15min Indicators Tool
  • Binance SM 1hour Indicators Tool
  • Binance SM 4hour Indicators Tool
  • Binance SM 1day Indicators Tool
  • Binance SM Price/24hStats/Kline Tool

  ⚙️ How It Works

  Triggered via webhook (typically by the Quant AI Agent).
  Extracts user symbol + timeframe from input (e.g., "DOGE outlook today").
  Calls all linked sub-workflows to retrieve indicators + live price data.
  Merges the data and formats a clean trading report using GPT-4o-mini.
  Returns HTML-formatted message suitable for Telegram delivery.

  📥 Sample Input

  {
    "message": "SOLUSDT",
    "sessionId": "654321123"
  }

  ✅ Telegram Output Format

  📊 SOLUSDT Market Snapshot

  💰 Price: $156.75  
  📉 24h Stats: High $160.10 | Low $149.00 | Volume: 1.1M SOL

  🧪 4h Indicators:
  • RSI: 58.2 (Neutral-Bullish)  
  • MACD: Crossover Up  
  • BB: Squeezing Near Upper Band  
  • ADX: 25.7 (Rising Trend)

  📈 Resistance: $163  
  📉 Support: $148

  🔍 Use Cases

  | Scenario                        | Outcome                                                   |
  | ------------------------------- | --------------------------------------------------------- |
  | User asks for “BTC outlook”     | Returns 1h + 4h + 1d indicators + live price + key levels |
  | Telegram bot prompt: “DOGE now” | Returns short-term 15m + 1h analysis snapshot             |
  | Strategy trigger inside n8n     | Enables other workflows to consume structured signal data |

  🎥 Watch the Live Demo



  📺 https://youtu.be/k9VuU2h5wwI

  🧾 Licensing & Attribution

  © 2025 Treasurium Capital Limited Company
  Architecture, prompts, and trade report structure are IP-protected.
  No unauthorized rebranding or redistribution permitted.

  🔗 For support: LinkedIn – Don Jayamaha

nodes_used:
  ["@n8n/n8n-nodes-langchain.agent","@n8n/n8n-nodes-langchain.lmChatOpenAi","@n8n/n8n-nodes-langchain.memoryBufferWindow","@n8n/n8n-nodes-langchain.toolWorkflow"]

workflow_json:
  {"id":"Nm41n4i6VMhrixZs","meta":{"instanceId":"a5283507e1917a33cc3ae615b2e7d5ad2c1e50955e6f831272ddd5ab816f3fb6","templateCredsSetupCompleted":true},"name":"Binance SM Financial Analyst Tool","tags":[],"nodes":[{"id":"76944051-b8a4-4619-a307-3467e545c2d0","name":"When Executed by Another Workflow","type":"n8n-nodes-base.executeWorkflowTrigger","position":[-640,-100],"parameters":{"workflowInputs":{"values":[{"name":"message"},{"name":"sessionId"}]}},"typeVersion":1.1},{"id":"035ef2de-8f55-4d8e-96fb-17ecefc835b9","name":"OpenAI Chat Model","type":"@n8n/n8n-nodes-langchain.lmChatOpenAi","position":[-920,240],"parameters":{"model":{"__rl":true,"mode":"list","value":"gpt-4.1-mini","cachedResultName":"gpt-4.1-mini"},"options":{}},"credentials":{"openAiApi":{"id":"yUizd8t0sD5wMYVG","name":"OpenAi account"}},"typeVersion":1.2},{"id":"8a658740-f8c3-44e2-ae3a-974bf5baec55","name":"Simple Memory","type":"@n8n/n8n-nodes-langchain.memoryBufferWindow","position":[-660,240],"parameters":{},"typeVersion":1.3},{"id":"ab7672db-5912-4ed5-b9cc-8a64195fb4f1","name":"Binance SM Financial Analyst Agent","type":"@n8n/n8n-nodes-langchain.agent","position":[-200,-100],"parameters":{"text":"={{ $json.message }}","options":{"systemMessage":"You are the **Binance Spot Market Financial Analyst AI Agent**, tasked with interpreting natural-language trading queries and generating **multi-timeframe, indicator-driven market analysis** for any Binance spot symbol.\n\nYour core responsibility is to orchestrate real-time price tools and technical indicator sub-agents to **diagnose trend conditions, volatility shifts, and market momentum**, and return a structured report formatted for Telegram.\n\n---\n\n### 🔗 Connected Tools & Agents\n\n#### 1. **Price & Market Structure Tool**\n\nWorkflow: `Binance SM Price-24hrStats-OrderBook-Kline Tool`\nReturns:\n\n* `getCurrentPrice`\n* `get24hrStats`\n* `getOrderBook`\n* `getKlines`\n  Input:\n\n```json\n{\n  \"message\": \"<SYMBOL>\",\n  \"sessionId\": \"<Telegram Chat ID>\"\n}\n```\n\n#### 2. **Timeframe-Based Technical Indicator Agents**\n\nEach uses the latest Binance kline data (limit: 40) to calculate:\n\n* **RSI** (14)\n* **MACD** (12/26/9)\n* **Bollinger Bands** (20/2)\n* **SMA / EMA** (20)\n* **ADX** (+DI, −DI, 14)\n\nAgents:\n\n* `Binance SM 15min Indicators Agent`\n* `Binance SM 1hour Indicators Agent`\n* `Binance SM 4hour Indicators Agent`\n* `Binance SM 1day Indicators Agent`\n\nInput to each agent:\n\n```json\n{\n  \"message\": \"<SYMBOL>\",\n  \"sessionId\": \"<Telegram Chat ID>\"\n}\n```\n\n---\n\n### 🧠 Decision Engine & Routing Logic\n\nYou must:\n\n* Extract the **symbol** and **implied timeframe** from the user query.\n* If no timeframe is given, default to:\n\n  * **Short-Term**: 15m + 1h\n  * **Mid-Term**: 1h + 4h\n  * **Long-Term**: 1d + 4h\n* Route data requests in parallel across tools\n* Merge raw metrics into a final structured insight\n\n---\n\n### 📤 Telegram Output Template\n\nReturn your final result in this format:\n\n```\n📊 <SYMBOL> Market Snapshot\n\n💰 Price: $63,220  \n📈 24h Change: +2.3%  \n📊 Volume: 45,210 BTC\n\n🧪 Technical Summary:\n• 1h RSI: 68 (Bullish)  \n• MACD: Crossover Up  \n• BB Width: Narrowing (Possible Breakout)  \n• ADX: 32 (Strong Trend)  \n\n📉 Support: $61,900  \n📈 Resistance: $63,800\n```\n\n---\n\n### ✅ Input Handling Notes\n\n* Input: Human questions like \"How’s BTC doing today?\" or \"Is SOL bullish in the 4h chart?\"\n* If timeframe is missing, **infer intent**\n* If symbol is missing, prompt: “Which token would you like me to analyze?”\n* All agents and tools **must return cleaned JSON**, avoid raw API output"},"promptType":"define"},"typeVersion":2},{"id":"f12e6672-bcb5-44af-b7d7-250437d8ba7c","name":"Binance SM Price-24hrStats-OrderBook-Kline Agent","type":"@n8n/n8n-nodes-langchain.toolWorkflow","position":[-400,220],"parameters":{"workflowId":{"__rl":true,"mode":"list","value":"xAa5vBxhQzEWWFJM","cachedResultName":"Work Drive — Binance SM Price-24hrStats-OrderBook-Kline Tool"},"description":"This tool is a delegated sub-agent workflow that provides low-level market data from the Binance Spot Market in response to upstream AI reasoning. It is used by higher-level agents (e.g. the Financial Analyst Agent) to retrieve structured financial metrics and price data for any cryptocurrency pair.\n\n🔧 What It Does:\nThis agent accepts a symbol-based message input and returns Binance API data for:\n\n✅ getCurrentPrice – Latest market price for a trading pair (e.g., BTCUSDT)\n\n✅ get24hrStats – 24-hour price change, high/low, volume, and close stats\n\n✅ getOrderBook – Real-time order book (bids/asks) with adjustable depth\n\n✅ getKlines – Candlestick OHLCV data for technical analysis","workflowInputs":{"value":{"message":"={{ $fromAI(\"message\",\"Populate this with a relevant message to this subagent\")}}","sessionId":"={{ $json.sessionId }}"},"schema":[{"id":"message","type":"string","display":true,"required":false,"displayName":"message","defaultMatch":false,"canBeUsedToMatch":true},{"id":"sessionId","type":"string","display":true,"required":false,"displayName":"sessionId","defaultMatch":false,"canBeUsedToMatch":true}],"mappingMode":"defineBelow","matchingColumns":[],"attemptToConvertTypes":false,"convertFieldsToString":false}},"typeVersion":2.2},{"id":"35936a8a-1bf6-4bfb-8ad7-1d192e6cf655","name":"Binance SM 15min Indicators Agent","type":"@n8n/n8n-nodes-langchain.toolWorkflow","position":[-120,220],"parameters":{"workflowId":{"__rl":true,"mode":"list","value":"INYtgCEbxdGBDivU","cachedResultName":"Work Drive — Binance SM 15min Indicators Tool"},"description":"This is a 15-minute interval technical indicator agent for Binance Spot Market pairs. It provides AI-driven access to real-time technical signals calculated on the latest 15-minute candlestick data. Designed for use within larger financial analysis workflows, this tool helps detect short-term momentum shifts and trading signals.\n\n🔧 What It Does:\nWhen called with a valid crypto symbol, this agent fetches the latest 15-minute technical indicators, typically including (but not limited to):\n\n✅ Relative Strength Index (RSI)\n\n✅ Bollinger Bands (BBANDS)\n\n✅ Moving Averages (SMA/EMA)\n\n✅ MACD\n\n✅ ADX","workflowInputs":{"value":{"message":"={{ $fromAI(\"message\",\"Populate this with a relevant message to this subagent\")}}","sessionId":"={{ $json.sessionId }}"},"schema":[{"id":"message","type":"string","display":true,"required":false,"displayName":"message","defaultMatch":false,"canBeUsedToMatch":true},{"id":"sessionId","type":"string","display":true,"required":false,"displayName":"sessionId","defaultMatch":false,"canBeUsedToMatch":true}],"mappingMode":"defineBelow","matchingColumns":[],"attemptToConvertTypes":false,"convertFieldsToString":false}},"typeVersion":2.2},{"id":"3c15aea8-475e-42e0-b8f7-2295a176e386","name":"Binance SM 1hour Indicators Agent","type":"@n8n/n8n-nodes-langchain.toolWorkflow","position":[100,220],"parameters":{"workflowId":{"__rl":true,"mode":"list","value":"eXDMxZUrE0tIPcR9","cachedResultName":"Work Drive — Binance SM 1hour Indicators Tool"},"description":"This agent is responsible for analyzing 1-hour interval technical indicators for trading pairs on the Binance Spot Market. It is used to detect mid-range market momentum and potential entry/exit signals based on trend strength and volatility.\n\n🔧 What It Does:\nWhen invoked, this agent queries the Binance SM 1hour Indicators Tool to retrieve AI-processed indicator data including (but not limited to):\n\n✅ RSI (Relative Strength Index)\n\n✅ MACD (Moving Average Convergence Divergence)\n\n✅ Bollinger Bands (BBANDS)\n\n✅ SMA / EMA (Simple & Exponential Moving Averages)\n\n✅ ADX (Average Directional Index)\n\nThese indicators are calculated from the latest 1-hour candlestick data and limited to the most recent data points (typically last 20).","workflowInputs":{"value":{"message":"={{ $fromAI(\"message\",\"Populate this with a relevant message to this subagent\")}}","sessionId":"={{ $json.sessionId }}"},"schema":[{"id":"message","type":"string","display":true,"required":false,"displayName":"message","defaultMatch":false,"canBeUsedToMatch":true},{"id":"sessionId","type":"string","display":true,"required":false,"displayName":"sessionId","defaultMatch":false,"canBeUsedToMatch":true}],"mappingMode":"defineBelow","matchingColumns":[],"attemptToConvertTypes":false,"convertFieldsToString":false}},"typeVersion":2.2},{"id":"b2feb013-9d16-4838-bfb5-2035ceb70790","name":"Binance SM 4hour Indicators Agent","type":"@n8n/n8n-nodes-langchain.toolWorkflow","position":[340,220],"parameters":{"workflowId":{"__rl":true,"mode":"list","value":"6U56ifHxnha9rf2n","cachedResultName":"Work Drive — Binance SM 4hour Indicators Tool"},"description":"This agent focuses on retrieving and analyzing 4-hour timeframe technical indicators for Binance Spot Market trading pairs. It provides a medium-term view of trend strength, volatility, and momentum shifts—ideal for swing trading analysis and macro-level setups.\n\n🔧 What It Does:\nWhen triggered, the agent queries the Binance SM 4hour Indicators Tool workflow and returns a curated set of technical indicator values, such as:\n\n✅ RSI (Relative Strength Index)\n\n✅ MACD (Moving Average Convergence Divergence)\n\n✅ Bollinger Bands\n\n✅ SMA / EMA\n\n✅ ADX (Trend Strength)\n\nThese indicators are derived from recent 4-hour candlestick data (typically the last 20 bars) and formatted for human-readable AI response generation.","workflowInputs":{"value":{"message":"={{ $fromAI(\"message\",\"Populate this with a relevant message to this subagent\")}}","sessionId":"={{ $json.sessionId }}"},"schema":[{"id":"message","type":"string","display":true,"required":false,"displayName":"message","defaultMatch":false,"canBeUsedToMatch":true},{"id":"sessionId","type":"string","display":true,"required":false,"displayName":"sessionId","defaultMatch":false,"canBeUsedToMatch":true}],"mappingMode":"defineBelow","matchingColumns":[],"attemptToConvertTypes":false,"convertFieldsToString":false}},"typeVersion":2.2},{"id":"248d63c7-0b95-4f50-acb0-ed2c58dfb4e9","name":"Binance SM 1day Indicators Agent","type":"@n8n/n8n-nodes-langchain.toolWorkflow","position":[600,220],"parameters":{"workflowId":{"__rl":true,"mode":"list","value":"tZtQVd3nbDgZ1DTZ","cachedResultName":"Work Drive — Binance SM 1day Indicators Tool"},"workflowInputs":{"value":{"message":"={{ $fromAI(\"message\",\"Populate this with a relevant message to this subagent\")}}","sessionId":"={{ $json.sessionId }}"},"schema":[{"id":"message","type":"string","display":true,"required":false,"displayName":"message","defaultMatch":false,"canBeUsedToMatch":true},{"id":"sessionId","type":"string","display":true,"required":false,"displayName":"sessionId","defaultMatch":false,"canBeUsedToMatch":true}],"mappingMode":"defineBelow","matchingColumns":[],"attemptToConvertTypes":false,"convertFieldsToString":false}},"typeVersion":2.2},{"id":"823c3ea2-dbee-4da5-a660-8b862e675db1","name":"Sticky Note","type":"n8n-nodes-base.stickyNote","position":[-700,-400],"parameters":{"color":4,"height":500,"content":"## Trigger: Parent Workflow Call\nNode: When Executed by Another Workflow\nThis agent does not start on its own. It is always triggered from a higher-level agent, like:\n\n**Binance Quant AI Agent**\n\nCustom multi-timeframe analyzers"},"typeVersion":1},{"id":"61189fe9-31c1-4c03-b185-61ab5847e144","name":"Sticky Note1","type":"n8n-nodes-base.stickyNote","position":[-720,180],"parameters":{"color":3,"width":220,"height":520,"content":"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n## Memory Context\nNode: **Simple Memory\nStores the session ID, message, and interim indicator values** for cross-tool alignment. Enables:\n\nMulti-turn dialogue logic\n\nTrend comparison across timeframes\n\nReport reuse if repeated query is made"},"typeVersion":1},{"id":"e9347973-3644-47dc-927e-87b480e473d9","name":"Sticky Note2","type":"n8n-nodes-base.stickyNote","position":[-980,180],"parameters":{"width":220,"height":520,"content":"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n## AI Engine\nNode: OpenAI Chat Model\nModel: **gpt-4.1-mini** or compatible\nUsed to:\n\nInterpret values from all indicator tools\n\nLabel behavior: **“Overbought,” “MACD Cross Up,” “Volatility Spike”**\n\nOutput final snapshot in clean Telegram format"},"typeVersion":1},{"id":"cee591cc-6c30-4d47-be93-5621315d02e4","name":"Sticky Note3","type":"n8n-nodes-base.stickyNote","position":[-460,180],"parameters":{"color":6,"width":220,"height":620,"content":"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n## Price & Structure Tool\nNode: **Binance SM Price-24hrStats-OrderBook-Kline Agent**\nReturns raw metrics:\n\n✅ Current Price\n\n✅ 24hr Stats (OHLCV)\n\n✅ Order Book Depth (top 100 bids/asks)\n\n✅ Kline snapshots (15m, 1h, 4h, 1d)\n\nAll data is Telegram-optimized before AI formatting.\n\n"},"typeVersion":1},{"id":"bfdeab4a-a387-41a6-97ca-6719b640b744","name":"Sticky Note4","type":"n8n-nodes-base.stickyNote","position":[-200,180],"parameters":{"color":6,"width":220,"height":780,"content":"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n## Technical Indicator Agents\nEach tool receives the same inputs:\n\njson\n{\n  \"message\": \"BTCUSDT\",\n  \"sessionId\": \"539847013\"\n}\n\n🔸 **15m Indicator Agent**\nDetects **fast-changing intraday signals** (scalping, fakeouts)\n\n\nEach calculates:\n\nRSI (14)\n\nMACD (12/26/9)\n\nBBANDS (20/2)\n\nSMA/EMA (20)\n\nADX (+DI / −DI, 14)"},"typeVersion":1},{"id":"a79b656a-b38a-4b0e-96c3-70b5282710aa","name":"Sticky Note5","type":"n8n-nodes-base.stickyNote","position":[40,180],"parameters":{"color":6,"width":220,"height":780,"content":"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n## Technical Indicator Agents\nEach tool receives the same inputs:\n\njson\n{\n  \"message\": \"BTCUSDT\",\n  \"sessionId\": \"539847013\"\n}\n\n🔸 **1h Indicator Agent**\nBest for **momentum confirmation or breakout acceleration**\n\n\nEach calculates:\n\nRSI (14)\n\nMACD (12/26/9)\n\nBBANDS (20/2)\n\nSMA/EMA (20)\n\nADX (+DI / −DI, 14)"},"typeVersion":1},{"id":"d1656eec-67d4-4ff0-8cf2-ee2040a9d8f2","name":"Sticky Note6","type":"n8n-nodes-base.stickyNote","position":[280,180],"parameters":{"color":6,"width":220,"height":780,"content":"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n## Technical Indicator Agents\nEach tool receives the same inputs:\n\njson\n{\n  \"message\": \"BTCUSDT\",\n  \"sessionId\": \"539847013\"\n}\n\n🔸 **4h Indicator Agent**\n**Macro view of medium-term setups and volume confirmation**\n\nEach calculates:\n\nRSI (14)\n\nMACD (12/26/9)\n\nBBANDS (20/2)\n\nSMA/EMA (20)\n\nADX (+DI / −DI, 14)"},"typeVersion":1},{"id":"115e5783-5220-45ac-a80e-bd9dd11d4af1","name":"Sticky Note7","type":"n8n-nodes-base.stickyNote","position":[540,180],"parameters":{"color":6,"width":220,"height":780,"content":"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n## Technical Indicator Agents\nEach tool receives the same inputs:\n\njson\n{\n  \"message\": \"BTCUSDT\",\n  \"sessionId\": \"539847013\"\n}\n\n\n🔸 1**d Indicator Agent**\n**High-timeframe sentiment, ideal for swing trade direction**\n\nEach calculates:\n\nRSI (14)\n\nMACD (12/26/9)\n\nBBANDS (20/2)\n\nSMA/EMA (20)\n\nADX (+DI / −DI, 14)"},"typeVersion":1},{"id":"bb184375-fab1-431a-a33f-b3dc0751105d","name":"Sticky Note8","type":"n8n-nodes-base.stickyNote","position":[-320,-380],"parameters":{"color":5,"width":500,"height":460,"content":"## Primary Reasoning Agent\nNode: Binance SM Financial Analyst Agent\nThis is the orchestrator that:\n\n**Parses the symbol** and optional timeframe from user input\n\nSelects **tools dynamically**\n\n**Merges all results into one final report**\n\n"},"typeVersion":1},{"id":"396ab0d2-a322-4373-836f-94490acdc9f0","name":"Sticky Note9","type":"n8n-nodes-base.stickyNote","position":[940,-920],"parameters":{"width":1060,"height":1900,"content":"# 📊 Binance SM Financial Analyst Tool – Documentation\n\nA central orchestrator that fuses market structure data and technical indicators across all relevant timeframes, preparing them for final trading analysis inside the Quant AI system.\n\n---\n\n## 🎯 Purpose\n\nThis tool is responsible for:\n\n* Parsing Telegram-style prompts from the master agent\n* Routing data requests to all relevant indicator tools (15m, 1h, 4h, 1d)\n* Fetching price, volume, order book, and kline structure\n* Merging all responses and returning a clean, readable summary\n\n---\n\n## 🧩 Connected Sub-Agents\n\n| Sub-Agent Tool                           | Role                                                     |\n| --------------------------------------   | -------------------------------------------------------- |\n| ✅ Binance SM 15min Indicators Tool       | Short-term volatility and reversals                      |\n| ✅ Binance SM 1hour Indicators Tool       | Intraday momentum and trend formation                    |\n| ✅ Binance SM 4hour Indicators Tool       | Swing trend analysis and confirmation                    |\n| ✅ Binance SM 1day Indicators Tool        | Macro trend detection and directional bias               |\n| ✅ Binance SM Price/24hStats/Kline Tool   | Raw market structure: OHLCV, order book, real-time price |\n\n---\n\n## ⚙️ Workflow Architecture\n\n| Section                             | Description                                                     |\n| ----------------------------------- | --------------------------------------------------------------- |\n| 🔄 **Trigger:**                     | Executed by Quant AI Agent or Telegram Bot Handler              |\n| 💬 **LLM Reasoning (gpt-4o-mini):** | Interprets queries, symbol, timeframe, intent                   |\n| 🧠 **Session Memory:**              | Tracks `sessionId`, symbol history, multi-turn intent           |\n| 📥 **Input Format:**                | `{ \\\"message\\\": \\\"SOLUSDT\\\", \\\"sessionId\\\": \\\"123456789\\\" }`    |\n| 🔁 **Tool Calls:**                  | Invokes all indicators and market data tools in parallel        |\n| 📊 **Merge Results:**               | Combines indicators + price + order book into structured output |\n| 📤 **Final Output:**                | Telegram-ready HTML summary (text only, no raw JSON)            |\n\n---\n\n## 📏 Timeframe Logic\n\n| Case           | Action                                            |\n| -------------- | ------------------------------------------------- |\n| No timeframe   | Default to `15m + 1h` (short-term snapshot)       |\n| Broad question | Return `1h + 4h + 1d` data (medium- to long-term) |\n| Symbol missing | Ask user to clarify the token or asset symbol     |\n\n---\n\n## 🖥️ Telegram Output Format\n\n```\n📊 ETHUSDT Market Overview\n\n💰 Price: $3,680  \n📉 24h Stats: High $3,720 | Low $3,580 | Volume: 920,000 ETH\n\n🧪 4h Technical Indicators:\n• RSI: 62.1 → Neutral-Bullish  \n• MACD: Crossover Up  \n• BB: Price near upper band  \n• ADX: 27.9 → Growing Trend\n\n📈 Resistance: $3,740  \n📉 Support: $3,600\n```\n\n---\n\n## ✅ Use Case Scenarios\n\n| Scenario                               | Result                                                     |\n| -------------------------------------- | ---------------------------------------------------------- |\n| User asks: “Show me BTC outlook today” | 15m + 1h + 1d analysis merged and summarized               |\n| User asks: “How is DOGE trending?”     | Indicator agent fetch + live price + structure returned    |\n| Input lacks timeframe                  | Defaults to short + medium scopes with follow-up if needed |\n\n---\n\n## 🚀 Support & Licensing\n\n🔗 **Don Jayamaha – LinkedIn**\n[http://linkedin.com/in/donjayamahajr](http://linkedin.com/in/donjayamahajr)\n\n© 2025 Treasurium Capital Limited Company. All rights reserved.\nThis AI automation system, including logic, code, prompt flows, and architectural structure, is proprietary intellectual property of **Treasurium Capital Limited Company**. Reproduction, redistribution, or resale is strictly prohibited without express license.\n"},"typeVersion":1}],"active":false,"pinData":{},"settings":{"executionOrder":"v1"},"versionId":"9d7a97dc-1249-4e37-a25a-e003555850b7","connections":{"Simple Memory":{"ai_memory":[[{"node":"Binance SM Financial Analyst Agent","type":"ai_memory","index":0}]]},"OpenAI Chat Model":{"ai_languageModel":[[{"node":"Binance SM Financial Analyst Agent","type":"ai_languageModel","index":0}]]},"Binance SM 1day Indicators Agent":{"ai_tool":[[{"node":"Binance SM Financial Analyst Agent","type":"ai_tool","index":0}]]},"Binance SM 15min Indicators Agent":{"ai_tool":[[{"node":"Binance SM Financial Analyst Agent","type":"ai_tool","index":0}]]},"Binance SM 1hour Indicators Agent":{"ai_tool":[[{"node":"Binance SM Financial Analyst Agent","type":"ai_tool","index":0}]]},"Binance SM 4hour Indicators Agent":{"ai_tool":[[{"node":"Binance SM Financial Analyst Agent","type":"ai_tool","index":0}]]},"When Executed by Another Workflow":{"main":[[{"node":"Binance SM Financial Analyst Agent","type":"main","index":0}]]},"Binance SM Price-24hrStats-OrderBook-Kline Agent":{"ai_tool":[[{"node":"Binance SM Financial Analyst Agent","type":"ai_tool","index":0}]]}}}


name: Binance SM Price-24hrStats-OrderBook-Kline Tool
author_name: Don Jayamaha Jr
author_username: don-the-gem-dealer
categories: []
created_at: 2025-06-06T18:08:36.625Z
updated_at: 2025-06-06T18:08:36.625Z
url: https://n8n.io/workflows/4742
scraped_at: 2025-06-19 22:50:01
description:
  A powerful sub-agent that collects real-time market structure data from Binance for any trading pair — including price, volume, order book depth, and candlestick snapshots across multiple timeframes (15m, 1h, 4h, 1d).

  🎥 Live Demo:

  🎯 Purpose

  This workflow powers the Quant AI system with:

  ✅ Real-time price feed (/ticker/price)
  ✅ 24-hour stats (OHLC, % change, volume via /ticker/24hr)
  ✅ Live order book depth (/depth)
  ✅ Latest candlestick data (/klines) for all major intervals

  All outputs are parsed and formatted using GPT and returned to the parent agent (e.g., Financial Analyst Tool) as a Telegram-optimized summary.

  ⚙️ Workflow Architecture

  | Node                                 | Role                                                         |
  | ------------------------------------ | ------------------------------------------------------------ |
  | 🔗 Execute Workflow Trigger        | Accepts input from parent workflow                           |
  | 🧠 Simple Memory                   | Stores session + symbol info                                 |
  | 🤖 Binance SM Market Agent         | Parses prompt, routes tool calls                             |
  | 💡 OpenAI Chat Model (gpt-4o-mini) | Converts raw data into a clean, readable format for Telegram |
  | 🌐 getCurrentPrice                 | Gets latest price                                            |
  | 🌐 get24hrStats                    | Gets OHLC/volume over past 24 hours                          |
  | 🌐 getOrderBook                    | Gets top 100 bids and asks                                   |
  | 🌐 getKlines                       | Gets latest 15m, 1h, 4h, and 1d candles                      |

  📥 Input Requirements

  This workflow is not called directly by the user. Instead, it is triggered by another workflow, such as:

  {
    "message": "BTCUSDT",
    "sessionId": "539847013"
  }

  📤 Telegram Output Example

  📊 BTCUSDT Market Overview

  💰 Price: $63,220  
  📈 24h Change: +2.3% | Volume: 45,210 BTC  

  📉 Order Book  
  • Top Bid: $63,190  
  • Top Ask: $63,230  

  🕰️ Latest Candles  
  • 15m: O: $63,000 | C: $63,220 | Vol: 320 BTC  
  • 1h : O: $62,700 | C: $63,300 | Vol: 980 BTC  
  • 4h : O: $61,800 | C: $63,500 | Vol: 2,410 BTC  
  • 1d : O: $59,200 | C: $63,220 | Vol: 7,850 BTC

  ✅ Use Cases

  | Scenario                           | Output Provided                                              |
  | ---------------------------------- | ------------------------------------------------------------ |
  | “Show current BTC price and trend” | Price, 24h stats, candles, and order book in one message     |
  | “Candles for SOL”                  | 15m, 1h, 4h, 1d candlesticks for SOLUSDT                     |
  | Triggered by Quant AI system       | Clean Telegram-ready summary with all structure tools merged |

  🧩 Toolchain Breakdown

  | Tool Name         | Endpoint               | Purpose                        |
  | ----------------- | ---------------------- | ------------------------------ |
  | getCurrentPrice | /api/v3/ticker/price | Latest trade price             |
  | get24hrStats    | /api/v3/ticker/24hr  | 24h OHLC, % change, volume     |
  | getOrderBook    | /api/v3/depth        | Top 100 bids and asks          |
  | getKlines       | /api/v3/klines       | 1-candle snapshot across 4 TFs |

  🚀 Installation Steps

  Import the JSON into your n8n instance
  Connect your OpenAI credentials for the Chat Model node
  No Binance API key needed — public endpoints
  Trigger this tool only via:

     Binance SM Financial Analyst Tool
     Binance Spot Market Quant AI Agent

  🔐 Licensing & Attribution

  © 2025 Treasurium Capital Limited Company
  Architecture, prompts, and trade structure are IP-protected. No unauthorized rebranding permitted.

  🔗 For support: Don Jayamaha – LinkedIn

nodes_used:
  ["@n8n/n8n-nodes-langchain.agent","@n8n/n8n-nodes-langchain.lmChatOpenAi","@n8n/n8n-nodes-langchain.memoryBufferWindow","@n8n/n8n-nodes-langchain.toolHttpRequest"]

workflow_json:
  {"id":"xAa5vBxhQzEWWFJM","meta":{"instanceId":"a5283507e1917a33cc3ae615b2e7d5ad2c1e50955e6f831272ddd5ab816f3fb6","templateCredsSetupCompleted":true},"name":"Binance SM Price-24hrStats-OrderBook-Kline Tool","tags":[],"nodes":[{"id":"200b26ba-fd67-48a2-86fc-cc1f92548757","name":"getCurrentPrice","type":"@n8n/n8n-nodes-langchain.toolHttpRequest","position":[80,160],"parameters":{"url":"https://api.binance.com/api/v3/ticker/price","sendQuery":true,"parametersQuery":{"values":[{"name":"symbol"}]},"toolDescription":"Fetches the current price for a trading pair (e.g., BTCUSDT) from Binance Spot Market.\n\n✅ Expected Query Format (JSON):\n\njson\n{\n  \"symbol\": \"BTCUSDT\"\n}\nYou must provide a valid symbol (e.g., BTCUSDT, ETHUSDT, BNBUSDT) as a string."},"typeVersion":1.1},{"id":"978a1d9f-b217-4455-b0b3-96b86d2fd809","name":"get24hrStats","type":"@n8n/n8n-nodes-langchain.toolHttpRequest","position":[320,160],"parameters":{"url":"https://api.binance.com/api/v3/ticker/24hr","sendQuery":true,"parametersQuery":{"values":[{"name":"symbol"}]},"toolDescription":"Fetches 24-hour price statistics including open, high, low, close, and volume for a trading pair (e.g., BTCUSDT) from Binance Spot Market.\\n\\n\\u2705 Expected Query Format (JSON):\\n{\\n  \\\"symbol\\\": \\\"BTCUSDT\\\"\\n}\\nReplace 'BTCUSDT' with the symbol you want to monitor."},"typeVersion":1.1},{"id":"b6c4bb2d-6669-433a-a83b-f0c25c48e5ce","name":"getOrderBook","type":"@n8n/n8n-nodes-langchain.toolHttpRequest","position":[560,160],"parameters":{"url":"https://api.binance.com/api/v3/depth","sendQuery":true,"parametersQuery":{"values":[{"name":"symbol"},{"name":"limit"}]},"toolDescription":"Fetches the live order book (bids and asks) for a specific trading pair from Binance.\n\n✅ Expected Input Format (JSON):\n{\n  \"symbol\": \"BTCUSDT\",\n  \"limit\": 100\n}\n\nYou may adjust the `limit` between 1 and 5000 (default: 100). The response includes `bids` and `asks` as arrays of [price, quantity] levels."},"typeVersion":1.1},{"id":"c5403bc9-349d-4205-9bd6-f0e48a33630e","name":"getKlines","type":"@n8n/n8n-nodes-langchain.toolHttpRequest","position":[820,160],"parameters":{"url":"https://api.binance.com/api/v3/klines","sendQuery":true,"parametersQuery":{"values":[{"name":"symbol"},{"name":"interval"},{"name":"limit","valueProvider":"modelOptional"}]},"toolDescription":"Fetches candlestick (OHLCV) data for a trading pair and time interval from Binance. Supports optional time range filtering.\n\n✅ Expected Input Format (JSON):\n{\n  \"symbol\": \"BTCUSDT\",\n  \"interval\": \"15m\",\n  \"limit\": 100,\n  \"startTime\": 1690000000000,\n  \"endTime\": 1690100000000,\n  \"timeZone\": \"0\"\n}\n\nOnly `symbol` and `interval` are required. All other fields are optional.\n\nThe response is an array of arrays representing each candlestick:\n[\n  [ openTime, open, high, low, close, volume, closeTime, quoteVolume, numTrades, takerBase, takerQuote, ignore ]\n]"},"typeVersion":1.1},{"id":"d4296211-d100-4b4d-9f39-31d5799c46cb","name":"OpenAI Chat Model","type":"@n8n/n8n-nodes-langchain.lmChatOpenAi","position":[-440,180],"parameters":{"model":{"__rl":true,"mode":"list","value":"gpt-4.1-mini","cachedResultName":"gpt-4.1-mini"},"options":{}},"credentials":{"openAiApi":{"id":"yUizd8t0sD5wMYVG","name":"OpenAi account"}},"typeVersion":1.2},{"id":"7a941f53-2294-4926-957d-ee82d01e4c11","name":"Simple Memory","type":"@n8n/n8n-nodes-langchain.memoryBufferWindow","position":[-200,180],"parameters":{},"typeVersion":1.3},{"id":"8f6328d3-2508-40e5-a01c-44e428384f16","name":"When Executed by Another Workflow","type":"n8n-nodes-base.executeWorkflowTrigger","position":[-320,-180],"parameters":{"workflowInputs":{"values":[{"name":"message"},{"name":"sessionId"}]}},"typeVersion":1.1},{"id":"c4400f35-e18f-4645-b92e-187ac73d40f6","name":"Binance SM Price-24hrStats-OrderBook-Kline Agent","type":"@n8n/n8n-nodes-langchain.agent","position":[80,-180],"parameters":{"text":"={{ $json.message }}","options":{"systemMessage":"You are the **Binance SM Price-24hrStats-OrderBook-Kline Agent**, responsible for gathering and summarizing real-time price and market structure data for any given trading pair. You always call **all four market data tools** and return **latest candles across all key intervals**.\n\n---\n\n### 🔧 Connected Tools (Always Executed)\n\n#### 📈 `getCurrentPrice`\n\n*Latest trade price*\n**Endpoint**: `/api/v3/ticker/price`\n**Input**:\n\n```json\n{ \"symbol\": \"BTCUSDT\" }\n```\n\n---\n\n#### 📊 `get24hrStats`\n\n*24-hour stats including OHLC and volume*\n**Endpoint**: `/api/v3/ticker/24hr`\n**Input**:\n\n```json\n{ \"symbol\": \"BTCUSDT\" }\n```\n\n---\n\n#### 🧾 `getOrderBook`\n\n*Live order book (top 100 bids/asks)*\n**Endpoint**: `/api/v3/depth`\n**Input**:\n\n```json\n{ \"symbol\": \"BTCUSDT\", \"limit\": 100 }\n```\n\n---\n\n#### 🕰️ `getKlines` (Multi-Interval)\n\n*Latest candle data for multiple timeframes*\n**Endpoint**: `/api/v3/klines`\n**Inputs** (run separately for each):\n\n```json\n{ \"symbol\": \"BTCUSDT\", \"interval\": \"15m\", \"limit\": 1 }\n{ \"symbol\": \"BTCUSDT\", \"interval\": \"1h\",  \"limit\": 1 }\n{ \"symbol\": \"BTCUSDT\", \"interval\": \"4h\",  \"limit\": 1 }\n{ \"symbol\": \"BTCUSDT\", \"interval\": \"1d\",  \"limit\": 1 }\n```\n\n---\n\n### 🧠 Behavior Instructions\n\n* Always extract the **symbol** from the user's prompt (e.g., \"ETHUSDT\", \"SOLUSDT\")\n* Trigger **all four tools** in parallel\n* For klines, call the endpoint 4 times (15m, 1h, 4h, 1d)\n* Merge all tool outputs into a **single response**\n* Format clearly for **Telegram** messaging\n\n---\n\n### 📤 Output Format (Telegram HTML)\n\nExample:\n\n```\n📊 BTCUSDT Market Overview\n\n💰 Price: $63,220  \n📈 24h Change: +2.3% | Volume: 45,210 BTC  \n\n📉 Order Book  \n• Top Bid: $63,190  \n• Top Ask: $63,230  \n\n🕰️ Latest Candles  \n• 15m: O: $63,000 | C: $63,220 | Vol: 320 BTC  \n• 1h : O: $62,700 | C: $63,300 | Vol: 980 BTC  \n• 4h : O: $61,800 | C: $63,500 | Vol: 2,410 BTC  \n• 1d : O: $59,200 | C: $63,220 | Vol: 7,850 BTC\n```\n\n---\n\n### ✅ Input Expectations\n\n* Input is in natural language, e.g.:\n\n  * \"What’s going on with BTC?\"\n  * \"Give me full SOL update\"\n  * \"Show 4h and 1d candles for ETH\"\n\n* If no symbol is found, ask:\n\n  > “Please provide the token symbol (e.g., BTCUSDT).”\n\n"},"promptType":"define"},"typeVersion":1.9},{"id":"f8d29f2d-5359-4dba-a99f-caaee2e44d91","name":"Sticky Note","type":"n8n-nodes-base.stickyNote","position":[-380,-480],"parameters":{"color":4,"height":500,"content":"## Triggered by Parent Workflow\nNode: When Executed by Another Workflow\nThis agent only activates when another agent (e.g., **Financial Analyst)** passes:"},"typeVersion":1},{"id":"2ffb4f3e-2cce-4e14-a1e4-c4cc0af8874b","name":"Sticky Note8","type":"n8n-nodes-base.stickyNote","position":[-40,-460],"parameters":{"color":5,"width":500,"height":460,"content":"## Main Reasoning Agent\nNode: Binance SM Price-24hrStats-OrderBook-Kline Agent\nThis is the AI interface that:\n\n**Accepts the prompt (symbol)**\n\nExtracts the **trading pair**\n\n**Automatically routes the query to all four** price tools\n\nCombines results and sends formatted response to parent agent\n\n"},"typeVersion":1},{"id":"f722bc3b-983d-423a-bce2-a62d238873a7","name":"Sticky Note2","type":"n8n-nodes-base.stickyNote","position":[-500,120],"parameters":{"width":220,"height":520,"content":"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n## OpenAI Formatter\nNode: OpenAI Chat Model (**gpt-4.1-mini**)\nUsed to:\n\nParse raw JSON responses\n\n**Convert numeric results into clean text blocks**\n\n**Label important stats** (e.g., trend, spread, volatility)\n\n"},"typeVersion":1},{"id":"60d3f253-2d1f-480c-ac32-8fc48c4cfab2","name":"Sticky Note1","type":"n8n-nodes-base.stickyNote","position":[-260,120],"parameters":{"color":3,"width":220,"height":520,"content":"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n## Simple Memory\nStores the session and symbol context. **Ensures continuity across tool calls** and can be used for **summarization logic.**\n\n"},"typeVersion":1},{"id":"dccc52f0-2f57-4bdb-a16b-79e84275bda6","name":"Sticky Note3","type":"n8n-nodes-base.stickyNote","position":[20,120],"parameters":{"color":6,"width":220,"height":620,"content":"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n##  getCurrentPrice\nType: toolHttpRequest\nEndpoint:\nhttps://api.binance.com/api/v3/ticker/price\n\nInput:\n\njson\n{ \"symbol\": \"BTCUSDT\" }\n\n**Returns last trade price.**"},"typeVersion":1},{"id":"dcae06d0-e8c6-4b72-87fd-1f730ef4829d","name":"Sticky Note4","type":"n8n-nodes-base.stickyNote","position":[260,120],"parameters":{"color":6,"width":220,"height":680,"content":"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n## get24hrStats\nType: toolHttpRequest\nEndpoint:\nhttps://api.binance.com/api/v3/ticker/24hr\n\nInput:\n\njson\n{ \"symbol\": \"BTCUSDT\" }\n\n**Returns 24h OHLC, % change, and volume.**\n\n"},"typeVersion":1},{"id":"4606d831-1579-4a5f-874a-c8d139369ebe","name":"Sticky Note5","type":"n8n-nodes-base.stickyNote","position":[500,120],"parameters":{"color":6,"width":220,"height":720,"content":"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n## getOrderBook\nType: toolHttpRequest\nEndpoint:\nhttps://api.binance.com/api/v3/depth\n\nInput:\n\njson\n{\n  \"symbol\": \"BTCUSDT\",\n  \"limit\": 100\n}\n\n**Returns top 100 bids and asks.**"},"typeVersion":1},{"id":"25239ca3-ca99-4095-9d64-5581d39244e0","name":"Sticky Note6","type":"n8n-nodes-base.stickyNote","position":[760,120],"parameters":{"color":6,"width":220,"height":720,"content":"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n## getKlines (Multi-Timeframe)\nType: toolHttpRequest\nEndpoint:\nhttps://api.binance.com/api/v3/klines\nInputs:\n\nExecuted 4 times, once for each timeframe:\n\njson\n{ \"symbol\": \"BTCUSDT\", \"interval\": \"15m\", \"limit\": 1 }\n{ \"symbol\": \"BTCUSDT\", \"interval\": \"1h\",  \"limit\": 1 }\n{ \"symbol\": \"BTCUSDT\", \"interval\": \"4h\",  \"limit\": 1 }\n{ \"symbol\": \"BTCUSDT\", \"interval\": \"1d\",  \"limit\": 1 }\n\n**Returns OHLCV for each interval’s most recent candle.**"},"typeVersion":1},{"id":"9937f721-ab8e-4ef1-9809-9b146c98de1a","name":"Sticky Note7","type":"n8n-nodes-base.stickyNote","position":[1240,-1420],"parameters":{"width":1220,"height":2480,"content":"# 📈 Binance SM Price-24hrStats-OrderBook-Kline Tool – Documentation\n\nA market structure sub-agent that collects **real-time price data**, **order book depth**, **24-hour statistics**, and **multi-timeframe candlestick data** for any Binance Spot trading pair.\n\n---\n\n## 🎯 Purpose\n\nThis tool provides the foundation of all market structure insights for a symbol by:\n\n* Fetching current price (`/ticker/price`)\n* Retrieving 24h stats like OHLC and volume (`/ticker/24hr`)\n* Capturing order book data (bids/asks, `/depth`)\n* Pulling latest candlesticks for: **15m, 1h, 4h, 1d** intervals (`/klines`)\n\n---\n\n## 🧩 Included API Endpoints\n\n| Tool Name         | Endpoint               | Description                                   |\n| ----------------- | ---------------------- | --------------------------------------------- |\n| `getCurrentPrice` | `/api/v3/ticker/price` | Latest trade price                            |\n| `get24hrStats`    | `/api/v3/ticker/24hr`  | OHLC + volume in past 24 hours                |\n| `getOrderBook`    | `/api/v3/depth`        | Top 100 bid/ask levels                        |\n| `getKlines`       | `/api/v3/klines`       | OHLCV candles for 15m, 1h, 4h, 1d (limit = 1) |\n\nAll tools are triggered **together**, and return unified results to the parent agent.\n\n---\n\n## 🛠️ Workflow Architecture\n\n| Node                                  | Function                                                 |\n| ------------------------------------- | -------------------------------------------------------- |\n| ✅ `When Executed by Another Workflow` | Triggers this tool from Financial Analyst Agent          |\n| 🤖 `Binance SM Price... Agent`        | Receives prompt, extracts symbol, calls all market tools |\n| 💡 `OpenAI Chat Model (gpt-4o-mini)`  | Converts raw API output into clean Telegram summary      |\n| 🧠 `Simple Memory`                    | Tracks session context (`sessionId`, last-used symbol)   |\n\n---\n\n## 📥 Expected Input\n\nThis tool is **not user-facing** — it is triggered by a parent workflow with input like:\n\n```json\n{\n  \"message\": \"BTCUSDT\",\n  \"sessionId\": \"539847013\"\n}\n```\n\n---\n\n## 🧾 Telegram Output Example\n\n```\n📊 BTCUSDT Market Overview\n\n💰 Price: $63,220  \n📈 24h Change: +2.3% | Volume: 45,210 BTC  \n\n📉 Order Book  \n• Top Bid: $63,190  \n• Top Ask: $63,230  \n\n🕰️ Latest Candles  \n• 15m: O: $63,000 | C: $63,220 | Vol: 320 BTC  \n• 1h : O: $62,700 | C: $63,300 | Vol: 980 BTC  \n• 4h : O: $61,800 | C: $63,500 | Vol: 2,410 BTC  \n• 1d : O: $59,200 | C: $63,220 | Vol: 7,850 BTC\n```\n\n---\n\n## ✅ Use Case Scenarios\n\n| Scenario                                | Result                                           |\n| --------------------------------------- | ------------------------------------------------ |\n| Trader asks for “current BTC data”      | Returns full snapshot across all structure tools |\n| Analyst needs “candles for SOL”         | Returns 15m, 1h, 4h, 1d OHLCV for SOLUSDT        |\n| Quant AI Agent triggers market analysis | Sends back clean Telegram-ready price structure  |\n\n---\n\n## 🚀 Installation Steps\n\n### 1. Import Workflow\n\n* Load this JSON into your n8n instance\n* Activate and rename for clarity if needed\n\n### 2. Credential Setup\n\n* No auth required for Binance public API\n* Ensure OpenAI API key is connected to `OpenAI Chat Model` node\n\n### 3. Trigger Configuration\n\n* This tool is **only executed via `Execute Workflow`** by:\n\n  * `Binance SM Financial Analyst Tool`\n  * `Binance Spot Market Quant AI Agent`\n\n---\n\n## 🔐 Licensing & Support\n\n🔗 **Don Jayamaha – LinkedIn**\n[http://linkedin.com/in/donjayamahajr](http://linkedin.com/in/donjayamahajr)\n\n© 2025 Treasurium Capital Limited Company. All rights reserved.\nThis automation system — including prompt flow, logic architecture, and tool structure — is proprietary to Treasurium Capital Limited Company. Redistribution, resale, or replication without license is prohibited under U.S. and international law.\n\n"},"typeVersion":1}],"active":false,"pinData":{},"settings":{"executionOrder":"v1"},"versionId":"3c34c007-ae59-4ea9-a073-4d5ba14ba3b8","connections":{"getKlines":{"ai_tool":[[{"node":"Binance SM Price-24hrStats-OrderBook-Kline Agent","type":"ai_tool","index":0}]]},"get24hrStats":{"ai_tool":[[{"node":"Binance SM Price-24hrStats-OrderBook-Kline Agent","type":"ai_tool","index":0}]]},"getOrderBook":{"ai_tool":[[{"node":"Binance SM Price-24hrStats-OrderBook-Kline Agent","type":"ai_tool","index":0}]]},"Simple Memory":{"ai_memory":[[{"node":"Binance SM Price-24hrStats-OrderBook-Kline Agent","type":"ai_memory","index":0}]]},"getCurrentPrice":{"ai_tool":[[{"node":"Binance SM Price-24hrStats-OrderBook-Kline Agent","type":"ai_tool","index":0}]]},"OpenAI Chat Model":{"ai_languageModel":[[{"node":"Binance SM Price-24hrStats-OrderBook-Kline Agent","type":"ai_languageModel","index":0}]]},"When Executed by Another Workflow":{"main":[[{"node":"Binance SM Price-24hrStats-OrderBook-Kline Agent","type":"main","index":0}]]}}}


name: Binance SM 15min Indicators Tool
author_name: Don Jayamaha Jr
author_username: don-the-gem-dealer
categories: []
created_at: 2025-06-06T18:11:59.825Z
updated_at: 2025-06-06T18:11:59.825Z
url: https://n8n.io/workflows/4743
scraped_at: 2025-06-19 22:49:20
description:
  A short-term technical analysis agent for 15-minute candles on Binance Spot Market pairs. Calculates and interprets key trading indicators (RSI, MACD, BBANDS, ADX, SMA/EMA) and returns structured summaries, optimized for Telegram or downstream AI trading agents.

  This tool is designed to be triggered by another workflow (such as the Binance SM Financial Analyst Tool or Binance Quant AI Agent) and is not intended for standalone use.

  🔧 Key Features

  ⏱️ Uses 15-minute kline data (last 100 candles)
  📈 Calculates: RSI, MACD, Bollinger Bands, SMA/EMA, ADX
  🧠 Interprets numeric data using GPT-4.1-mini
  📤 Outputs concise, formatted analysis like:

      • RSI: 72 → Overbought  
    • MACD: Cross Up  
    • BB: Expanding  
    • ADX: 34 → Strong Trend
  🧠 AI Agent Purpose

  &gt; You are a short-term analysis tool for spotting volatility, early breakouts, and scalping setups.

  Used by higher agents to determine:

  Entry/exit precision
  Momentum shifts
  Scalping opportunities

  ⚙️ How it Works

  Triggered externally by another workflow
  Accepts input:

        {
       "message": "BTCUSDT",
       "sessionId": "123456789"
     }
     Sends POST request to backend endpoint:

        https://treasurium.app.n8n.cloud/webhook/15m-indicators
     Fetches last 100 candles and calculates indicators
  Passes data to GPT for interpretation
  Returns summary with indicator tags for human readability

  🔗 Dependencies

  This tool is triggered by:

  ✅ Binance SM Financial Analyst Tool
  ✅ Binance Spot Market Quant AI Agent

  🚀 Setup Instructions

  Import into your n8n instance
  Make sure /15m-indicators webhook is active and calculates indicators correctly
  Connect your OpenAI GPT-4.1-mini credentials
  Trigger from upstream agent with Binance symbol and session ID
  Ensure all external calls (to Binance + webhook) are working

  🧪 Example Use Cases

  | Use Case                              | Result                                  |
  | ------------------------------------- | --------------------------------------- |
  | Short-term trade decision for ETHUSDT | Receives 15m signal indicators summary  |
  | Input from Financial Analyst Tool     | Returns real-time volatility snapshot   |
  | Telegram bot asks for “DOGE update”   | Returns momentum indicators in 15m view |

  🎥 Demo Preview


  📺 https://youtu.be/k9VuU2h5wwI

  🧾 Licensing & Attribution

  © 2025 Treasurium Capital Limited Company
  Architecture, prompts, and trade report structure are IP-protected.
  No unauthorized rebranding or resale permitted.

  🔗 For support: Don Jayamaha – LinkedIn

nodes_used:
[cell repeats an earlier one in this file: 120 characters]

workflow_json:
  {"id":"INYtgCEbxdGBDivU","meta":{"instanceId":"a5283507e1917a33cc3ae615b2e7d5ad2c1e50955e6f831272ddd5ab816f3fb6"},"name":"Binance SM 15min Indicators Tool","tags":[],"nodes":[{"id":"b6621b6c-c014-4028-b274-9df8279a830f","name":"OpenAI Chat Model","type":"@n8n/n8n-nodes-langchain.lmChatOpenAi","position":[-280,140],"parameters":{"model":{"__rl":true,"mode":"list","value":"gpt-4.1-mini","cachedResultName":"gpt-4.1-mini"},"options":{}},"credentials":{"openAiApi":{"id":"yUizd8t0sD5wMYVG","name":"OpenAi account"}},"typeVersion":1.2},{"id":"694b7706-e7c4-4441-8e76-24fadacfed96","name":"Simple Memory","type":"@n8n/n8n-nodes-langchain.memoryBufferWindow","position":[0,140],"parameters":{},"typeVersion":1.3},{"id":"03bb428a-e79c-4f0c-aa33-8db7d9b96418","name":"When Executed by Another Workflow","type":"n8n-nodes-base.executeWorkflowTrigger","position":[-460,-180],"parameters":{"workflowInputs":{"values":[{"name":"message"},{"name":"sessionId"}]}},"typeVersion":1.1},{"id":"9ee0b29e-18bc-4048-a318-8727fbdc9c06","name":"Binance SM 15min Indicators Agent","type":"@n8n/n8n-nodes-langchain.agent","position":[-60,-180],"parameters":{"text":"={{ $json.message }}","options":{"systemMessage":"You are a short-term technical analysis agent that calculates **15-minute interval trading signals** for any Binance Spot Market trading pair. You are used by higher-level agents to assess intraday volatility, trend momentum, and entry/exit opportunities.\n\n---\n\n### 🔐 Access Control\n\n* Expect to be triggered by another workflow.\n* Maintain `sessionId` context for user-specific response handling.\n\n---\n\n### 📥 Expected Input Format\n\n```json\n{\n  \"message\": \"BTCUSDT\",\n  \"sessionId\": \"123456789\"\n}\n```\n\n* `message`: Valid Binance symbol (e.g., BTCUSDT)\n* `sessionId`: Telegram user or workflow context\n\n---\n\n### 🔧 Tools Used\n\nYou POST the trading pair to this endpoint:\n\n```\nhttps://treasurium.app.n8n.cloud/webhook/15m-indicators\n```\n\n**Payload format:**\n\n```json\n{\n  \"symbol\": \"BTCUSDT\"\n}\n```\n\n---\n\n### 📊 Behavior\n\n* Request **15-minute kline data** with a limit sufficient for indicator calculations (typically `limit: 100`).\n* Calculate key indicators including:\n\n  * RSI\n  * MACD\n  * Bollinger Bands\n  * SMA/EMA\n  * ADX\n* Return results in Telegram-optimized format (e.g. Markdown with clear sections).\n\n---\n\n### 🧠 Use Cases\n\n* Detect momentum shifts in short-term windows.\n* Generate alerts for potential scalping or breakout signals.\n* Contribute insights to larger multi-timeframe analysis workflows (e.g., Quant AI Agent, Financial Analyst Tool).\n\n"},"promptType":"define"},"typeVersion":1.9},{"id":"2678122f-90fc-42ba-ae63-724006266c38","name":"HTTP Request 15m Indicators Tool","type":"n8n-nodes-base.httpRequestTool","position":[260,120],"parameters":{"url":"https://treasurium.app.n8n.cloud/webhook/15m-indicators","method":"POST","options":{},"sendBody":true,"bodyParameters":{"parameters":[{"name":"symbol","value":"={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('parameters0_Value', ``, 'string') }}"}]}},"typeVersion":4.2},{"id":"3427df64-fdcf-4b8a-a817-dc1385cdec50","name":"Sticky Note","type":"n8n-nodes-base.stickyNote","position":[-540,-460],"parameters":{"color":4,"height":500,"content":"## Workflow Trigger\nNode: When Executed by Another Workflow\nThis workflow does not start on its own — it is always triggered by:\n\n**Binance SM Financial Analyst Tool**\n\n**Binance Quant AI Agent**"},"typeVersion":1},{"id":"54c97888-ae8a-4098-b6ec-c6ced7ac340a","name":"Sticky Note8","type":"n8n-nodes-base.stickyNote","position":[-160,-620],"parameters":{"color":5,"width":500,"height":620,"content":"## Agent Reasoning (GPT)\nNode: **Binance SM 15min Indicators Agent**\nUses GPT-4o-mini (gpt-4.1-mini) to:\n\n**Interpret raw indicator output**\n\nDetect signal patterns like:\n\n**Overbought RSI**\n\n**MACD crossovers**\n\n**Bollinger Band squeezes**\n\n**EMA/SMA relationships**\n\n**Strong/weak ADX readings**\n\n**Generate structured summaries**\n\n"},"typeVersion":1},{"id":"fd29107f-4b0a-496e-a5d6-9054573fd917","name":"Sticky Note2","type":"n8n-nodes-base.stickyNote","position":[-340,80],"parameters":{"width":220,"height":520,"content":"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n## OpenAI Model\nNode: OpenAI Chat Model\nModel: **gpt-4.1-mini**\nProvides language interpretation of the numeric indicators.\n\nExample:\n\n**• RSI: 71 → Overbought  \n• MACD: Cross Up  \n• BB: Touching Upper Band  \n• ADX: 32 → Strong Uptrend**\n"},"typeVersion":1},{"id":"06b488f6-5af2-4906-ab58-ff720ea4d1e2","name":"Sticky Note1","type":"n8n-nodes-base.stickyNote","position":[-80,80],"parameters":{"color":3,"width":220,"height":520,"content":"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n## Memory System\nNode: Simple Memory\nStores **session context (sessionId, symbol, last query).**\nUsed for:\n\n**Persistent multi-turn interactions\n\nCross-agent symbol consistency**"},"typeVersion":1},{"id":"4b2198d4-e337-48ce-b857-edd1a8dbe1a2","name":"Sticky Note5","type":"n8n-nodes-base.stickyNote","position":[200,80],"parameters":{"color":6,"width":220,"height":960,"content":"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n## Indicator Tool Request\nNode: HTTP Request 15m Indicators Tool\n\n**Makes a POST request to:**\n\nhttps://treasurium.app.n8n.cloud/webhook/15m-indicators\n\nPayload:\n\njson\n{ \"symbol\": \"BTCUSDT\" }\n\nThis **backend endpoint** is responsible for:\n\n**Fetching the last 100 15m candles\n\nCalculating:\n\nRSI (14)\n\nMACD (12/26/9)\n\nBollinger Bands (20/2)\n\nSMA + EMA (20)\n\nADX (14)**\n\nThe result is returned as cleaned JSON with **indicator values and signal tags.**"},"typeVersion":1},{"id":"56983511-8084-4fc1-be59-cc223a062b1e","name":"Sticky Note3","type":"n8n-nodes-base.stickyNote","position":[620,-1420],"parameters":{"width":1360,"height":2860,"content":"# 🧪 Binance SM 15min Indicators Tool – Documentation\n\nA specialized short-term technical analysis module that calculates and interprets trading indicators using **15-minute candlestick data** for any Binance Spot Market symbol.\n\n---\n\n## 🎯 Purpose\n\nThis workflow is used to:\n\n* Extract recent 15m kline data from Binance\n* Calculate core technical indicators: RSI, MACD, BBANDS, ADX, SMA/EMA\n* Interpret signals using GPT (e.g., “Overbought RSI”, “MACD crossover up”)\n* Return results formatted for Telegram or internal agent use\n\nIt is designed to help the Quant AI Agent and Financial Analyst Tool understand intraday volatility and momentum.\n\n---\n\n## ⚙️ Key Workflow Structure\n\n| Node Name                           | Role                                                             |\n| ----------------------------------- | ---------------------------------------------------------------- |\n| `When Executed by Another Workflow` | Trigger — activated by Financial Analyst or Quant AI Agent       |\n| `Binance SM 15min Indicators Agent` | Main agent that receives input and manages tool orchestration    |\n| `HTTP Request 15m Indicators Tool`  | Calls webhook that calculates indicators using raw kline data    |\n| `Simple Memory`                     | Tracks session context (Telegram ID, symbol)                     |\n| `OpenAI Chat Model`                 | Interprets raw numeric data into human-readable Telegram message |\n\n---\n\n## 📥 Expected Input Format\n\nThis tool receives structured inputs:\n\n```json\n{\n  \"message\": \"BTCUSDT\",\n  \"sessionId\": \"123456789\"\n}\n```\n\n* `message`: Must be a valid Binance trading pair (e.g., ETHUSDT)\n* `sessionId`: Used for maintaining conversational context\n\n---\n\n## 🔧 Indicator Calculation Logic\n\nThe actual computation is done by the **15m Indicator Backend Tool** via HTTP POST:\n\n**Endpoint:**\n\n```\nhttps://treasurium.app.n8n.cloud/webhook/15m-indicators\n```\n\n**Payload:**\n\n```json\n{\n  \"symbol\": \"BTCUSDT\"\n}\n```\n\n**Backend calculates:**\n\n* RSI (14)\n* MACD (12,26,9)\n* Bollinger Bands (20, 2)\n* Simple Moving Average (SMA 20)\n* Exponential Moving Average (EMA 20)\n* ADX (14)\n\nThe response includes the latest values, directional bias, and status tags like `\"Overbought\"`, `\"Cross Up\"`, etc.\n\n---\n\n## 🧠 GPT Analysis Layer\n\nThe raw values are sent to the **gpt-4.1-mini** model, which:\n\n* Translates them into structured insights\n* Highlights key signals like:\n\n  * RSI zones (Overbought/Oversold)\n  * BB squeeze or expansion\n  * MACD crossover points\n  * ADX trend strength\n\n**Sample Output:**\n\n```\n📉 15m Technical Overview for BTCUSDT\n\n• RSI: 72 → Overbought  \n• MACD: Cross Up (Bullish)  \n• BB: Expanding, Price near Upper Band  \n• EMA > SMA → Bullish Momentum  \n• ADX: 34 → Strong Trend\n```\n\n---\n\n## 🧩 Use Case Scenarios\n\n| Scenario                              | Outcome                                                           |\n| ------------------------------------- | ----------------------------------------------------------------- |\n| User asks for “short-term DOGE trend” | Tool returns 15m signals showing volatility or setup pattern      |\n| Part of daily report on BTC           | Confirms intraday strength or exhaustion with momentum indicators |\n| Used by Financial Analyst Tool        | Feeds into broader analysis (1h/4h/1d + price structure)          |\n\n---\n\n## 📦 Deployment Instructions\n\n1. **Import** this workflow into your n8n instance\n2. **Ensure webhook endpoint** (`/15m-indicators`) is active and reachable\n3. **Test trigger** using `Execute Workflow` from Quant AI or Financial Analyst tool\n4. **Connect OpenAI API key** to enable GPT interpretation\n5. Confirm all input symbols are valid Binance pairs\n\n---\n\n## 🔐 Licensing & Support\n\n🔗 **Don Jayamaha – LinkedIn**\n[http://linkedin.com/in/donjayamahajr](http://linkedin.com/in/donjayamahajr)\n\n© 2025 Treasurium Capital Limited Company. All rights reserved.\nUnauthorized reuse, resale, or redistribution of this tool or its design is strictly prohibited. This system and its supporting architecture are protected under U.S. and international copyright law.\n\n"},"typeVersion":1}],"active":false,"pinData":{},"settings":{"executionOrder":"v1"},"versionId":"f7a27402-e9cd-4c5c-ad16-c3b8edf5a393","connections":{"Simple Memory":{"ai_memory":[[{"node":"Binance SM 15min Indicators Agent","type":"ai_memory","index":0}]]},"OpenAI Chat Model":{"ai_languageModel":[[{"node":"Binance SM 15min Indicators Agent","type":"ai_languageModel","index":0}]]},"HTTP Request 15m Indicators Tool":{"ai_tool":[[{"node":"Binance SM 15min Indicators Agent","type":"ai_tool","index":0}]]},"When Executed by Another Workflow":{"main":[[{"node":"Binance SM 15min Indicators Agent","type":"main","index":0}]]}}}


name: Binance SM 1hour Indicators Tool
author_name: Don Jayamaha Jr
author_username: don-the-gem-dealer
categories: []
created_at: 2025-06-06T18:17:27.363Z
updated_at: 2025-06-06T18:17:27.363Z
url: https://n8n.io/workflows/4744
scraped_at: 2025-06-19 22:49:36
description:
  🧪 Binance SM 1hour Indicators Tool

  A precision trading signal engine that interprets 1-hour candlestick indicators for Binance Spot Market pairs using a GPT-4.1-mini LLM. Ideal for swing traders seeking directional bias and momentum clarity across medium timeframes.

  🎥 Live Demo:

  🎯 Purpose

  This tool provides a structured 1-hour market read using:

  RSI** (Relative Strength Index)
  MACD** (Moving Average Convergence Divergence)
  BBANDS** (Bollinger Bands)
  SMA & EMA** (Simple and Exponential Moving Averages)
  ADX** (Average Directional Index)

  It’s invoked as a sub-agent in broader AI workflows, such as the Binance Financial Analyst Tool and the Spot Market Quant AI Agent.

  ⚙️ Key Features

  | Feature                | Description                                                   |
  | ---------------------- | ------------------------------------------------------------- |
  | 🔄 Subworkflow Trigger | Runs only when called by parent agent (not standalone)        |
  | 🧠 GPT-4.1-mini LLM    | Translates numeric indicators into natural-language summaries |
  | 📊 Real-time Data      | Pulls latest 40×1h candles via internal webhook from Binance  |
  | 📥 Input Format        | { "message": "ETHUSDT", "sessionId": "telegram_chat_id" }   |
  | 📤 Output Format       | JSON summary + Telegram-friendly HTML overview                |

  💡 Example Output

  📊 1h Technical Overview – ETHUSDT

  • RSI: 59 (Neutral)  
  • MACD: Bullish Crossover  
  • BBANDS: Price at Upper Band  
  • EMA &gt; SMA → Positive Slope  
  • ADX: 28 → Moderate Trend Strength

  🧩 Use Cases

  | Scenario                               | Result                                          |
  | -------------------------------------- | ----------------------------------------------- |
  | Mid-frame market alignment             | Verifies momentum between 15m and 4h timeframes |
  | Quant AI Agent input                   | Supplies trend context for entry/exit decisions |
  | Standalone medium-term signal snapshot | Validates swing trade setups or filters noise   |

  📦 Installation Instructions

  Import workflow into your n8n instance
  Confirm internal webhook /1h-indicators is live and authorized
  Insert your OpenAI credentials for GPT-4.1-mini node
  Use only when triggered via:

     Binance Financial Analyst Tool
     Binance Spot Market Quant AI Agent

  🧾 Licensing & Support

  🔗 Don Jayamaha – LinkedIn
  linkedin.com/in/donjayamahajr

  © 2025 Treasurium Capital Limited Company
  Architecture, prompts, and signal logic are proprietary. Redistribution or commercial use requires explicit licensing. No unauthorized cloning permitted.

nodes_used:
[cell repeats an earlier one in this file: 120 characters]

workflow_json:
  {"id":"cmA9VcPQYLFfdLqE","meta":{"instanceId":"a5283507e1917a33cc3ae615b2e7d5ad2c1e50955e6f831272ddd5ab816f3fb6"},"name":"Binance SM 1hour Indicators Tool","tags":[],"nodes":[{"id":"a6f12769-4e3c-43b7-a288-dc9ca6bbd191","name":"OpenAI Chat Model","type":"@n8n/n8n-nodes-langchain.lmChatOpenAi","position":[760,840],"parameters":{"model":{"__rl":true,"mode":"list","value":"gpt-4.1-mini","cachedResultName":"gpt-4.1-mini"},"options":{}},"credentials":{"openAiApi":{"id":"yUizd8t0sD5wMYVG","name":"OpenAi account"}},"typeVersion":1.2},{"id":"eec01f23-2628-4476-807f-a0a562496509","name":"Simple Memory","type":"@n8n/n8n-nodes-langchain.memoryBufferWindow","position":[1000,840],"parameters":{},"typeVersion":1.3},{"id":"804c71f0-7c43-4caa-8194-dd0b9e8fe2d5","name":"When Executed by Another Workflow","type":"n8n-nodes-base.executeWorkflowTrigger","position":[600,520],"parameters":{"workflowInputs":{"values":[{"name":"message"},{"name":"sessionId"}]}},"typeVersion":1.1},{"id":"551b288d-10ac-48e8-b4e1-ab36d0764b74","name":"Binance SM 1hour Indicators Agent","type":"@n8n/n8n-nodes-langchain.agent","position":[920,520],"parameters":{"text":"={{ $json.message }}","options":{"systemMessage":"You are the **Binance 1-Hour Technical Indicator Agent**, responsible for calculating and delivering **1-hour interval trading signals** for any Binance Spot Market trading pair. You support higher-level agents in detecting medium-term trend direction, volatility phases, and price action momentum.\n\n---\n\n### 🔗 Connected Tools (via internal workflow)\n\nYou call the following indicators using `https://treasurium.app.n8n.cloud/webhook/1h-indicators`:\n\n* **RSI** (14-period)\n* **MACD** (12/26/9 standard)\n* **Bollinger Bands** (20-period, 2×STD)\n* **SMA** (20-period)\n* **EMA** (20-period)\n* **ADX** (14-period, with DI+ and DI−)\n\n---\n\n### 📥 Expected Input Format\n\n```json\n{\n  \"message\": \"ETHUSDT\",\n  \"sessionId\": \"telegram_chat_id\"\n}\n```\n\n* `message`: A valid Binance Spot Market symbol (e.g., BTCUSDT, ADAUSDT)\n* `sessionId`: Workflow context or user ID for session memory\n\n---\n\n### 📊 Behavior\n\n* Extract `symbol` and format input for internal HTTP POST request:\n\n  ```\n  https://treasurium.app.n8n.cloud/webhook/1h-indicators\n  ```\n\n  ```json\n  {\n    \"symbol\": \"ETHUSDT\"\n  }\n  ```\n\n* Internally, fetch **40 latest 1h candles** via Binance API and calculate the indicators above.\n\n* You **merge all indicator outputs** and return them in a clean JSON array format ready for downstream reasoning or formatting.\n\n---\n\n### 🧠 Use Case Scenarios\n\n* Evaluate **1-hour trends** for swing trading alignment\n* Confirm **mid-frame structure** between 15m and 4h signals\n* Serve **Financial Analyst Tool** and **Quant AI Agent** with structured indicators\n* Support **entry/exit precision** on higher timeframes\n\n---\n\n### ⚠️ Operational Notes\n\n* Ensure enough data is returned from Binance (minimum 40 candles)\n* Validate input symbol format before execution\n* Use consistent timestamp alignment across all indicators\n* If any module fails, log the error but return valid others\n"},"promptType":"define"},"typeVersion":1.9},{"id":"fb7b461e-fde3-4e9e-a1e8-e2c5e863e0fb","name":"HTTP Request 1h Indicators Tool","type":"n8n-nodes-base.httpRequestTool","position":[1240,820],"parameters":{"url":"https://treasurium.app.n8n.cloud/webhook/1h-indicators","method":"POST","options":{},"sendBody":true,"bodyParameters":{"parameters":[{"name":"symbol","value":"={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('parameters0_Value', ``, 'string') }}"}]}},"typeVersion":4.2},{"id":"76059b12-d48f-46ec-87c0-bacfc6e9cb45","name":"Sticky Note","type":"n8n-nodes-base.stickyNote","position":[520,200],"parameters":{"color":4,"height":500,"content":"## Workflow Trigger\nNode: When Executed by Another Workflow\nThis workflow does not start on its own — it is always triggered by:\n\n**Binance SM Financial Analyst Tool**\n\n**Binance Quant AI Agent**"},"typeVersion":1},{"id":"b090748a-f361-425e-962f-1bb36c17f6fa","name":"Sticky Note8","type":"n8n-nodes-base.stickyNote","position":[800,160],"parameters":{"color":5,"width":500,"height":540,"content":"## Main Reasoning Agent\nNode: **Binance SM 1hour Indicators Agent**\n\nYou are the **Binance 1-Hour Technical Indicator Agent**.\nYour job is to extract **momentum, direction, and structure using 1h indicators** for any Binance Spot Market symbol.\n\nIt:\n\n**Receives the symbol**\n\n**Calls the 1h indicator tool**\n\nReturns structured JSON and natural-language signal labels\n\n"},"typeVersion":1},{"id":"af0c41e0-3e8c-4fa1-9012-a33913a71195","name":"Sticky Note2","type":"n8n-nodes-base.stickyNote","position":[700,780],"parameters":{"width":220,"height":520,"content":"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n##  OpenAI Chat Model\nNode: OpenAI Chat Model\nModel: **gpt-4.1-mini**\n\nTranslates raw indicator data into:\n\n**Natural signal summaries\n\nMomentum interpretations**\n\nSummary suitable for Telegram display\n"},"typeVersion":1},{"id":"8099df6b-8407-41c0-8948-b48bc44d5126","name":"Sticky Note1","type":"n8n-nodes-base.stickyNote","position":[940,780],"parameters":{"color":3,"width":220,"height":520,"content":"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n## Memory System\nNode: Simple Memory\nStores **session context (sessionId, symbol, last query).**\nUsed for:\n\n**Persistent multi-turn interactions\n\nCross-agent symbol consistency**"},"typeVersion":1},{"id":"c767ae7b-0043-4c0b-9d59-44dce6fca107","name":"Sticky Note5","type":"n8n-nodes-base.stickyNote","position":[1180,780],"parameters":{"color":6,"width":220,"height":820,"content":"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n## 1-Hour Indicator Webhook\nNode: HTTP Request 1h Indicators Tool\n\n**POSTs to:**\n\nhttps://treasurium.app.n8n.cloud/webhook/1h-indicators\n\nPayload:\n\njson\n{ \"symbol\": \"ETHUSDT\" }\n\nThe backend calculates:\n\n**RSI (14)\n\nMACD (12/26/9)\n\nBBANDS (20, 2 STD)\n\nEMA + SMA (20)\n\nADX (+DI / −DI, 14)**\n\nUsing the latest **40 candles of 1h kline data.**"},"typeVersion":1},{"id":"b7c581f0-c1c9-4007-8c32-62f603b719a5","name":"Sticky Note3","type":"n8n-nodes-base.stickyNote","position":[1660,-600],"parameters":{"width":1320,"height":2820,"content":"# 🧪 Binance SM 1hour Indicators Tool – Documentation\n\nThis workflow calculates and interprets technical trading indicators using **1-hour candlestick data** from Binance for any Spot Market pair. It provides medium-term signals and serves as the core engine for swing-trade setup validation.\n\n---\n\n## 🎯 Purpose\n\n* Fetches the latest 40 × 1h klines for a symbol\n* Calculates key indicators: RSI, MACD, BBANDS, SMA, EMA, ADX\n* Labels signals using GPT (e.g., “Neutral RSI”, “MACD Crossover Up”)\n* Returns structured JSON + natural-language summary ready for use in Telegram or AI agents\n\n---\n\n## ⚙️ Key Components\n\n| Node Name                           | Function                                                             |\n| ----------------------------------- | -------------------------------------------------------------------- |\n| `When Executed by Another Workflow` | Trigger: This is not a standalone tool; it's triggered via sub-agent |\n| `Binance SM 1hour Indicators Agent` | Core logic agent that orchestrates HTTP call and formats data        |\n| `HTTP Request 1h Indicators Tool`   | Calls backend webhook that calculates the actual indicator values    |\n| `OpenAI Chat Model (gpt-4.1-mini)`  | Interprets indicator values into human-readable signal summaries     |\n| `Simple Memory`                     | Tracks session context (symbol, user ID, previous query)             |\n\n---\n\n## 📥 Input Format\n\nExpected input when called by another workflow:\n\n```json\n{\n  \"message\": \"ETHUSDT\",\n  \"sessionId\": \"telegram_chat_id\"\n}\n```\n\n---\n\n## 🔧 Indicator Calculation Logic\n\nThis tool POSTs data to an internal webhook:\n\n**Endpoint:**\n\n```\nhttps://treasurium.app.n8n.cloud/webhook/1h-indicators\n```\n\n**Payload:**\n\n```json\n{\n  \"symbol\": \"ETHUSDT\"\n}\n```\n\n**Backend calculates:**\n\n* **RSI (14)**\n* **MACD (12/26/9)**\n* **BBANDS (20, 2×STD)**\n* **SMA (20)**\n* **EMA (20)**\n* **ADX (14)** with DI+/DI−\n\nIt uses the latest **40 × 1h candles** pulled from Binance.\n\n---\n\n## 🧠 GPT Analysis\n\nAfter fetching the numeric data, the workflow sends it to the `OpenAI Chat Model` using gpt-4.1-mini.\n\nThe model:\n\n* Identifies overbought/oversold signals (RSI)\n* Detects MACD crossover or divergence\n* Labels trend strength (ADX > 25 = strong)\n* Provides a short summary in Telegram-readable format\n\n**Example Output:**\n\n```\n📊 1h Technical Overview – ETHUSDT\n\n• RSI: 59 (Neutral)  \n• MACD: Bullish Crossover  \n• BBANDS: Price at Upper Band  \n• EMA > SMA → Positive Slope  \n• ADX: 28 → Moderate Trend Strength\n```\n\n---\n\n## 🧩 Use Cases\n\n| Scenario                           | Behavior                                                        |\n| ---------------------------------- | --------------------------------------------------------------- |\n| Part of full market analysis       | Helps confirm swing-trade setups in Quant AI Agent              |\n| User asks “What’s BTC’s 1h trend?” | Tool gives labeled indicators with interpretation               |\n| Risk filter for Financial Analyst  | Cross-checks high-probability entries via momentum confirmation |\n\n---\n\n## 📦 Installation Instructions\n\n1. **Import workflow** into your n8n instance\n2. Ensure backend webhook `/1h-indicators` is reachable\n3. Add your OpenAI API key to enable GPT node\n4. Confirm it's triggered by:\n\n   * Binance Financial Analyst Tool\n   * Binance Spot Market Quant AI Agent\n\n---\n\n## 🔐 Licensing & Support\n\n🔗 **Don Jayamaha – LinkedIn**\n[http://linkedin.com/in/donjayamahajr](http://linkedin.com/in/donjayamahajr)\n\n© 2025 Treasurium Capital Limited Company. All rights reserved.\nThis tool and its architecture—including API chaining, reasoning flow, and Telegram summary generation—are proprietary. Commercial use, redistribution, or duplication is prohibited without an active license.\n"},"typeVersion":1}],"active":false,"pinData":{},"settings":{"executionOrder":"v1"},"versionId":"9868a86d-7b04-4db6-8587-66e6cbdee043","connections":{"Simple Memory":{"ai_memory":[[{"node":"Binance SM 1hour Indicators Agent","type":"ai_memory","index":0}]]},"OpenAI Chat Model":{"ai_languageModel":[[{"node":"Binance SM 1hour Indicators Agent","type":"ai_languageModel","index":0}]]},"HTTP Request 1h Indicators Tool":{"ai_tool":[[{"node":"Binance SM 1hour Indicators Agent","type":"ai_tool","index":0}]]},"When Executed by Another Workflow":{"main":[[{"node":"Binance SM 1hour Indicators Agent","type":"main","index":0}]]}}}


name: Binance SM 4hour Indicators Tool
author_name: Don Jayamaha Jr
author_username: don-the-gem-dealer
categories: []
created_at: 2025-06-06T18:20:34.879Z
updated_at: 2025-06-06T18:20:34.879Z
url: https://n8n.io/workflows/4745
scraped_at: 2025-06-19 22:50:00
description:
  A medium-term trend analyzer for the Binance Spot Market that leverages core technical indicators across 4-hour candle data to provide human-readable swing-trade signals via AI.

  🎥 Live Demo:

  🎯 What It Does

  Accepts a Binance trading pair (e.g., AVAXUSDT)
  Sends the symbol to an internal webhook for technical indicator calculation
  Computes 4h RSI, MACD, Bollinger Bands, SMA, EMA, ADX
  Returns structured, GPT-analyzed signals ready for Telegram delivery

  🧠 AI Agent Details

  Model:** GPT-4.1-mini (OpenAI Chat)
  Agent Role:** Translates raw indicator values into sentiment-labeled signals
  Memory:** Tracks session + symbol context for cleaner multi-turn logic

  🔗 Required Backend Workflow

  To calculate indicators, this tool depends on:

  POST https://treasurium.app.n8n.cloud/webhook/4h-indicators
  {
    "symbol": "AVAXUSDT"
  }

  Returns a JSON object with the latest 40×4h candle-based calculations.

  📥 Input Format

  {
    "message": "AVAXUSDT",
    "sessionId": "telegram_chat_id"
  }

  📊 Sample Output

  🕓 4h Technical Signals – AVAXUSDT

  • RSI: 64 → Slightly Bullish  
  • MACD: Bullish Cross above baseline  
  • BB: Upper band touch – volatility expanding  
  • EMA &gt; SMA → Confirmed Upside Momentum  
  • ADX: 31 → Strengthening Trend

  📚 Use Case Scenarios

  | Use Case                      | Result                                               |
  | ----------------------------- | ---------------------------------------------------- |
  | Swing trend confirmation      | Uses 4h indicators to validate or reject setups      |
  | Breakout signal confluence    | Helps assess if momentum is real or noise            |
  | Inputs to Quant AI or Analyst | Supports higher-frame trade recommendation synthesis |

  🛠️ Setup Instructions

  Import the JSON template into your n8n workspace.
  Set your OpenAI API credentials for the GPT node.
  Ensure the /webhook/4h-indicators backend tool is live and accessible.
  Connect this to your Binance Financial Analyst Tool or master Quant AI orchestrator.

  🤖 Parent Workflows That Use This Tool

  Binance SM Financial Analyst Tool
  Binance Spot Market Quant AI Agent

  📎 Sticky Notes & Annotations

  This workflow includes internal sticky notes describing:

  Node roles (GPT, webhook, memory)
  System behavior (reasoning agent logic)
  Telegram formatting guidance

  🔐 Licensing & Attribution

  © 2025 Treasurium Capital Limited Company
  All architecture, prompt logic, and signal formatting are proprietary. Redistribution or rebranding is prohibited.

  🔗 Connect with the creator: Don Jayamaha – LinkedIn

nodes_used:
[cell repeats an earlier one in this file: 120 characters]

workflow_json:
  {"id":"ex0hMYddq8rZdLHh","meta":{"instanceId":"a5283507e1917a33cc3ae615b2e7d5ad2c1e50955e6f831272ddd5ab816f3fb6"},"name":"Binance SM 4hour Indicators Tool","tags":[],"nodes":[{"id":"b0fd1949-684e-44dc-895b-82d8203d6cd2","name":"OpenAI Chat Model","type":"@n8n/n8n-nodes-langchain.lmChatOpenAi","position":[-600,1140],"parameters":{"model":{"__rl":true,"mode":"list","value":"gpt-4.1-mini","cachedResultName":"gpt-4.1-mini"},"options":{}},"credentials":{"openAiApi":{"id":"yUizd8t0sD5wMYVG","name":"OpenAi account"}},"typeVersion":1.2},{"id":"55b4c308-c31b-4709-a197-e06b2f85af28","name":"Simple Memory","type":"@n8n/n8n-nodes-langchain.memoryBufferWindow","position":[-360,1140],"parameters":{},"typeVersion":1.3},{"id":"c8342413-5338-4018-b647-b5cf03e954a3","name":"When Executed by Another Workflow","type":"n8n-nodes-base.executeWorkflowTrigger","position":[-780,880],"parameters":{"workflowInputs":{"values":[{"name":"message"},{"name":"sessionId"}]}},"typeVersion":1.1},{"id":"39651ecb-c1b5-45ad-8625-324d4a781c13","name":"Binance SM 4hour Indicators Tool Agent","type":"@n8n/n8n-nodes-langchain.agent","position":[-380,880],"parameters":{"text":"={{ $json.message }}","options":{"systemMessage":"You are the **Binance 4-Hour Technical Indicator Agent**, tasked with calculating and returning **4-hour interval trading signals** for any Binance Spot Market symbol. Your outputs help assess swing trend continuation, volatility compression, and reversal pressure within the medium-term structure.\n\n---\n\n### 🔗 Connected Tools (via internal workflow)\n\nYou call the following indicators using `https://treasurium.app.n8n.cloud/webhook/4h-indicators`:\n\n* **RSI** (14-period)\n* **MACD** (12/26/9 config)\n* **Bollinger Bands** (20-period, 2×STD)\n* **SMA** (20-period)\n* **EMA** (20-period)\n* **ADX** (14-period with DI+ and DI−)\n\n---\n\n### 📥 Expected Input Format\n\n```json\n{\n  \"message\": \"BNBUSDT\",\n  \"sessionId\": \"telegram_chat_id\"\n}\n```\n\n* `message`: Binance Spot Market symbol (e.g., BNBUSDT, AVAXUSDT)\n* `sessionId`: Passed context used for continuity and formatting\n\n---\n\n### 📊 Behavior\n\n* Accepts symbol and sends POST request to:\n\n  ```\n  https://treasurium.app.n8n.cloud/webhook/4h-indicators\n  ```\n\n  with payload:\n\n  ```json\n  {\n    \"symbol\": \"BNBUSDT\"\n  }\n  ```\n\n* Pulls **at least 40 4h candles** from Binance\n\n* Calculates each indicator in parallel and returns unified output\n\n---\n\n### 🧠 Use Case Scenarios\n\n* Evaluate **trend momentum and strength** in the 1–2 day horizon\n* Validate **higher timeframe support/resistance** zones\n* Confirm **breakouts or trend continuation** against noise\n* Feed **Financial Analyst** and **Quant AI Agent** for confident, multi-frame synthesis\n\n---\n\n### ⚠️ Operational Notes\n\n* Validate input symbol (must be valid and uppercase)\n* Ensure enough candles are available to compute full indicator set\n* Timestamps should align across outputs for accurate merges\n* Return fallback message if Binance API throttling or empty klines\n\n"},"promptType":"define"},"typeVersion":1.9},{"id":"e881b384-5dfd-4b5b-b0c5-0f5e6ea1eb94","name":"HTTP Request 4h Indicators Tool","type":"n8n-nodes-base.httpRequestTool","position":[-120,1120],"parameters":{"url":"https://treasurium.app.n8n.cloud/webhook/4h-indicators","method":"POST","options":{},"sendBody":true,"bodyParameters":{"parameters":[{"name":"symbol","value":"={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('parameters0_Value', ``, 'string') }}"}]}},"typeVersion":4.2},{"id":"7e11f80e-a646-4757-855c-afe7217a0e16","name":"Sticky Note","type":"n8n-nodes-base.stickyNote","position":[-840,620],"parameters":{"color":4,"height":440,"content":"## Workflow Trigger\nNode: When Executed by Another Workflow\nThis workflow does not start on its own — it is always triggered by:\n\n**Binance SM Financial Analyst Tool**\n\n**Binance Quant AI Agent**"},"typeVersion":1},{"id":"fcf62b46-38c1-4ea7-bff5-41a9698935f7","name":"Sticky Note8","type":"n8n-nodes-base.stickyNote","position":[-500,720],"parameters":{"color":5,"width":500,"height":340,"content":"## System Reasoning Agent\nNode: **Binance SM 4hour Indicators Tool Agent**\n\nSystem prompt defines this as a **swing trend analyzer**.\nIt interprets indicator outputs and transforms them into labeled sentiment for the 4h window."},"typeVersion":1},{"id":"0bc45ef5-54fd-419c-b392-a70b2c2cd513","name":"Sticky Note2","type":"n8n-nodes-base.stickyNote","position":[-660,1100],"parameters":{"width":220,"height":600,"content":"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n##  OpenAI Chat Model\nNode: OpenAI Chat Model **(gpt-4.1-mini)**\n\nInterprets indicator values and returns Telegram-friendly summaries:\n\n\n•** RSI: 65 → Slightly overbought  \n• MACD: Bullish cross  \n• BB: Expanding volatility  \n• EMA > SMA → Uptrend  \n• ADX: 31 → Trend **strengthening"},"typeVersion":1},{"id":"ac0bfd01-4371-463a-80bf-ceb511985c18","name":"Sticky Note1","type":"n8n-nodes-base.stickyNote","position":[-420,1100],"parameters":{"color":3,"width":220,"height":520,"content":"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n## Context Memory\nNode: Simple Memory\nStores session variables like symbol and prior state.\n\nUseful for:\n\n**Inter-agent coordination\n\nSymbol recall\n\nMulti-turn interaction state tracking**"},"typeVersion":1},{"id":"eb18f07d-536d-4312-9a10-ae1ba5dce118","name":"Sticky Note5","type":"n8n-nodes-base.stickyNote","position":[-180,1100],"parameters":{"color":6,"width":220,"height":1000,"content":"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n## Webhook Request (Core Tool)\nNode: HTTP Request 4h Indicators Tool\n\n**POSTs to:**\n\nhttps://treasurium.app.n8n.cloud/webhook/4h-indicators\n\nPayload:\n\njson\n{ \"symbol\": \"BNBUSDT\" }\n\nThis backend:\n\n**Pulls 40 candles of 4h OHLCV from Binance**\n\nCalculates:\n\n**RSI (14)\n\nMACD (12,26,9)\n\nBollinger Bands (20/2)\n\nSMA (20)\n\nEMA (20)\n\nADX (14, +DI, −DI)**\n\nReturns a clean JSON object with all indicators and signal summaries.\n\n"},"typeVersion":1},{"id":"8a089b09-0478-45e8-ba59-e27c7448ef05","name":"Sticky Note3","type":"n8n-nodes-base.stickyNote","position":[240,-400],"parameters":{"width":1280,"height":2760,"content":"# ⏳ Binance SM 4hour Indicators Tool – Documentation\n\nA medium-term trend analyzer for the Binance Spot Market. This tool calculates and interprets key trading indicators using 4-hour candle data to help validate breakout setups, momentum continuation, and trend strength.\n\n---\n\n## 🎯 Purpose\n\n* Pulls the latest 40×4h OHLCV candles for a symbol from Binance\n* Calculates core technical indicators for swing-trade insights:\n\n  * RSI, MACD, Bollinger Bands, SMA, EMA, ADX\n* Returns structured Telegram-ready signals interpreted via GPT\n* Supports the **Quant AI Agent** and **Financial Analyst Tool** for higher-timeframe confirmations\n\n---\n\n## ⚙️ Workflow Components\n\n| Node                                | Role                                                            |\n| ----------------------------------- | --------------------------------------------------------------- |\n| `When Executed by Another Workflow` | Triggered by parent workflows                                   |\n| `Binance SM 4hour Indicators Agent` | Core reasoning agent (routes inputs, interprets outputs)        |\n| `HTTP Request 4h Indicators Tool`   | Sends POST to `/webhook/4h-indicators` for raw indicator values |\n| `OpenAI Chat Model (gpt-4.1-mini)`  | Transforms raw values into labeled, human-readable analysis     |\n| `Simple Memory`                     | Tracks user symbol and session for contextual coordination      |\n\n---\n\n## 📥 Input Format\n\n```json\n{\n  \"message\": \"AVAXUSDT\",\n  \"sessionId\": \"telegram_chat_id\"\n}\n```\n\n* `message`: Any valid Binance trading pair (uppercase required)\n* `sessionId`: Used to persist Telegram or session-based memory\n\n---\n\n## 🔧 Indicator Calculation Details\n\n**Webhook Called:**\n\n```\nhttps://treasurium.app.n8n.cloud/webhook/4h-indicators\n```\n\n**POST Payload:**\n\n```json\n{\n  \"symbol\": \"AVAXUSDT\"\n}\n```\n\n**Calculated Indicators:**\n\n| Name           | Description                                        |\n| -------------- | -------------------------------------------------- |\n| RSI (14)       | Overbought / oversold indicator                    |\n| MACD (12,26,9) | Momentum trend strength / crossover signals        |\n| BBANDS (20,2)  | Volatility compression and breakout identification |\n| SMA (20)       | Medium-term baseline                               |\n| EMA (20)       | Reactivity to momentum                             |\n| ADX (14)       | Trend strength + DI+/DI− comparison                |\n\n---\n\n## 🧠 GPT Analysis Output\n\nThe GPT node interprets each indicator and formats results for user consumption:\n\n**Example Output:**\n\n```\n🕓 4h Technical Signals – AVAXUSDT\n\n• RSI: 64 → Slightly Bullish  \n• MACD: Bullish Cross above baseline  \n• BB: Upper band touch – volatility expanding  \n• EMA > SMA → Confirmed Upside Momentum  \n• ADX: 31 → Strengthening Trend\n```\n\n---\n\n## 📚 Use Case Scenarios\n\n| Use Case                                        | Result                                                           |\n| ----------------------------------------------- | ---------------------------------------------------------------- |\n| Evaluating macro-swing trend                    | Confirms breakout setups or continuation risk                    |\n| Filtering false breakouts on 1h                 | ADX, MACD trend detection help anchor confidence                 |\n| Multi-frame confluence inside Financial Analyst | Used in tandem with 1h + 1d indicators for trade signal stacking |\n\n---\n\n## 🛠️ Installation Steps\n\n1. **Import** this JSON into your n8n workspace.\n2. **Connect GPT API** to the OpenAI Chat Model node.\n3. **Ensure webhook** `/webhook/4h-indicators` is active and receives valid symbols.\n4. **Parent workflows** that may trigger this:\n\n   * Binance SM Financial Analyst Tool\n   * Binance Spot Market Quant AI Agent\n\n---\n\n## 🧾 Output Format (Telegram)\n\n* Emoji-labeled\n* Bullet-point structure\n* Timeframe noted explicitly\n* No raw JSON exposed\n\n---\n\n## 🔐 Licensing & Support\n\n🔗 **Don Jayamaha – LinkedIn**\n[http://linkedin.com/in/donjayamahajr](http://linkedin.com/in/donjayamahajr)\n\n© 2025 Treasurium Capital Limited Company. All rights reserved.\nThe logic, structure, and orchestration of this tool are proprietary and protected under U.S. copyright and international IP law. Redistribution or resale without license is prohibited."},"typeVersion":1}],"active":false,"pinData":{},"settings":{"executionOrder":"v1"},"versionId":"ddffb52d-ba6d-45b4-8f7a-8f7009bfaa15","connections":{"Simple Memory":{"ai_memory":[[{"node":"Binance SM 4hour Indicators Tool Agent","type":"ai_memory","index":0}]]},"OpenAI Chat Model":{"ai_languageModel":[[{"node":"Binance SM 4hour Indicators Tool Agent","type":"ai_languageModel","index":0}]]},"HTTP Request 4h Indicators Tool":{"ai_tool":[[{"node":"Binance SM 4hour Indicators Tool Agent","type":"ai_tool","index":0}]]},"When Executed by Another Workflow":{"main":[[{"node":"Binance SM 4hour Indicators Tool Agent","type":"main","index":0}]]}}}


name: Binance SM 1day Indicators Tool
author_name: Don Jayamaha Jr
author_username: don-the-gem-dealer
categories: []
created_at: 2025-06-06T18:23:40.026Z
updated_at: 2025-06-06T18:23:40.026Z
url: https://n8n.io/workflows/4746
scraped_at: 2025-06-19 22:49:53
description:
  This advanced agent analyzes long-term price action in the Binance Spot Market using 1-day candles. It calculates key macro indicators like RSI, MACD, BBANDS, EMA, SMA, and ADX to identify high-confidence trend setups and market momentum. Used by the Quant AI system for directional bias and macro-level signal validation.

  🎥 Live Demo:

  🎯 Purpose

  Detect major trend reversals, consolidation zones, and macro bias
  Support long-term swing trading decisions
  Provide reliable 1-day signals for downstream agents

  🧠 Core Features

  | Feature                     | Description                                                  |
  | --------------------------- | ------------------------------------------------------------ |
  | 🔁 Trigger                  | Called by parent workflows via Execute Workflow            |
  | 📥 Input Format             | { "message": "MATICUSDT", "sessionId": "telegram_id" }     |
  | 📡 Webhook Call             | Sends request to internal 1d indicators webhook              |
  | 🧮 Technical Indicators     | RSI, MACD, BBANDS, EMA, SMA, ADX (based on 40 daily candles) |
  | 🧠 GPT (gpt-4.1-mini) Agent | Interprets numerical data into human-readable trend signals  |
  | 💬 Output                   | Summary suitable for Telegram or further agent consumption   |

  🔗 External Tools Called

  https://treasurium.app.n8n.cloud/webhook/1d-indicators

  Sends:

  {
    "symbol": "SOLUSDT"
  }

  📊 Indicator Calculations

  | Indicator      | Purpose                         |
  | -------------- | ------------------------------- |
  | RSI (14)       | Overbought / Oversold Signals   |
  | MACD (12,26,9) | Trend Reversals / Momentum      |
  | BBANDS (20, 2) | Volatility Expansion            |
  | EMA (20)       | Short-Term Trend Confirmation   |
  | SMA (20)       | Macro-Level Support/Resistance  |
  | ADX (14)       | Trend Strength + Directional DI |

  📦 Setup

  Import the JSON into n8n.
  Add your OpenAI API credentials.
  Ensure webhook /1d-indicators is connected and working.
  Use this agent as a sub-workflow in:

     Binance SM Financial Analyst Tool
     Binance Spot Market Quant AI Agent

  📤 Output Example

  📅 1D Overview – MATICUSDT

  • RSI: 71 → Overbought  
  • MACD: Bearish Cross forming  
  • BBANDS: Widening Volatility  
  • EMA &lt; SMA → Downtrend Momentum  
  • ADX: 33 → High Trend Strength

  📌 Notes

  Not user-facing — outputs are structured JSON or Telegram-style summaries.
  Pairs well with shorter timeframe tools (15m–4h) for confidence stacking.

  🧾 Licensing & Attribution

  © 2025 Treasurium Capital Limited Company
  Architecture, prompts, and trade report structure are IP-protected.
  No unauthorized rebranding permitted.

  🔗 Need help? Reach out on LinkedIn – Don Jayamaha

nodes_used:
[cell repeats an earlier one in this file: 120 characters]

workflow_json:
  {"id":"tRckisVXLUy8rbLG","meta":{"instanceId":"a5283507e1917a33cc3ae615b2e7d5ad2c1e50955e6f831272ddd5ab816f3fb6"},"name":"Binance SM 1day Indicators Tool","tags":[],"nodes":[{"id":"17fdc5ce-753b-4197-8f36-7f2b4df2fb39","name":"OpenAI Chat Model","type":"@n8n/n8n-nodes-langchain.lmChatOpenAi","position":[3100,2040],"parameters":{"model":{"__rl":true,"mode":"list","value":"gpt-4.1-mini","cachedResultName":"gpt-4.1-mini"},"options":{}},"credentials":{"openAiApi":{"id":"yUizd8t0sD5wMYVG","name":"OpenAi account"}},"typeVersion":1.2},{"id":"bfdcd736-dabb-40b3-82a4-55e8cef8cb18","name":"Simple Memory","type":"@n8n/n8n-nodes-langchain.memoryBufferWindow","position":[3360,2060],"parameters":{},"typeVersion":1.3},{"id":"b7df590f-0c56-466d-a09c-b271f9f27c49","name":"When Executed by Another Workflow","type":"n8n-nodes-base.executeWorkflowTrigger","position":[2940,1700],"parameters":{"workflowInputs":{"values":[{"name":"message"},{"name":"sessionId"}]}},"typeVersion":1.1},{"id":"0928613f-9c83-41d8-a761-03cd357ba78a","name":"Binance SM 1day Indicators Agent","type":"@n8n/n8n-nodes-langchain.agent","position":[3340,1700],"parameters":{"text":"={{ $json.message }}","options":{"systemMessage":"You are the **Binance 1-Day Technical Indicator Agent**, responsible for calculating and returning **1-day interval signals** for any Binance Spot Market pair. You help detect major trend shifts, long-term support/resistance, and macro market behavior.\n\n---\n\n### 🔗 Connected Tools (via internal workflow)\n\nYou call the following indicators using `https://treasurium.app.n8n.cloud/webhook/1d-indicators`:\n\n* **RSI** (14-period)\n* **MACD** (12/26/9 config)\n* **Bollinger Bands** (20-period, 2×STD)\n* **SMA** (20-period)\n* **EMA** (20-period)\n* **ADX** (14-period with DI+ and DI−)\n\n---\n\n### 📥 Expected Input Format\n\n```json\n{\n  \"message\": \"SOLUSDT\",\n  \"sessionId\": \"telegram_chat_id\"\n}\n```\n\n* `message`: A valid Binance Spot Market symbol (e.g., SOLUSDT, MATICUSDT)\n* `sessionId`: For preserving user context and session-based replies\n\n---\n\n### 📊 Behavior\n\n* Sends POST request to:\n\n  ```\n  https://treasurium.app.n8n.cloud/webhook/1d-indicators\n  ```\n\n  with:\n\n  ```json\n  {\n    \"symbol\": \"SOLUSDT\"\n  }\n  ```\n\n* Retrieves **at least 40 daily candles** via Binance API\n\n* Calculates and merges results from all indicators listed above\n\n* Returns a single unified array for downstream agent interpretation\n\n---\n\n### 🧠 Use Case Scenarios\n\n* Identify **long-term market sentiment and trend shifts**\n* Support **macro trade setups** or high-confidence swing positions\n* Anchor **support/resistance levels** across multi-timeframe views\n* Feed **Financial Analyst Tool** and **Quant AI Agent** with base trend orientation\n\n---\n\n### ⚠️ Operational Notes\n\n* Validate that the symbol is correctly formatted (uppercase, no typos)\n* Ensure Binance returns sufficient 1d candles (fallback if not)\n* Timestamp consistency is required across indicators\n* Return all calculated metrics in structured JSON format with labels\n\n"},"promptType":"define"},"typeVersion":1.9},{"id":"07b02663-cf9f-4532-a745-64f8400ca3b2","name":"HTTP Request 1d Indicators Tool","type":"n8n-nodes-base.httpRequestTool","position":[3600,2020],"parameters":{"url":"https://treasurium.app.n8n.cloud/webhook/1d-indicators","method":"POST","options":{},"sendBody":true,"bodyParameters":{"parameters":[{"name":"symbol","value":"={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('parameters0_Value', ``, 'string') }}"}]}},"typeVersion":4.2},{"id":"79a6b169-30b1-41c3-854e-5ec05ba21e69","name":"Sticky Note","type":"n8n-nodes-base.stickyNote","position":[2880,1380],"parameters":{"color":4,"height":500,"content":"## Workflow Trigger\nNode: When Executed by Another Workflow\nThis workflow does not start on its own — it is always triggered by:\n\n**Binance SM Financial Analyst Tool**\n\n**Binance Quant AI Agent**"},"typeVersion":1},{"id":"d7466bfd-8c66-4342-a184-76b4e6652623","name":"Sticky Note8","type":"n8n-nodes-base.stickyNote","position":[3220,1500],"parameters":{"color":5,"width":500,"height":380,"content":"## Main Reasoning Agent\nNode: **Binance SM 1day Indicators Agent**\n\nYou calculate daily **RSI, MACD, Bollinger Bands, SMA, EMA, and ADX** for any Binance symbol. Your goal is to **detect macro sentiment, support/resistance zones, and long-term trend setups**."},"typeVersion":1},{"id":"be007521-ac2c-484b-8053-7328cc3ee75c","name":"Sticky Note2","type":"n8n-nodes-base.stickyNote","position":[3020,2000],"parameters":{"width":220,"height":520,"content":"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n##   OpenAI Chat Model\nNode: OpenAI Chat Model\nModel: **gpt-4.1-mini**\nThis node interprets:\n\nWhether the trend is **forming, consolidating, or reversing**\n\nTags like **\"Bearish Reversal\", \"Momentum Building\"**, etc.\n\nTelegram-ready summaries"},"typeVersion":1},{"id":"a7968e7d-4f05-4f2d-8a42-ec62f810b96b","name":"Sticky Note1","type":"n8n-nodes-base.stickyNote","position":[3280,2000],"parameters":{"color":3,"width":220,"height":520,"content":"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n## Session Memory\nNode: **Simple Memory\nStores sessionId, symbol, and last-used indicators** for tracking across multi-timeframe reports."},"typeVersion":1},{"id":"4097c8e4-d2c0-41a9-806e-26ccdd02d03e","name":"Sticky Note5","type":"n8n-nodes-base.stickyNote","position":[3540,2000],"parameters":{"color":6,"width":220,"height":860,"content":"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n## 1D Indicator Tool Call\nNode: HTTP Request 1d Indicators Tool\n\n**Sends a POST request to:**\n\n\nhttps://treasurium.app.n8n.cloud/webhook/1d-indicators\n\nPayload:\n\njson\n{\n  \"symbol\": \"SOLUSDT\"\n}\nCalculates:\n\n**RSI (14)\n\nMACD (12,26,9)\n\nBollinger Bands (20/2)\n\nSMA / EMA (20)\n\nADX (14 +DI/−DI)**\n\nUses the latest **40 candles** of 1-day interval data from **Binance**.\n\n"},"typeVersion":1},{"id":"2070c387-3359-43f5-a358-6aefd983aea2","name":"Sticky Note3","type":"n8n-nodes-base.stickyNote","position":[3960,340],"parameters":{"width":1400,"height":2820,"content":"# 🗓️ Binance SM 1day Indicators Tool – Documentation\n\nThis workflow acts as the macro-trend analysis unit of the Binance Spot Market Quant AI Agent. It calculates long-term indicators using 1-day candles and identifies major trend reversals, support zones, and macro structure.\n\n---\n\n## 🎯 Purpose\n\n* Retrieve 1-day OHLCV data for any Binance trading pair (last 40 candles)\n* Calculate daily indicators: RSI, MACD, Bollinger Bands, ADX, SMA, EMA\n* Send all raw indicator outputs to GPT for interpretation\n* Return high-confidence macro trend assessment, formatted for Telegram or AI reasoning layers\n\n---\n\n## ⚙️ Core Workflow Components\n\n| Node Name                           | Function                                                         |\n| ----------------------------------- | ---------------------------------------------------------------- |\n| `When Executed by Another Workflow` | Trigger (activated by Quant AI Agent or Financial Analyst Tool)  |\n| `Binance SM 1day Indicators Agent`  | Main logic agent for input routing and tool coordination         |\n| `HTTP Request 1d Indicators Tool`   | Calls webhook for real indicator calculations                    |\n| `OpenAI Chat Model (gpt-4.1-mini)`  | Interprets numerical outputs into human-readable trading signals |\n| `Simple Memory`                     | Tracks symbol and session context                                |\n\n---\n\n## 📥 Input Format\n\n```json\n{\n  \"message\": \"MATICUSDT\",\n  \"sessionId\": \"telegram_chat_id\"\n}\n```\n\n* `message`: Target Binance Spot Market symbol (uppercase)\n* `sessionId`: Used to track Telegram conversations and agent memory\n\n---\n\n## 🧠 Calculated Indicators\n\n| Indicator      | Details                            |\n| -------------- | ---------------------------------- |\n| RSI (14)       | Identifies overbought/oversold     |\n| MACD (12,26,9) | Detects trend shifts and momentum  |\n| BBANDS (20, 2) | Volatility squeeze or expansion    |\n| SMA (20)       | Macro trend support/resistance     |\n| EMA (20)       | Faster-moving confirmation layer   |\n| ADX (14)       | Strength of trend (includes DI+/-) |\n\nWebhook endpoint:\n\n```\nPOST https://treasurium.app.n8n.cloud/webhook/1d-indicators\n```\n\nPayload:\n\n```json\n{\n  \"symbol\": \"MATICUSDT\"\n}\n```\n\n---\n\n## 📤 GPT Output Format Example\n\n```\n📅 1D Overview – MATICUSDT\n\n• RSI: 71 → Overbought  \n• MACD: Bearish Cross forming  \n• BBANDS: Widening Volatility  \n• EMA < SMA → Downtrend Momentum  \n• ADX: 33 → High Trend Strength\n```\n\n---\n\n## 📊 Use Case Scenarios\n\n| Scenario                                 | Behavior                                                    |\n| ---------------------------------------- | ----------------------------------------------------------- |\n| Swing trader requests long-term trend    | Output highlights multi-day reversal or continuation setups |\n| Agent confirms bias before entry         | Used in conjunction with 15m–4h for confidence stacking     |\n| Analyst wants sentiment-free macro trend | This tool uses price structure only (no news input)         |\n\n---\n\n## 📦 Setup Instructions\n\n### 1. Import Workflow\n\n* Upload JSON into your n8n project\n* Rename for clarity if needed\n\n### 2. Configure GPT + Webhook\n\n* Ensure OpenAI API key is linked to GPT node\n* Confirm webhook `/1d-indicators` is active and functional\n\n### 3. Link Parent Workflows\n\n* This tool must be called by:\n\n  * `Binance SM Financial Analyst Tool`\n  * `Binance Spot Market Quant AI Agent`\n\n---\n\n## 🧾 Output Channel\n\n* This tool is not user-facing\n* Sends formatted summaries and structured arrays back to the calling agent\n\n---\n\n## 🔐 Licensing & Support\n\n🔗 **Don Jayamaha – LinkedIn**\n[http://linkedin.com/in/donjayamahajr](http://linkedin.com/in/donjayamahajr)\n\n© 2025 Treasurium Capital Limited Company. All rights reserved.\nThis tool is licensed for internal automation only. Its structure, API logic, prompt format, and data orchestration are protected under U.S. intellectual property law. Reuse or sale without a license is prohibited.\n"},"typeVersion":1}],"active":false,"pinData":{},"settings":{"executionOrder":"v1"},"versionId":"ca337caf-2f77-47ec-97e3-efbcb74ef79d","connections":{"Simple Memory":{"ai_memory":[[{"node":"Binance SM 1day Indicators Agent","type":"ai_memory","index":0}]]},"OpenAI Chat Model":{"ai_languageModel":[[{"node":"Binance SM 1day Indicators Agent","type":"ai_languageModel","index":0}]]},"HTTP Request 1d Indicators Tool":{"ai_tool":[[{"node":"Binance SM 1day Indicators Agent","type":"ai_tool","index":0}]]},"When Executed by Another Workflow":{"main":[[{"node":"Binance SM 1day Indicators Agent","type":"main","index":0}]]}}}


name: Binance SM Indicators Webhook Tool
author_name: Don Jayamaha Jr
author_username: don-the-gem-dealer
nodes_used: ["n8n-nodes-base.httpRequest","n8n-nodes-base.code"]
categories: []
created_at: 2025-06-06T18:28:23.790Z
updated_at: 2025-06-06T18:28:23.790Z
url: https://n8n.io/workflows/4747
scraped_at: 2025-06-19 22:49:33
description:
  This workflow acts as a central API gateway for all technical indicator agents in the Binance Spot Market Quant AI system. It listens for incoming webhook requests and dynamically routes them to the correct timeframe-based indicator tool (15m, 1h, 4h, 1d). Designed to power multi-timeframe analysis at scale.

  🎥 Live Demo:

  🎯 What It Does

  Accepts requests via webhook with a token symbol and timeframe
  Forwards requests to the correct internal technical indicator tool
  Returns a clean JSON payload with RSI, MACD, BBANDS, EMA, SMA, and ADX
  Can be used directly or as a microservice by other agents

  🛠️ Input Format

  Webhook endpoint:

  POST /webhook/indicators

  Body format:

  {
    "symbol": "DOGEUSDT",
    "timeframe": "15m"
  }

  🔄 Routing Logic

  | Timeframe | Routed To                        |
  | --------- | -------------------------------- |
  | 15m       | Binance SM 15min Indicators Tool |
  | 1h        | Binance SM 1hour Indicators Tool |
  | 4h        | Binance SM 4hour Indicators Tool |
  | 1d        | Binance SM 1day Indicators Tool  |

  🔎 Use Cases

  | Use Case                                           | Description                                            |
  | -------------------------------------------------- | ------------------------------------------------------ |
  | 🔗 Used by Binance Financial Analyst Tool          | Automatically triggers all indicator tools in parallel |
  | 🤖 Integrated in Binance Quant AI System           | Supports reasoning, signal generation, and summaries   |
  | ⚙️ Can be called independently for raw data access | Useful for dashboards or advanced analytics            |

  📤 Output Example

  {
    "symbol": "DOGEUSDT",
    "timeframe": "15m",
    "rsi": 56.7,
    "macd": "Bearish Crossover",
    "bbands": "Stable",
    "ema": "Price above EMA",
    "adx": 19.4
  }

  ✅ Prerequisites

  Make sure all the following workflows are installed and operational:

    Binance SM 15min Indicators Tool
    Binance SM 1hour Indicators Tool
    Binance SM 4hour Indicators Tool
    Binance SM 1day Indicators Tool
  OpenAI credentials (for any agent using LLM formatting)

  🧾 Licensing & Attribution

  © 2025 Treasurium Capital Limited Company
  All architectural routing logic and endpoint structuring is IP-protected.
  No unauthorized rebranding or resale permitted.

  🔗 Need help? Connect on LinkedIn – Don Jayamaha

workflow_json:
  {"id":"HrTD222kWpvKsy2j","meta":{"instanceId":"a5283507e1917a33cc3ae615b2e7d5ad2c1e50955e6f831272ddd5ab816f3fb6"},"name":"Binance SM Indicators Webhook Tool","tags":[],"nodes":[{"id":"61cb3bd7-60ba-4dcf-a080-146b7612a99b","name":"HTTP Request","type":"n8n-nodes-base.httpRequest","position":[-1080,0],"parameters":{"url":"https://api.binance.com/api/v3/klines","options":{},"sendQuery":true,"queryParameters":{"parameters":[{"name":"symbol","value":"={{$json.body.symbol}}"},{"name":"interval","value":"15m"},{"name":"limit","value":"40"}]}},"typeVersion":4.2},{"id":"b372f57e-917a-42d2-964c-25a296ea982d","name":"Webhook 15m Indicators","type":"n8n-nodes-base.webhook","position":[-1460,0],"webhookId":"39cc366c-af5f-472a-9d48-bbe30a4fe3ea","parameters":{"path":"39cc366c-af5f-472a-9d48-bbe30a4fe3ea","options":{},"httpMethod":"POST","responseMode":"responseNode"},"typeVersion":2},{"id":"46b937d5-7338-457f-b2f0-eb85ac44a8bb","name":"Merge Into 1 Array","type":"n8n-nodes-base.code","position":[-740,0],"parameters":{"jsCode":"const klines = $input.all().map(item => item.json);\nreturn [{ json: { klines } }];"},"typeVersion":2},{"id":"5b8c1049-bcf4-41d4-bba3-5f76e940bd3e","name":"Calculate Bollinger Bands","type":"n8n-nodes-base.code","position":[-280,-460],"parameters":{"jsCode":"// Get raw klines array\nconst klines = $input.first().json.klines;\n\n// Parameters\nconst period = 20;\nconst stdMultiplier = 2;\n\n// Validate type\nif (!Array.isArray(klines)) {\n  throw new Error(\"klines is not an array\");\n}\n\n// Extract closing prices\nconst closes = klines.map(k => parseFloat(k[4]));\n\n// Ensure enough data\nif (closes.length < period) {\n  throw new Error(`Not enough data: got ${closes.length}, expected at least ${period}`);\n}\n\n// BB calculation logic\nfunction calculateBB(prices, period) {\n  const result = [];\n  for (let i = period - 1; i < prices.length; i++) {\n    const slice = prices.slice(i - period + 1, i + 1);\n    const mean = slice.reduce((sum, val) => sum + val, 0) / period;\n    const variance = slice.reduce((sum, val) => sum + Math.pow(val - mean, 2), 0) / period;\n    const stdDev = Math.sqrt(variance);\n\n    result.push({\n      close: prices[i],\n      basis: mean,\n      upper: mean + stdMultiplier * stdDev,\n      lower: mean - stdMultiplier * stdDev,\n      timestamp: klines[i][0]\n    });\n  }\n  return result;\n}\n\n// Calculate bands\nconst bands = calculateBB(closes, period);\n\n// Format output\nreturn bands.map(b => ({\n  json: {\n    timestamp: b.timestamp,\n    close: b.close,\n    bb_basis: b.basis,\n    bb_upper: b.upper,\n    bb_lower: b.lower\n  }\n}));"},"typeVersion":2},{"id":"b0391e28-03a3-40f0-8182-72df0928ca2c","name":"Calculate RSI","type":"n8n-nodes-base.code","position":[-280,-240],"parameters":{"jsCode":"// Pull klines array from JSON\nconst klines = $input.first().json.klines;\n\n// === CONFIGURATION ===\nconst period = 14; // RSI period\n\n// === Extract closing prices ===\nconst closes = klines.map(k => parseFloat(k[4]));\n\n// === Ensure enough data ===\nif (closes.length < period + 1) {\n  throw new Error(`Not enough data for RSI. Need at least ${period + 1}, got ${closes.length}`);\n}\n\n// === RSI Calculation ===\nfunction calculateRSI(prices, period) {\n  const result = [];\n\n  for (let i = period; i < prices.length; i++) {\n    let gains = 0;\n    let losses = 0;\n\n    for (let j = i - period + 1; j <= i; j++) {\n      const change = prices[j] - prices[j - 1];\n      if (change >= 0) gains += change;\n      else losses -= change;\n    }\n\n    const avgGain = gains / period;\n    const avgLoss = losses / period;\n\n    const rs = avgLoss === 0 ? 100 : avgGain / avgLoss;\n    const rsi = avgLoss === 0 ? 100 : 100 - (100 / (1 + rs));\n\n    result.push({\n      timestamp: klines[i][0],\n      close: prices[i],\n      rsi: rsi\n    });\n  }\n\n  return result;\n}\n\n// === Run RSI ===\nconst rsiSeries = calculateRSI(closes, period);\n\n// === Return formatted RSI output ===\nreturn rsiSeries.map(r => ({\n  json: {\n    timestamp: r.timestamp,\n    close: r.close,\n    rsi: r.rsi\n  }\n}));"},"typeVersion":2},{"id":"2c598960-630c-4687-91c0-bfae10da1943","name":"Calculate MACD","type":"n8n-nodes-base.code","position":[-280,-40],"parameters":{"jsCode":"// Get klines array\nconst klines = $input.first().json.klines;\n\n// Extract closing prices\nconst closes = klines.map(k => parseFloat(k[4]));\n\n// Parameters\nconst fastPeriod = 12;\nconst slowPeriod = 26;\nconst signalPeriod = 9;\n\n// Validate data length\nconst minRequired = slowPeriod + signalPeriod;\nif (closes.length < minRequired) {\n  throw new Error(`Not enough data for MACD. Need at least ${minRequired}, got ${closes.length}`);\n}\n\n// === Helper: EMA function ===\nfunction calculateEMA(prices, period) {\n  const k = 2 / (period + 1);\n  const ema = [prices.slice(0, period).reduce((a, b) => a + b, 0) / period];\n\n  for (let i = period; i < prices.length; i++) {\n    ema.push(prices[i] * k + ema[ema.length - 1] * (1 - k));\n  }\n\n  return ema;\n}\n\n// === MACD Core Calculation ===\nconst slowEMA = calculateEMA(closes, slowPeriod);\nconst fastEMA = calculateEMA(closes.slice(slowPeriod - fastPeriod), fastPeriod);\n\n// Align lengths\nconst alignedFastEMA = fastEMA.slice(fastEMA.length - slowEMA.length);\nconst macdLine = alignedFastEMA.map((val, i) => val - slowEMA[i]);\n\n// Signal line\nconst signalLine = calculateEMA(macdLine, signalPeriod);\n\n// Histogram\nconst histogram = macdLine.slice(signalPeriod - 1).map((macd, i) => macd - signalLine[i]);\n\n// Final output start index\nconst startIndex = closes.length - histogram.length;\n\nconst result = [];\n\nfor (let i = 0; i < histogram.length; i++) {\n  const idx = startIndex + i;\n  result.push({\n    timestamp: klines[idx]?.[0] || null,\n    close: closes[idx],\n    macd: macdLine[i + signalPeriod - 1],\n    signal: signalLine[i],\n    histogram: histogram[i]\n  });\n}\n\nreturn result.map(r => ({\n  json: r\n}));"},"typeVersion":2},{"id":"c50f7fa5-2707-47a4-9b32-1d582bf5d600","name":"Calculate SMA","type":"n8n-nodes-base.code","position":[-280,200],"parameters":{"jsCode":"// Get klines array\nconst klines = $input.first().json.klines;\n\n// Parameters\nconst period = 20; // Change to 50, 100, 200, etc. as needed\n\n// Extract closing prices\nconst closes = klines.map(k => parseFloat(k[4]));\n\n// Check for sufficient data\nif (closes.length < period) {\n  throw new Error(`Not enough data to compute SMA. Need at least ${period}, got ${closes.length}`);\n}\n\n// Calculate SMA values\nconst result = [];\n\nfor (let i = period - 1; i < closes.length; i++) {\n  const slice = closes.slice(i - period + 1, i + 1);\n  const sum = slice.reduce((a, b) => a + b, 0);\n  const average = sum / period;\n\n  result.push({\n    timestamp: klines[i][0],\n    close: closes[i],\n    sma: average\n  });\n}\n\n// Return formatted output\nreturn result.map(r => ({\n  json: r\n}));"},"typeVersion":2},{"id":"25ef2964-c9b1-4b9e-b6ce-3766b215d163","name":"Calculate EMA","type":"n8n-nodes-base.code","position":[-280,420],"parameters":{"jsCode":"// Get klines array\nconst klines = $input.first().json.klines;\n\n// Parameters\nconst period = 20; // Change to 9, 12, 26, 50, etc. as needed\n\n// Extract closing prices\nconst closes = klines.map(k => parseFloat(k[4]));\n\n// Check for sufficient data\nif (closes.length < period) {\n  throw new Error(`Not enough data to compute EMA. Need at least ${period}, got ${closes.length}`);\n}\n\n// EMA Calculation\nconst k = 2 / (period + 1);\nconst ema = [];\n\n// Start with SMA of first period\nlet sma = closes.slice(0, period).reduce((a, b) => a + b, 0) / period;\nema.push({\n  timestamp: klines[period - 1][0],\n  close: closes[period - 1],\n  ema: sma\n});\n\n// Continue EMA calculation\nfor (let i = period; i < closes.length; i++) {\n  const value = closes[i] * k + ema[ema.length - 1].ema * (1 - k);\n  ema.push({\n    timestamp: klines[i][0],\n    close: closes[i],\n    ema: value\n  });\n}\n\n// Return result\nreturn ema.map(e => ({\n  json: e\n}));"},"typeVersion":2},{"id":"df6546be-3778-4fba-801a-870c0fe883c3","name":"Calculate ADX","type":"n8n-nodes-base.code","position":[-280,660],"parameters":{"jsCode":"// Get kline array from merged item\nconst klines = $input.first().json.klines;\n\n// Parameters\nconst period = 14;\n\n// Parse high, low, close arrays\nconst highs = klines.map(k => parseFloat(k[2]));\nconst lows = klines.map(k => parseFloat(k[3]));\nconst closes = klines.map(k => parseFloat(k[4]));\n\n// Validation\nif (closes.length < period + 1) {\n  throw new Error(`Not enough data for ADX. Need at least ${period + 1}, got ${closes.length}`);\n}\n\n// Initialize arrays\nconst tr = [];\nconst plusDM = [];\nconst minusDM = [];\n\n// Step 1: Calculate TR, +DM, -DM\nfor (let i = 1; i < klines.length; i++) {\n  const highDiff = highs[i] - highs[i - 1];\n  const lowDiff = lows[i - 1] - lows[i];\n  const upMove = highDiff > 0 && highDiff > lowDiff ? highDiff : 0;\n  const downMove = lowDiff > 0 && lowDiff > highDiff ? lowDiff : 0;\n\n  const trueRange = Math.max(\n    highs[i] - lows[i],\n    Math.abs(highs[i] - closes[i - 1]),\n    Math.abs(lows[i] - closes[i - 1])\n  );\n\n  tr.push(trueRange);\n  plusDM.push(upMove);\n  minusDM.push(downMove);\n}\n\n// Step 2: Smooth TR, +DM, -DM and calculate DI\nconst smoothedTR = [tr.slice(0, period).reduce((a, b) => a + b, 0)];\nconst smoothedPlusDM = [plusDM.slice(0, period).reduce((a, b) => a + b, 0)];\nconst smoothedMinusDM = [minusDM.slice(0, period).reduce((a, b) => a + b, 0)];\n\nfor (let i = period; i < tr.length; i++) {\n  smoothedTR.push(smoothedTR[smoothedTR.length - 1] - smoothedTR[smoothedTR.length - 1] / period + tr[i]);\n  smoothedPlusDM.push(smoothedPlusDM[smoothedPlusDM.length - 1] - smoothedPlusDM[smoothedPlusDM.length - 1] / period + plusDM[i]);\n  smoothedMinusDM.push(smoothedMinusDM[smoothedMinusDM.length - 1] - smoothedMinusDM[smoothedMinusDM.length - 1] / period + minusDM[i]);\n}\n\nconst plusDI = smoothedPlusDM.map((val, i) => 100 * val / smoothedTR[i]);\nconst minusDI = smoothedMinusDM.map((val, i) => 100 * val / smoothedTR[i]);\n\n// Step 3: Calculate DX\nconst dx = plusDI.map((val, i) => {\n  const diff = Math.abs(plusDI[i] - minusDI[i]);\n  const sum = plusDI[i] + minusDI[i];\n  return sum === 0 ? 0 : 100 * (diff / sum);\n});\n\n// Step 4: Smooth DX into ADX\nconst adx = [];\nconst firstADX = dx.slice(0, period).reduce((a, b) => a + b, 0) / period;\nadx.push(firstADX);\n\nfor (let i = period; i < dx.length; i++) {\n  const newADX = (adx[adx.length - 1] * (period - 1) + dx[i]) / period;\n  adx.push(newADX);\n}\n\n// Step 5: Final result formatting\nconst output = [];\n\nfor (let i = 0; i < adx.length; i++) {\n  const index = i + (2 * period); // account for offset\n  if (klines[index]) {\n    output.push({\n      timestamp: klines[index][0],\n      close: closes[index],\n      adx: adx[i],\n      plusDI: plusDI[i + period],\n      minusDI: minusDI[i + period]\n    });\n  }\n}\n\nreturn output.map(r => ({ json: r }));"},"typeVersion":2},{"id":"5ea4756f-a20a-444c-8471-57d209457823","name":"Merge 15 min Indicators","type":"n8n-nodes-base.merge","position":[180,-80],"parameters":{"numberInputs":6},"typeVersion":3.1},{"id":"0a46ea7c-a85d-4fc6-b20c-7e65ab962ea6","name":"Respond to 15m Webhook","type":"n8n-nodes-base.respondToWebhook","position":[560,-20],"parameters":{"options":{},"respondWith":"allIncomingItems"},"typeVersion":1.3},{"id":"40fcbba9-489b-4452-baf8-9a41ef0f9b07","name":"Webhook 1h Indicators","type":"n8n-nodes-base.webhook","position":[-3220,1760],"webhookId":"78948764-5cdb-4808-8ef9-2155f10dd721","parameters":{"path":"78948764-5cdb-4808-8ef9-2155f10dd721","options":{},"httpMethod":"POST","responseMode":"responseNode"},"typeVersion":2},{"id":"39e6b058-d800-4751-b75b-5e62be379c61","name":"Respond to 1h Webhook","type":"n8n-nodes-base.respondToWebhook","position":[-1060,1740],"parameters":{"options":{},"respondWith":"allIncomingItems"},"typeVersion":1.3},{"id":"af471a36-1107-4ccd-be14-efa06ba27330","name":"Merge 1h Indicators","type":"n8n-nodes-base.merge","position":[-1460,1680],"parameters":{"numberInputs":6},"typeVersion":3.1},{"id":"d7d9bb31-6986-42e6-9f0c-7d7f00d66ee1","name":"Merge Into 1 Array 1h","type":"n8n-nodes-base.code","position":[-2540,1760],"parameters":{"jsCode":"const klines = $input.all().map(item => item.json);\nreturn [{ json: { klines } }];"},"typeVersion":2},{"id":"a2e9d933-47d7-47f5-8d49-224860d8600a","name":"Calculate Bollinger Bands(1h)","type":"n8n-nodes-base.code","position":[-2060,1220],"parameters":{"jsCode":"// Get raw klines array\nconst klines = $input.first().json.klines;\n\n// Parameters\nconst period = 20;\nconst stdMultiplier = 2;\n\n// Validate type\nif (!Array.isArray(klines)) {\n  throw new Error(\"klines is not an array\");\n}\n\n// Extract closing prices\nconst closes = klines.map(k => parseFloat(k[4]));\n\n// Ensure enough data\nif (closes.length < period) {\n  throw new Error(`Not enough data: got ${closes.length}, expected at least ${period}`);\n}\n\n// BB calculation logic\nfunction calculateBB(prices, period) {\n  const result = [];\n  for (let i = period - 1; i < prices.length; i++) {\n    const slice = prices.slice(i - period + 1, i + 1);\n    const mean = slice.reduce((sum, val) => sum + val, 0) / period;\n    const variance = slice.reduce((sum, val) => sum + Math.pow(val - mean, 2), 0) / period;\n    const stdDev = Math.sqrt(variance);\n\n    result.push({\n      close: prices[i],\n      basis: mean,\n      upper: mean + stdMultiplier * stdDev,\n      lower: mean - stdMultiplier * stdDev,\n      timestamp: klines[i][0]\n    });\n  }\n  return result;\n}\n\n// Calculate bands\nconst bands = calculateBB(closes, period);\n\n// Format output\nreturn bands.map(b => ({\n  json: {\n    timestamp: b.timestamp,\n    close: b.close,\n    bb_basis: b.basis,\n    bb_upper: b.upper,\n    bb_lower: b.lower\n  }\n}));"},"typeVersion":2},{"id":"702e8bc8-d8f0-4fb4-b44f-fd19479c8b03","name":"Calculate RSI(1h)","type":"n8n-nodes-base.code","position":[-2060,1500],"parameters":{"jsCode":"// Pull klines array from JSON\nconst klines = $input.first().json.klines;\n\n// === CONFIGURATION ===\nconst period = 14; // RSI period\n\n// === Extract closing prices ===\nconst closes = klines.map(k => parseFloat(k[4]));\n\n// === Ensure enough data ===\nif (closes.length < period + 1) {\n  throw new Error(`Not enough data for RSI. Need at least ${period + 1}, got ${closes.length}`);\n}\n\n// === RSI Calculation ===\nfunction calculateRSI(prices, period) {\n  const result = [];\n\n  for (let i = period; i < prices.length; i++) {\n    let gains = 0;\n    let losses = 0;\n\n    for (let j = i - period + 1; j <= i; j++) {\n      const change = prices[j] - prices[j - 1];\n      if (change >= 0) gains += change;\n      else losses -= change;\n    }\n\n    const avgGain = gains / period;\n    const avgLoss = losses / period;\n\n    const rs = avgLoss === 0 ? 100 : avgGain / avgLoss;\n    const rsi = avgLoss === 0 ? 100 : 100 - (100 / (1 + rs));\n\n    result.push({\n      timestamp: klines[i][0],\n      close: prices[i],\n      rsi: rsi\n    });\n  }\n\n  return result;\n}\n\n// === Run RSI ===\nconst rsiSeries = calculateRSI(closes, period);\n\n// === Return formatted RSI output ===\nreturn rsiSeries.map(r => ({\n  json: {\n    timestamp: r.timestamp,\n    close: r.close,\n    rsi: r.rsi\n  }\n}));"},"typeVersion":2},{"id":"d16b7829-59ca-45ca-a5ae-4e315168c96d","name":"Calculate MACD(1h)","type":"n8n-nodes-base.code","position":[-2060,1720],"parameters":{"jsCode":"// Get klines array\nconst klines = $input.first().json.klines;\n\n// Extract closing prices\nconst closes = klines.map(k => parseFloat(k[4]));\n\n// Parameters\nconst fastPeriod = 12;\nconst slowPeriod = 26;\nconst signalPeriod = 9;\n\n// Validate data length\nconst minRequired = slowPeriod + signalPeriod;\nif (closes.length < minRequired) {\n  throw new Error(`Not enough data for MACD. Need at least ${minRequired}, got ${closes.length}`);\n}\n\n// === Helper: EMA function ===\nfunction calculateEMA(prices, period) {\n  const k = 2 / (period + 1);\n  const ema = [prices.slice(0, period).reduce((a, b) => a + b, 0) / period];\n\n  for (let i = period; i < prices.length; i++) {\n    ema.push(prices[i] * k + ema[ema.length - 1] * (1 - k));\n  }\n\n  return ema;\n}\n\n// === MACD Core Calculation ===\nconst slowEMA = calculateEMA(closes, slowPeriod);\nconst fastEMA = calculateEMA(closes.slice(slowPeriod - fastPeriod), fastPeriod);\n\n// Align lengths\nconst alignedFastEMA = fastEMA.slice(fastEMA.length - slowEMA.length);\nconst macdLine = alignedFastEMA.map((val, i) => val - slowEMA[i]);\n\n// Signal line\nconst signalLine = calculateEMA(macdLine, signalPeriod);\n\n// Histogram\nconst histogram = macdLine.slice(signalPeriod - 1).map((macd, i) => macd - signalLine[i]);\n\n// Final output start index\nconst startIndex = closes.length - histogram.length;\n\nconst result = [];\n\nfor (let i = 0; i < histogram.length; i++) {\n  const idx = startIndex + i;\n  result.push({\n    timestamp: klines[idx]?.[0] || null,\n    close: closes[idx],\n    macd: macdLine[i + signalPeriod - 1],\n    signal: signalLine[i],\n    histogram: histogram[i]\n  });\n}\n\nreturn result.map(r => ({\n  json: r\n}));"},"typeVersion":2},{"id":"15bf5c3b-de07-412b-988c-f5c59fa7a06f","name":"Calculate SMA(1h)","type":"n8n-nodes-base.code","position":[-2060,1960],"parameters":{"jsCode":"// Get klines array\nconst klines = $input.first().json.klines;\n\n// Parameters\nconst period = 20; // Change to 50, 100, 200, etc. as needed\n\n// Extract closing prices\nconst closes = klines.map(k => parseFloat(k[4]));\n\n// Check for sufficient data\nif (closes.length < period) {\n  throw new Error(`Not enough data to compute SMA. Need at least ${period}, got ${closes.length}`);\n}\n\n// Calculate SMA values\nconst result = [];\n\nfor (let i = period - 1; i < closes.length; i++) {\n  const slice = closes.slice(i - period + 1, i + 1);\n  const sum = slice.reduce((a, b) => a + b, 0);\n  const average = sum / period;\n\n  result.push({\n    timestamp: klines[i][0],\n    close: closes[i],\n    sma: average\n  });\n}\n\n// Return formatted output\nreturn result.map(r => ({\n  json: r\n}));"},"typeVersion":2},{"id":"83fa487a-1a67-4059-9007-d5298d8bb105","name":"Calculate EMA(1h)","type":"n8n-nodes-base.code","position":[-2060,2220],"parameters":{"jsCode":"// Get klines array\nconst klines = $input.first().json.klines;\n\n// Parameters\nconst period = 20; // Change to 9, 12, 26, 50, etc. as needed\n\n// Extract closing prices\nconst closes = klines.map(k => parseFloat(k[4]));\n\n// Check for sufficient data\nif (closes.length < period) {\n  throw new Error(`Not enough data to compute EMA. Need at least ${period}, got ${closes.length}`);\n}\n\n// EMA Calculation\nconst k = 2 / (period + 1);\nconst ema = [];\n\n// Start with SMA of first period\nlet sma = closes.slice(0, period).reduce((a, b) => a + b, 0) / period;\nema.push({\n  timestamp: klines[period - 1][0],\n  close: closes[period - 1],\n  ema: sma\n});\n\n// Continue EMA calculation\nfor (let i = period; i < closes.length; i++) {\n  const value = closes[i] * k + ema[ema.length - 1].ema * (1 - k);\n  ema.push({\n    timestamp: klines[i][0],\n    close: closes[i],\n    ema: value\n  });\n}\n\n// Return result\nreturn ema.map(e => ({\n  json: e\n}));"},"typeVersion":2},{"id":"7301ba32-ab0c-4c80-b041-cd398f7daa2c","name":"Calculate ADX1","type":"n8n-nodes-base.code","position":[-2060,2420],"parameters":{"jsCode":"// Get kline array from merged item\nconst klines = $input.first().json.klines;\n\n// Parameters\nconst period = 14;\n\n// Parse high, low, close arrays\nconst highs = klines.map(k => parseFloat(k[2]));\nconst lows = klines.map(k => parseFloat(k[3]));\nconst closes = klines.map(k => parseFloat(k[4]));\n\n// Validation\nif (closes.length < period + 1) {\n  throw new Error(`Not enough data for ADX. Need at least ${period + 1}, got ${closes.length}`);\n}\n\n// Initialize arrays\nconst tr = [];\nconst plusDM = [];\nconst minusDM = [];\n\n// Step 1: Calculate TR, +DM, -DM\nfor (let i = 1; i < klines.length; i++) {\n  const highDiff = highs[i] - highs[i - 1];\n  const lowDiff = lows[i - 1] - lows[i];\n  const upMove = highDiff > 0 && highDiff > lowDiff ? highDiff : 0;\n  const downMove = lowDiff > 0 && lowDiff > highDiff ? lowDiff : 0;\n\n  const trueRange = Math.max(\n    highs[i] - lows[i],\n    Math.abs(highs[i] - closes[i - 1]),\n    Math.abs(lows[i] - closes[i - 1])\n  );\n\n  tr.push(trueRange);\n  plusDM.push(upMove);\n  minusDM.push(downMove);\n}\n\n// Step 2: Smooth TR, +DM, -DM and calculate DI\nconst smoothedTR = [tr.slice(0, period).reduce((a, b) => a + b, 0)];\nconst smoothedPlusDM = [plusDM.slice(0, period).reduce((a, b) => a + b, 0)];\nconst smoothedMinusDM = [minusDM.slice(0, period).reduce((a, b) => a + b, 0)];\n\nfor (let i = period; i < tr.length; i++) {\n  smoothedTR.push(smoothedTR[smoothedTR.length - 1] - smoothedTR[smoothedTR.length - 1] / period + tr[i]);\n  smoothedPlusDM.push(smoothedPlusDM[smoothedPlusDM.length - 1] - smoothedPlusDM[smoothedPlusDM.length - 1] / period + plusDM[i]);\n  smoothedMinusDM.push(smoothedMinusDM[smoothedMinusDM.length - 1] - smoothedMinusDM[smoothedMinusDM.length - 1] / period + minusDM[i]);\n}\n\nconst plusDI = smoothedPlusDM.map((val, i) => 100 * val / smoothedTR[i]);\nconst minusDI = smoothedMinusDM.map((val, i) => 100 * val / smoothedTR[i]);\n\n// Step 3: Calculate DX\nconst dx = plusDI.map((val, i) => {\n  const diff = Math.abs(plusDI[i] - minusDI[i]);\n  const sum = plusDI[i] + minusDI[i];\n  return sum === 0 ? 0 : 100 * (diff / sum);\n});\n\n// Step 4: Smooth DX into ADX\nconst adx = [];\nconst firstADX = dx.slice(0, period).reduce((a, b) => a + b, 0) / period;\nadx.push(firstADX);\n\nfor (let i = period; i < dx.length; i++) {\n  const newADX = (adx[adx.length - 1] * (period - 1) + dx[i]) / period;\n  adx.push(newADX);\n}\n\n// Step 5: Final result formatting\nconst output = [];\n\nfor (let i = 0; i < adx.length; i++) {\n  const index = i + (2 * period); // account for offset\n  if (klines[index]) {\n    output.push({\n      timestamp: klines[index][0],\n      close: closes[index],\n      adx: adx[i],\n      plusDI: plusDI[i + period],\n      minusDI: minusDI[i + period]\n    });\n  }\n}\n\nreturn output.map(r => ({ json: r }));"},"typeVersion":2},{"id":"9ec777b1-eb23-43b0-8bb3-726adcc3418f","name":"HTTP Request 1h","type":"n8n-nodes-base.httpRequest","position":[-2880,1760],"parameters":{"url":"https://api.binance.com/api/v3/klines","options":{},"sendQuery":true,"queryParameters":{"parameters":[{"name":"symbol","value":"={{$json.body.symbol}}"},{"name":"interval","value":"1h"},{"name":"limit","value":"40"}]}},"typeVersion":4.2},{"id":"c4a718f8-f2d6-464b-8120-1e4067d760ad","name":"Webhook 4h Indicators","type":"n8n-nodes-base.webhook","position":[-40,1680],"webhookId":"55fd9665-ed4a-4e1a-8062-890cad0fb6ac","parameters":{"path":"55fd9665-ed4a-4e1a-8062-890cad0fb6ac","options":{},"httpMethod":"POST","responseMode":"responseNode"},"typeVersion":2},{"id":"bbb81a2a-b1c4-4c1e-80e9-a4990c45fae8","name":"HTTP Request 4h","type":"n8n-nodes-base.httpRequest","position":[300,1680],"parameters":{"url":"https://api.binance.com/api/v3/klines","options":{},"sendQuery":true,"queryParameters":{"parameters":[{"name":"symbol","value":"={{$json.body.symbol}}"},{"name":"interval","value":"4h"},{"name":"limit","value":"40"}]}},"typeVersion":4.2},{"id":"20e58706-035f-46ef-b235-78fe468875bc","name":"Merge Into 1 Array 4h","type":"n8n-nodes-base.code","position":[640,1680],"parameters":{"jsCode":"const klines = $input.all().map(item => item.json);\nreturn [{ json: { klines } }];"},"typeVersion":2},{"id":"1675168b-97ab-4be4-92d2-734d075e2222","name":"Calculate Bollinger Bands(4h)","type":"n8n-nodes-base.code","position":[1120,1180],"parameters":{"jsCode":"// Get raw klines array\nconst klines = $input.first().json.klines;\n\n// Parameters\nconst period = 20;\nconst stdMultiplier = 2;\n\n// Validate type\nif (!Array.isArray(klines)) {\n  throw new Error(\"klines is not an array\");\n}\n\n// Extract closing prices\nconst closes = klines.map(k => parseFloat(k[4]));\n\n// Ensure enough data\nif (closes.length < period) {\n  throw new Error(`Not enough data: got ${closes.length}, expected at least ${period}`);\n}\n\n// BB calculation logic\nfunction calculateBB(prices, period) {\n  const result = [];\n  for (let i = period - 1; i < prices.length; i++) {\n    const slice = prices.slice(i - period + 1, i + 1);\n    const mean = slice.reduce((sum, val) => sum + val, 0) / period;\n    const variance = slice.reduce((sum, val) => sum + Math.pow(val - mean, 2), 0) / period;\n    const stdDev = Math.sqrt(variance);\n\n    result.push({\n      close: prices[i],\n      basis: mean,\n      upper: mean + stdMultiplier * stdDev,\n      lower: mean - stdMultiplier * stdDev,\n      timestamp: klines[i][0]\n    });\n  }\n  return result;\n}\n\n// Calculate bands\nconst bands = calculateBB(closes, period);\n\n// Format output\nreturn bands.map(b => ({\n  json: {\n    timestamp: b.timestamp,\n    close: b.close,\n    bb_basis: b.basis,\n    bb_upper: b.upper,\n    bb_lower: b.lower\n  }\n}));"},"typeVersion":2},{"id":"d1c2fcc7-65ac-446c-8f59-c4cd8ac7d795","name":"Calculate RSI(4h)","type":"n8n-nodes-base.code","position":[1120,1420],"parameters":{"jsCode":"// Pull klines array from JSON\nconst klines = $input.first().json.klines;\n\n// === CONFIGURATION ===\nconst period = 14; // RSI period\n\n// === Extract closing prices ===\nconst closes = klines.map(k => parseFloat(k[4]));\n\n// === Ensure enough data ===\nif (closes.length < period + 1) {\n  throw new Error(`Not enough data for RSI. Need at least ${period + 1}, got ${closes.length}`);\n}\n\n// === RSI Calculation ===\nfunction calculateRSI(prices, period) {\n  const result = [];\n\n  for (let i = period; i < prices.length; i++) {\n    let gains = 0;\n    let losses = 0;\n\n    for (let j = i - period + 1; j <= i; j++) {\n      const change = prices[j] - prices[j - 1];\n      if (change >= 0) gains += change;\n      else losses -= change;\n    }\n\n    const avgGain = gains / period;\n    const avgLoss = losses / period;\n\n    const rs = avgLoss === 0 ? 100 : avgGain / avgLoss;\n    const rsi = avgLoss === 0 ? 100 : 100 - (100 / (1 + rs));\n\n    result.push({\n      timestamp: klines[i][0],\n      close: prices[i],\n      rsi: rsi\n    });\n  }\n\n  return result;\n}\n\n// === Run RSI ===\nconst rsiSeries = calculateRSI(closes, period);\n\n// === Return formatted RSI output ===\nreturn rsiSeries.map(r => ({\n  json: {\n    timestamp: r.timestamp,\n    close: r.close,\n    rsi: r.rsi\n  }\n}));"},"typeVersion":2},{"id":"df32e55c-2dbc-44d6-8161-f70db651cfcd","name":"Calculate MACD(4h)","type":"n8n-nodes-base.code","position":[1120,1660],"parameters":{"jsCode":"// Get klines array\nconst klines = $input.first().json.klines;\n\n// Extract closing prices\nconst closes = klines.map(k => parseFloat(k[4]));\n\n// Parameters\nconst fastPeriod = 12;\nconst slowPeriod = 26;\nconst signalPeriod = 9;\n\n// Validate data length\nconst minRequired = slowPeriod + signalPeriod;\nif (closes.length < minRequired) {\n  throw new Error(`Not enough data for MACD. Need at least ${minRequired}, got ${closes.length}`);\n}\n\n// === Helper: EMA function ===\nfunction calculateEMA(prices, period) {\n  const k = 2 / (period + 1);\n  const ema = [prices.slice(0, period).reduce((a, b) => a + b, 0) / period];\n\n  for (let i = period; i < prices.length; i++) {\n    ema.push(prices[i] * k + ema[ema.length - 1] * (1 - k));\n  }\n\n  return ema;\n}\n\n// === MACD Core Calculation ===\nconst slowEMA = calculateEMA(closes, slowPeriod);\nconst fastEMA = calculateEMA(closes.slice(slowPeriod - fastPeriod), fastPeriod);\n\n// Align lengths\nconst alignedFastEMA = fastEMA.slice(fastEMA.length - slowEMA.length);\nconst macdLine = alignedFastEMA.map((val, i) => val - slowEMA[i]);\n\n// Signal line\nconst signalLine = calculateEMA(macdLine, signalPeriod);\n\n// Histogram\nconst histogram = macdLine.slice(signalPeriod - 1).map((macd, i) => macd - signalLine[i]);\n\n// Final output start index\nconst startIndex = closes.length - histogram.length;\n\nconst result = [];\n\nfor (let i = 0; i < histogram.length; i++) {\n  const idx = startIndex + i;\n  result.push({\n    timestamp: klines[idx]?.[0] || null,\n    close: closes[idx],\n    macd: macdLine[i + signalPeriod - 1],\n    signal: signalLine[i],\n    histogram: histogram[i]\n  });\n}\n\nreturn result.map(r => ({\n  json: r\n}));"},"typeVersion":2},{"id":"93a115f7-e876-43f0-8ecb-70a47a06f41c","name":"Calculate SMA(4h)","type":"n8n-nodes-base.code","position":[1120,1880],"parameters":{"jsCode":"// Get klines array\nconst klines = $input.first().json.klines;\n\n// Parameters\nconst period = 20; // Change to 50, 100, 200, etc. as needed\n\n// Extract closing prices\nconst closes = klines.map(k => parseFloat(k[4]));\n\n// Check for sufficient data\nif (closes.length < period) {\n  throw new Error(`Not enough data to compute SMA. Need at least ${period}, got ${closes.length}`);\n}\n\n// Calculate SMA values\nconst result = [];\n\nfor (let i = period - 1; i < closes.length; i++) {\n  const slice = closes.slice(i - period + 1, i + 1);\n  const sum = slice.reduce((a, b) => a + b, 0);\n  const average = sum / period;\n\n  result.push({\n    timestamp: klines[i][0],\n    close: closes[i],\n    sma: average\n  });\n}\n\n// Return formatted output\nreturn result.map(r => ({\n  json: r\n}));"},"typeVersion":2},{"id":"17bf4e9f-7053-4a04-b439-3e23fe5cb7f9","name":"Calculate EMA(4h)","type":"n8n-nodes-base.code","position":[1120,2100],"parameters":{"jsCode":"// Get klines array\nconst klines = $input.first().json.klines;\n\n// Parameters\nconst period = 20; // Change to 9, 12, 26, 50, etc. as needed\n\n// Extract closing prices\nconst closes = klines.map(k => parseFloat(k[4]));\n\n// Check for sufficient data\nif (closes.length < period) {\n  throw new Error(`Not enough data to compute EMA. Need at least ${period}, got ${closes.length}`);\n}\n\n// EMA Calculation\nconst k = 2 / (period + 1);\nconst ema = [];\n\n// Start with SMA of first period\nlet sma = closes.slice(0, period).reduce((a, b) => a + b, 0) / period;\nema.push({\n  timestamp: klines[period - 1][0],\n  close: closes[period - 1],\n  ema: sma\n});\n\n// Continue EMA calculation\nfor (let i = period; i < closes.length; i++) {\n  const value = closes[i] * k + ema[ema.length - 1].ema * (1 - k);\n  ema.push({\n    timestamp: klines[i][0],\n    close: closes[i],\n    ema: value\n  });\n}\n\n// Return result\nreturn ema.map(e => ({\n  json: e\n}));"},"typeVersion":2},{"id":"d61db420-9def-4ec1-bf8a-94afeabda186","name":"Calculate ADX (4h)","type":"n8n-nodes-base.code","position":[1120,2360],"parameters":{"jsCode":"// Get kline array from merged item\nconst klines = $input.first().json.klines;\n\n// Parameters\nconst period = 14;\n\n// Parse high, low, close arrays\nconst highs = klines.map(k => parseFloat(k[2]));\nconst lows = klines.map(k => parseFloat(k[3]));\nconst closes = klines.map(k => parseFloat(k[4]));\n\n// Validation\nif (closes.length < period + 1) {\n  throw new Error(`Not enough data for ADX. Need at least ${period + 1}, got ${closes.length}`);\n}\n\n// Initialize arrays\nconst tr = [];\nconst plusDM = [];\nconst minusDM = [];\n\n// Step 1: Calculate TR, +DM, -DM\nfor (let i = 1; i < klines.length; i++) {\n  const highDiff = highs[i] - highs[i - 1];\n  const lowDiff = lows[i - 1] - lows[i];\n  const upMove = highDiff > 0 && highDiff > lowDiff ? highDiff : 0;\n  const downMove = lowDiff > 0 && lowDiff > highDiff ? lowDiff : 0;\n\n  const trueRange = Math.max(\n    highs[i] - lows[i],\n    Math.abs(highs[i] - closes[i - 1]),\n    Math.abs(lows[i] - closes[i - 1])\n  );\n\n  tr.push(trueRange);\n  plusDM.push(upMove);\n  minusDM.push(downMove);\n}\n\n// Step 2: Smooth TR, +DM, -DM and calculate DI\nconst smoothedTR = [tr.slice(0, period).reduce((a, b) => a + b, 0)];\nconst smoothedPlusDM = [plusDM.slice(0, period).reduce((a, b) => a + b, 0)];\nconst smoothedMinusDM = [minusDM.slice(0, period).reduce((a, b) => a + b, 0)];\n\nfor (let i = period; i < tr.length; i++) {\n  smoothedTR.push(smoothedTR[smoothedTR.length - 1] - smoothedTR[smoothedTR.length - 1] / period + tr[i]);\n  smoothedPlusDM.push(smoothedPlusDM[smoothedPlusDM.length - 1] - smoothedPlusDM[smoothedPlusDM.length - 1] / period + plusDM[i]);\n  smoothedMinusDM.push(smoothedMinusDM[smoothedMinusDM.length - 1] - smoothedMinusDM[smoothedMinusDM.length - 1] / period + minusDM[i]);\n}\n\nconst plusDI = smoothedPlusDM.map((val, i) => 100 * val / smoothedTR[i]);\nconst minusDI = smoothedMinusDM.map((val, i) => 100 * val / smoothedTR[i]);\n\n// Step 3: Calculate DX\nconst dx = plusDI.map((val, i) => {\n  const diff = Math.abs(plusDI[i] - minusDI[i]);\n  const sum = plusDI[i] + minusDI[i];\n  return sum === 0 ? 0 : 100 * (diff / sum);\n});\n\n// Step 4: Smooth DX into ADX\nconst adx = [];\nconst firstADX = dx.slice(0, period).reduce((a, b) => a + b, 0) / period;\nadx.push(firstADX);\n\nfor (let i = period; i < dx.length; i++) {\n  const newADX = (adx[adx.length - 1] * (period - 1) + dx[i]) / period;\n  adx.push(newADX);\n}\n\n// Step 5: Final result formatting\nconst output = [];\n\nfor (let i = 0; i < adx.length; i++) {\n  const index = i + (2 * period); // account for offset\n  if (klines[index]) {\n    output.push({\n      timestamp: klines[index][0],\n      close: closes[index],\n      adx: adx[i],\n      plusDI: plusDI[i + period],\n      minusDI: minusDI[i + period]\n    });\n  }\n}\n\nreturn output.map(r => ({ json: r }));"},"typeVersion":2},{"id":"7940bc3f-c5f4-4b4b-b542-8737f17afbbf","name":"Merge 4h Indicators","type":"n8n-nodes-base.merge","position":[1720,1600],"parameters":{"numberInputs":6},"typeVersion":3.1},{"id":"8585a269-b70d-4af7-b264-db9f638c8a77","name":"Respond to 4h Webhook","type":"n8n-nodes-base.respondToWebhook","position":[2120,1660],"parameters":{"options":{},"respondWith":"allIncomingItems"},"typeVersion":1.3},{"id":"91a05310-bd36-4ee0-8381-b3d16c3346be","name":"Webhook 1d Indicators","type":"n8n-nodes-base.webhook","position":[-1600,3140],"webhookId":"23c8ec04-5aec-49c6-9c2c-c352ccec11b4","parameters":{"path":"23c8ec04-5aec-49c6-9c2c-c352ccec11b4","options":{},"httpMethod":"POST","responseMode":"responseNode"},"typeVersion":2},{"id":"29121e2e-f6e2-4d42-8e5b-e8eea1e61ec8","name":"HTTP Request 1d","type":"n8n-nodes-base.httpRequest","position":[-1260,3140],"parameters":{"url":"https://api.binance.com/api/v3/klines","options":{},"sendQuery":true,"queryParameters":{"parameters":[{"name":"symbol","value":"={{$json.body.symbol}}"},{"name":"interval","value":"1d"},{"name":"limit","value":"40"}]}},"typeVersion":4.2},{"id":"1be26316-3d08-4983-9d12-6bc36465e76e","name":"Merge Into 1 Array 1d","type":"n8n-nodes-base.code","position":[-900,3140],"parameters":{"jsCode":"const klines = $input.all().map(item => item.json);\nreturn [{ json: { klines } }];"},"typeVersion":2},{"id":"6e9c7976-737b-4377-b412-633a1a67097b","name":"Calculate Bollinger Bands(1d)","type":"n8n-nodes-base.code","position":[-440,2620],"parameters":{"jsCode":"// Get raw klines array\nconst klines = $input.first().json.klines;\n\n// Parameters\nconst period = 20;\nconst stdMultiplier = 2;\n\n// Validate type\nif (!Array.isArray(klines)) {\n  throw new Error(\"klines is not an array\");\n}\n\n// Extract closing prices\nconst closes = klines.map(k => parseFloat(k[4]));\n\n// Ensure enough data\nif (closes.length < period) {\n  throw new Error(`Not enough data: got ${closes.length}, expected at least ${period}`);\n}\n\n// BB calculation logic\nfunction calculateBB(prices, period) {\n  const result = [];\n  for (let i = period - 1; i < prices.length; i++) {\n    const slice = prices.slice(i - period + 1, i + 1);\n    const mean = slice.reduce((sum, val) => sum + val, 0) / period;\n    const variance = slice.reduce((sum, val) => sum + Math.pow(val - mean, 2), 0) / period;\n    const stdDev = Math.sqrt(variance);\n\n    result.push({\n      close: prices[i],\n      basis: mean,\n      upper: mean + stdMultiplier * stdDev,\n      lower: mean - stdMultiplier * stdDev,\n      timestamp: klines[i][0]\n    });\n  }\n  return result;\n}\n\n// Calculate bands\nconst bands = calculateBB(closes, period);\n\n// Format output\nreturn bands.map(b => ({\n  json: {\n    timestamp: b.timestamp,\n    close: b.close,\n    bb_basis: b.basis,\n    bb_upper: b.upper,\n    bb_lower: b.lower\n  }\n}));"},"typeVersion":2},{"id":"ac84877a-75cf-4ef2-bad1-8d0f444ecead","name":"Calculate RSI(1d)","type":"n8n-nodes-base.code","position":[-440,2880],"parameters":{"jsCode":"// Pull klines array from JSON\nconst klines = $input.first().json.klines;\n\n// === CONFIGURATION ===\nconst period = 14; // RSI period\n\n// === Extract closing prices ===\nconst closes = klines.map(k => parseFloat(k[4]));\n\n// === Ensure enough data ===\nif (closes.length < period + 1) {\n  throw new Error(`Not enough data for RSI. Need at least ${period + 1}, got ${closes.length}`);\n}\n\n// === RSI Calculation ===\nfunction calculateRSI(prices, period) {\n  const result = [];\n\n  for (let i = period; i < prices.length; i++) {\n    let gains = 0;\n    let losses = 0;\n\n    for (let j = i - period + 1; j <= i; j++) {\n      const change = prices[j] - prices[j - 1];\n      if (change >= 0) gains += change;\n      else losses -= change;\n    }\n\n    const avgGain = gains / period;\n    const avgLoss = losses / period;\n\n    const rs = avgLoss === 0 ? 100 : avgGain / avgLoss;\n    const rsi = avgLoss === 0 ? 100 : 100 - (100 / (1 + rs));\n\n    result.push({\n      timestamp: klines[i][0],\n      close: prices[i],\n      rsi: rsi\n    });\n  }\n\n  return result;\n}\n\n// === Run RSI ===\nconst rsiSeries = calculateRSI(closes, period);\n\n// === Return formatted RSI output ===\nreturn rsiSeries.map(r => ({\n  json: {\n    timestamp: r.timestamp,\n    close: r.close,\n    rsi: r.rsi\n  }\n}));"},"typeVersion":2},{"id":"a5da65c5-db5a-4f9d-a6cf-228f081ffb3c","name":"Calculate MACD(1d)","type":"n8n-nodes-base.code","position":[-440,3120],"parameters":{"jsCode":"// Get klines array\nconst klines = $input.first().json.klines;\n\n// Extract closing prices\nconst closes = klines.map(k => parseFloat(k[4]));\n\n// Parameters\nconst fastPeriod = 12;\nconst slowPeriod = 26;\nconst signalPeriod = 9;\n\n// Validate data length\nconst minRequired = slowPeriod + signalPeriod;\nif (closes.length < minRequired) {\n  throw new Error(`Not enough data for MACD. Need at least ${minRequired}, got ${closes.length}`);\n}\n\n// === Helper: EMA function ===\nfunction calculateEMA(prices, period) {\n  const k = 2 / (period + 1);\n  const ema = [prices.slice(0, period).reduce((a, b) => a + b, 0) / period];\n\n  for (let i = period; i < prices.length; i++) {\n    ema.push(prices[i] * k + ema[ema.length - 1] * (1 - k));\n  }\n\n  return ema;\n}\n\n// === MACD Core Calculation ===\nconst slowEMA = calculateEMA(closes, slowPeriod);\nconst fastEMA = calculateEMA(closes.slice(slowPeriod - fastPeriod), fastPeriod);\n\n// Align lengths\nconst alignedFastEMA = fastEMA.slice(fastEMA.length - slowEMA.length);\nconst macdLine = alignedFastEMA.map((val, i) => val - slowEMA[i]);\n\n// Signal line\nconst signalLine = calculateEMA(macdLine, signalPeriod);\n\n// Histogram\nconst histogram = macdLine.slice(signalPeriod - 1).map((macd, i) => macd - signalLine[i]);\n\n// Final output start index\nconst startIndex = closes.length - histogram.length;\n\nconst result = [];\n\nfor (let i = 0; i < histogram.length; i++) {\n  const idx = startIndex + i;\n  result.push({\n    timestamp: klines[idx]?.[0] || null,\n    close: closes[idx],\n    macd: macdLine[i + signalPeriod - 1],\n    signal: signalLine[i],\n    histogram: histogram[i]\n  });\n}\n\nreturn result.map(r => ({\n  json: r\n}));"},"typeVersion":2},{"id":"5b1f34b3-e675-46b1-a754-679080680058","name":"Calculate SMA(1d)","type":"n8n-nodes-base.code","position":[-440,3340],"parameters":{"jsCode":"// Get klines array\nconst klines = $input.first().json.klines;\n\n// Parameters\nconst period = 20; // Change to 50, 100, 200, etc. as needed\n\n// Extract closing prices\nconst closes = klines.map(k => parseFloat(k[4]));\n\n// Check for sufficient data\nif (closes.length < period) {\n  throw new Error(`Not enough data to compute SMA. Need at least ${period}, got ${closes.length}`);\n}\n\n// Calculate SMA values\nconst result = [];\n\nfor (let i = period - 1; i < closes.length; i++) {\n  const slice = closes.slice(i - period + 1, i + 1);\n  const sum = slice.reduce((a, b) => a + b, 0);\n  const average = sum / period;\n\n  result.push({\n    timestamp: klines[i][0],\n    close: closes[i],\n    sma: average\n  });\n}\n\n// Return formatted output\nreturn result.map(r => ({\n  json: r\n}));"},"typeVersion":2},{"id":"0b3278a6-5793-4d70-8954-70562c43a3eb","name":"Calculate EMA(1d)","type":"n8n-nodes-base.code","position":[-440,3580],"parameters":{"jsCode":"// Get klines array\nconst klines = $input.first().json.klines;\n\n// Parameters\nconst period = 20; // Change to 9, 12, 26, 50, etc. as needed\n\n// Extract closing prices\nconst closes = klines.map(k => parseFloat(k[4]));\n\n// Check for sufficient data\nif (closes.length < period) {\n  throw new Error(`Not enough data to compute EMA. Need at least ${period}, got ${closes.length}`);\n}\n\n// EMA Calculation\nconst k = 2 / (period + 1);\nconst ema = [];\n\n// Start with SMA of first period\nlet sma = closes.slice(0, period).reduce((a, b) => a + b, 0) / period;\nema.push({\n  timestamp: klines[period - 1][0],\n  close: closes[period - 1],\n  ema: sma\n});\n\n// Continue EMA calculation\nfor (let i = period; i < closes.length; i++) {\n  const value = closes[i] * k + ema[ema.length - 1].ema * (1 - k);\n  ema.push({\n    timestamp: klines[i][0],\n    close: closes[i],\n    ema: value\n  });\n}\n\n// Return result\nreturn ema.map(e => ({\n  json: e\n}));"},"typeVersion":2},{"id":"28dd6fb1-a161-49ed-9c14-740e88e2195d","name":"Calculate ADX (1d)","type":"n8n-nodes-base.code","position":[-440,3780],"parameters":{"jsCode":"// Get kline array from merged item\nconst klines = $input.first().json.klines;\n\n// Parameters\nconst period = 14;\n\n// Parse high, low, close arrays\nconst highs = klines.map(k => parseFloat(k[2]));\nconst lows = klines.map(k => parseFloat(k[3]));\nconst closes = klines.map(k => parseFloat(k[4]));\n\n// Validation\nif (closes.length < period + 1) {\n  throw new Error(`Not enough data for ADX. Need at least ${period + 1}, got ${closes.length}`);\n}\n\n// Initialize arrays\nconst tr = [];\nconst plusDM = [];\nconst minusDM = [];\n\n// Step 1: Calculate TR, +DM, -DM\nfor (let i = 1; i < klines.length; i++) {\n  const highDiff = highs[i] - highs[i - 1];\n  const lowDiff = lows[i - 1] - lows[i];\n  const upMove = highDiff > 0 && highDiff > lowDiff ? highDiff : 0;\n  const downMove = lowDiff > 0 && lowDiff > highDiff ? lowDiff : 0;\n\n  const trueRange = Math.max(\n    highs[i] - lows[i],\n    Math.abs(highs[i] - closes[i - 1]),\n    Math.abs(lows[i] - closes[i - 1])\n  );\n\n  tr.push(trueRange);\n  plusDM.push(upMove);\n  minusDM.push(downMove);\n}\n\n// Step 2: Smooth TR, +DM, -DM and calculate DI\nconst smoothedTR = [tr.slice(0, period).reduce((a, b) => a + b, 0)];\nconst smoothedPlusDM = [plusDM.slice(0, period).reduce((a, b) => a + b, 0)];\nconst smoothedMinusDM = [minusDM.slice(0, period).reduce((a, b) => a + b, 0)];\n\nfor (let i = period; i < tr.length; i++) {\n  smoothedTR.push(smoothedTR[smoothedTR.length - 1] - smoothedTR[smoothedTR.length - 1] / period + tr[i]);\n  smoothedPlusDM.push(smoothedPlusDM[smoothedPlusDM.length - 1] - smoothedPlusDM[smoothedPlusDM.length - 1] / period + plusDM[i]);\n  smoothedMinusDM.push(smoothedMinusDM[smoothedMinusDM.length - 1] - smoothedMinusDM[smoothedMinusDM.length - 1] / period + minusDM[i]);\n}\n\nconst plusDI = smoothedPlusDM.map((val, i) => 100 * val / smoothedTR[i]);\nconst minusDI = smoothedMinusDM.map((val, i) => 100 * val / smoothedTR[i]);\n\n// Step 3: Calculate DX\nconst dx = plusDI.map((val, i) => {\n  const diff = Math.abs(plusDI[i] - minusDI[i]);\n  const sum = plusDI[i] + minusDI[i];\n  return sum === 0 ? 0 : 100 * (diff / sum);\n});\n\n// Step 4: Smooth DX into ADX\nconst adx = [];\nconst firstADX = dx.slice(0, period).reduce((a, b) => a + b, 0) / period;\nadx.push(firstADX);\n\nfor (let i = period; i < dx.length; i++) {\n  const newADX = (adx[adx.length - 1] * (period - 1) + dx[i]) / period;\n  adx.push(newADX);\n}\n\n// Step 5: Final result formatting\nconst output = [];\n\nfor (let i = 0; i < adx.length; i++) {\n  const index = i + (2 * period); // account for offset\n  if (klines[index]) {\n    output.push({\n      timestamp: klines[index][0],\n      close: closes[index],\n      adx: adx[i],\n      plusDI: plusDI[i + period],\n      minusDI: minusDI[i + period]\n    });\n  }\n}\n\nreturn output.map(r => ({ json: r }));"},"typeVersion":2},{"id":"660dfcb4-ed63-4c53-806b-cba96c105fee","name":"Merge 1d Indicators","type":"n8n-nodes-base.merge","position":[160,3060],"parameters":{"numberInputs":6},"typeVersion":3.1},{"id":"939665ce-7a50-4a6d-9b37-62ad800350b0","name":"Respond to 1d Webhook","type":"n8n-nodes-base.respondToWebhook","position":[560,3120],"parameters":{"options":{},"respondWith":"allIncomingItems"},"typeVersion":1.3},{"id":"2f44a150-0c5a-4b74-92b5-fe941fccb86d","name":"Sticky Note13","type":"n8n-nodes-base.stickyNote","position":[100,-340],"parameters":{"color":5,"width":260,"height":620,"content":"## Technical Indicator API Merge \n\n**Binance API** for 6 indicators:\n\n• **RSI, MACD, BBANDS, SMA, EMA, ADX**"},"typeVersion":1},{"id":"fbf6424d-8bfc-469b-ae56-c9824e657e75","name":"Sticky Note","type":"n8n-nodes-base.stickyNote","position":[1640,1340],"parameters":{"color":5,"width":260,"height":620,"content":"## Technical Indicator API Merge \n\n**Binance API** for 6 indicators:\n\n• **RSI, MACD, BBANDS, SMA, EMA, ADX**"},"typeVersion":1},{"id":"fba15cd9-e7a0-4a03-813e-444dd2cd25f7","name":"Sticky Note14","type":"n8n-nodes-base.stickyNote","position":[-1540,1380],"parameters":{"color":5,"width":260,"height":620,"content":"## Technical Indicator API Merge \n\n**Binance API** for 6 indicators:\n\n• **RSI, MACD, BBANDS, SMA, EMA, ADX**"},"typeVersion":1},{"id":"ab87eb1b-3048-4717-af97-b7fa92c0f260","name":"Sticky Note15","type":"n8n-nodes-base.stickyNote","position":[80,2760],"parameters":{"color":5,"width":260,"height":620,"content":"## Technical Indicator API Merge \n\n**Binance API** for 6 indicators:\n\n• **RSI, MACD, BBANDS, SMA, EMA, ADX**"},"typeVersion":1},{"id":"b3abceb1-3605-4cca-8b4e-1f85f792fff2","name":"Sticky Note1","type":"n8n-nodes-base.stickyNote","position":[-1540,-500],"parameters":{"color":4,"height":680,"content":"## Webhooks (15minData)\n\n• **Entry point** for external workflows calling indicator batches\n\n• Orchestrates trigger for **indicator API pull + formatter nodes**\n\n• Returns **cleaned batch** back via Respond to Webhook node\n\n📎 Notes:\n\n• Must pass through correct **webhook** path\n\n• Responds after **merge with all 6 formatted outputs** per timeframe"},"typeVersion":1},{"id":"2143ce8a-8746-4187-bc43-c9cc294da7b8","name":"Sticky Note2","type":"n8n-nodes-base.stickyNote","position":[-3300,1240],"parameters":{"color":4,"height":680,"content":"## Webhooks (1hourData)\n\n• **Entry point** for external workflows calling indicator batches\n\n• Orchestrates trigger for **indicator API pull + formatter nodes**\n\n• Returns **cleaned batch** back via Respond to Webhook node\n\n📎 Notes:\n\n• Must pass through correct **webhook** path\n\n• Responds after **merge with all 6 formatted outputs** per timeframe"},"typeVersion":1},{"id":"d9150fb0-42b5-48e8-b123-e588672a653f","name":"Sticky Note3","type":"n8n-nodes-base.stickyNote","position":[-100,1200],"parameters":{"color":4,"height":680,"content":"## Webhooks (4hourData)\n\n• **Entry point** for external workflows calling indicator batches\n\n• Orchestrates trigger for **indicator API pull + formatter nodes**\n\n• Returns **cleaned batch** back via Respond to Webhook node\n\n📎 Notes:\n\n• Must pass through correct **webhook** path\n\n• Responds after **merge with all 6 formatted outputs** per timeframe"},"typeVersion":1},{"id":"50737e51-ef67-42af-bf15-ac228c750f4d","name":"Sticky Note4","type":"n8n-nodes-base.stickyNote","position":[-1680,2640],"parameters":{"color":4,"height":680,"content":"## Webhooks (1dayData)\n\n• **Entry point** for external workflows calling indicator batches\n\n• Orchestrates trigger for **indicator API pull + formatter nodes**\n\n• Returns **cleaned batch** back via Respond to Webhook node\n\n📎 Notes:\n\n• Must pass through correct **webhook** path\n\n• Responds after **merge with all 6 formatted outputs** per timeframe"},"typeVersion":1},{"id":"61972dcf-2bd5-454e-880b-0d3e97c82f98","name":"Sticky Note5","type":"n8n-nodes-base.stickyNote","position":[480,-480],"parameters":{"color":4,"width":280,"height":640,"content":"## Webhooks Respond (15minData)\n\n• **Exit point** for external workflows calling indicator batches\n\n• Orchestrates trigger for **indicator API pull + formatter nodes**\n\n• Returns **cleaned batch** back via Respond to Webhook node\n\n📎 Notes:\n\n• Must pass through correct **webhook** path\n\n• Responds after **merge with all 6 formatted outputs** per timeframe"},"typeVersion":1},{"id":"c545e86b-8f90-4e3b-8e72-25f56de0b214","name":"Sticky Note6","type":"n8n-nodes-base.stickyNote","position":[2020,1200],"parameters":{"color":4,"width":280,"height":640,"content":"## Webhooks Respond (4hourData)\n\n• **Exit point** for external workflows calling indicator batches\n\n• Orchestrates trigger for **indicator API pull + formatter nodes**\n\n• Returns **cleaned batch** back via Respond to Webhook node\n\n📎 Notes:\n\n• Must pass through correct **webhook** path\n\n• Responds after **merge with all 6 formatted outputs** per timeframe"},"typeVersion":1},{"id":"9e838383-1c81-45c6-98f1-f735dc5789df","name":"Sticky Note7","type":"n8n-nodes-base.stickyNote","position":[-1140,1260],"parameters":{"color":4,"width":280,"height":640,"content":"## Webhooks Respond (1hourData)\n\n• **Exit point** for external workflows calling indicator batches\n\n• Orchestrates trigger for **indicator API pull + formatter nodes**\n\n• Returns **cleaned batch** back via Respond to Webhook node\n\n📎 Notes:\n\n• Must pass through correct **webhook** path\n\n• Responds after **merge with all 6 formatted outputs** per timeframe"},"typeVersion":1},{"id":"f05d2def-9593-46c5-862d-378a5d1f64d4","name":"Sticky Note8","type":"n8n-nodes-base.stickyNote","position":[480,2660],"parameters":{"color":4,"width":280,"height":640,"content":"## Webhooks Respond (1dayData)\n\n• **Exit point** for external workflows calling indicator batches\n\n• Orchestrates trigger for **indicator API pull + formatter nodes**\n\n• Returns **cleaned batch** back via Respond to Webhook node\n\n📎 Notes:\n\n• Must pass through correct **webhook** path\n\n• Responds after **merge with all 6 formatted outputs** per timeframe"},"typeVersion":1},{"id":"ceb5f8e0-e51f-4554-a752-a319033c14c4","name":"Sticky Note9","type":"n8n-nodes-base.stickyNote","position":[-1160,-300],"parameters":{"color":6,"width":260,"height":520,"content":"## Binance API Calls 15m \n\n• Triggers **Binance API** for k-line data:\n\n\n• Each node pulls and returns **raw API data** for formatting"},"typeVersion":1},{"id":"8e1aeb88-3232-4ea7-85c3-49a75097341b","name":"Sticky Note10","type":"n8n-nodes-base.stickyNote","position":[-2940,1480],"parameters":{"color":6,"width":260,"height":500,"content":"## Binance API Calls 1h \n\n• Triggers **Binance API** for k-line data:\n\n\n• Each node pulls and returns **raw API data** for formatting"},"typeVersion":1},{"id":"53996473-bdd7-44d3-9060-96a2f072077c","name":"Sticky Note11","type":"n8n-nodes-base.stickyNote","position":[240,1420],"parameters":{"color":6,"width":260,"height":500,"content":"## Binance API Calls 4h \n\n• Triggers **Binance API** for k-line data:\n\n\n• Each node pulls and returns **raw API data** for formatting"},"typeVersion":1},{"id":"6b138f55-5f0e-4844-a570-47919c8888b5","name":"Sticky Note12","type":"n8n-nodes-base.stickyNote","position":[-1340,2920],"parameters":{"color":6,"width":260,"height":420,"content":"## Binance API Calls 1d \n\n• Triggers **Binance API** for k-line data:\n\n\n• Each node pulls and returns **raw API data** for formatting"},"typeVersion":1},{"id":"8d8bd17f-c437-4e57-a517-3b6eb44eeff7","name":"Sticky Note16","type":"n8n-nodes-base.stickyNote","position":[-2120,720],"parameters":{"color":2,"height":1860,"content":"## Calculate Technical Indicators \n  \n\n• Ensures consistent **downstream format for merge and reasoning**\n\n📎 Notes:\n\n• **Format logic** is customized per indicator\n\n• Essential for **standardizing multi-timeframe data ingestion**"},"typeVersion":1},{"id":"ee6e6788-7b9d-4d29-9cdd-0af5256289ef","name":"Sticky Note17","type":"n8n-nodes-base.stickyNote","position":[-360,-860],"parameters":{"color":2,"width":260,"height":1720,"content":"## Calculate Technical Indicators \n  \n\n• Ensures consistent **downstream format for merge and reasoning**\n\n📎 Notes:\n\n• **Format logic** is customized per indicator\n\n• Essential for **standardizing multi-timeframe data ingestion**"},"typeVersion":1},{"id":"e53bcd92-c603-43f3-b25f-0d7dd46afca0","name":"Sticky Note18","type":"n8n-nodes-base.stickyNote","position":[1040,720],"parameters":{"color":2,"width":260,"height":1820,"content":"## Calculate Technical Indicators \n  \n\n• Ensures consistent **downstream format for merge and reasoning**\n\n📎 Notes:\n\n• **Format logic** is customized per indicator\n\n• Essential for **standardizing multi-timeframe data ingestion**"},"typeVersion":1},{"id":"7d27698c-bbc5-4faf-aa41-4c4332abb484","name":"Sticky Note19","type":"n8n-nodes-base.stickyNote","position":[-520,2180],"parameters":{"color":2,"width":260,"height":1800,"content":"## Calculate Technical Indicators \n  \n\n• Ensures consistent **downstream format for merge and reasoning**\n\n📎 Notes:\n\n• **Format logic** is customized per indicator\n\n• Essential for **standardizing multi-timeframe data ingestion**"},"typeVersion":1},{"id":"309f22d1-aeb2-4d48-a7c4-deaad51070e3","name":"Sticky Note20","type":"n8n-nodes-base.stickyNote","position":[-820,-240],"parameters":{"color":5,"width":260,"height":460,"content":"## API Merge \n\n**Binance API** for k-line Data to calculate:\n\n• **RSI, MACD, BBANDS, SMA, EMA, ADX**"},"typeVersion":1},{"id":"5a27535c-5bc9-4718-b895-5a8eccf37974","name":"Sticky Note21","type":"n8n-nodes-base.stickyNote","position":[-2600,1560],"parameters":{"color":5,"width":260,"height":420,"content":"## API Merge \n\n**Binance API** for k-line Data to calculate:\n\n• **RSI, MACD, BBANDS, SMA, EMA, ADX**"},"typeVersion":1},{"id":"52180c40-a1d3-4c41-aea6-73f62f7c98ee","name":"Sticky Note22","type":"n8n-nodes-base.stickyNote","position":[-980,2920],"parameters":{"color":5,"width":260,"height":460,"content":"## API Merge \n\n**Binance API** for k-line Data to calculate:\n\n• **RSI, MACD, BBANDS, SMA, EMA, ADX**"},"typeVersion":1},{"id":"08697498-181c-417f-8027-8d6de1471bed","name":"Sticky Note23","type":"n8n-nodes-base.stickyNote","position":[560,1480],"parameters":{"color":5,"width":260,"height":440,"content":"## API Merge \n\n**Binance API** for k-line Data to calculate:\n\n• **RSI, MACD, BBANDS, SMA, EMA, ADX**"},"typeVersion":1},{"id":"773a2b4f-f716-41ab-ba18-1412e2dd50e5","name":"Sticky Note24","type":"n8n-nodes-base.stickyNote","position":[2800,-60],"parameters":{"width":1460,"height":3020,"content":"# 🧪 Binance SM Indicators Webhook Tool – Documentation\n\nA backend webhook processor that performs **real-time indicator calculations** for 15m, 1h, 4h, and 1d Binance candlestick data. This workflow powers all the indicator sub-agents and is essential for maintaining modular and scalable logic across timeframes.\n\n---\n\n## 🎯 Purpose\n\n* Accepts HTTP POST requests from the 15m, 1h, 4h, or 1d sub-agents\n* Pulls raw OHLCV kline data for the symbol and interval\n* Calculates technical indicators:\n\n  * RSI, MACD, Bollinger Bands, SMA, EMA, ADX\n* Returns structured JSON with labeled values (e.g., `\"MACD_Cross\": \"Bullish\"`)\n\nThis tool ensures **centralized logic reuse** across all timeframe agents while improving speed and maintainability.\n\n---\n\n## ⚙️ Key Components\n\n| Node Name              | Description                                               |\n| ---------------------- | --------------------------------------------------------- |\n| `Webhook Trigger`      | Handles POST at `/15m-indicators`, `/1h-indicators`, etc. |\n| `Extract Symbol`       | Validates input payload (must include `symbol`)           |\n| `Fetch Binance Klines` | Gets latest 100 candles using `/api/v3/klines`            |\n| `RSI Calculator`       | Computes 14-period RSI from closing prices                |\n| `MACD Calculator`      | Computes 12, 26, 9 MACD with signal and histogram         |\n| `BBANDS Calculator`    | Calculates 20-period bands using std. deviation           |\n| `SMA/EMA Node`         | Computes 20-period simple and exponential MAs             |\n| `ADX Calculator`       | Computes 14-period trend strength (DI+/DI− included)      |\n| `Prepare Output`       | Returns JSON with all labeled indicators                  |\n\n---\n\n## 📥 Expected Input (from sub-agent)\n\n```json\n{\n  \"symbol\": \"BTCUSDT\"\n}\n```\n\nMust be a valid Binance Spot trading pair. Interval is auto-routed based on webhook endpoint:\n\n| Endpoint Path     | Interval |\n| ----------------- | -------- |\n| `/15m-indicators` | 15m      |\n| `/1h-indicators`  | 1h       |\n| `/4h-indicators`  | 4h       |\n| `/1d-indicators`  | 1d       |\n\n---\n\n## 📊 Sample Output JSON\n\n```json\n{\n  \"symbol\": \"BTCUSDT\",\n  \"interval\": \"4h\",\n  \"rsi\": 65.1,\n  \"macd\": {\n    \"value\": 24.3,\n    \"signal\": 21.7,\n    \"histogram\": 2.6,\n    \"cross\": \"Bullish\"\n  },\n  \"bb\": {\n    \"basis\": 62600,\n    \"upper\": 63500,\n    \"lower\": 61700,\n    \"status\": \"Expanding\"\n  },\n  \"sma\": 62000,\n  \"ema\": 62400,\n  \"adx\": {\n    \"value\": 32.8,\n    \"strength\": \"Strong\"\n  }\n}\n```\n\n---\n\n## 🧩 Use Case Scenarios\n\n| Scenario                                   | Result                                                   |\n| ------------------------------------------ | -------------------------------------------------------- |\n| 15m tool POSTs to `/15m-indicators`        | Webhook responds with 15m indicator set                  |\n| Financial Analyst Tool requests 1h signals | This workflow handles the actual math for each indicator |\n| 1d tool needs RSI + MACD + ADX             | Centralized logic avoids duplication across agents       |\n\n---\n\n## 🛠️ Installation Instructions\n\n### 1. Import & Activate\n\n* Import JSON into n8n\n* Ensure webhook is live and accessible\n* Test each endpoint (e.g., `/1h-indicators`) via POST\n\n### 2. Connect to Binance API\n\n* Public API: no credentials required\n* Ensure the HTTP request node for klines uses:\n\n  ```\n  https://api.binance.com/api/v3/klines\n  ```\n\n### 3. Link to Sub-Agent Workflows\n\n* 15m, 1h, 4h, 1d tools all depend on this for logic\n* Must POST `symbol` to the correct interval endpoint\n\n---\n\n## 📦 Example Workflow Integration\n\nAll the following tools rely on this:\n\n* `Binance SM 15min Indicators Tool`\n* `Binance SM 1hour Indicators Tool`\n* `Binance SM 4hour Indicators Tool`\n* `Binance SM 1day Indicators Tool`\n\nThis acts as the math engine behind each.\n\n---\n\n## 🔐 Licensing & Support\n\n🔗 **Don Jayamaha – LinkedIn**\n[http://linkedin.com/in/donjayamahajr](http://linkedin.com/in/donjayamahajr)\n\n© 2025 Treasurium Capital Limited Company. All rights reserved.\nThe design, architecture, and indicator calculation code within this system are proprietary. Reuse, resale, or modification without license is strictly prohibited.\n"},"typeVersion":1}],"active":false,"pinData":{},"settings":{"executionOrder":"v1"},"versionId":"f7032997-bb7f-4e2a-9982-7ee18c95cfbe","connections":{"HTTP Request":{"main":[[{"node":"Merge Into 1 Array","type":"main","index":0}]]},"Calculate ADX":{"main":[[{"node":"Merge 15 min Indicators","type":"main","index":5}]]},"Calculate EMA":{"main":[[{"node":"Merge 15 min Indicators","type":"main","index":4}]]},"Calculate RSI":{"main":[[{"node":"Merge 15 min Indicators","type":"main","index":1}]]},"Calculate SMA":{"main":[[{"node":"Merge 15 min Indicators","type":"main","index":3}]]},"Calculate ADX1":{"main":[[{"node":"Merge 1h Indicators","type":"main","index":5}]]},"Calculate MACD":{"main":[[{"node":"Merge 15 min Indicators","type":"main","index":2}]]},"HTTP Request 1d":{"main":[[{"node":"Merge Into 1 Array 1d","type":"main","index":0}]]},"HTTP Request 1h":{"main":[[{"node":"Merge Into 1 Array 1h","type":"main","index":0}]]},"HTTP Request 4h":{"main":[[{"node":"Merge Into 1 Array 4h","type":"main","index":0}]]},"Calculate EMA(1d)":{"main":[[{"node":"Merge 1d Indicators","type":"main","index":4}]]},"Calculate EMA(1h)":{"main":[[{"node":"Merge 1h Indicators","type":"main","index":4}]]},"Calculate EMA(4h)":{"main":[[{"node":"Merge 4h Indicators","type":"main","index":4}]]},"Calculate RSI(1d)":{"main":[[{"node":"Merge 1d Indicators","type":"main","index":1}]]},"Calculate RSI(1h)":{"main":[[{"node":"Merge 1h Indicators","type":"main","index":1}]]},"Calculate RSI(4h)":{"main":[[{"node":"Merge 4h Indicators","type":"main","index":1}]]},"Calculate SMA(1d)":{"main":[[{"node":"Merge 1d Indicators","type":"main","index":3}]]},"Calculate SMA(1h)":{"main":[[{"node":"Merge 1h Indicators","type":"main","index":3}]]},"Calculate SMA(4h)":{"main":[[{"node":"Merge 4h Indicators","type":"main","index":3}]]},"Calculate ADX (1d)":{"main":[[{"node":"Merge 1d Indicators","type":"main","index":5}]]},"Calculate ADX (4h)":{"main":[[{"node":"Merge 4h Indicators","type":"main","index":5}]]},"Calculate MACD(1d)":{"main":[[{"node":"Merge 1d Indicators","type":"main","index":2}]]},"Calculate MACD(1h)":{"main":[[{"node":"Merge 1h Indicators","type":"main","index":2}]]},"Calculate MACD(4h)":{"main":[[{"node":"Merge 4h Indicators","type":"main","index":2}]]},"Merge Into 1 Array":{"main":[[{"node":"Calculate Bollinger Bands","type":"main","index":0},{"node":"Calculate RSI","type":"main","index":0},{"node":"Calculate MACD","type":"main","index":0},{"node":"Calculate SMA","type":"main","index":0},{"node":"Calculate EMA","type":"main","index":0},{"node":"Calculate ADX","type":"main","index":0}]]},"Merge 1d Indicators":{"main":[[{"node":"Respond to 1d Webhook","type":"main","index":0}]]},"Merge 1h Indicators":{"main":[[{"node":"Respond to 1h Webhook","type":"main","index":0}]]},"Merge 4h Indicators":{"main":[[{"node":"Respond to 4h Webhook","type":"main","index":0}]]},"Merge Into 1 Array 1d":{"main":[[{"node":"Calculate Bollinger Bands(1d)","type":"main","index":0},{"node":"Calculate RSI(1d)","type":"main","index":0},{"node":"Calculate MACD(1d)","type":"main","index":0},{"node":"Calculate SMA(1d)","type":"main","index":0},{"node":"Calculate EMA(1d)","type":"main","index":0},{"node":"Calculate ADX (1d)","type":"main","index":0}]]},"Merge Into 1 Array 1h":{"main":[[{"node":"Calculate Bollinger Bands(1h)","type":"main","index":0},{"node":"Calculate RSI(1h)","type":"main","index":0},{"node":"Calculate MACD(1h)","type":"main","index":0},{"node":"Calculate SMA(1h)","type":"main","index":0},{"node":"Calculate EMA(1h)","type":"main","index":0},{"node":"Calculate ADX1","type":"main","index":0}]]},"Merge Into 1 Array 4h":{"main":[[{"node":"Calculate Bollinger Bands(4h)","type":"main","index":0},{"node":"Calculate RSI(4h)","type":"main","index":0},{"node":"Calculate MACD(4h)","type":"main","index":0},{"node":"Calculate SMA(4h)","type":"main","index":0},{"node":"Calculate EMA(4h)","type":"main","index":0},{"node":"Calculate ADX (4h)","type":"main","index":0}]]},"Webhook 1d Indicators":{"main":[[{"node":"HTTP Request 1d","type":"main","index":0}]]},"Webhook 1h Indicators":{"main":[[{"node":"HTTP Request 1h","type":"main","index":0}]]},"Webhook 4h Indicators":{"main":[[{"node":"HTTP Request 4h","type":"main","index":0}]]},"Webhook 15m Indicators":{"main":[[{"node":"HTTP Request","type":"main","index":0}]]},"Merge 15 min Indicators":{"main":[[{"node":"Respond to 15m Webhook","type":"main","index":0}]]},"Calculate Bollinger Bands":{"main":[[{"node":"Merge 15 min Indicators","type":"main","index":0}]]},"Calculate Bollinger Bands(1d)":{"main":[[{"node":"Merge 1d Indicators","type":"main","index":0}]]},"Calculate Bollinger Bands(1h)":{"main":[[{"node":"Merge 1h Indicators","type":"main","index":0}]]},"Calculate Bollinger Bands(4h)":{"main":[[{"node":"Merge 4h Indicators","type":"main","index":0}]]}}}


name: AI Email Auto-Responder System- AI RAG Agent for Email Inbox
author_name: LukaszB
author_username: lukaszb
categories: []
created_at: 2025-06-06T19:16:47.224Z
updated_at: 2025-06-06T19:16:47.224Z
url: https://n8n.io/workflows/4748
scraped_at: 2025-06-19 22:49:26
description:
  AI Email Auto-Responder – Smart Client Reply Automation with RAG

  This workflow is built for individuals, teams, and businesses that receive regular inquiries via email and want to automate responses in a way that’s intelligent, brand-aligned, and always up to date. Its core purpose is to generate high-quality, professional email replies using internal company data, brand voice, and semantic search — fully automated through Gmail, Pinecone, and OpenAI.

  The system is divided into three steps. First, it allows you to index your internal knowledge base (Docs, Sheets, PDFs) with embeddings. Second, it injects a consistent brand brief into every interaction to ensure tone and positioning. Finally, the main flow listens for incoming emails, understands the user query, retrieves all needed data, and writes a full HTML reply — sending it directly to the original thread via Gmail.

  This solution is ideal for support teams, solopreneurs, B2B service providers, or anyone looking to scale high-quality client communication without scaling manual work. It can be extended to handle multilingual queries, intent routing, or CRM logging.

  How it works

  When a new email arrives in Gmail, the workflow checks whether it's a valid client inquiry. If so, it:
  Extracts the subject and message content
  Sends the message through OpenAI to understand the question
  Queries a Pinecone vector database (populated via a separate embedding workflow) to find relevant internal knowledge
  Loads a brand brief from a Google Doc or Notion block
  Combines retrieved data and brand context to generate a clear, structured HTML reply using OpenAI
  Sends the reply via Gmail and logs the message

  This process ensures every reply is relevant, accurate, and consistent with your brand — and takes under 10 seconds.

  Set up steps

  Getting started takes about 30–60 minutes.

  Create three workflows: one for embedding documents (Step 1), one sub-workflow for the brand brief (Step 2), and one main responder flow (Step 3)
  Connect the following APIs: Gmail (OAuth2), OpenAI, Pinecone, Google Drive, and optionally Notion
  Replace all placeholders: folder ID in Google Drive, Pinecone index and namespace, your brand brief URL or doc ID, and Gmail credentials
  Test your embedding workflow by uploading a document and verifying its presence in Pinecone
  Trigger the responder by sending an email and reviewing the AI’s reply

  Detailed setup instructions are stored in sticky notes within each workflow to guide you through configuration.

nodes_used:
  ["n8n-nodes-base.googleDrive","n8n-nodes-base.gmail","n8n-nodes-base.notion","n8n-nodes-base.googleDocs","@n8n/n8n-nodes-langchain.agent","@n8n/n8n-nodes-langchain.chainLlm","@n8n/n8n-nodes-langchain.embeddingsOpenAi","@n8n/n8n-nodes-langchain.lmChatOpenAi","@n8n/n8n-nodes-langchain.memoryBufferWindow","@n8n/n8n-nodes-langchain.textSplitterRecursiveCharacterTextSplitter","@n8n/n8n-nodes-langchain.toolWorkflow","@n8n/n8n-nodes-langchain.vectorStorePinecone","@n8n/n8n-nodes-langchain.documentDefaultDataLoader","@n8n/n8n-nodes-langchain.toolVectorStore"]

workflow_json:
  {"id":"T7GqmcUwv8GVTe8L","meta":{"instanceId":"740c1df6d3b1b6ea8a9d2223701f6904173f9e3cf7381cd181644b043420ba09","templateCredsSetupCompleted":true},"name":"AI Email Auto-Responder System","tags":[],"nodes":[{"id":"2db5e025-209e-48ef-bdf5-8ee1eb0fab7b","name":"OpenAI Chat Model","type":"@n8n/n8n-nodes-langchain.lmChatOpenAi","position":[1780,1200],"parameters":{},"typeVersion":1.2},{"id":"c11e07ab-75e8-42ed-b6a7-c98f0039eddb","name":"Answer questions with a vector store","type":"@n8n/n8n-nodes-langchain.toolVectorStore","position":[2200,1200],"parameters":{},"typeVersion":1.1},{"id":"e615fb6f-0870-4c81-bcef-c8a9d7ae0233","name":"Pinecone Vector Store1","type":"@n8n/n8n-nodes-langchain.vectorStorePinecone","position":[2040,1400],"parameters":{},"typeVersion":1.1},{"id":"fcf497be-9614-4701-a5a8-15e04a9040fe","name":"Embeddings OpenAI","type":"@n8n/n8n-nodes-langchain.embeddingsOpenAi","position":[2040,1520],"parameters":{},"typeVersion":1.2},{"id":"d1b4ab12-fe69-406a-8c1b-d4bab1c02e63","name":"OpenAI Chat Model1","type":"@n8n/n8n-nodes-langchain.lmChatOpenAi","position":[2340,1420],"parameters":{},"typeVersion":1.2},{"id":"7ab09163-cea5-45a1-8a49-235b734773e5","name":"Get Brand brief","type":"@n8n/n8n-nodes-langchain.toolWorkflow","position":[2080,1220],"parameters":{},"typeVersion":2.2},{"id":"8e571e5e-aa9f-48ac-86d7-365f05d25f7f","name":"Gmail Trigger","type":"n8n-nodes-base.gmailTrigger","position":[780,900],"parameters":{},"typeVersion":1.2},{"id":"a63ac63b-2002-4c56-9674-2ec20e406932","name":"OpenAI Chat Model2","type":"@n8n/n8n-nodes-langchain.lmChatOpenAi","position":[1360,1120],"parameters":{},"typeVersion":1.2},{"id":"cdc804b7-6b4f-4669-b3c0-3da3df1681d9","name":"If","type":"n8n-nodes-base.if","position":[1660,900],"parameters":{},"typeVersion":2.2},{"id":"1ea5665e-15ea-4dda-b1d7-88669139c0d4","name":"Simple Memory","type":"@n8n/n8n-nodes-langchain.memoryBufferWindow","position":[1940,1220],"parameters":{},"typeVersion":1.3},{"id":"b50d2551-8b91-41aa-9e88-03f292e41858","name":"OpenAI Chat Model3","type":"@n8n/n8n-nodes-langchain.lmChatOpenAi","position":[2660,1200],"parameters":{},"typeVersion":1.2},{"id":"c833622a-c488-41a0-80b6-fced19b5c497","name":"Gmail","type":"n8n-nodes-base.gmail","position":[3080,900],"webhookId":"2f018774-35ff-4090-b5d2-acad7f512034","parameters":{},"typeVersion":2.1},{"id":"f35198e9-2479-4e58-8d0e-21c96f8e9411","name":"Search Information","type":"@n8n/n8n-nodes-langchain.agent","position":[1960,900],"parameters":{},"typeVersion":1.9},{"id":"8cc3a83a-0772-4d2d-b26a-1030b6d0a55b","name":"Response writer","type":"@n8n/n8n-nodes-langchain.agent","position":[2620,900],"parameters":{},"typeVersion":2},{"id":"7cb7bae5-0630-4406-893b-c66d6888680b","name":"Set Data","type":"n8n-nodes-base.set","position":[1040,900],"parameters":{},"typeVersion":3.4},{"id":"9cc8f67f-dac0-41b7-9277-8f6ee6d4c0d7","name":"Google Drive Trigger","type":"n8n-nodes-base.googleDriveTrigger","position":[1040,-720],"parameters":{},"typeVersion":1},{"id":"92c8079b-f3c7-4949-b5e9-b01c4cf9395f","name":"Google Drive","type":"n8n-nodes-base.googleDrive","position":[1280,-720],"parameters":{},"typeVersion":3},{"id":"6b851c32-609a-4970-8065-5ad6193f1637","name":"Pinecone Vector Store","type":"@n8n/n8n-nodes-langchain.vectorStorePinecone","position":[1580,-720],"parameters":{},"typeVersion":1.1},{"id":"5492ffd8-21df-4dd9-9f3c-b55b8ecfb258","name":"Default Data Loader","type":"@n8n/n8n-nodes-langchain.documentDefaultDataLoader","position":[1800,-500],"parameters":{},"typeVersion":1},{"id":"d27b5bd6-0136-4a5d-a524-91b3c50a9524","name":"Recursive Character Text Splitter","type":"@n8n/n8n-nodes-langchain.textSplitterRecursiveCharacterTextSplitter","position":[1800,-300],"parameters":{},"typeVersion":1},{"id":"2453df3e-9fc6-4b23-9076-339d9fcb4281","name":"Embeddings OpenAI1","type":"@n8n/n8n-nodes-langchain.embeddingsOpenAi","position":[1440,-500],"parameters":{},"typeVersion":1.2},{"id":"d5603de9-510d-42d4-9cca-b81326933550","name":"When Executed by Another Workflow","type":"n8n-nodes-base.executeWorkflowTrigger","position":[1120,180],"parameters":{},"typeVersion":1.1},{"id":"2315b4c2-e4df-4934-9b16-40e362397da1","name":"Notion","type":"n8n-nodes-base.notion","position":[1360,180],"parameters":{},"typeVersion":2.2},{"id":"9709f9dc-f2d0-4453-9795-ed321577a301","name":"Aggregate","type":"n8n-nodes-base.aggregate","position":[1580,180],"parameters":{},"typeVersion":1},{"id":"1e62669f-dd75-443c-a967-f362c824f9cf","name":"Edit Fields","type":"n8n-nodes-base.set","position":[1800,180],"parameters":{},"typeVersion":3.4},{"id":"a00066ed-aa5c-4d06-ac84-defe30c44358","name":"Sticky Note","type":"n8n-nodes-base.stickyNote","position":[680,-900],"parameters":{"content":""},"typeVersion":1},{"id":"0d1f7c5d-0826-46f5-8c79-15516e97e1cc","name":"Sticky Note1","type":"n8n-nodes-base.stickyNote","position":[2320,-900],"parameters":{"content":""},"typeVersion":1},{"id":"18e784de-5ae5-45d5-8c92-067406327abd","name":"Sticky Note2","type":"n8n-nodes-base.stickyNote","position":[680,-60],"parameters":{"content":""},"typeVersion":1},{"id":"d0afaa13-fdec-4006-8a5e-f31b2ebe308b","name":"Google Docs","type":"n8n-nodes-base.googleDocs","disabled":true,"position":[1360,0],"parameters":{},"typeVersion":2},{"id":"7f79c5f2-6430-4b4d-b578-7d95006d10bd","name":"Sticky Note3","type":"n8n-nodes-base.stickyNote","position":[2320,-80],"parameters":{"content":""},"typeVersion":1},{"id":"9a3c6070-aad1-4d7f-a274-d75929b54796","name":"Sticky Note4","type":"n8n-nodes-base.stickyNote","position":[640,740],"parameters":{"content":""},"typeVersion":1},{"id":"a77c19e2-02ab-445f-b748-ee471d20add5","name":"Sticky Note5","type":"n8n-nodes-base.stickyNote","position":[3420,720],"parameters":{"content":""},"typeVersion":1},{"id":"00cae7df-b14b-4b9f-9252-7eaf285906a4","name":"Check if Question","type":"@n8n/n8n-nodes-langchain.chainLlm","position":[1260,900],"parameters":{},"typeVersion":1.7},{"id":"aefac4d4-9c6a-4b1c-9526-83a8909b51f7","name":"Sticky Note6","type":"n8n-nodes-base.stickyNote","position":[3360,-780],"parameters":{"content":""},"typeVersion":1}],"active":false,"pinData":{},"settings":{"timezone":"Europe/Warsaw","callerPolicy":"workflowsFromSameOwner","executionOrder":"v1"},"versionId":"c77d2b14-2465-402f-8668-98d82ba09383","connections":{"If":{"main":[[{"node":"Search Information","type":"main","index":0}],[]]},"Notion":{"main":[[{"node":"Aggregate","type":"main","index":0}]]},"Set Data":{"main":[[{"node":"Check if Question","type":"main","index":0}]]},"Aggregate":{"main":[[{"node":"Edit Fields","type":"main","index":0}]]},"Google Drive":{"main":[[{"node":"Pinecone Vector Store","type":"main","index":0}]]},"Gmail Trigger":{"main":[[{"node":"Set Data","type":"main","index":0}]]},"Simple Memory":{"ai_memory":[[{"node":"Search Information","type":"ai_memory","index":0}]]},"Get Brand brief":{"ai_tool":[[{"node":"Search Information","type":"ai_tool","index":0}]]},"Response writer":{"main":[[{"node":"Gmail","type":"main","index":0}]]},"Check if Question":{"main":[[{"node":"If","type":"main","index":0}]]},"Embeddings OpenAI":{"ai_embedding":[[{"node":"Pinecone Vector Store1","type":"ai_embedding","index":0}]]},"OpenAI Chat Model":{"ai_languageModel":[[{"node":"Search Information","type":"ai_languageModel","index":0}]]},"Embeddings OpenAI1":{"ai_embedding":[[{"node":"Pinecone Vector Store","type":"ai_embedding","index":0}]]},"OpenAI Chat Model1":{"ai_languageModel":[[{"node":"Answer questions with a vector store","type":"ai_languageModel","index":0}]]},"OpenAI Chat Model2":{"ai_languageModel":[[{"node":"Check if Question","type":"ai_languageModel","index":0}]]},"OpenAI Chat Model3":{"ai_languageModel":[[{"node":"Response writer","type":"ai_languageModel","index":0}]]},"Search Information":{"main":[[{"node":"Response writer","type":"main","index":0}]]},"Default Data Loader":{"ai_document":[[{"node":"Pinecone Vector Store","type":"ai_document","index":0}]]},"Google Drive Trigger":{"main":[[{"node":"Google Drive","type":"main","index":0}]]},"Pinecone Vector Store1":{"ai_vectorStore":[[{"node":"Answer questions with a vector store","type":"ai_vectorStore","index":0}]]},"Recursive Character Text Splitter":{"ai_textSplitter":[[{"node":"Default Data Loader","type":"ai_textSplitter","index":0}]]},"When Executed by Another Workflow":{"main":[[{"node":"Notion","type":"main","index":0}]]},"Answer questions with a vector store":{"ai_tool":[[{"node":"Search Information","type":"ai_tool","index":0}]]}}}


name: Payment Processing and Order Tracking with YooKassa and Google Sheets
author_name: Sergey Skorobogatov
author_username: cepreusa
nodes_used: ["n8n-nodes-base.googleSheets","n8n-nodes-base.httpRequest","n8n-nodes-base.code"]
categories: []
created_at: 2025-06-06T22:41:32.579Z
updated_at: 2025-06-06T22:41:32.579Z
url: https://n8n.io/workflows/4749
scraped_at: 2025-06-19 22:49:41
description:
  Accept YooKassa payments and log transactions in Google Sheets

  🧾 Summary

  This workflow allows you to accept online payments via YooKassa and log both orders and transactions in Google Sheets — all without writing a single line of code. It supports full payment flow: product selection, payment initiation, webhook processing, refund updates, and payment status checks.

  👥 Who is this for?

  This template is ideal for:

  Online stores with simple checkout flows
  Sellers of digital products or info-courses
  Entrepreneurs using Telegram bots or web forms
  Anyone needing quick payment integration with Google Sheets tracking

  🎯 What problem does this workflow solve?

  Setting up online payments usually requires backend infrastructure. This no-code solution automates the entire payment flow:

  Handles product listing and price retrieval
  Initiates payments with email and return URL
  Listens for payment.succeeded and refund.succeeded events
  Records every action into structured Google Sheets

  ⚙️ What this workflow does

  1. GET /products

  Returns a sorted list of products from a Google Sheet (products).

  2. POST /payment

  Validates required fields (product_id, email, return_url)
  Checks email format
  Fetches product data from products
  Generates a unique idempotence key
  Sends a request to YooKassa API
  Saves the order into the orders sheet
  Returns a payment confirmation link

  3. POST /yoomoney

  Webhook to process payment/refund events:

  On payment.succeeded, adds entry to transactions
  On refund.succeeded, updates transaction status

  4. GET /status/\:id

  Returns real-time payment status from YooKassa

  🚀 Setup

  Connect credentials:

     Google Sheets (OAuth2)
     YooKassa (Basic Auth using shopId and secretKey)

  Update the following Google Sheets:

     products: should contain product_id, title, price
     orders: for saving confirmed purchases
     transactions: for logging all successful or refunded payments

  Test endpoints using any HTTP client:

  Example payload for /payment:

  {
    "product_id": "abc123",
    "email": "user@example.com",
    "return_url": "https://your.site/success"
  }

  🔧 How to customize this workflow

  Add delivery logic (e.g., email with product link after successful payment)
  Replace Google Sheets with a database (e.g., PostgreSQL)
  Connect Telegram or other messengers for post-payment notifications
  Add promo codes, discounts, or subscriptions logic

  💼 Use cases

  Simple online checkouts
  Telegram bots selling access
  Educational product sales
  MVP e-commerce flows
  Donation or membership payments

  📎 Notes

  ✅ Includes Sticky Notes for sections
  ✅ Includes error handling and validation
  ✅ No custom code needed except UUID generation

workflow_json:
  {"id":"HHoQmMSal4U1i65J","meta":{"instanceId":"673dd365761c86615255caaaae908ad0f2b40ed6e6f64e1be5631254544e65ca"},"name":"Yookassa","tags":[],"nodes":[{"id":"0ccb2fd9-139a-4234-9e2b-feabf63563c5","name":"Respond Products","type":"n8n-nodes-base.respondToWebhook","position":[560,40],"parameters":{"options":{},"respondWith":"allIncomingItems"},"retryOnFail":false,"typeVersion":1.3},{"id":"cabb25e6-9683-4a4f-9832-7a7630a011bf","name":"Sticky Note5","type":"n8n-nodes-base.stickyNote","position":[-180,-40],"parameters":{"color":5,"width":1040,"height":400,"content":"# Get Products"},"typeVersion":1},{"id":"88b5245c-bce9-44e7-beb7-172137d63d61","name":"Get products","type":"n8n-nodes-base.webhook","position":[-120,80],"webhookId":"05a39af8-d82c-4807-a156-0f2631886199","parameters":{"path":"products","options":{},"responseMode":"responseNode"},"typeVersion":2},{"id":"5a218b21-d7a7-4f4f-9883-6db1a994513b","name":"Sorting  by price","type":"n8n-nodes-base.sort","position":[340,40],"parameters":{"options":{},"sortFieldsUi":{"sortField":[{"fieldName":"price"}]}},"typeVersion":1},{"id":"d3265cbe-dc41-49ee-9cdd-d265efefaa0c","name":"Handle Error (get product)","type":"n8n-nodes-base.respondToWebhook","position":[560,200],"parameters":{"options":{"responseCode":400},"respondWith":"noData"},"typeVersion":1.3},{"id":"14fad20c-566a-4ce3-a4c3-a28922f2ceb1","name":"Get Product","type":"n8n-nodes-base.googleSheets","onError":"continueErrorOutput","maxTries":2,"position":[680,500],"parameters":{"options":{},"filtersUI":{"values":[{"lookupValue":"={{ $json.product_id }}","lookupColumn":"product_id"}]},"sheetName":{"__rl":true,"mode":"list","value":"gid=0","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1OkaZTGWiTvX_qiQbRcMJKxUjXv0t6-IQtGm5crY0CXE/edit#gid=0","cachedResultName":"products"},"documentId":{"__rl":true,"mode":"list","value":"1OkaZTGWiTvX_qiQbRcMJKxUjXv0t6-IQtGm5crY0CXE","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1OkaZTGWiTvX_qiQbRcMJKxUjXv0t6-IQtGm5crY0CXE/edit?usp=drivesdk","cachedResultName":"Yookassa"}},"credentials":{"googleSheetsOAuth2Api":{"id":"Yh4hxJEg7r5FU0cs","name":"Google Sheets account"}},"retryOnFail":true,"typeVersion":4.6},{"id":"5b619423-3a66-4ea8-bdc4-da49c5c55295","name":"YooKassa Request","type":"n8n-nodes-base.httpRequest","onError":"continueErrorOutput","position":[1280,500],"parameters":{"url":"https://api.yookassa.ru/v3/payments","method":"POST","options":{},"jsonBody":"={\n    \"amount\": {\n        \"value\": \"{{ $('Get Product').item.json.price }}.00\",\n        \"currency\": \"RUB\"\n    },\n    \"capture\": true,\n    \"metadata\": {\"email\": \"{{ $('Payment').item.json.body.email }}\"},\n    \"confirmation\": {\n        \"type\": \"redirect\",\n        \"locale\": \"ru_RU\",\n        \"return_url\": \"{{ $('Payment').item.json.body.return_url }}\"\n    },\n    \"description\": \"{{ $('Get Product').item.json.title.replace(/\"/g, '\\\\\"') }}\",\n    \"receipt\": {\n        \"email\": \"{{ $('Payment').item.json.body.email }}\",\n        \"items\": [\n            {\n                \"description\": \"{{ $('Get Product').item.json.title.replace(/\"/g, '\\\\\"') }}\",\n                \"quantity\": \"1\",\n                \"amount\": {\n                    \"value\": \"{{ $('Get Product').item.json.price }}.00\",\n                    \"currency\": \"RUB\"\n                },\n                \"vat_code\": 1\n            }\n        ]\n    }\n} ","sendBody":true,"sendHeaders":true,"specifyBody":"json","authentication":"genericCredentialType","genericAuthType":"httpBasicAuth","headerParameters":{"parameters":[{"name":"Idempotence-Key","value":"={{ $json.data }}"},{"name":"Content-Type","value":"application/json"}]}},"credentials":{"httpBasicAuth":{"id":"iQsXBuezh0M2AbDr","name":"Yookassa credential"}},"typeVersion":4.2},{"id":"a56d477f-af9b-40a1-ba6c-5d28d11b4f8d","name":"Save Order","type":"n8n-nodes-base.googleSheets","onError":"continueErrorOutput","maxTries":2,"position":[1480,500],"parameters":{"columns":{"value":{"id":"={{ $json.id }}","email":"={{ $json.metadata.email }}","product_id":"={{ $('Get product_id').item.json.product_id }}","order_datetime":"={{ $json.created_at }}"},"schema":[{"id":"id","type":"string","display":true,"removed":false,"required":false,"displayName":"id","defaultMatch":true,"canBeUsedToMatch":true},{"id":"email","type":"string","display":true,"required":false,"displayName":"email","defaultMatch":false,"canBeUsedToMatch":true},{"id":"product_id","type":"string","display":true,"required":false,"displayName":"product_id","defaultMatch":false,"canBeUsedToMatch":true},{"id":"order_datetime","type":"string","display":true,"required":false,"displayName":"order_datetime","defaultMatch":false,"canBeUsedToMatch":true}],"mappingMode":"defineBelow","matchingColumns":["id"],"attemptToConvertTypes":false,"convertFieldsToString":false},"options":{},"operation":"append","sheetName":{"__rl":true,"mode":"list","value":1924940864,"cachedResultUrl":"https://docs.google.com/spreadsheets/d/1OkaZTGWiTvX_qiQbRcMJKxUjXv0t6-IQtGm5crY0CXE/edit#gid=1924940864","cachedResultName":"orders"},"documentId":{"__rl":true,"mode":"list","value":"1OkaZTGWiTvX_qiQbRcMJKxUjXv0t6-IQtGm5crY0CXE","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1OkaZTGWiTvX_qiQbRcMJKxUjXv0t6-IQtGm5crY0CXE/edit?usp=drivesdk","cachedResultName":"Yookassa"}},"credentials":{"googleSheetsOAuth2Api":{"id":"Yh4hxJEg7r5FU0cs","name":"Google Sheets account"}},"retryOnFail":true,"typeVersion":4.6},{"id":"241307e3-9536-404c-aa27-6e21bb5424c0","name":"Sticky Note","type":"n8n-nodes-base.stickyNote","position":[-180,400],"parameters":{"color":5,"width":2140,"height":480,"content":"# Payment"},"typeVersion":1},{"id":"830a9d53-1e6a-4293-8440-7aa73edbd2f8","name":"Payment","type":"n8n-nodes-base.webhook","position":[-120,600],"webhookId":"2b502106-9efc-4991-b9f7-32adc790370a","parameters":{"path":"payment","options":{"rawBody":true},"httpMethod":"POST","responseMode":"responseNode"},"typeVersion":2},{"id":"7dedf78b-414f-421f-97af-6e5ab87fdec4","name":"Check request values","type":"n8n-nodes-base.if","position":[80,600],"parameters":{"options":{},"conditions":{"options":{"version":2,"leftValue":"","caseSensitive":true,"typeValidation":"strict"},"combinator":"and","conditions":[{"id":"2728d695-e20d-41f0-9357-14e027c756ce","operator":{"type":"string","operation":"exists","singleValue":true},"leftValue":"={{ $json.body.product_id }}","rightValue":""},{"id":"00a85085-1715-44d6-84ec-7cc10c16c046","operator":{"type":"string","operation":"exists","singleValue":true},"leftValue":"={{ $json.body.email }}","rightValue":""},{"id":"8fa8951d-d1df-46f1-88da-cfe0680af42c","operator":{"type":"string","operation":"exists","singleValue":true},"leftValue":"={{ $json.body.return_url }}","rightValue":""}]}},"typeVersion":2.2},{"id":"84c0764f-6496-4047-bd34-593b722560f1","name":"Email validation","type":"n8n-nodes-base.if","position":[280,520],"parameters":{"options":{},"conditions":{"options":{"version":2,"leftValue":"","caseSensitive":true,"typeValidation":"strict"},"combinator":"and","conditions":[{"id":"d70fb2cf-7e73-4853-bbeb-e310eb656c64","operator":{"type":"string","operation":"regex"},"leftValue":"={{ $json.body.email }}","rightValue":"^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$"}]}},"typeVersion":2.2},{"id":"9090fbcf-96c9-4f53-b13a-0fa471435052","name":"Get product_id","type":"n8n-nodes-base.set","position":[480,500],"parameters":{"options":{},"assignments":{"assignments":[{"id":"b8ecf70e-20c0-4513-a168-6cd1f2d5f3a6","name":"product_id","type":"string","value":"={{ $json.body.product_id }}"}]}},"typeVersion":3.4},{"id":"ad49466c-6ad4-411c-9c67-8a3e066d5359","name":"Check product_id","type":"n8n-nodes-base.if","position":[880,500],"parameters":{"options":{},"conditions":{"options":{"version":2,"leftValue":"","caseSensitive":true,"typeValidation":"strict"},"combinator":"and","conditions":[{"id":"a8274ea7-f8e8-4ed5-9f40-5e3cc18ed852","operator":{"type":"object","operation":"exists","singleValue":true},"leftValue":"={{ $input.item.json }}","rightValue":""}]}},"typeVersion":2.2},{"id":"b1bca082-6fbe-42e8-9602-4a31c86a82c6","name":"Handle Error (product_id)","type":"n8n-nodes-base.respondToWebhook","position":[1080,680],"parameters":{"options":{"responseCode":404},"respondWith":"text","responseBody":"product_id not found"},"typeVersion":1.3},{"id":"913b424e-fceb-4435-820b-59efe11083a3","name":"Idempotence Key Generation","type":"n8n-nodes-base.code","position":[1080,500],"parameters":{"jsCode":"const template = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx';\n  let uuid = '';\n\n  for (let i = 0; i < template.length; i++) {\n    const char = template[i];\n\n    if (char === 'x' || char === 'y') {\n      const rand = Math.floor(Math.random() * 16);\n      let value;\n\n      if (char === 'x') {\n        value = rand;\n      } else {\n        value = (rand & 0x3) | 0x8;\n      }\n\n      uuid += value.toString(16);\n    } else {\n      uuid += char;\n    }\n  }\n\n  return {\n    data: uuid\n  }"},"typeVersion":2},{"id":"f5bc3ad6-8599-4ed1-a501-bc2c1507fa73","name":"Handle Error","type":"n8n-nodes-base.respondToWebhook","position":[480,680],"parameters":{"options":{"responseCode":400},"respondWith":"text","responseBody":"Bad request"},"typeVersion":1.3},{"id":"4b6d62b9-3ac3-4cc8-944a-64372a8aaa80","name":"Handle Error (yookassa)","type":"n8n-nodes-base.respondToWebhook","position":[1480,680],"parameters":{"options":{"responseCode":400},"respondWith":"text","responseBody":"Bad request"},"typeVersion":1.3},{"id":"12568776-4885-46ac-a831-35d56207bb95","name":"Handle Error (save order)","type":"n8n-nodes-base.respondToWebhook","position":[1700,680],"parameters":{"options":{"responseCode":400},"respondWith":"noData"},"typeVersion":1.3},{"id":"d1032cdb-c456-45b0-a534-14ed920228b6","name":"Respond Payment","type":"n8n-nodes-base.respondToWebhook","position":[1700,500],"parameters":{"options":{"responseCode":200},"respondWith":"json","responseBody":"={{ {confirmation_url:$('YooKassa Request').item.json.confirmation.confirmation_url} }}"},"typeVersion":1.3},{"id":"52b428e6-521c-4b22-b41e-ed96971f5ecf","name":"Handle Error (get product)_1","type":"n8n-nodes-base.respondToWebhook","position":[880,680],"parameters":{"options":{"responseCode":400},"respondWith":"noData"},"typeVersion":1.3},{"id":"46193f6f-577b-4872-a11c-22b7e2f1ff61","name":"Get Order","type":"n8n-nodes-base.googleSheets","onError":"continueErrorOutput","maxTries":2,"position":[480,1000],"parameters":{"options":{},"filtersUI":{"values":[{"lookupValue":"={{ $json.body.object.id }}","lookupColumn":"id"}]},"sheetName":{"__rl":true,"mode":"list","value":1924940864,"cachedResultUrl":"https://docs.google.com/spreadsheets/d/1OkaZTGWiTvX_qiQbRcMJKxUjXv0t6-IQtGm5crY0CXE/edit#gid=1924940864","cachedResultName":"orders"},"documentId":{"__rl":true,"mode":"list","value":"1OkaZTGWiTvX_qiQbRcMJKxUjXv0t6-IQtGm5crY0CXE","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1OkaZTGWiTvX_qiQbRcMJKxUjXv0t6-IQtGm5crY0CXE/edit?usp=drivesdk","cachedResultName":"Yookassa"}},"credentials":{"googleSheetsOAuth2Api":{"id":"Yh4hxJEg7r5FU0cs","name":"Google Sheets account"}},"executeOnce":false,"retryOnFail":true,"typeVersion":4.6},{"id":"d5abfe86-2462-4299-a84f-18006879ba81","name":"Save Transaction","type":"n8n-nodes-base.googleSheets","onError":"continueRegularOutput","maxTries":2,"position":[880,1000],"parameters":{"columns":{"value":{"id":"={{ $('Handle YooKassa webhook').item.json.body.object.id }}","email":"={{ $('Handle YooKassa webhook').item.json.body.object.metadata.email }}","product_id":"={{ $json.product_id }}","transaction_status":"succeeded","transaction_datetime":"={{ $('Handle YooKassa webhook').item.json.body.object.captured_at }}"},"schema":[{"id":"id","type":"string","display":true,"removed":false,"required":false,"displayName":"id","defaultMatch":true,"canBeUsedToMatch":true},{"id":"email","type":"string","display":true,"required":false,"displayName":"email","defaultMatch":false,"canBeUsedToMatch":true},{"id":"product_id","type":"string","display":true,"required":false,"displayName":"product_id","defaultMatch":false,"canBeUsedToMatch":true},{"id":"transaction_datetime","type":"string","display":true,"required":false,"displayName":"transaction_datetime","defaultMatch":false,"canBeUsedToMatch":true},{"id":"transaction_status","type":"string","display":true,"removed":false,"required":false,"displayName":"transaction_status","defaultMatch":false,"canBeUsedToMatch":true}],"mappingMode":"defineBelow","matchingColumns":["id"],"attemptToConvertTypes":false,"convertFieldsToString":false},"options":{},"operation":"append","sheetName":{"__rl":true,"mode":"list","value":1976749998,"cachedResultUrl":"https://docs.google.com/spreadsheets/d/1OkaZTGWiTvX_qiQbRcMJKxUjXv0t6-IQtGm5crY0CXE/edit#gid=1976749998","cachedResultName":"transactions"},"documentId":{"__rl":true,"mode":"list","value":"1OkaZTGWiTvX_qiQbRcMJKxUjXv0t6-IQtGm5crY0CXE","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1OkaZTGWiTvX_qiQbRcMJKxUjXv0t6-IQtGm5crY0CXE/edit?usp=drivesdk","cachedResultName":"Yookassa"}},"credentials":{"googleSheetsOAuth2Api":{"id":"Yh4hxJEg7r5FU0cs","name":"Google Sheets account"}},"retryOnFail":true,"typeVersion":4.6},{"id":"081a8ec1-01ba-4ce6-811d-d527060e73f6","name":"Sticky Note1","type":"n8n-nodes-base.stickyNote","position":[-180,920],"parameters":{"color":5,"width":1520,"height":620,"content":"# Webhook"},"typeVersion":1},{"id":"4c7ad01d-314e-463a-b499-e05a4628f8d9","name":"Handle Events","type":"n8n-nodes-base.switch","position":[80,1180],"parameters":{"rules":{"values":[{"outputKey":"payment.succeeded","conditions":{"options":{"version":2,"leftValue":"","caseSensitive":false,"typeValidation":"strict"},"combinator":"and","conditions":[{"id":"71f1d0c7-e46c-40e5-8d49-2bf17c5a8582","operator":{"type":"string","operation":"equals"},"leftValue":"={{ $json.body.event }}","rightValue":"payment.succeeded"}]},"renameOutput":true},{"outputKey":"refund.succeeded","conditions":{"options":{"version":2,"leftValue":"","caseSensitive":false,"typeValidation":"strict"},"combinator":"and","conditions":[{"id":"bec8e08e-83fd-49f0-968a-ada7772e3a46","operator":{"name":"filter.operator.equals","type":"string","operation":"equals"},"leftValue":"={{ $json.body.event }}","rightValue":"refund.succeeded"}]},"renameOutput":true}]},"options":{"ignoreCase":true}},"typeVersion":3.2},{"id":"5eb6b856-c62b-4781-a7cd-728f9e43b0aa","name":"Validation metadata","type":"n8n-nodes-base.if","position":[280,1000],"parameters":{"options":{"ignoreCase":true},"conditions":{"options":{"version":2,"leftValue":"","caseSensitive":false,"typeValidation":"strict"},"combinator":"and","conditions":[{"id":"a8f8592e-683e-463b-9bd4-9d15eb685e46","operator":{"type":"string","operation":"exists","singleValue":true},"leftValue":"={{ $json.body.object.id }}","rightValue":""},{"id":"3115f67e-c0ea-4ef7-9eb7-67a1e628b038","operator":{"type":"string","operation":"exists","singleValue":true},"leftValue":"={{ $json.body.object.metadata.email }}","rightValue":""}]}},"typeVersion":2.2},{"id":"e0670c19-ac44-4d10-ae8f-8f324f209b0c","name":"Check Order","type":"n8n-nodes-base.if","position":[680,1000],"parameters":{"options":{},"conditions":{"options":{"version":2,"leftValue":"","caseSensitive":true,"typeValidation":"strict"},"combinator":"and","conditions":[{"id":"9c2238c4-c3ec-4d0c-8892-86169bc8fdef","operator":{"type":"object","operation":"exists","singleValue":true},"leftValue":"={{ $input.item.json }}","rightValue":""}]}},"typeVersion":2.2},{"id":"f5436549-a2c8-4b1c-bc09-1a7902afe8be","name":"Validation metadata_","type":"n8n-nodes-base.if","position":[280,1360],"parameters":{"options":{"ignoreCase":true},"conditions":{"options":{"version":2,"leftValue":"","caseSensitive":false,"typeValidation":"strict"},"combinator":"and","conditions":[{"id":"a8f8592e-683e-463b-9bd4-9d15eb685e46","operator":{"type":"string","operation":"exists","singleValue":true},"leftValue":"={{ $json.body.object.id }}","rightValue":""}]}},"typeVersion":2.2},{"id":"e2f00535-bf29-43b5-9eac-a8e5ee6c3ab9","name":"Get transaction","type":"n8n-nodes-base.googleSheets","onError":"continueErrorOutput","maxTries":2,"position":[480,1360],"parameters":{"options":{},"filtersUI":{"values":[{"lookupValue":"={{ $json.body.object.id }}","lookupColumn":"id"}]},"sheetName":{"__rl":true,"mode":"list","value":1976749998,"cachedResultUrl":"https://docs.google.com/spreadsheets/d/1OkaZTGWiTvX_qiQbRcMJKxUjXv0t6-IQtGm5crY0CXE/edit#gid=1976749998","cachedResultName":"transactions"},"documentId":{"__rl":true,"mode":"list","value":"1OkaZTGWiTvX_qiQbRcMJKxUjXv0t6-IQtGm5crY0CXE","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1OkaZTGWiTvX_qiQbRcMJKxUjXv0t6-IQtGm5crY0CXE/edit?usp=drivesdk","cachedResultName":"Yookassa"}},"credentials":{"googleSheetsOAuth2Api":{"id":"Yh4hxJEg7r5FU0cs","name":"Google Sheets account"}},"retryOnFail":true,"typeVersion":4.6},{"id":"24016b43-795b-4c7b-ad9b-9d9d220cdeef","name":"Respond payment event","type":"n8n-nodes-base.respondToWebhook","position":[1080,1000],"parameters":{"options":{"responseCode":200},"respondWith":"noData"},"typeVersion":1.3},{"id":"64aa9833-522e-41b0-bb78-454d1122eb71","name":"Respond refund event","type":"n8n-nodes-base.respondToWebhook","position":[1080,1360],"parameters":{"options":{"responseCode":200},"respondWith":"noData"},"typeVersion":1.3},{"id":"984ac85d-5cae-4b57-8ce7-c61c6a12ceef","name":"Handle Error webhook","type":"n8n-nodes-base.respondToWebhook","position":[880,1180],"parameters":{"options":{"responseCode":200},"respondWith":"noData"},"typeVersion":1.3},{"id":"cf3937fa-e0ee-4d5c-b9b9-4a575f895122","name":"Status","type":"n8n-nodes-base.webhook","position":[-120,1720],"webhookId":"d2cf1d05-671c-4308-8e08-3d054fc4944a","parameters":{"path":"status/:id","options":{},"responseMode":"responseNode"},"typeVersion":2},{"id":"100e8560-78b2-40a8-ac20-82f8bb16138e","name":"Handle Error status","type":"n8n-nodes-base.respondToWebhook","position":[480,1900],"parameters":{"options":{"responseCode":"={{ $json.error.status }}"},"respondWith":"text","responseBody":"={{ $json.error.message }}"},"typeVersion":1.3},{"id":"e943aec6-962f-444d-811c-7975e12fad20","name":"Handle Error (check request)","type":"n8n-nodes-base.respondToWebhook","position":[280,1900],"parameters":{"options":{"responseCode":400},"respondWith":"noData"},"typeVersion":1.3},{"id":"eb076097-abc8-46b3-b983-31918d96e284","name":"Check request values_1","type":"n8n-nodes-base.if","position":[80,1720],"parameters":{"options":{},"conditions":{"options":{"version":2,"leftValue":"","caseSensitive":true,"typeValidation":"strict"},"combinator":"and","conditions":[{"id":"8fa8951d-d1df-46f1-88da-cfe0680af42c","operator":{"type":"string","operation":"exists","singleValue":true},"leftValue":"={{ $json.params.id }}","rightValue":""}]}},"typeVersion":2.2},{"id":"4d1b91e0-0b28-4fea-a5ad-ee10a2f7c238","name":"YooKassa Request Status","type":"n8n-nodes-base.httpRequest","onError":"continueErrorOutput","position":[280,1720],"parameters":{"url":"=https://api.yookassa.ru/v3/payments/{{ $('Status').item.json.params.id }}","options":{},"authentication":"genericCredentialType","genericAuthType":"httpBasicAuth"},"credentials":{"httpBasicAuth":{"id":"iQsXBuezh0M2AbDr","name":"Yookassa credential"}},"typeVersion":4.2},{"id":"bf520270-5b44-48f7-a891-cf1394df64ad","name":"Respond status","type":"n8n-nodes-base.respondToWebhook","position":[480,1720],"parameters":{"options":{"responseCode":200},"respondWith":"json","responseBody":"={\n  \"id\": \"{{ $json.id }}\",\n  \"status\": \"{{ $json.status }}\",\n  \"description\": {{ $json.description }}\n} "},"typeVersion":1.3},{"id":"b0f5195c-ffb7-4af6-8fbf-04eeeca5eafd","name":"Sticky Note3","type":"n8n-nodes-base.stickyNote","position":[-180,1580],"parameters":{"color":5,"width":960,"height":500,"content":"# Status"},"typeVersion":1},{"id":"b3821373-2948-412e-b9e5-f52c5c707512","name":"Sticky Note2","type":"n8n-nodes-base.stickyNote","position":[-920,-40],"parameters":{"color":5,"width":700,"height":2460,"content":"# Accept YooKassa payments and log transactions in Google Sheets\n\n## 🧾 Summary\n\nThis workflow allows you to accept online payments via **YooKassa** and log both orders and transactions in **Google Sheets** — all without writing a single line of code. It supports full payment flow: product selection, payment initiation, webhook processing, refund updates, and payment status checks.\n\n## 👥 Who is this for?\n\nThis template is ideal for:\n\n* Online stores with simple checkout flows\n* Sellers of digital products or info-courses\n* Entrepreneurs using Telegram bots or web forms\n* Anyone needing quick payment integration with Google Sheets tracking\n\n## 🎯 What problem does this workflow solve?\n\nSetting up online payments usually requires backend infrastructure. This no-code solution automates the entire payment flow:\n\n* Handles product listing and price retrieval\n* Initiates payments with email and return URL\n* Listens for `payment.succeeded` and `refund.succeeded` events\n* Records every action into structured Google Sheets\n\n## ⚙️ What this workflow does\n\n### 1. **GET /products**\n\nReturns a sorted list of products from a Google Sheet (`products`).\n\n### 2. **POST /payment**\n\n* Validates required fields (`product_id`, `email`, `return_url`)\n* Checks email format\n* Fetches product data from `products`\n* Generates a unique idempotence key\n* Sends a request to YooKassa API\n* Saves the order into the `orders` sheet\n* Returns a payment confirmation link\n\n### 3. **POST /yoomoney**\n\nWebhook to process payment/refund events:\n\n* On `payment.succeeded`, adds entry to `transactions`\n* On `refund.succeeded`, updates transaction status\n\n### 4. **GET /status/\\:id**\n\nReturns real-time payment status from YooKassa\n\n## 🚀 Setup\n\n1. **Connect credentials:**\n\n   * Google Sheets (OAuth2)\n   * YooKassa (Basic Auth using `shopId` and `secretKey`)\n\n2. **Update the following Google Sheets:**\n\n   * `products`: should contain `product_id`, `title`, `price`\n   * `orders`: for saving confirmed purchases\n   * `transactions`: for logging all successful or refunded payments\n\n3. **Test endpoints using any HTTP client**:\n\nExample payload for `/payment`:\n\n```json\n{\n  \"product_id\": \"abc123\",\n  \"email\": \"user@example.com\",\n  \"return_url\": \"https://your.site/success\"\n}\n```\n\n## 🔧 How to customize this workflow\n\n* Add delivery logic (e.g., email with product link after successful payment)\n* Replace Google Sheets with a database (e.g., PostgreSQL)\n* Connect Telegram or other messengers for post-payment notifications\n* Add promo codes, discounts, or subscriptions logic\n\n## 💼 Use cases\n\n* Simple online checkouts\n* Telegram bots selling access\n* Educational product sales\n* MVP e-commerce flows\n* Donation or membership payments\n\n## 📎 Notes\n\n✅ Includes Sticky Notes for sections\n✅ Includes error handling and validation\n✅ No custom code needed except UUID generation"},"typeVersion":1},{"id":"966a7de7-af56-4780-afba-e55f1ac10375","name":"Get products_1","type":"n8n-nodes-base.googleSheets","onError":"continueErrorOutput","maxTries":2,"position":[100,80],"parameters":{"options":{},"sheetName":{"__rl":true,"mode":"list","value":"gid=0","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1OkaZTGWiTvX_qiQbRcMJKxUjXv0t6-IQtGm5crY0CXE/edit#gid=0","cachedResultName":"products"},"documentId":{"__rl":true,"mode":"list","value":"1OkaZTGWiTvX_qiQbRcMJKxUjXv0t6-IQtGm5crY0CXE","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1OkaZTGWiTvX_qiQbRcMJKxUjXv0t6-IQtGm5crY0CXE/edit?usp=drivesdk","cachedResultName":"Yookassa"}},"credentials":{"googleSheetsOAuth2Api":{"id":"Yh4hxJEg7r5FU0cs","name":"Google Sheets account"}},"retryOnFail":true,"typeVersion":4.6},{"id":"f26e5f4f-39f8-4345-b2b3-bbae0740c9a7","name":"Handle YooKassa webhook","type":"n8n-nodes-base.webhook","position":[-120,1180],"webhookId":"d2cf1d05-671c-4308-8e08-3d054fc4944a","parameters":{"path":"yoomoney","options":{"rawBody":true},"httpMethod":"POST","responseMode":"responseNode"},"typeVersion":2},{"id":"d7c1eebc-3a26-49bf-ac98-ebe60a8127ca","name":"Update refund status","type":"n8n-nodes-base.googleSheets","onError":"continueRegularOutput","maxTries":2,"position":[880,1360],"parameters":{"columns":{"value":{"id":"{{ $json.body.object.id }}","transaction_status":"refund"},"schema":[{"id":"id","type":"string","display":true,"removed":false,"required":false,"displayName":"id","defaultMatch":true,"canBeUsedToMatch":true},{"id":"email","type":"string","display":true,"removed":true,"required":false,"displayName":"email","defaultMatch":false,"canBeUsedToMatch":true},{"id":"product_id","type":"string","display":true,"removed":true,"required":false,"displayName":"product_id","defaultMatch":false,"canBeUsedToMatch":true},{"id":"transaction_datetime","type":"string","display":true,"removed":true,"required":false,"displayName":"transaction_datetime","defaultMatch":false,"canBeUsedToMatch":true},{"id":"transaction_status","type":"string","display":true,"required":false,"displayName":"transaction_status","defaultMatch":false,"canBeUsedToMatch":true},{"id":"row_number","type":"string","display":true,"removed":true,"readOnly":true,"required":false,"displayName":"row_number","defaultMatch":false,"canBeUsedToMatch":true}],"mappingMode":"defineBelow","matchingColumns":["id"],"attemptToConvertTypes":false,"convertFieldsToString":false},"options":{},"operation":"update","sheetName":{"__rl":true,"mode":"list","value":1976749998,"cachedResultUrl":"https://docs.google.com/spreadsheets/d/1OkaZTGWiTvX_qiQbRcMJKxUjXv0t6-IQtGm5crY0CXE/edit#gid=1976749998","cachedResultName":"transactions"},"documentId":{"__rl":true,"mode":"list","value":"1OkaZTGWiTvX_qiQbRcMJKxUjXv0t6-IQtGm5crY0CXE","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1OkaZTGWiTvX_qiQbRcMJKxUjXv0t6-IQtGm5crY0CXE/edit?usp=drivesdk","cachedResultName":"Yookassa"}},"credentials":{"googleSheetsOAuth2Api":{"id":"Yh4hxJEg7r5FU0cs","name":"Google Sheets account"}},"retryOnFail":true,"typeVersion":4.6},{"id":"2bf0aa18-1542-44d8-a198-7b0e024a1717","name":"Check if transaction exists","type":"n8n-nodes-base.if","position":[680,1360],"parameters":{"options":{},"conditions":{"options":{"version":2,"leftValue":"","caseSensitive":true,"typeValidation":"strict"},"combinator":"and","conditions":[{"id":"63373f12-84c3-4d9a-8356-09cc8b449361","operator":{"type":"object","operation":"exists","singleValue":true},"leftValue":"={{ $input.item.json }}","rightValue":""}]}},"typeVersion":2.2}],"active":false,"pinData":{},"settings":{"executionOrder":"v1"},"versionId":"b8225bd6-2191-48d1-8e9b-7c11681bf6a0","connections":{"Status":{"main":[[{"node":"Check request values_1","type":"main","index":0}]]},"Payment":{"main":[[{"node":"Check request values","type":"main","index":0}]]},"Get Order":{"main":[[{"node":"Check Order","type":"main","index":0}],[{"node":"Handle Error webhook","type":"main","index":0}]]},"Save Order":{"main":[[{"node":"Respond Payment","type":"main","index":0}],[{"node":"Handle Error (save order)","type":"main","index":0}]]},"Check Order":{"main":[[{"node":"Save Transaction","type":"main","index":0}],[{"node":"Handle Error webhook","type":"main","index":0}]]},"Get Product":{"main":[[{"node":"Check product_id","type":"main","index":0}],[{"node":"Handle Error (get product)_1","type":"main","index":0}]]},"Get products":{"main":[[{"node":"Get products_1","type":"main","index":0}]]},"Handle Events":{"main":[[{"node":"Validation metadata","type":"main","index":0}],[{"node":"Validation metadata_","type":"main","index":0}]]},"Get product_id":{"main":[[{"node":"Get Product","type":"main","index":0}]]},"Get products_1":{"main":[[{"node":"Sorting  by price","type":"main","index":0}],[{"node":"Handle Error (get product)","type":"main","index":0}]]},"Get transaction":{"main":[[{"node":"Check if transaction exists","type":"main","index":0}],[{"node":"Handle Error webhook","type":"main","index":0}]]},"Check product_id":{"main":[[{"node":"Idempotence Key Generation","type":"main","index":0}],[{"node":"Handle Error (product_id)","type":"main","index":0}]]},"Email validation":{"main":[[{"node":"Get product_id","type":"main","index":0}],[{"node":"Handle Error","type":"main","index":0}]]},"Save Transaction":{"main":[[{"node":"Respond payment event","type":"main","index":0}]]},"YooKassa Request":{"main":[[{"node":"Save Order","type":"main","index":0}],[{"node":"Handle Error (yookassa)","type":"main","index":0}]]},"Sorting  by price":{"main":[[{"node":"Respond Products","type":"main","index":0}]]},"Validation metadata":{"main":[[{"node":"Get Order","type":"main","index":0}],[{"node":"Handle Error webhook","type":"main","index":0}]]},"Check request values":{"main":[[{"node":"Email validation","type":"main","index":0}],[{"node":"Handle Error","type":"main","index":0}]]},"Update refund status":{"main":[[{"node":"Respond refund event","type":"main","index":0}]]},"Validation metadata_":{"main":[[{"node":"Get transaction","type":"main","index":0}],[{"node":"Handle Error webhook","type":"main","index":0}]]},"Check request values_1":{"main":[[{"node":"YooKassa Request Status","type":"main","index":0}],[{"node":"Handle Error (check request)","type":"main","index":0}]]},"Handle YooKassa webhook":{"main":[[{"node":"Handle Events","type":"main","index":0}]]},"YooKassa Request Status":{"main":[[{"node":"Respond status","type":"main","index":0}],[{"node":"Handle Error status","type":"main","index":0}]]},"Idempotence Key Generation":{"main":[[{"node":"YooKassa Request","type":"main","index":0}]]},"Check if transaction exists":{"main":[[{"node":"Update refund status","type":"main","index":0}],[{"node":"Handle Error webhook","type":"main","index":0}]]}}}


name: Automated Video Translation & Distribution with DubLab to Multiple Platforms
author_name: Behram
author_username: behram
categories: []
created_at: 2025-06-07T02:21:31.652Z
updated_at: 2025-06-07T02:21:31.652Z
url: https://n8n.io/workflows/4751
scraped_at: 2025-06-19 22:49:17
description:
  Automated n8n workflow: Receives videos via form, dubs/translates them to the selected languages, and—upon completion—uploads them to multiple social media channels and cloud drives, including Box, Dropbox, and YouTube, Telegram, Postiz (Facebook, Instagram, Tiktok, Reddit etc.)

  Workflows
  Via n8n form select files to dub for desired languages.
   Listen webhook and whenever dubbing finishes upload to desired platforms

  Used Stacks
  DubLab App (ApiKey, Webhook Setup Required)
  Optional (Upload)
   Telegram (Token Required)
   Box (Oauth2 Required)
   Dropbox (Oauth2 Required)
   Youtube (Oauth2 Required)
   Postiz (ApiKey Required)

nodes_used:
  ["n8n-nodes-base.dropbox","n8n-nodes-base.httpRequest","n8n-nodes-base.telegram","n8n-nodes-base.box","n8n-nodes-base.youTube","n8n-nodes-base.code"]

workflow_json:
  {"id":"9ep4J2EilLwr2Qv8","meta":{"instanceId":"cdead8ad85d97beb6ccc10a2ca33665d26529396bcde1290665cf5cc5a67f620","templateCredsSetupCompleted":true},"name":"DubLab App Video Dubbing and Translate","tags":[],"nodes":[{"id":"9eceba49-99b2-4989-a9e3-001d8a445bd6","name":"Init Dubbing","type":"n8n-nodes-base.httpRequest","position":[-420,-80],"parameters":{"url":"https://api.dublab.app/v1/init-dub","method":"POST","options":{},"jsonBody":"={\n    \"dest_lang\": \"{{ $json.language }}\",\n    \"duration\": 30,\n    \"fileType\": \"{{ $json.mimetype }}\",\n    \"name\": \"{{ $json.filename }}\",\n    \"source_lang\": \"auto\"\n}","sendBody":true,"sendHeaders":true,"specifyBody":"json","headerParameters":{"parameters":[{"name":"ApiKey","value":"DUBLAB_API_KEY"}]}},"typeVersion":4.2},{"id":"c2426bfe-cffe-4d75-8262-14f5e844768d","name":"Upload Video","type":"n8n-nodes-base.httpRequest","position":[60,-20],"parameters":{"url":"={{ $json.upload_url }}","method":"PUT","options":{},"sendBody":true,"contentType":"binaryData","sendHeaders":true,"headerParameters":{"parameters":[{"name":"Content-Type","value":"video/mp4"}]},"inputDataFieldName":"=VIDEO_{{ $json.binary_order }}"},"typeVersion":4.2},{"id":"ea97d19e-b54e-46f5-bcb3-385af87353b1","name":"Start Dubbing","type":"n8n-nodes-base.httpRequest","position":[620,-160],"parameters":{"url":"https://api.dublab.app/v1/start-dub","method":"POST","options":{},"jsonBody":"={\n    \"id\": \"{{ $json.id }}\"\n}","sendBody":true,"sendHeaders":true,"specifyBody":"json","headerParameters":{"parameters":[{"name":"ApiKey","value":"DUBLAB_API_KEY"}]}},"typeVersion":4.2},{"id":"f5a09337-eb25-4a5b-a00d-cc5c90a9a8d4","name":"Fetch Projects","type":"n8n-nodes-base.httpRequest","position":[880,-160],"parameters":{"url":"https://api.dublab.app/v1/dubs","options":{},"sendHeaders":true,"headerParameters":{"parameters":[{"name":"ApiKey","value":"DUBLAB_API_KEY"}]}},"typeVersion":4.2},{"id":"e564ebac-5af2-4684-9168-dd0123672543","name":"Combine Videos and Languages","type":"n8n-nodes-base.code","position":[-600,-260],"parameters":{"jsCode":"const langMap = {\n  English: \"en\",\n  German: \"de\",\n  Russian: \"ru\",\n  Polish: \"pl\",\n  Spanish: \"es\",\n  Portuguese: \"pt\",\n  French: \"fr\",\n  Italian: 'it',\n  Turkish: \"tr\",\n  Arabic: \"ar\",\n  Dutch: \"nl\"\n};\n\nconst results = [];\nconsole.log($input)\nlet counter = 1\nlet video_key = 0\n$input.all().forEach(item => {\n  const videos = item.json.Video;\n  const languages = item.json[\"Destination Language\"];\n\n  videos.forEach(video => {\n    languages.forEach(lang => {\n      const video_binary = item.json.Video.length === 1 ? \"Video\" : (\"Video_\"+video_key);\n      results.push({\n        json: {\n          ...video,\n          language: langMap[lang] || lang, // fallback to original if not mapped\n          submittedAt: item.json.submittedAt,\n          formMode: item.json.formMode,\n          binary_order: counter\n        },\n        binary: { \n          [\"VIDEO_\" + counter] : item.binary[video_binary]\n        }\n      });\n      counter +=1\n    });\n    video_key +=1\n  });\n});\n\nreturn results;"},"typeVersion":2},{"id":"b831d614-d37d-4915-a3bb-f6c9561abd29","name":"Proxy Videos","type":"n8n-nodes-base.merge","position":[-200,-220],"parameters":{"mode":"combine","options":{},"combineBy":"combineByPosition"},"typeVersion":3},{"id":"780b5045-687d-426a-b683-59b446363760","name":"Proxy Ids","type":"n8n-nodes-base.merge","position":[320,-160],"parameters":{"mode":"combine","options":{},"combineBy":"combineByPosition"},"typeVersion":3},{"id":"0a651887-ba6d-43db-ba6f-c8ff4cb9802d","name":"Webhook","type":"n8n-nodes-base.webhook","position":[-880,460],"webhookId":"e41c5f62-f2de-4df0-ac29-851837a67282","parameters":{"path":"e41c5f62-f2de-4df0-ac29-851837a67282","options":{},"httpMethod":"POST"},"typeVersion":2},{"id":"480388e6-34d6-48b2-971c-f7eb78f4f907","name":"Original Video","type":"n8n-nodes-base.httpRequest","position":[-580,160],"parameters":{"url":"={{ $json.body.original_download_url }}","options":{}},"typeVersion":4.2},{"id":"3028b095-aed6-4b71-8d4d-eb24702fb318","name":"Dubbed Video","type":"n8n-nodes-base.httpRequest","position":[-580,440],"parameters":{"url":"={{ $json.body.dubbed_download_url }}","options":{}},"typeVersion":4.2},{"id":"23abad27-ac2e-4f58-a06d-a7318c22889e","name":"Telegram","type":"n8n-nodes-base.telegram","position":[-260,100],"webhookId":"20a81b1b-f38d-4e08-b301-a9e6ac2b951a","parameters":{"chatId":"145187085","operation":"sendVideo","binaryData":true,"additionalFields":{"fileName":"Dubbed Video"}},"credentials":{"telegramApi":{"id":"oFYckTt5TXjqEbLX","name":"Telegram account"}},"typeVersion":1.2},{"id":"629757fa-9c59-4724-9ede-08b73d62a654","name":"Box","type":"n8n-nodes-base.box","position":[-260,260],"parameters":{"fileName":"={{ Math.random().toString(36).slice(2) }}-dubbed-{{ $json.body.dest_lang }}-{{ $json.body.name }}","binaryData":true},"credentials":{"boxOAuth2Api":{"id":"2AurohQtPXu9w5Ev","name":"Box account"}},"typeVersion":1},{"id":"9e0c84a5-5ddc-4628-a391-5771a5f10fa3","name":"Dropbox","type":"n8n-nodes-base.dropbox","position":[-260,420],"parameters":{"path":"=/dublab-files/{{ Math.random().toString(36).slice(2) }}-dubbed-{{ $json.body.dest_lang }}-{{ $json.body.name }}","binaryData":true,"authentication":"oAuth2"},"credentials":{"dropboxOAuth2Api":{"id":"KaBWvQNCjKDgcxYH","name":"Dropbox account"}},"typeVersion":1},{"id":"0134c66f-d572-4737-90c1-09d835a0478e","name":"YouTube","type":"n8n-nodes-base.youTube","position":[-260,600],"parameters":{"title":"={{ $json.body.name }}","options":{},"resource":"video","operation":"upload","regionCode":"PL"},"credentials":{"youTubeOAuth2Api":{"id":"lDxH7eygurgvuWpp","name":"YouTube account"}},"typeVersion":1},{"id":"e24e81e3-3f1f-4fc6-9d37-d8338b9cb4ca","name":"Postiz","type":"n8n-nodes-base.httpRequest","position":[-260,780],"parameters":{"url":"https://api.postiz.com/api/public/v1/upload","method":"POST","options":{},"sendBody":true,"contentType":"multipart-form-data","sendHeaders":true,"bodyParameters":{"parameters":[{"name":"file","parameterType":"formBinaryData","inputDataFieldName":"data"}]},"headerParameters":{"parameters":[{"name":"Authorization","value":"POSTIZ_API_KEY"},{"name":"Proxy-Authorization","value":"PROXY_AUTH"}]}},"typeVersion":4.2},{"id":"bab5f441-0d29-47d5-bfed-20fd99bf1489","name":"Start","type":"n8n-nodes-base.formTrigger","position":[-860,-300],"webhookId":"85d519f9-3df6-4377-833c-4355a34ebbab","parameters":{"options":{},"formTitle":"Dub Videos","formFields":{"values":[{"fieldType":"file","fieldLabel":"Video","requiredField":true,"acceptFileTypes":".mp4"},{"fieldType":"dropdown","fieldLabel":"Destination Language","multiselect":true,"fieldOptions":{"values":[{"option":"English"},{"option":"German"},{"option":"Russian"},{"option":"Polish"},{"option":"Spanish"},{"option":"Portuguese"},{"option":"Italian"},{"option":"Arabic"},{"option":"French"},{"option":"Turkish"},{"option":"Dutch"}]},"requiredField":true}]}},"typeVersion":2.2},{"id":"52f11162-27df-4f69-992d-880919d5b2c4","name":"Sticky Note","type":"n8n-nodes-base.stickyNote","position":[-1640,-280],"parameters":{"width":600,"height":360,"content":"## Dub Videos And Share on Social Media\n\n### Workflows\n----------\n 1. Via n8n form select files to dub for desired languages.\n 2. Listen webhook and whenever dubbing finishes upload to desired platforms\n\n### Used Stacks\n-------------\n - DubLab App (ApiKey, Webhook Setup Required)\n - Telegram (Token Required)\n - Box (Oauth2 Required)\n - Dropbox (Oauth2 Required)\n - Youtube (Oauth2 Required)\n - Postiz (ApiKey Required)"},"typeVersion":1},{"id":"1554519e-f8c1-4735-b513-6e6eaf979c30","name":"Sticky Note1","type":"n8n-nodes-base.stickyNote","position":[-1640,460],"parameters":{"width":600,"height":180,"content":"## How to Use\n\n - Obtain Api Key from https://dublab.app, set as variable or just update on nodes.\n - Grab Webhook Url and add to DubLab App\n - Setup upload providers (Telegram, Box, Dropbox, YouTube, Postiz etc.)"},"typeVersion":1},{"id":"1bd8ed8e-9d77-4b6e-8478-2aba1e7de564","name":"Sticky Note2","type":"n8n-nodes-base.stickyNote","position":[0,740],"parameters":{"width":600,"height":140,"content":"### Postiz\n - https://postiz.com/\n - Pretty neat tool which supports many social media platforms\n - Supports cloud and self-hosted version\n - Via API post can be shared over below platforms (Facebook, Instagram, Threads, Tiktok, Reddit etc.)"},"typeVersion":1}],"active":true,"pinData":{},"settings":{"executionOrder":"v1"},"versionId":"00fe9678-8e82-474a-8038-81a38166fa34","connections":{"Start":{"main":[[{"node":"Combine Videos and Languages","type":"main","index":0}]]},"Webhook":{"main":[[{"node":"Dubbed Video","type":"main","index":0},{"node":"Original Video","type":"main","index":0}]]},"Proxy Ids":{"main":[[{"node":"Start Dubbing","type":"main","index":0}]]},"Dubbed Video":{"main":[[{"node":"Telegram","type":"main","index":0},{"node":"Box","type":"main","index":0},{"node":"Dropbox","type":"main","index":0},{"node":"YouTube","type":"main","index":0},{"node":"Postiz","type":"main","index":0}]]},"Init Dubbing":{"main":[[{"node":"Proxy Videos","type":"main","index":1}]]},"Proxy Videos":{"main":[[{"node":"Upload Video","type":"main","index":0},{"node":"Proxy Ids","type":"main","index":0}]]},"Upload Video":{"main":[[{"node":"Proxy Ids","type":"main","index":1}]]},"Start Dubbing":{"main":[[{"node":"Fetch Projects","type":"main","index":0}]]},"Fetch Projects":{"main":[[]]},"Original Video":{"main":[[{"node":"Telegram","type":"main","index":0}]]},"Combine Videos and Languages":{"main":[[{"node":"Init Dubbing","type":"main","index":0},{"node":"Proxy Videos","type":"main","index":0}]]}}}


name: Chat with PDF / MD / Text Files using GraphRAG (no vector store needed)
author_name: InfraNodus
author_username: infranodus
categories: []
created_at: 2025-06-07T09:42:46.538Z
updated_at: 2025-06-07T09:42:46.538Z
url: https://n8n.io/workflows/4755
scraped_at: 2025-06-19 22:48:51
description:
  Set up a chat with your documents without the complex vector store setup.

  This templates helps you 
  ingest** your PDF / text / MD documents into a knowledge graph
  use the graph as the knowledge base for your AI chatbots (and other workflows)
  visualize the main topics* and *gaps** in your documents (good for observability and research)


  The knowledge base is provided using the InfraNodus GraphRAG with the knowledge graphs  offering high-quality responses without the need to set up complex RAG vector store workflows.

  The advantages of using GraphRAG instead of the standard vector stores for knowledge are:

  Easy and quick to set up and update** — no complex data import workflows needed
  A knowledge graph offers a holistic and interactive view of your knowledge base (accessible via our API or a web interface — also shareable)
  Better retrieval of relations** between the document chunks = higher quality responses

  How it works
  This template uses the InfraNodus knowledge graph as a knowledge base for your n8n AI agent node.

  The knowledge graph contains the documents you can upload using this template from your Google Drive.

  When the user asks a question via the chat interface, the agent forwards this question to the InfraNodus knowledge graph, retrieves a response, a summary, and a list of matching statements (based advanced Graph RAG), then delivers the final response back the user.

  Here's a description step by step:

  Step 1: Upload your documents
  Put the PDF / text / MD files you want to chat with into a folder on your Google drive
  Authorize access to that folder using the Google drive node in the template. 
  Add the InfraNodus API key to the InfraNodus Save to Graph HTTP node 
  Optional: change the name of the graph you want to save the data to in the InfraNodus HTTP node (in the name field of the HTTP post request).
  Run the workflow to ingest all the files and save them into the graph
  Optional: check the link provided in the Step 1 workflow description to see the visualization of your knowledge base. It will look something like that:



  Note:* you can replace the PDF to Text convertor node with a better quality *PDF convertor* from ConvertAPI which respects the original file layout and doesn't split text into small chunks


  Step 2: Chat with your documents

  Deactive the trigger in the Step 1
  Activate the chat trigger in the Step 2
  Add your InfraNodus API credentials to Knowledge Base GraphRAG InfraNodus node
  Optional: change the graph name in the Knowledge Base node to match the name you provided in the step 1 above
  Run the chat and ask the question
  Watch the magic 

  How to use

  You need an InfraNodus GraphRAG API account and key to use this workflow. 

  Create an InfraNodus account
  Get the API key at https://infranodus.com/api-access and create a Bearer authorization key for the InfraNodus HTTP nodes.

  Requirements

  An InfraNodus account and API key
  An OpenAI (or any other LLM) API key
  A Google Drive OAuth access (follow the n8n instructions)
  Optional: ConvertAPI API key for better quality PDF conversion

  Customizing this workflow

  You can customize this workflow by adding several experts to your AI agent. 

  Check out the complete guide at https://support.noduslabs.com/hc/en-us/articles/20174217658396-Using-InfraNodus-Knowledge-Graphs-as-Experts-for-AI-Chatbot-Agents-in-n8n

  Also check out the video tutorial with a demo:



  For support and feedback, please, contact us at https://support.noduslabs.com

  To learn more about InfraNodus: https://infranodus.com

nodes_used:
  ["n8n-nodes-base.httpRequest","n8n-nodes-base.googleDrive","@n8n/n8n-nodes-langchain.agent","@n8n/n8n-nodes-langchain.lmChatOpenAi","@n8n/n8n-nodes-langchain.memoryBufferWindow"]

workflow_json:
  {"id":"EQVZKxcCDzTNXLRp","meta":{"instanceId":"2a26454b0172ffcb8d70ba77c235b1209f92cd71bf06c79ba609c7173b416d68","templateCredsSetupCompleted":true},"name":"Chat with PDF / MD / Text Files using GraphRAG (no vector store needed)","tags":[{"id":"66wgFoDi9Xjl74M3","name":"Support","createdAt":"2025-05-21T17:06:32.355Z","updatedAt":"2025-05-21T17:06:32.355Z"},{"id":"kRM0hQV2zw7VxrON","name":"Research","createdAt":"2025-05-21T19:44:19.136Z","updatedAt":"2025-05-21T19:44:19.136Z"},{"id":"sJk9cUvmMU8FkJXv","name":"AI","createdAt":"2025-05-20T13:16:15.636Z","updatedAt":"2025-05-20T13:16:15.636Z"}],"nodes":[{"id":"011910a9-c2a0-49eb-b1eb-8043e0c2accc","name":"Search Google Drive","type":"n8n-nodes-base.googleDrive","position":[-220,-120],"parameters":{"filter":{"folderId":{"__rl":true,"mode":"list","value":"13tqp0SaI_v4jG1CFLAZo96isx-UBno4v","cachedResultUrl":"https://drive.google.com/drive/folders/13tqp0SaI_v4jG1CFLAZo96isx-UBno4v","cachedResultName":"GraphRAG"}},"options":{},"resource":"fileFolder","returnAll":true,"queryString":"*"},"credentials":{"googleDriveOAuth2Api":{"id":"oz9iNMxcuQ2pxr1e","name":"Google Drive account"}},"typeVersion":3},{"id":"22872ac5-14e4-4ea7-b792-30e19a02cb88","name":"Loop Over Items","type":"n8n-nodes-base.splitInBatches","position":[260,-120],"parameters":{"options":{}},"typeVersion":3},{"id":"6456b7ac-f936-425a-a0ac-62fe118e985a","name":"Retrieve File","type":"n8n-nodes-base.googleDrive","position":[500,-80],"parameters":{"fileId":{"__rl":true,"mode":"id","value":"={{ $json.id }}"},"options":{},"operation":"download"},"credentials":{"googleDriveOAuth2Api":{"id":"oz9iNMxcuQ2pxr1e","name":"Google Drive account"}},"typeVersion":3},{"id":"8c1f2da9-fff4-457d-bc2e-7c84de3500b3","name":"Switch","type":"n8n-nodes-base.switch","position":[740,-20],"parameters":{"rules":{"values":[{"outputKey":"pdf","conditions":{"options":{"version":2,"leftValue":"","caseSensitive":true,"typeValidation":"strict"},"combinator":"and","conditions":[{"id":"7b4e792b-ab6d-4b9b-88a1-d8e51bea6853","operator":{"type":"string","operation":"equals"},"leftValue":"={{$binary[\"data\"].mimeType}}","rightValue":"application/pdf"}]},"renameOutput":true},{"outputKey":"text","conditions":{"options":{"version":2,"leftValue":"","caseSensitive":true,"typeValidation":"strict"},"combinator":"and","conditions":[{"id":"09b7d7c5-5353-4719-b4e2-072e4da39948","operator":{"name":"filter.operator.equals","type":"string","operation":"equals"},"leftValue":"={{$binary[\"data\"].mimeType}}","rightValue":"text/plain"}]},"renameOutput":true},{"outputKey":"md","conditions":{"options":{"version":2,"leftValue":"","caseSensitive":true,"typeValidation":"strict"},"combinator":"and","conditions":[{"id":"cb2e6726-97d8-4541-8383-deafff9b18e6","operator":{"name":"filter.operator.equals","type":"string","operation":"equals"},"leftValue":"={{$binary[\"data\"].mimeType}}","rightValue":"text/markdown"}]},"renameOutput":true},{"outputKey":"json","conditions":{"options":{"version":2,"leftValue":"","caseSensitive":true,"typeValidation":"strict"},"combinator":"and","conditions":[{"id":"d2763a45-a592-47c8-868f-59dfcd17a71c","operator":{"name":"filter.operator.equals","type":"string","operation":"equals"},"leftValue":"={{$binary[\"data\"].mimeType}}","rightValue":"application/json"}]},"renameOutput":true},{"outputKey":"docs","conditions":{"options":{"version":2,"leftValue":"","caseSensitive":true,"typeValidation":"strict"},"combinator":"and","conditions":[{"id":"0d9b561f-89c5-479e-a4e2-1f5f05fa8417","operator":{"name":"filter.operator.equals","type":"string","operation":"equals"},"leftValue":"={{$binary[\"data\"].mimeType}}","rightValue":""}]},"renameOutput":true},{"outputKey":"csv","conditions":{"options":{"version":2,"leftValue":"","caseSensitive":true,"typeValidation":"strict"},"combinator":"and","conditions":[{"id":"6b19deed-5d00-4796-bb9d-b4d87564a751","operator":{"name":"filter.operator.equals","type":"string","operation":"equals"},"leftValue":"={{$binary[\"data\"].mimeType}}","rightValue":"csv"}]},"renameOutput":true}]},"options":{}},"typeVersion":3.2},{"id":"fe133ad7-bd7a-43e2-91a7-4b3dd2652490","name":"Extract from PDF","type":"n8n-nodes-base.extractFromFile","position":[1020,-240],"parameters":{"options":{},"operation":"pdf"},"typeVersion":1},{"id":"49f89141-a8ea-46c6-888d-cf9dafcc7c2a","name":"Extract from Text File","type":"n8n-nodes-base.extractFromFile","position":[1020,-60],"parameters":{"options":{},"operation":"text"},"typeVersion":1},{"id":"a47d8f07-917e-44ed-a69e-5d6085981d36","name":"Extract from Markdown","type":"n8n-nodes-base.extractFromFile","position":[1020,140],"parameters":{"options":{},"operation":"text"},"typeVersion":1},{"id":"a2298650-5408-45f8-accf-292ac669002a","name":"InfraNodus Save to Graph","type":"n8n-nodes-base.httpRequest","position":[1480,200],"parameters":{"url":"https://infranodus.com/api/v1/graphAndStatements?doNotSave=false&includeGraph=false&includeGraphSummary=true&includeGraph=false","method":"POST","options":{},"sendBody":true,"authentication":"genericCredentialType","bodyParameters":{"parameters":[{"name":"name","value":"graphrag_from_google_drive"},{"name":"text","value":"={{ $json.data }}"},{"name":"=categories","value":"=[filename: {{ $('Switch').item.json.name }}]"},{"name":"contextSettings","value":"={{{ \"squareBracketsProcessing\":\"IGNORE_BRACKETS\"} }}"}]},"genericAuthType":"httpBearerAuth"},"credentials":{"httpBearerAuth":{"id":"FPDx6PA5CtzGEIQc","name":"InfraNodus DeeMeeTree API Key"}},"typeVersion":4.2},{"id":"bb06d60a-01c7-4a1e-bc7a-901e1f7f175d","name":"Sticky Note4","type":"n8n-nodes-base.stickyNote","position":[-560,-480],"parameters":{"color":4,"width":2200,"height":980,"content":"# Step 1: Upload Your PDF / MD / Text Files to InfraNodus GraphRAG\n\n## Copy your PDF files to a Google drive and then upload them to your InfraNodus knowledge graph\n\n### InfraNodus visualizes your text as a knowledge graph, showing the main topics and ideas inside. It also provides API access to the knowledge graph, so you can use it as a knowledge base instead of the complex vector store setup\n\n1. You need an [InfraNodus](https://infranodus.com) account to use this workflow. Get the API key at [https://infranodus.com/api-access](https://infranodus.com/api-access)\n2. Also, specify the **name of the graph** you want to save the files to in the InfraNodus HTTP node\n3. When the workflow finishes running, you can get a visualization of your knowledge base at [https://infranodus.com/your_user_name/your_graph_name/edit](https://infranodus.com/your_user_name/your_graph_name/edit)\n\n\n"},"typeVersion":1},{"id":"38707a4d-b397-43e7-b55c-da18a00bb480","name":"Map PDF to Text","type":"n8n-nodes-base.set","position":[1320,-100],"parameters":{"options":{},"assignments":{"assignments":[{"id":"fd160009-0b92-46fc-9e34-a1283b810e91","name":"data","type":"string","value":"={{ $json.text }}"}]}},"typeVersion":3.4},{"id":"49426e56-7d6c-4dc0-a279-348dea59cca2","name":"Convert File to PDF","type":"n8n-nodes-base.httpRequest","disabled":true,"position":[1720,200],"parameters":{"url":"https://v2.convertapi.com/convert/pdf/to/txt","method":"POST","options":{"response":{"response":{"responseFormat":"text"}}},"sendBody":true,"contentType":"multipart-form-data","sendHeaders":true,"authentication":"genericCredentialType","bodyParameters":{"parameters":[{"name":"file","parameterType":"formBinaryData","inputDataFieldName":"data"}]},"genericAuthType":"httpBearerAuth","headerParameters":{"parameters":[{"name":"Accept","value":"application/octet-stream"}]}},"credentials":{"httpBearerAuth":{"id":"mDxLoJUWSmuTJsAC","name":"ConvertAPI"}},"notesInFlow":true,"typeVersion":4.2},{"id":"5d21b250-7b0f-4925-a858-5aa6badf5700","name":"Sticky Note5","type":"n8n-nodes-base.stickyNote","position":[1680,-340],"parameters":{"color":2,"width":360,"height":840,"content":"## Optional: Better PDF Conversion\n\n### Standard Map PDF to Text node will split your PDF files into very short chunks, which deteriorates retrieval. \n\nUse can use [ConvertAPI](https://convertapi.com?ref=4l54n) which is a high-quality convertor that will respect the layout of the original document and not cut the paragraphs into short chunks. \n\nHere is an HTTP node that makes a request to their API to convert the PDF into text. If you have a ConvertAPI account, you can replace the \"Map PDF to Text\" node in step 4 with this node. \n"},"typeVersion":1},{"id":"ceda9ea4-963b-4ffb-a741-6e7eb3fc7411","name":"When chat message received","type":"@n8n/n8n-nodes-langchain.chatTrigger","disabled":true,"position":[-520,840],"webhookId":"a2cfd3b0-aaa4-4003-940d-e520e64830c6","parameters":{"public":true,"options":{"title":"Talk to PDFs"},"initialMessages":"=Ask any question about the PDFs or write `/question` to generate an interesting question to discuss."},"typeVersion":1.1},{"id":"d78cf21e-753b-44d3-a2b4-493f85aa5129","name":"AI Agent","type":"@n8n/n8n-nodes-langchain.agent","position":[-240,840],"parameters":{"options":{"systemMessage":"You provide information about the topic of user's interest. Always use the knowledge base attached to get the final response. "}},"typeVersion":1.9},{"id":"02497c8b-89d6-4440-bc4d-d3906b9c4872","name":"OpenAI Chat Model","type":"@n8n/n8n-nodes-langchain.lmChatOpenAi","position":[-420,1100],"parameters":{"model":{"__rl":true,"mode":"list","value":"gpt-4o-mini"},"options":{}},"credentials":{"openAiApi":{"id":"07wFa8Wa4mMRCHAj","name":"OpenAi account 2"}},"typeVersion":1.2},{"id":"6d77fb59-fb03-4d22-ac40-4cf9bde25909","name":"Simple Memory","type":"@n8n/n8n-nodes-langchain.memoryBufferWindow","position":[-260,1100],"parameters":{},"typeVersion":1.3},{"id":"978c8309-380d-4fc8-b238-e0d0148b77b9","name":"Knowledge Base GraphRAG","type":"n8n-nodes-base.httpRequestTool","position":[100,1060],"parameters":{"url":"https://infranodus.com/api/v1/graphAndAdvice?doNotSave=true&addStats=true&optimize=develop&includeStatements=true&includeGraphSummary=true&includeGraph=false","method":"POST","options":{},"sendBody":true,"authentication":"genericCredentialType","bodyParameters":{"parameters":[{"name":"name","value":"graphrag_from_google_drive"},{"name":"requestMode","value":"response"},{"name":"prompt","value":"={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('parameters2_Value', `User query to send to the expert`, 'string') }}"},{"name":"aiTopics","value":"true"}]},"genericAuthType":"httpBearerAuth","toolDescription":"You contain knowledge on the topic of user's interst"},"credentials":{"httpBearerAuth":{"id":"6lSuuSDajZrvI2GM","name":"InfraNodus API Key"}},"typeVersion":4.2},{"id":"b005f83d-3d4a-42c8-b70a-63e267747fcd","name":"Sticky Note","type":"n8n-nodes-base.stickyNote","position":[-560,540],"parameters":{"width":2200,"height":700,"content":"# Step 2: Chat with your PDF / MD / Text Files using [InfraNodus](https://infranodus.com) Graph RAG Knowledge Base\n\n## InfraNodus is used instead of the vector store. It combines traditional RAG and GraphRAG, providing a better topical overview of your knowledge base and having a better understanding of relations between entities in your documents.\n\n1. Deactivate the trigger node in Step 1 and activate the trigger Chat node here\n2. Provide your API key at [https://infranodus.com/api-access](https://infranodus.com/api-access) to the HTTP agent tool\n3. Specify the same **name of the graph** as in the Step 1, so you query the graph where saved the files. \n4. If you connect several knowledge bases, make sure to describe them well, so the agent knows what to query. Get the description from the InfraNodus Graph > Project Notes > RAG enhancement"},"typeVersion":1},{"id":"6a6ad150-670d-45d5-a69e-0bafaf8f2ac4","name":"Click ‘Test workflow’ to ingest the documents","type":"n8n-nodes-base.manualTrigger","position":[-500,-120],"parameters":{},"typeVersion":1},{"id":"0a148a3f-e898-4f83-9ebb-82da7f3f4633","name":"Sticky Note1","type":"n8n-nodes-base.stickyNote","position":[-540,100],"parameters":{"width":680,"height":380,"content":"## [InfraNodus](https://infranodus.com) Knowledege Graph Example\n\n![InfraNodus knowledge graph](https://infranodus.com/images/front/infranodus-overview.jpg)"},"typeVersion":1}],"active":false,"pinData":{},"settings":{"executionOrder":"v1"},"versionId":"90ea1bad-6d21-4f20-81b4-0ba48cc7e7fa","connections":{"Switch":{"main":[[{"node":"Extract from PDF","type":"main","index":0}],[{"node":"Extract from Text File","type":"main","index":0}],[{"node":"Extract from Markdown","type":"main","index":0}],[],[]]},"Retrieve File":{"main":[[{"node":"Switch","type":"main","index":0}]]},"Simple Memory":{"ai_memory":[[{"node":"AI Agent","type":"ai_memory","index":0}]]},"Loop Over Items":{"main":[[],[{"node":"Retrieve File","type":"main","index":0}]]},"Map PDF to Text":{"main":[[{"node":"InfraNodus Save to Graph","type":"main","index":0}]]},"Extract from PDF":{"main":[[{"node":"Map PDF to Text","type":"main","index":0}]]},"OpenAI Chat Model":{"ai_languageModel":[[{"node":"AI Agent","type":"ai_languageModel","index":0}]]},"Search Google Drive":{"main":[[{"node":"Loop Over Items","type":"main","index":0}]]},"Extract from Markdown":{"main":[[{"node":"InfraNodus Save to Graph","type":"main","index":0}]]},"Extract from Text File":{"main":[[{"node":"InfraNodus Save to Graph","type":"main","index":0}]]},"Knowledge Base GraphRAG":{"ai_tool":[[{"node":"AI Agent","type":"ai_tool","index":0}]]},"InfraNodus Save to Graph":{"main":[[{"node":"Loop Over Items","type":"main","index":0}]]},"When chat message received":{"main":[[{"node":"AI Agent","type":"main","index":0}]]},"Click ‘Test workflow’ to ingest the documents":{"main":[[{"node":"Search Google Drive","type":"main","index":0}]]}}}


name: Send Cryptocurrency Price Threshold Alerts from CoinGecko to Discord
author_name: LukaszB
author_username: lukaszb
nodes_used: ["n8n-nodes-base.discord","n8n-nodes-base.coinGecko"]
categories: []
created_at: 2025-06-07T16:24:49.130Z
updated_at: 2025-06-07T16:24:49.130Z
url: https://n8n.io/workflows/4759
scraped_at: 2025-06-19 22:49:53
description:
  Crypto Price Alert – n8n Workflow

  A simple and effective crypto alert system for anyone who wants to stay up to date with coin price changes — without refreshing charts all day. This workflow checks the current price of your chosen cryptocurrency (via CoinGecko) and sends you an alert on Discord if it goes above or below your target range.

  It’s lightweight, easy to set up, and runs on autopilot.

  What the Workflow Does
  Checks the live price of a selected coin using the CoinGecko API.
  Compares it to the max/min prices you define manually.
  Decides if the price is too high or too low.
  Sends an alert message to Discord depending on the result.

  How It Works
  The flow is triggered manually or on a schedule (your choice).
  It pulls the current price of the coin you set.
  Compares that price with your min and max values.
  Sends a “high” or “low” message to your Discord webhook.

  Setup Steps
  Enter your coin ID and price thresholds in the “Set Low and High” node.
  Paste your Discord webhook URLs in the "Message High" and "Message Low" nodes.
  Optional: Adjust the schedule trigger to run every X minutes/hours.
  Run once manually to test — takes under 1 minutes.

  Full instructions and config tips are in sticky notes inside the workflow.

workflow_json:
  {"id":"KvtiflL8appirMde","meta":{"instanceId":"740c1df6d3b1b6ea8a9d2223701f6904173f9e3cf7381cd181644b043420ba09","templateCredsSetupCompleted":true},"name":"📈 Crypto Price Alert","tags":[],"nodes":[{"id":"33a95d3d-6ed1-4930-aad4-9332ffdca917","name":"CoinGecko","type":"n8n-nodes-base.coinGecko","position":[-40,-60],"parameters":{"options":{"ids":"bitcoin"},"operation":"market","baseCurrency":"usd"},"typeVersion":1},{"id":"273ef562-bc09-41f1-86d4-105b98ff5752","name":"When clicking ‘Execute workflow’","type":"n8n-nodes-base.manualTrigger","position":[-440,-200],"parameters":{},"typeVersion":1},{"id":"32a3380a-1f73-476d-a5ae-60c8f2b74968","name":"Schedule Trigger","type":"n8n-nodes-base.scheduleTrigger","position":[-440,20],"parameters":{"rule":{"interval":[{"field":"minutes"}]}},"typeVersion":1.2},{"id":"7ab0b8b0-55cb-44a7-8364-e258dc35878f","name":"Set Low and High","type":"n8n-nodes-base.set","position":[180,-60],"parameters":{"options":{},"assignments":{"assignments":[{"id":"4f11efb0-2e18-46b9-a56c-e00e77f46981","name":"high","type":"number","value":100500},{"id":"f1660885-1fad-49cd-9039-a27391216826","name":"low","type":"number","value":100000}]}},"typeVersion":3.4},{"id":"f473f8df-9f4b-4cba-940a-7c2fac36301f","name":"Check movement","type":"n8n-nodes-base.if","position":[480,-60],"parameters":{"options":{},"conditions":{"options":{"version":2,"leftValue":"","caseSensitive":true,"typeValidation":"strict"},"combinator":"or","conditions":[{"id":"c8869aa4-102c-4d87-bcbd-108b1c6ec2ba","operator":{"type":"number","operation":"gt"},"leftValue":"={{ $('CoinGecko').item.json.current_price }}","rightValue":"={{ $json.high }}"},{"id":"94f0ee9d-744c-4a19-889c-f8e85f5e4081","operator":{"type":"number","operation":"lt"},"leftValue":"={{ $('CoinGecko').item.json.current_price }}","rightValue":"={{ $json.low }}"}]}},"typeVersion":2.2},{"id":"cd5bbd3e-9e4b-4270-91db-525656e63da2","name":"Check Direction","type":"n8n-nodes-base.if","position":[740,-60],"parameters":{"options":{},"conditions":{"options":{"version":2,"leftValue":"","caseSensitive":true,"typeValidation":"strict"},"combinator":"or","conditions":[{"id":"c8869aa4-102c-4d87-bcbd-108b1c6ec2ba","operator":{"type":"number","operation":"gt"},"leftValue":"={{ $('CoinGecko').item.json.current_price }}","rightValue":"={{ $json.high }}"}]}},"typeVersion":2.2},{"id":"deea1b59-20ec-462e-8721-c30c253d2774","name":"Message High","type":"n8n-nodes-base.discord","position":[1260,-160],"webhookId":"6f55d01d-f512-478f-85c4-9c80d1efb8df","parameters":{"content":"=💹 {{ $json.name }} is now {{ $json.current_price }} ","guildId":{"__rl":true,"mode":"id","value":"[SELECT YOUR CHANEL]"},"options":{},"resource":"message","channelId":{"__rl":true,"mode":"id","value":"[SELECT YOUR CHANEL]"}},"credentials":{"discordBotApi":{"id":"Y0I6czAZgnJ8lNoy","name":"Discord Bot Empty"}},"typeVersion":2},{"id":"4724b211-3046-431d-875e-df88cfeb298a","name":"Message Low","type":"n8n-nodes-base.discord","position":[1260,80],"webhookId":"6f55d01d-f512-478f-85c4-9c80d1efb8df","parameters":{"content":"=❗〽️ {{ $json.name }} is now {{ $json.current_price }} ","guildId":{"__rl":true,"mode":"id","value":"[SELECT YOUR CHANEL]"},"options":{},"resource":"message","channelId":{"__rl":true,"mode":"id","value":"[SELECT YOUR CHANEL]"}},"credentials":{"discordBotApi":{"id":"Y0I6czAZgnJ8lNoy","name":"Discord Bot Empty"}},"typeVersion":2},{"id":"5f95d096-759a-4563-abac-a4e7484ce6f9","name":"Sticky Note","type":"n8n-nodes-base.stickyNote","position":[-560,-340],"parameters":{"color":4,"width":360,"height":520,"content":"# Triggers\nSet the trigger time\n– Run manually or on a schedule."},"typeVersion":1},{"id":"f1cccde7-715e-420d-90a9-0e3a0941cc68","name":"Sticky Note1","type":"n8n-nodes-base.stickyNote","position":[-120,-340],"parameters":{"color":4,"width":480,"height":520,"content":"# Coin and Price Thresholds\nSelect a coin and define price limits\n– Fetch current price from CoinGecko\n– Set your custom low and high price thresholds.\n\n"},"typeVersion":1},{"id":"c0bccb72-5d15-40b6-9fc3-743af1a767b9","name":"Sticky Note2","type":"n8n-nodes-base.stickyNote","position":[440,-340],"parameters":{"width":480,"height":520,"content":"# Logic\nCheck if price crosses defined thresholds\n– Compare the current price with your limits\n– Determine if the movement is above or below threshold.\n\n"},"typeVersion":1},{"id":"ddf127e2-4432-4552-b685-03a44b61da76","name":"Sticky Note3","type":"n8n-nodes-base.stickyNote","position":[960,-340],"parameters":{"color":6,"width":580,"height":580,"content":"# Send Alert on Discord\nNotify when price is too high or too low\n– Send a “High” alert if price is above threshold\n– Send a “Low” alert if price is below threshold.\n\nSet your connection and channel"},"typeVersion":1},{"id":"76028425-c4df-4d52-945d-93140f700bbc","name":"Sticky Note4","type":"n8n-nodes-base.stickyNote","position":[1180,60],"parameters":{"color":3,"content":""},"typeVersion":1},{"id":"727a423a-f836-4624-ac03-8c0eb94c9460","name":"Sticky Note5","type":"n8n-nodes-base.stickyNote","position":[1180,-180],"parameters":{"color":4,"content":""},"typeVersion":1},{"id":"66a1ccf8-07d0-4244-8e81-ae6f912ea13a","name":"Sticky Note6","type":"n8n-nodes-base.stickyNote","position":[1600,-360],"parameters":{"color":7,"width":580,"height":620,"content":"# 📈 Crypto Price Alert Workflow\n\nThis workflow monitors the price of a selected cryptocurrency using CoinGecko API and sends alerts to Discord when the price goes above or below your defined thresholds.\n\n## ✅ How it works:\n1. **Trigger:** Runs on schedule or manually.\n2. **Fetch Price:** Uses CoinGecko to get the current price of your selected coin.\n3. **Set Limits:** You define the minimum and maximum price thresholds.\n4. **Logic Check:** Compares current price to thresholds.\n5. **Alert:** Sends a Discord message if the price is too high or too low.\n\n## 🛠 Setup Instructions:\n- Edit the \"Set Low and High\" node to define your target coin and price limits.\n- Configure your Discord Webhook URLs in the “Message High” and “Message Low” nodes.\n- Optionally adjust the schedule trigger to run at your preferred interval.\n\nEnjoy automated crypto alerts 🚀\n"},"typeVersion":1}],"active":false,"pinData":{},"settings":{"executionOrder":"v1"},"versionId":"8ffd26de-f76b-4eb9-8299-f7d5a3058f0a","connections":{"CoinGecko":{"main":[[{"node":"Set Low and High","type":"main","index":0}]]},"Check movement":{"main":[[{"node":"Check Direction","type":"main","index":0}]]},"Check Direction":{"main":[[{"node":"Message High","type":"main","index":0}],[{"node":"Message Low","type":"main","index":0}]]},"Schedule Trigger":{"main":[[{"node":"CoinGecko","type":"main","index":0}]]},"Set Low and High":{"main":[[{"node":"Check movement","type":"main","index":0}]]},"When clicking ‘Execute workflow’":{"main":[[{"node":"CoinGecko","type":"main","index":0}]]}}}


name: Gmail Customer Support Auto-Responder with Ollama LLM and Pinecone RAG
author_name: Aashit Sharma
author_username: aashitsharma
categories: []
created_at: 2025-06-07T17:27:27.416Z
updated_at: 2025-06-07T17:27:27.416Z
url: https://n8n.io/workflows/4760
scraped_at: 2025-06-19 22:49:45
description:
  Gmail Customer Support Auto-Responder with Ollama LLM and Pinecone RAG

  Built by Setidure Technologies  
  Automate intelligent, friendly replies to customer queries using AI, vector search, and Gmail — all without human effort.

  Overview

  This is a ready-to-deploy smart customer support automation template for businesses that want to reply to emails instantly and accurately with the warmth of a human agent.  

  It uses Gmail, LangChain agents, Ollama-hosted LLMs, and Pinecone vector search to craft contextual, brand-aligned replies at scale.

  &gt; Note: This template uses community nodes and requires a self-hosted n8n instance.

  What the Workflow Does

  1. Triggers on Incoming Emails  
  Uses Gmail Trigger node to listen for new messages  
  Activates every minute to ensure fast responses

  2. Classifies Email Intent  
  A LangChain Text Classifier detects whether the email is a Customer Support query  
  Non-relevant emails are skipped

  3. Generates AI Response  
  An AI Agent powered by Ollama generates the email reply  
  Follows a predefined tone: "Mr. Aashit Sharma from Setidure Technologies"  
  Written in a warm, human tone with natural phrasing

  4. Retrieves FAQ-Based Knowledge  
  Connects to Pinecone vector database for real-time FAQ retrieval  
  Enhances responses with specific, accurate product or policy information

  5. Labels Email in Gmail  
  Automatically tags emails with labels like Handled or Auto-Replied for easy tracking

  6. Sends Email Reply  
  Sends the generated response back to the customer  
  Includes personal sign-off and clean formatting

  Tech Stack Used

  Gmail Trigger & Send Nodes  
  LangChain AI Agent & Classifier  
  Ollama LLMs (e.g., phi4, llama3)  
  Pinecone Vector Store  
  Custom Prompts for Brand Persona  
  Local Embeddings using Ollama

  Key Features

  Fully automated — no human action needed  
  Local LLMs ensure data privacy  
  Real-time answers powered by vector search  
  Brand-personality aligned tone  
  Organized inbox with Gmail labels

  Best For

  Startups scaling support with limited staff  
  SaaS companies or e-commerce businesses  
  Privacy-conscious enterprises using local LLMs  
  Teams building branded auto-communication workflows

  Customization Tips

  Modify AI prompt to reflect your brand's voice and tone  
  Expand classifier for more email categories  
  Replace Gmail output with Slack, Notion, or your CRM  
  Update Pinecone FAQ index to match evolving support content

nodes_used:
  ["n8n-nodes-base.gmail","@n8n/n8n-nodes-langchain.agent","@n8n/n8n-nodes-langchain.lmChatOllama","@n8n/n8n-nodes-langchain.lmOllama","@n8n/n8n-nodes-langchain.memoryBufferWindow","@n8n/n8n-nodes-langchain.vectorStorePinecone","@n8n/n8n-nodes-langchain.embeddingsOllama","@n8n/n8n-nodes-langchain.textClassifier"]

workflow_json:
  {"meta":{"instanceId":"473ff4054f1a6c3ed6f17a2b4a2e55676fe5b921cceb87b2256e6c416c158559","templateCredsSetupCompleted":true},"nodes":[{"id":"fcc4f02d-1e29-4079-97ba-c5d79120b3bc","name":"Sticky Note","type":"n8n-nodes-base.stickyNote","position":[-240,80],"parameters":{"content":""},"typeVersion":1},{"id":"6cdc9627-679f-4450-a16f-6ae1b90b92c0","name":"Gmail Trigger","type":"n8n-nodes-base.gmailTrigger","position":[-180,200],"parameters":{},"typeVersion":1.2},{"id":"be28ff9c-da0b-47e4-bf1b-c0dd7db660cc","name":"Text Classifier","type":"@n8n/n8n-nodes-langchain.textClassifier","position":[40,200],"parameters":{},"typeVersion":1},{"id":"3b9d2f14-730a-48c7-a211-8fa64e9dc869","name":"AI Agent","type":"@n8n/n8n-nodes-langchain.agent","position":[280,380],"parameters":{},"typeVersion":1.8},{"id":"3145c4bd-e7a0-4da0-ba24-221de1796a77","name":"Pinecone Vector Store","type":"@n8n/n8n-nodes-langchain.vectorStorePinecone","position":[620,400],"parameters":{},"typeVersion":1.1},{"id":"8c68df50-e781-4605-9ef7-0cd14e33530a","name":"Label","type":"n8n-nodes-base.gmail","position":[580,200],"webhookId":"c0c7c2b3-31f9-4cd1-8216-b5862601ddc7","parameters":{},"typeVersion":2.1},{"id":"4730d2dc-97c7-49a6-a75b-1cdb458277fb","name":"Send","type":"n8n-nodes-base.gmail","position":[780,200],"webhookId":"63fe17a2-3eca-4444-9cea-34b80b57ee49","parameters":{},"typeVersion":2.1},{"id":"f51d6efd-d426-470b-994a-e8d33aa4325d","name":"Ollama Model","type":"@n8n/n8n-nodes-langchain.lmOllama","position":[100,380],"parameters":{},"typeVersion":1},{"id":"9c1f601b-cb58-41d6-aebc-1f7be0b0269a","name":"Embeddings Ollama","type":"@n8n/n8n-nodes-langchain.embeddingsOllama","position":[640,560],"parameters":{},"typeVersion":1},{"id":"1f2a81de-2c6b-4394-a32e-47a49a220f73","name":"Ollama Chat Model","type":"@n8n/n8n-nodes-langchain.lmChatOllama","position":[280,560],"parameters":{},"typeVersion":1},{"id":"951189a8-9a0d-4d78-91d9-0ebfa444f0c7","name":"Simple Memory","type":"@n8n/n8n-nodes-langchain.memoryBufferWindow","position":[80,520],"parameters":{},"typeVersion":1.3}],"pinData":{},"connections":{"Label":{"main":[[{"node":"Send","type":"main","index":0}]]},"AI Agent":{"main":[[{"node":"Label","type":"main","index":0}]]},"Ollama Model":{"ai_languageModel":[[{"node":"Text Classifier","type":"ai_languageModel","index":0}]]},"Gmail Trigger":{"main":[[{"node":"Text Classifier","type":"main","index":0}]]},"Simple Memory":{"ai_memory":[[{"node":"AI Agent","type":"ai_memory","index":0}]]},"Text Classifier":{"main":[[{"node":"AI Agent","type":"main","index":0}],[]]},"Embeddings Ollama":{"ai_embedding":[[{"node":"Pinecone Vector Store","type":"ai_embedding","index":0}]]},"Ollama Chat Model":{"ai_languageModel":[[{"node":"AI Agent","type":"ai_languageModel","index":0}]]},"Pinecone Vector Store":{"ai_tool":[[{"node":"AI Agent","type":"ai_tool","index":0}]]}}}


