# templates

name: Extract Instagram Profile Data with Apify and Store in Google Sheets
author_name: Yaron Been
author_username: yaron-nofluff
nodes_used: ["n8n-nodes-base.googleSheets","n8n-nodes-base.httpRequest"]
categories: []
created_at: 2025-06-02T08:50:13.898Z
updated_at: 2025-06-02T08:50:13.898Z
url: https://n8n.io/workflows/4587
scraped_at: 2025-07-06 21:16:30
description:
  Workflow Overview
  This cutting-edge n8n automation is a powerful social media intelligence gathering tool designed to transform Instagram profile research into a seamless, automated process. By intelligently combining web scraping, data formatting, and cloud storage technologies, this workflow:

  Discovers Profile Insights: 
     Automatically scrapes Instagram profile data
     Captures comprehensive profile metrics
     Extracts critical social media intelligence

  Intelligent Data Capture:
     Retrieves follower counts
     Collects biographical information
     Captures profile picture and external links

  Seamless Data Logging:
     Automatically stores data in Google Sheets
     Creates a living, updateable database
     Enables easy analysis and tracking

  Key Benefits
  🤖 Full Automation: Instant profile intelligence
  💡 Comprehensive Insights: Detailed social media metrics
  📊 Effortless Tracking: Automated data collection
  🌐 Multi-Purpose Research: Flexible data gathering

  Workflow Architecture

  🔹 Stage 1: Trigger & Input
  Form-Based Trigger**: Manual username submission
  Webhook Support**: Flexible data entry methods
  User-Driven Initiation**

  🔹 Stage 2: Web Scraping
  Apify Integration**: Robust Instagram data extraction
  Comprehensive Profile Scanning**:
    Followers count
    Following count
    Profile biography
    Profile picture URL

  🔹 Stage 3: Data Formatting
  Intelligent Data Mapping**
  Standardized Data Structure**
  Preparation for Storage**

  🔹 Stage 4: Cloud Logging
  Google Sheets Integration**
  Persistent Data Storage**
  Easy Access and Analysis**

  Potential Use Cases
  Influencer Marketing**: Talent identification
  Competitive Intelligence**: Audience research
  Social Media Analysis**: Performance tracking
  Recruitment**: Talent scouting
  Brand Partnerships**: Collaboration opportunities

  Setup Requirements
  Apify Account
     Instagram scraping actor
     API token
     Configured scraping parameters

  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 profile scoring
  📊 Engagement rate calculation
  🔔 Real-time change alerts
  🌐 Multi-platform profile tracking
  🧠 AI-powered insights generation

  Technical Considerations
  Implement robust error handling
  Use exponential backoff for API calls
  Maintain flexible data extraction strategies
  Ensure compliance with platform terms of service

  Ethical Guidelines
  Respect user privacy
  Use data for legitimate research
  Maintain transparent data collection practices
  Provide opt-out mechanisms

  Connect With Me

  Ready to unlock social media insights?

  📧 Email: Yaron@nofluff.online

  🎥 YouTube: @YaronBeen

  💼 LinkedIn: Yaron Been

  Transform your social media research with intelligent, automated workflows!

  #InstagramDataScraping #SocialMediaIntelligence #InfluencerMarketing #DataAutomation #AIResearch #MarketingTechnology #SocialMediaAnalytics #ProfileIntelligence #WebScraping #MarketingTech

workflow_json:
  {"id":"rDGkfQpVtkD1D6RH","meta":{"instanceId":"84ad02d6104594179f43f1ce9cfe3a81637b2faedb57dafcb9e649b7542988db","templateCredsSetupCompleted":true},"name":"Instagram Profile Scraper","tags":[],"nodes":[{"id":"923b9b8e-f344-4984-a9cc-2ad111db39a4","name":"Provide Usernames","type":"n8n-nodes-base.formTrigger","position":[0,0],"webhookId":"896b15ed-970c-4164-a57a-b6e567b72db7","parameters":{"options":{},"formTitle":"Instagram profile scraper","formFields":{"values":[{"fieldLabel":"Username","requiredField":true}]},"formDescription":"Scrapes profile via apify"},"typeVersion":2.2},{"id":"cd6ea4f9-45dc-4193-954a-798a04716c5c","name":"Scrape Instagram Profile via Apify","type":"n8n-nodes-base.httpRequest","position":[280,0],"parameters":{"url":"https://api.apify.com/v2/actor-tasks/<TASK_ID>/run-sync-get-dataset-items?token=<YOUR_API_TOKEN>","method":"POST","options":{},"jsonBody":"={\n  \"input\": {\n    \"usernames\": [\n      {{ $json.Username }}\n    ],\n    \"resultsLimit\": 1\n  }\n}","sendBody":true,"specifyBody":"json"},"typeVersion":4.2},{"id":"e140ffbf-0ca4-4415-8cff-a78dfc6c040b","name":"Format Instagram Profile Data","type":"n8n-nodes-base.set","position":[660,0],"parameters":{"options":{},"assignments":{"assignments":[{"id":"5dc90212-ac40-4351-a15a-ef9f35ffd389","name":"username","type":"string","value":"={{ $json.username }}"},{"id":"02339555-2d6b-4d20-a59c-2e8dfa63361c","name":"fullName","type":"string","value":"={{ $json.fullName }}"},{"id":"f5a95d72-443d-468a-a1a6-8cc394b93fa4","name":"followersCount","type":"number","value":"={{ $json.followersCount }}"},{"id":"826fe0c8-4fbe-44e7-abf3-8a73022151f2","name":"followsCount","type":"number","value":"={{ $json.followsCount }}"},{"id":"dac8d9cc-5fa8-47d8-859d-d9f164ec20bd","name":"biography","type":"string","value":"={{ $json.biography }}"},{"id":"4c775459-f8f5-43d1-8b1a-aa122413cd12","name":"profilePicUrl","type":"string","value":"={{ $json.profilePicUrl }}"}]}},"typeVersion":3.4},{"id":"9c4f528b-c5c9-4f0b-92c4-1f9d75532fc4","name":"Append Profile to Google Sheet","type":"n8n-nodes-base.googleSheets","position":[880,0],"parameters":{"columns":{"value":{"Username":"={{ $json.username }}","Biography":"={{ $json.biography }}","Full Name":"={{ $json.fullName }}","Followers Count":"={{ $json.followersCount }}","Following Count":"={{ $json.followsCount }}","Profile Pic URL":"={{ $json.profilePicUrl }}"},"schema":[{"id":"Username","type":"string","display":true,"required":false,"displayName":"Username","defaultMatch":false,"canBeUsedToMatch":true},{"id":"Full Name","type":"string","display":true,"required":false,"displayName":"Full Name","defaultMatch":false,"canBeUsedToMatch":true},{"id":"Followers Count","type":"string","display":true,"required":false,"displayName":"Followers Count","defaultMatch":false,"canBeUsedToMatch":true},{"id":"Following Count","type":"string","display":true,"required":false,"displayName":"Following Count","defaultMatch":false,"canBeUsedToMatch":true},{"id":"Biography","type":"string","display":true,"required":false,"displayName":"Biography","defaultMatch":false,"canBeUsedToMatch":true},{"id":"Profile Pic URL","type":"string","display":true,"required":false,"displayName":"Profile Pic URL","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/1VQUy0tfWujh0lyulh0w6UhLGq87f8j8F7uFOaLFUyuQ/edit#gid=0","cachedResultName":"Sheet1"},"documentId":{"__rl":true,"mode":"list","value":"1VQUy0tfWujh0lyulh0w6UhLGq87f8j8F7uFOaLFUyuQ","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1VQUy0tfWujh0lyulh0w6UhLGq87f8j8F7uFOaLFUyuQ/edit?usp=drivesdk","cachedResultName":"Instagram Profile Scraper"}},"credentials":{"googleSheetsOAuth2Api":{"id":"K5yYfUnKFTqaRn6A","name":"Google Sheets account"}},"typeVersion":4.5},{"id":"1980e973-f240-4b55-a4b8-4faa36f78c42","name":"Sticky Note","type":"n8n-nodes-base.stickyNote","position":[-40,-1460],"parameters":{"color":3,"width":500,"height":1660,"content":"### 🔹 **1. `Trigger: On Form Submission`**\n\n* **Node Type:** Manual Trigger (or Webhook if embedded in a real form)\n* **Purpose:** Starts the workflow when a user submits a form with an Instagram username\n* **Expected Input:**\n\n  ```json\n  {\n    \"username\": \"influencer_1\"\n  }\n  ```\n\n---\n\n### 🔹 **2. `Scrape Instagram Profile via Apify`**\n\n* **Node Type:** HTTP Request\n\n* **Method:** `POST`\n\n* **URL:**\n\n  ```plaintext\n  https://api.apify.com/v2/actor-tasks/<TASK_ID>/run-sync-get-dataset-items?token=<API_TOKEN>\n  ```\n\n* **Headers:**\n\n  ```json\n  {\n    \"Content-Type\": \"application/json\"\n  }\n  ```\n\n* **Body Parameters:**\n\n  ```json\n  {\n    \"input\": {\n      \"usernames\": [\"={{ $json.username }}\"]\n    }\n  }\n  ```\n\n* **Sample Output from Apify:**\n\n  ```json\n  [\n    {\n      \"username\": \"influencer_1\",\n      \"fullName\": \"Jane Doe\",\n      \"followersCount\": 12500,\n      \"followsCount\": 320,\n      \"biography\": \"Travel | Lifestyle 🌍\",\n      \"profilePicUrl\": \"https://instagram.com/path/to/pic.jpg\",\n      \"isPrivate\": false,\n      \"isVerified\": true,\n      \"externalUrl\": \"https://janedoe.com\"\n    }\n  ]\n  ```\n\n✅ **Result:** The username submitted from the form is scraped in real time using Apify’s Instagram actor, and the result is passed to the next step."},"typeVersion":1},{"id":"9c341b28-0385-4691-904b-8fa8d8e0b213","name":"Sticky Note1","type":"n8n-nodes-base.stickyNote","position":[600,-1240],"parameters":{"color":6,"width":500,"height":1440,"content":"## ✨ SECTION 2: 🛠 Format Data + 📊 Append to Google Sheets\n\n### 🔹 **3. `Format Instagram Profile Data`**\n\n* **Node Type:** Set\n* **Purpose:** Clean and organize the Apify response to match your Google Sheets schema\n* **Fields to Set:**\n\n  | Field Name        | Value                      |\n  | ----------------- | -------------------------- |\n  | `Username`        | `{{$json.username}}`       |\n  | `Full Name`       | `{{$json.fullName}}`       |\n  | `Followers`       | `{{$json.followersCount}}` |\n  | `Following`       | `{{$json.followsCount}}`   |\n  | `Bio`             | `{{$json.biography}}`      |\n  | `Profile Pic URL` | `{{$json.profilePicUrl}}`  |\n  | `Website`         | `{{$json.externalUrl}}`    |\n\n✅ **Result:** The data is transformed into a clean format suitable for logging or outreach tracking.\n\n---\n\n### 🔹 **4. `Append Profile to Google Sheet`**\n\n* **Node Type:** Google Sheets (Append Row)\n* **Setup:**\n\n  * **Sheet Name:** `Scraped_Influencer_Data`\n  * **Columns:** Username, Full Name, Followers, Following, Bio, Profile Pic URL, Website\n* **Purpose:** Stores the formatted data into a centralized Google Sheet for future reference or outreach\n\n✅ **Result:** Your influencer data is persistently stored and ready to be used for marketing, analytics, or CRM integration.\n\n---\n\n## ✅ Final Workflow Summary\n\n```plaintext\n[Form Trigger] \n   ⬇️\n[Apify HTTP Request] \n   ⬇️\n[Format Fields]\n   ⬇️\n[Google Sheet Append]\n```"},"typeVersion":1},{"id":"1552dfc6-f98c-45e1-bb18-071fbb69a159","name":"Sticky Note9","type":"n8n-nodes-base.stickyNote","position":[-1800,-1460],"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":"91ca76cf-d9dd-489c-a9de-357c876d00e2","name":"Sticky Note4","type":"n8n-nodes-base.stickyNote","position":[-1800,-1120],"parameters":{"color":4,"width":1289,"height":2418,"content":"# 🧠 **Workflow Overview: Instagram Profile Scraper using Apify & Google Sheets in n8n**\n\n## 🔍 **Purpose**\n\nThis n8n automation workflow allows you to **scrape Instagram profile data** using the **Apify Instagram Scraper** and **store the results in Google Sheets** for marketing, outreach, or analytics. It's designed to be simple, efficient, and extendable — ideal for influencer marketers, social analysts, or growth teams who want actionable Instagram data without writing code.\n\n---\n\n## 🧩 **Core Workflow Logic**\n\n### 💡 What It Does\n\n1. **Receives an Instagram username** (via form or manual trigger)\n2. **Sends the username to Apify** to scrape public profile data\n3. **Extracts key details** (followers, bio, profile pic, etc.)\n4. **Appends the cleaned data** to a structured Google Sheet\n\n---\n\n## 🏗️ **Workflow Structure & Components**\n\n## 📊 **Data Flow Example**\n\n### 🔸 **Input (Submitted via Form or Manual Trigger):**\n\n```json\n{\n  \"username\": \"influencer_1\"\n}\n```\n\n### 🔹 **Output (Saved to Google Sheets):**\n\n| Username      | Full Name | Followers | Following | Bio    | Profile Pic URL | Website                                                        |                                            |\n| ------------- | --------- | --------- | --------- | ------ | --------------- | -------------------------------------------------------------- | ------------------------------------------ |\n| influencer\\_1 | Jane Doe  | 12,500    | 320       | Travel | Lifestyle 🌍    | [https://instagram.com/pic.jpg](https://instagram.com/pic.jpg) | [https://janedoe.com](https://janedoe.com) |\n\n---\n\n## 🛠️ **Built With**\n\n* [n8n](https://n8n.io/) – Open-source workflow automation\n* [Apify](https://apify.com/) – Instagram Profile Scraper actor\n* Google Sheets (native integration via n8n)\n\n---\n\n## 🔐 **Authentication & API Notes**\n\n* **Apify Token**: Required in the HTTP Request URL\n* **Google Sheets Access**: OAuth2 credentials configured in n8n\n* **Security Tip**: Store secrets as [n8n environment variables](https://docs.n8n.io/hosting/environment-variables/)\n\n---\n\n## 💼 **Real-World Use Cases**\n\n| Use Case                  | Description                                                   |\n| ------------------------- | ------------------------------------------------------------- |\n| 👩‍💼 Influencer Outreach | Automatically collect Instagram metrics for campaign planning |\n| 📊 Competitor Analysis    | Track follower growth and bio updates for competitors         |\n| 📋 CRM Enrichment         | Enrich influencer records with live Instagram data            |\n\n---\n\n## 🚀 **Enhancements & Ideas**\n\n* 🔁 **Loop from Google Sheets:** Read a batch of usernames and scrape in loop\n* 🚫 **Avoid Duplicates:** Add an `IF` node to skip usernames already scraped\n* 📩 **Send Slack/Email Alerts** when new data is added\n* 🧠 **Filter Low Engagement Accounts** (e.g., if followers < 1,000)\n\n---\n\n## 📸 **Visual Workflow Map**\n\n```plaintext\n[Trigger: On Form Submission]\n          ⬇️\n[Scrape Instagram Profile via Apify]\n          ⬇️\n[Format Instagram Profile Data]\n          ⬇️\n[Append Profile to Google Sheet]\n```\n\n---\n\n## 🧾 **Conclusion**\n\nThis workflow is a **powerful no-code solution** to streamline the process of gathering Instagram profile data. It integrates the flexibility of n8n, the scraping power of Apify, and the accessibility of Google Sheets to form a seamless automation — perfect for creators, marketers, and analysts.\n\n"},"typeVersion":1}],"active":false,"settings":{"executionOrder":"v1"},"versionId":"0073a2a2-78d1-4806-b6f9-216a99a06107","connections":{"Provide Usernames":{"main":[[{"node":"Scrape Instagram Profile via Apify","type":"main","index":0}]]},"Format Instagram Profile Data":{"main":[[{"node":"Append Profile to Google Sheet","type":"main","index":0}]]},"Scrape Instagram Profile via Apify":{"main":[[{"node":"Format Instagram Profile Data","type":"main","index":0}]]}}}


name: Firecrawl AI-Powered Market Intelligence Bot: Automated News Insights Delivery
author_name: Yaron Been
author_username: yaron-nofluff
categories: []
created_at: 2025-06-02T08:54:26.735Z
updated_at: 2025-06-02T08:54:26.735Z
url: https://n8n.io/workflows/4588
scraped_at: 2025-07-06 21:16:30
description:
  Workflow Overview
  This cutting-edge n8n automation is a sophisticated market research and intelligence gathering tool designed to transform web content discovery into actionable insights. By intelligently combining web crawling, AI-powered filtering, and smart summarization, this workflow:

  Discovers Relevant Content: 
     Automatically crawls target websites
     Identifies trending topics
     Extracts comprehensive article details

  Intelligent Content Filtering:
     Applies custom keyword matching
     Filters for most relevant articles
     Ensures high-quality information capture

  AI-Powered Summarization:
     Generates concise, meaningful summaries
     Extracts key insights
     Provides quick, digestible information

  Seamless Delivery:
     Sends summaries directly to Slack
     Enables instant team communication
     Facilitates rapid information sharing

  Key Benefits
  🤖 Full Automation: Continuous market intelligence
  💡 Smart Filtering: Precision content discovery
  📊 AI-Powered Insights: Intelligent summarization
  🚀 Instant Delivery: Real-time team updates

  Workflow Architecture

  🔹 Stage 1: Content Discovery
  Scheduled Trigger**: Daily market research
  FireCrawl Integration**: Web content crawling
  Comprehensive Site Scanning**:
    Extracts article metadata
    Captures full article content
    Identifies key information sources

  🔹 Stage 2: Intelligent Filtering
  Keyword-Based Matching**
  Relevance Assessment**
  Custom Domain Optimization**:
    AI and technology focus
    Startup and innovation tracking

  🔹 Stage 3: AI Summarization
  OpenAI GPT Integration**
  Contextual Understanding**
  Concise Insight Generation**:
    3-point summary format
    Captures essential information

  🔹 Stage 4: Team Notification
  Slack Integration**
  Instant Information Sharing**
  Formatted Insight Delivery**

  Potential Use Cases
  Market Research Teams**: Trend tracking
  Innovation Departments**: Technology monitoring
  Startup Ecosystems**: Competitive intelligence
  Product Management**: Industry insights
  Strategic Planning**: Rapid information gathering

  Setup Requirements
  FireCrawl API
     Web crawling credentials
     Configured crawling parameters

  OpenAI API
     GPT model access
     Summarization configuration
     API key management

  Slack Workspace
     Channel for insights delivery
     Appropriate app permissions
     Webhook configuration

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

  Future Enhancement Suggestions
  🤖 Multi-source crawling
  📊 Advanced sentiment analysis
  🔔 Customizable alert mechanisms
  🌐 Expanded topic tracking
  🧠 Machine learning refinement

  Technical Considerations
  Implement robust error handling
  Use exponential backoff for API calls
  Maintain flexible crawling strategies
  Ensure compliance with website terms of service

  Ethical Guidelines
  Respect content creator rights
  Use data for legitimate research
  Maintain transparent information gathering
  Provide proper attribution

  Workflow Visualization

  [Daily Trigger]
      ⬇️
  [Web Crawling]
      ⬇️
  [Content Filtering]
      ⬇️
  [AI Summarization]
      ⬇️
  [Slack Delivery]

  Connect With Me

  Ready to revolutionize your market research?

  📧 Email: Yaron@nofluff.online

  🎥 YouTube: @YaronBeen

  💼 LinkedIn: Yaron Been

  Transform your information gathering with intelligent, automated workflows!


  #AIResearch #MarketIntelligence #AutomatedInsights #TechTrends #WebCrawling #AIMarketing #InnovationTracking #BusinessIntelligence #DataAutomation #TechNews

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

workflow_json:
  {"id":"iTYjhgQEFE4ap1c8","meta":{"instanceId":"84ad02d6104594179f43f1ce9cfe3a81637b2faedb57dafcb9e649b7542988db","templateCredsSetupCompleted":true},"name":"FireCrawl Summary Bot","tags":[],"nodes":[{"id":"471044c1-cafd-4810-973d-b40c74ef6999","name":"Daily Market Research Trigger","type":"n8n-nodes-base.scheduleTrigger","position":[-160,0],"parameters":{"rule":{"interval":[{"triggerAtHour":8}]}},"typeVersion":1.2},{"id":"8f6e97b6-6910-4c6b-8c9a-29a0cf95ac09","name":"Crawl TechCrunch (FireCrawl)","type":"n8n-nodes-base.httpRequest","position":[140,0],"parameters":{"url":"https://api.firecrawl.dev/v1/crawl","method":"POST","options":{},"sendBody":true,"sendHeaders":true,"bodyParameters":{"parameters":[{"name":"url","value":"https://techcrunch.com"},{"name":"crawl_type","value":"scrape"},{"name":"extract_article","value":"true"}]},"headerParameters":{"parameters":[{"name":"Authorization","value":"Bearer YOUR_TOKEN_HERE"}]}},"typeVersion":4.2},{"id":"7d446441-d882-4816-805e-2d52cd8aea87","name":"Filter Relevant Articles","type":"n8n-nodes-base.code","position":[360,0],"parameters":{"jsCode":"const keywords = ['AI', 'machine learning', 'startup', 'generative'];\nconst results = [];\n\nfor (const item of items) {\n  const title = item.json.article?.title?.toLowerCase() || '';\n  const content = item.json.article?.content?.toLowerCase() || '';\n\n  const isRelevant = keywords.some(keyword =>\n    title.includes(keyword.toLowerCase()) ||\n    content.includes(keyword.toLowerCase())\n  );\n\n  if (isRelevant) {\n    results.push(item); // keep only relevant articles\n  }\n}\n\nreturn results;\n"},"typeVersion":2},{"id":"a326e8fd-bfc8-4380-9c66-20481aaa8a6c","name":"Summarizer Agent","type":"@n8n/n8n-nodes-langchain.agent","position":[700,0],"parameters":{"text":"=Summarize the following article in 3 bullet points:\nTitle: {{ $json.article.title }}\ndescription: {{ $json.meta.description }}\nContent: {{ $json.article.content }}","options":{},"promptType":"define"},"typeVersion":1.9},{"id":"d8576228-6261-4654-84de-0864e398c22d","name":"OpenAI Summarizer","type":"@n8n/n8n-nodes-langchain.lmChatOpenAi","position":[640,240],"parameters":{"model":{"__rl":true,"mode":"list","value":"gpt-4o-mini"},"options":{}},"credentials":{"openAiApi":{"id":"wYwTjEv45IzlAOAu","name":"OpenAi account 2"}},"typeVersion":1.2},{"id":"f5965b4a-4ab1-4e5f-868c-2dc11c59fc28","name":"Send Summary to Slack","type":"n8n-nodes-base.slack","position":[1060,0],"webhookId":"c2e00b18-42bd-49b7-bc4c-05d60633a7c8","parameters":{"text":"=🔍 AI Research Summary: \nTitle: {{ $('Filter Relevant Articles').item.json.article.title }}\nLink: {{ $('Filter Relevant Articles').item.json.url }}\nSummary: {{ $json.output }}","select":"channel","channelId":{"__rl":true,"mode":"list","value":"C08TTV0CC3E","cachedResultName":"all-nathing"},"otherOptions":{}},"credentials":{"slackApi":{"id":"L2vpqY0w5ba50NlR","name":"Slack account 2"}},"typeVersion":2.3},{"id":"295fae17-e75e-47db-a321-0379899f44cc","name":"Sticky Note","type":"n8n-nodes-base.stickyNote","position":[80,-580],"parameters":{"color":3,"width":440,"height":800,"content":"🌐💻 2. Crawling & Filtering\nNodes:\n🌐 Crawl TechCrunch (FireCrawl) (HTTP Request)\n\n🧠 Filter Relevant Articles (Code)\n\n🔍 What these nodes do:\n🌐 Crawl TechCrunch (FireCrawl)\nUses a POST request to FireCrawl’s API\n\nInputs:\n\nurl: Target site (e.g., https://techcrunch.com)\n\ncrawl_type: \"scrape\"\n\nextract_article: true\n\nRetrieves:\n\ntitle, content, author, published_at\n\n🧠 Filter Relevant Articles\nUses a Code node to check if the article is relevant\n\nKeywords like \"AI\", \"machine learning\", \"startup\" are matched\n\nFilters only the articles that matter to your domain"},"typeVersion":1},{"id":"5fe2fbcc-8489-42cf-a578-48a46f18977d","name":"Sticky Note1","type":"n8n-nodes-base.stickyNote","position":[580,-540],"parameters":{"color":5,"width":640,"height":920,"content":"🤖💬 3. Summarization & Delivery\nNodes:\n🧠 Summarize Article with AI (AI Agent)\n\n🔗 OpenAI Chat (Summarizer) (OpenAI Chat Model)\n\n💬 Send Summary to Slack (Slack)\n\n📌 What happens here:\n🤖 Summarize Article with AI\nPasses the article to a GPT-4 or GPT-3.5 agent\n\nUses a prompt like:\n\n“Summarize the following article in 3 bullet points…”\n\n💡 OpenAI Chat (Summarizer)\nExecutes the actual summarization\n\nOutputs a short, clean summary ideal for fast reading\n\n💬 Send Summary to Slack\nPosts the summary to a specific Slack channel (e.g., #market-research)"},"typeVersion":1},{"id":"97ecbbb2-e763-47f0-82b8-2fede05b486f","name":"Sticky Note9","type":"n8n-nodes-base.stickyNote","position":[-2100,-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":"d28d5f04-db81-4833-869f-158b4586a337","name":"Sticky Note4","type":"n8n-nodes-base.stickyNote","position":[-2100,-220],"parameters":{"color":4,"width":1289,"height":2758,"content":"Absolutely! Here's your **Market Research Automation Workflow** beautifully divided into logical sections, with clear explanations and fitting icons to help you grasp each part at a glance.\n\n---\n\n# 🚀 **n8n Market Research Automation Workflow**\n\nAutomate the process of **crawling news sites**, **filtering for relevant content**, **summarizing it with AI**, and **posting it to Slack** — all in a seamless flow.\n\n---\n\n## ⏰ 1. **Trigger & Scheduling**\n\n**Node:** `🕒 Daily Market Research Trigger`\n\n> Starts the workflow on a recurring schedule.\n\n🔧 **What it does:**\n\n* Runs every morning (or your defined time)\n* Ensures your team receives fresh updates daily\n\n📅 **Example Cron Setting:**\n\n* Every day at 8:00 AM\n\n---\n\n## 🌐💻 2. **Crawling & Filtering**\n\n### **Nodes:**\n\n* `🌐 Crawl TechCrunch (FireCrawl)` *(HTTP Request)*\n* `🧠 Filter Relevant Articles` *(Code)*\n\n### 🔍 What these nodes do:\n\n#### 🌐 **Crawl TechCrunch (FireCrawl)**\n\n* Uses a **POST** request to FireCrawl’s API\n* Inputs:\n\n  * `url`: Target site (e.g., `https://techcrunch.com`)\n  * `crawl_type`: `\"scrape\"`\n  * `extract_article`: `true`\n* Retrieves:\n\n  * `title`, `content`, `author`, `published_at`\n\n#### 🧠 **Filter Relevant Articles**\n\n* Uses a `Code` node to check if the article is relevant\n* Keywords like `\"AI\"`, `\"machine learning\"`, `\"startup\"` are matched\n* Filters only the articles that **matter to your domain**\n\n📄 **Sample Code:**\n\n```javascript\nconst keywords = ['AI', 'machine learning', 'startup', 'generative'];\nconst results = [];\n\nfor (const item of items) {\n  const title = item.json.article?.title?.toLowerCase() || '';\n  const content = item.json.article?.content?.toLowerCase() || '';\n\n  const isRelevant = keywords.some(keyword =>\n    title.includes(keyword.toLowerCase()) ||\n    content.includes(keyword.toLowerCase())\n  );\n\n  if (isRelevant) {\n    results.push(item); // keep only relevant articles\n  }\n}\n\nreturn results;\n```\n\n---\n\n## 🤖💬 3. **Summarization & Delivery**\n\n### **Nodes:**\n\n* `🧠 Summarize Article with AI` *(AI Agent)*\n* `🔗 OpenAI Chat (Summarizer)` *(OpenAI Chat Model)*\n* `💬 Send Summary to Slack` *(Slack)*\n\n### 📌 What happens here:\n\n#### 🤖 **Summarize Article with AI**\n\n* Passes the article to a GPT-4 or GPT-3.5 agent\n* Uses a prompt like:\n\n  > “Summarize the following article in 3 bullet points…”\n\n#### 💡 **OpenAI Chat (Summarizer)**\n\n* Executes the actual summarization\n* Outputs a short, clean summary ideal for fast reading\n\n#### 💬 **Send Summary to Slack**\n\n* Posts the summary to a specific Slack channel (e.g., `#market-research`)\n* Message format example:\n\n  ```\n  🔍 *Market Research Summary*\n  *Title:* OpenAI launches GPT-5\n  *Link:* https://techcrunch.com/article\n  *Summary:*\n  - GPT-5 improves reasoning\n  - Enhanced safety mechanisms\n  - Better multilingual performance\n  ```\n\n"},"typeVersion":1}],"active":false,"settings":{"executionOrder":"v1"},"versionId":"8d64bd18-6a8f-4a2b-a952-5d8417122a2e","connections":{"Summarizer Agent":{"main":[[{"node":"Send Summary to Slack","type":"main","index":0}]]},"OpenAI Summarizer":{"ai_languageModel":[[{"node":"Summarizer Agent","type":"ai_languageModel","index":0}]]},"Filter Relevant Articles":{"main":[[{"node":"Summarizer Agent","type":"main","index":0}]]},"Crawl TechCrunch (FireCrawl)":{"main":[[{"node":"Filter Relevant Articles","type":"main","index":0}]]},"Daily Market Research Trigger":{"main":[[{"node":"Crawl TechCrunch (FireCrawl)","type":"main","index":0}]]}}}


name: AI-Powered Lead Enrichment with Bright Data MCP and Google Sheets
author_name: Cyril Nicko Gaspar
author_username: cngaspar
categories: []
created_at: 2025-06-02T09:57:14.427Z
updated_at: 2025-06-02T09:57:14.427Z
url: https://n8n.io/workflows/4589
scraped_at: 2025-07-06 21:16:30
description:
  📌 HubSpot Lead Enrichment with Bright Data MCP



  This template enables natural-language-driven automation using Bright Data's MCP tools, triggered directly by new leads in HubSpot. It dynamically extracts and executes the right tool based on lead context—powered by AI and configurable in N8N.

  ❓ What Problem Does This Solve?

  Manual lead enrichment is slow, inconsistent, and drains valuable time. This solution automates the process using a no-code workflow that connects HubSpot, Bright Data MCP, and an AI agent—without requiring scripts or technical skills. Perfect for marketing, sales, and RevOps teams.

  🧰 Prerequisites

  To use this template, you’ll need:

  A self-hosted or cloud instance of N8N
  A Bright Data MCP API token
  A valid OpenAI API key (or compatible AI model)
  A HubSpot account
  Either a Private App token or OAuth credentials for HubSpot
  Basic familiarity with N8N workflows

  ⚙️ Setup Instructions

  1. Set Up Authentication in HubSpot

  🔐 Option 1: Use a Private App Token (Simple Setup)
  Log in to your HubSpot account.
  Navigate to Settings → Integrations → Private Apps.
  Create a new Private App with the following scopes:
     crm.objects.contacts.read
     crm.objects.contacts.write
     crm.schemas.contacts.read
     crm.objects.companies.read (optional)
  Copy the Access Token.
  In N8N, create a credential for HubSpot App Token and paste the app token in the field.
  Go back to Hubspot Private App settings to setup a webhook.
     Copy the url in your workflow's Webhook node and paste it here.

  🔁 Option 2: Use OAuth (Advanced + Secure)
  In HubSpot, go to Settings → Integrations → Apps → Create App.
  Set your Redirect URL to match your N8N OAuth2 redirect path.
  Choose scopes like:
     crm.objects.companies.read
     crm.objects.contacts.read
     crm.objects.deals.read
     crm.schemas.companies.read
     crm.schemas.contacts.read
     crm.schemas.deals.read
     crm.objects.contacts.write (conditionally required)
  Note the Client ID and Client Secret.
  Copy the App ID and the developer API key
  In N8N, create a credential for HubSpot Developer API and paste those info from previous step.
  Attach these credentials to the HubSpot node in N8N.

  2. Setup and obtain API token and other necessary information from Bright Data

     In your Bright Data account, obtain the following information:
     API token
     Web Unlocker zone name (optional)
     Browser API username and password string separated by colon (optional)
  3. Host SSE server from STDIO command
     The methods below will allow you to receive SSE (Server-Sent Events) from Bright Data MCP via a local Supergateway or Smithery

     **

     Method 1: Run Supergateway in a separate web service (Recommended)

     This method will work for both cloud version and self-hosted N8N.

     Signup to any cloud services of your choice (DigitalOcean, Heroku, Hetzner, Render, etc.).

  For NPM based installation:

     Create a new web service.
     Choose Node.js as runtime environment and setup a custom server without repository.
     In your server’s settings to define environment variables or .env file, add:
  `API_TOKEN=your_brightdata_api_token
  WEB_UNLOCKER_ZONE=optional_zone_name
  BROWSER_AUTH=optional_browser_auth`
     Paste the following text as a start command: npx -y supergateway --stdio "npx -y @brightdata/mcp" --port 8000 --baseUrl http://localhost:8000 --ssePath /sse --messagePath /message
     Deploy it and copy the web server URL, then append /sse into it.
     Your SSE server should now be accessible at: https://your_server_url/sse

  For Docker based installation:
     Create a new web service.
     Choose Docker as the runtime environment.
     Set up your Docker environment by pulling the necessary images or creating a custom Dockerfile.
     In your server’s settings to define environment variables or .env file, add:
  `API_TOKEN=your_brightdata_api_token
  WEB_UNLOCKER_ZONE=optional_zone_name
  BROWSER_ZONE=optional_browser_zone_name`
      Use the following Docker command to run Supergateway: `docker run -it --rm -p 8000:8000 supercorp/supergateway \
      --stdio "npx -y @brightdata/mcp /" \
      --port 8000`
     Deploy it and copy the web server URL, then append /sse into it.
     Your SSE server should now be accessible at: https://your_server_url/sse

     For more installation guides, please refer to https://github.com/supercorp-ai/supergateway.git.
     **

     Method 2: Run Supergateway in the same web service as the N8N instance

     This method will only work for self-hosted N8N.

  a. Set Required Environment Variables

     In your server's settings to define environment variables or .env file, add:

        API_TOKEN=your_brightdata_api_token
     WEB_UNLOCKER_ZONE=optional_zone_name
     BROWSER_ZONE=optional_browser_zone_name
  b. Run Supergateway in Background

        npx -y supergateway --stdio "npx -y @brightdata/mcp" --port 8000 --baseUrl http://localhost:8000 --ssePath /sse --messagePath /message
        Use the command above to execute it through the cloud shell or set it as a pre-deploy command.


     Your SSE server should now be accessible at:  
     http://localhost:8000/sse

   
     For more installation guides, please refer to https://github.com/supercorp-ai/supergateway.git.

     *

     *Method 3: Configure via Smithery.ai* (Easiest)
  If you don't want additional setup and want to test it right away, follow these instructions:

     Visit https://smithery.ai/server/@luminati-io/brightdata-mcp/tools to:
     Signup (if you are new to Smithery)
     Create an API key
     Define environment variables via a profile
     Retrieve your SSE server HTTP URL

  4. Connect Google Sheets to N8N

  Ensure your Google Sheet:
    Contains columns like row_id, first_name, last_name, email, and status.
    Is shared with your N8N service account (or connected via OAuth)

  In N8N:
    Add a Google Sheets Trigger node
    Set it to watch for new rows in your lead sheet

  5. Import and Configure the N8N Workflow

  Import the provided JSON workflow into N8N
  Update nodes with your credentials:
    Hubspot: Add your API key or connect it via OAuth.
    Google Sheets Trigger: Link to your actual sheet
    OpenAI Node: Add your API key
    Bright Data Tool Execution: Add Bright Data token and SSE URL

  🔄 How It Works
  New contact in Hubspot or a new row is added to the Google Sheet
  N8N triggers the workflow
  AI agent classifies the task (e.g., “Find LinkedIn”, “Get company info”)
  The relevant MCP tool is called
  Results are appended back to the sheet or routed to another destination
  Rerun the specific record by specifying status "needs more enrichment", or leaving it blank. 

  🧩 Use Cases

  B2B Lead Enrichment** – Add missing fields (title, domain, social profiles)
  Email Intelligence** – Validate and enrich based on email
  Market Research** – Pull company or contact data on demand
  CRM Auto-fill** – Push enriched leads to tools like HubSpot or Salesforce

  🛠️ Customization

  Prompt Tuning** – Adjust how the AI interprets input data
  Column Mapping** – Customize which fields to pull from the sheet
  Tool Logic** – Add retries, fallback tools, or confidence-based routing
  Destination Output** – Integrate with CRMs, Slack, or webhook endpoints

  ✅ Summary

  This template turns a Google Sheet into an AI-powered lead enrichment engine. By combining Bright Data’s tools with a natural language AI agent, your team can automate repetitive tasks and scale lead ops—without writing code.

  Just add a row, and let the workflow do the rest.

nodes_used:
  ["n8n-nodes-base.googleSheets","n8n-nodes-base.hubspot","@n8n/n8n-nodes-langchain.agent","@n8n/n8n-nodes-langchain.lmChatOpenAi","@n8n/n8n-nodes-langchain.outputParserAutofixing","@n8n/n8n-nodes-langchain.outputParserStructured","@n8n/n8n-nodes-langchain.openAi","@n8n/n8n-nodes-langchain.mcpClientTool"]

workflow_json:
  {"meta":{"instanceId":"4e6be3a68285934388a854ac0ffdc5e5500688d5cdb88d0ec2d734e85f097355","templateCredsSetupCompleted":true},"nodes":[{"id":"80ffc9b5-2a35-46e3-a641-45ae6f9556bd","name":"Google Sheets Trigger","type":"n8n-nodes-base.googleSheetsTrigger","position":[-5820,2140],"parameters":{"options":{"columnsToWatch":["status"]},"pollTimes":{"item":[{"mode":"everyMinute"}]},"sheetName":{"__rl":true,"mode":"list","value":870504645,"cachedResultUrl":"https://docs.google.com/spreadsheets/d/18bkVOsgjONipJNbPe91UiiLgKnSCvsr0b7BDLZUIJh0/edit#gid=870504645","cachedResultName":"sampleATcsv"},"documentId":{"__rl":true,"mode":"list","value":"18bkVOsgjONipJNbPe91UiiLgKnSCvsr0b7BDLZUIJh0","cachedResultUrl":"https://docs.google.com/spreadsheets/d/18bkVOsgjONipJNbPe91UiiLgKnSCvsr0b7BDLZUIJh0/edit?usp=drivesdk","cachedResultName":"Test Database"}},"credentials":{"googleSheetsTriggerOAuth2Api":{"id":"VNqOvRgnzQaAingt","name":"Google Sheets Trigger account"}},"typeVersion":1},{"id":"06d817c6-f625-495e-bfd3-d019a98f0ebb","name":"Structured Output Parser","type":"@n8n/n8n-nodes-langchain.outputParserStructured","position":[-3260,2280],"parameters":{"schemaType":"manual","inputSchema":"{\n\"$schema\": \"http://json-schema.org/draft-07/schema#\",\n\"title\": \"UserData\",\n\"type\": \"object\",\n\"properties\": {\n  \"first_name\": {\n      \"type\": \"string\"\n  },\n  \"last_name\": {\n      \"type\": \"string\"\n  },\n  \"middle_name\": {\n      \"type\": \"string\"\n  },\n  \"gender\": {\n      \"type\": \"string\"\n  },\n  \"address\": {\n      \"type\": \"string\"\n  },\n  \"city\": {\n      \"type\": \"string\"\n  },\n  \"state\": {\n      \"type\": \"string\"\n  },\n  \"zip\": {\n      \"type\": \"integer\"\n  },\n  \"country\": {\n      \"type\": \"string\"\n  },\n  \"email\": {\n      \"type\": \"string\",\n      \"format\": \"email\"\n  },\n  \"phone\": {\n      \"type\": \"string\"\n  },\n  \"date_of_birth\": {\n      \"type\": \"string\"\n  },\n  \"field_of_study\": {\n      \"type\": \"string\"\n  },\n  \"graduation_date\": {\n      \"type\": \"string\"\n  },\n  \"company\": {\n      \"type\": \"string\"\n  },\n  \"job_title\": {\n      \"type\": \"string\"\n  },\n  \"department\": {\n      \"type\": \"string\"\n  },\n  \"facebook_handle\": {\n      \"type\": \"string\"\n  },\n  \"linkedin_url\": {\n      \"type\": \"string\",\n      \"format\": \"uri\"\n  },\n  \"x_handle\": {\n      \"type\": \"string\"\n  },\n  \"instagram_handle\": {\n      \"type\": \"string\"\n  },\n  \"company_address\": {\n      \"type\": \"string\"\n  },\n  \"company_city\": {\n      \"type\": \"string\"\n  },\n  \"company_state\": {\n      \"type\": \"string\"\n  },\n  \"company_zip\": {\n      \"type\": \"integer\"\n  },\n  \"company_country\": {\n      \"type\": \"string\"\n  },\n  \"company_phone\": {\n      \"type\": \"string\"\n  },\n  \"company_email\": {\n      \"type\": \"string\",\n      \"format\": \"email\"\n  },\n  \"company_industry\": {\n      \"type\": \"string\"\n  },\n  \"company_size\": {\n      \"type\": \"integer\"\n  },\n  \"company_founded_year\": {\n      \"type\": \"integer\"\n  },\n  \"degree\": {\n      \"type\": \"string\"\n  },\n \n  \"job_function\": {\n      \"type\": \"string\"\n  },\n  \"marital_status\": {\n      \"type\": \"string\"\n  },\n  \"salutation\": {\n      \"type\": \"string\"\n  },\n  \"school\": {\n      \"type\": \"string\"\n  },\n  \"scrape_error\": {\n      \"type\": \"string\"\n  }\n},\n\"required\": [\n  \"first_name\",\n  \"last_name\",\n  \"email\"\n],\n\"additionalProperties\": false\n}"},"typeVersion":1.2},{"id":"18ef61dc-5134-4c8b-817b-da162c093b06","name":"Sticky Note","type":"n8n-nodes-base.stickyNote","position":[-5880,1920],"parameters":{"color":4,"width":460,"height":540,"content":"## Watch for the updated record in Google Sheets based on the column 'status'\nWrite 'needs more enrichment' in the status column if you want to retry the enrichment\n"},"typeVersion":1},{"id":"e3b79eff-1504-4da3-85ef-4423f5ee71cd","name":"Auto-fixing Output Parser","type":"@n8n/n8n-nodes-langchain.outputParserAutofixing","position":[-3480,2080],"parameters":{"options":{"prompt":"Instructions:\n--------------\n{instructions}\n--------------\nCompletion:\n--------------\n{completion}\n--------------\n\nAbove, the Completion did not satisfy the constraints given in the Instructions.\nError:\n--------------\n{error}\n--------------\n\nPlease only return the first_name, last_name, email, and scrape_error (put the error details in this field)"}},"typeVersion":1},{"id":"1023e561-8f92-4fe1-8d21-1b6fcd2bbb6e","name":"OpenAI Chat Model1","type":"@n8n/n8n-nodes-langchain.lmChatOpenAi","position":[-3500,2200],"parameters":{"model":{"__rl":true,"mode":"list","value":"gpt-4o-mini"},"options":{}},"credentials":{"openAiApi":{"id":"K4cmCYcro5viwUfR","name":"Thijs 2"}},"typeVersion":1.2},{"id":"ac4f57e8-f7f0-47b8-b039-9a93f198083a","name":"Sticky Note1","type":"n8n-nodes-base.stickyNote","position":[-6620,1440],"parameters":{"color":4,"width":520,"height":540,"content":"## Manually run the records that is needed enrichment\n"},"typeVersion":1},{"id":"c46b338f-ccb6-4ce4-a1a3-623a615d19b2","name":"Process each leads one by one","type":"n8n-nodes-base.splitInBatches","position":[-4620,1260],"parameters":{"options":{}},"typeVersion":3},{"id":"e6f86e5f-f49f-4781-90d2-78747efd5053","name":"Filter the leads that needs enrichment","type":"n8n-nodes-base.filter","position":[-5600,2140],"parameters":{"options":{},"conditions":{"options":{"version":2,"leftValue":"","caseSensitive":true,"typeValidation":"strict"},"combinator":"or","conditions":[{"id":"1ec242aa-557e-434a-8bb5-d043b5645e88","operator":{"type":"string","operation":"empty","singleValue":true},"leftValue":"={{ $json.status?.toString() }}","rightValue":""},{"id":"400fe682-5882-441f-a506-ea8f9bdb9df8","operator":{"type":"string","operation":"equals"},"leftValue":"={{ $json.status }}","rightValue":"needs more enrichment"}]}},"typeVersion":2.2},{"id":"46203489-bdd1-48ea-a020-8f5e1734cbdb","name":"Remove unneccessary fields for the prompt","type":"n8n-nodes-base.set","position":[-4100,1260],"parameters":{"include":"except","options":{},"excludeFields":"row_number, status, row_id","includeOtherFields":true},"typeVersion":3.4},{"id":"838ba8a6-3f41-4973-b5aa-805b9abc6baa","name":"Sticky Note2","type":"n8n-nodes-base.stickyNote","position":[-800,720],"parameters":{"color":4,"width":980,"height":1620,"content":"# Update the record in Google Sheet"},"typeVersion":1},{"id":"1315c393-9cb2-4345-ba01-34faa5673e72","name":"Sticky Note3","type":"n8n-nodes-base.stickyNote","position":[-4260,1040],"parameters":{"color":6,"width":840,"height":740,"content":"# AI Agent with Bright Data MCP attached\nPlease play around which model suited best"},"typeVersion":1},{"id":"f77f311d-20c4-4e5d-a679-f905a5e1680a","name":"Bright Data MCP Client","type":"@n8n/n8n-nodes-langchain.mcpClientTool","position":[-3760,1540],"parameters":{"include":"selected","sseEndpoint":"http://localhost:8000/sse","includeTools":["search_engine","web_data_linkedin_person_profile","web_data_linkedin_company_profile","web_data_linkedin_people_search","web_data_crunchbase_company","web_data_tiktok_profiles","web_data_instagram_profiles"]},"typeVersion":1},{"id":"f5d6bf43-d9c0-4272-9d5f-cf1371f0e27a","name":"OpenAI Chat Model","type":"@n8n/n8n-nodes-langchain.lmChatOpenAi","position":[-4000,1540],"parameters":{"model":{"__rl":true,"mode":"list","value":"gpt-4.1-mini","cachedResultName":"gpt-4.1-mini"},"options":{}},"credentials":{"openAiApi":{"id":"3wONK02jjm23nMHf","name":"OpenAi account"}},"typeVersion":1.2},{"id":"370ea5eb-0abc-418a-836f-f9e28d3f11be","name":"Sticky Note4","type":"n8n-nodes-base.stickyNote","position":[-3360,1040],"parameters":{"width":1160,"height":760,"content":"# Formating the results and comparing it to the original"},"typeVersion":1},{"id":"cc8043c0-6306-4808-9caf-0776b9a29553","name":"If","type":"n8n-nodes-base.if","position":[-2980,1440],"parameters":{"options":{},"conditions":{"options":{"version":2,"leftValue":"","caseSensitive":true,"typeValidation":"strict"},"combinator":"and","conditions":[{"id":"54ed6517-f4b9-48ff-baf1-37c7551c85ed","operator":{"name":"filter.operator.equals","type":"string","operation":"equals"},"leftValue":"={{ $json.output.first_name }}","rightValue":"={{ $('Process each leads one by one').item.json.first_name }}"},{"id":"465b70a3-9830-4521-8248-a1236795b296","operator":{"name":"filter.operator.equals","type":"string","operation":"equals"},"leftValue":"={{ $json.output.last_name }}","rightValue":"={{ $('Process each leads one by one').item.json.last_name }}"},{"id":"5a2f38ab-64e6-4e5d-92e2-7a88135e7884","operator":{"name":"filter.operator.equals","type":"string","operation":"equals"},"leftValue":"={{ $json.output.email }}","rightValue":"={{ $('Process each leads one by one').item.json.email }}"}]}},"typeVersion":2.2},{"id":"7cfe0f1d-d2ef-4630-b4d4-5ef155852f4c","name":"Switch","type":"n8n-nodes-base.switch","position":[-3240,1280],"parameters":{"rules":{"values":[{"outputKey":"Email only","conditions":{"options":{"version":2,"leftValue":"","caseSensitive":true,"typeValidation":"strict"},"combinator":"and","conditions":[{"id":"26b1eb37-80d1-4966-a223-fe7a6d032083","operator":{"type":"boolean","operation":"true","singleValue":true},"leftValue":"={{ $('Process each leads one by one').item.json.email !== \"\" && ($('Process each leads one by one').item.json.first_name + \" \" + $('Process each leads one by one').item.json.last_name).trim() === \"\"  }}","rightValue":""}]},"renameOutput":true},{"outputKey":"Name only","conditions":{"options":{"version":2,"leftValue":"","caseSensitive":true,"typeValidation":"strict"},"combinator":"and","conditions":[{"id":"7a4f68df-3d5b-4476-b186-8a5fb847d78e","operator":{"type":"boolean","operation":"true","singleValue":true},"leftValue":"={{ $('Process each leads one by one').item.json.email === \"\" && ($('Process each leads one by one').item.json.first_name + \" \" + $('Process each leads one by one').item.json.last_name).trim() !== \"\"  }}","rightValue":""}]},"renameOutput":true},{"outputKey":"Both email and name exists","conditions":{"options":{"version":2,"leftValue":"","caseSensitive":true,"typeValidation":"strict"},"combinator":"and","conditions":[{"id":"13d089ae-1fd1-4a15-a35c-edae907141f5","operator":{"type":"boolean","operation":"true","singleValue":true},"leftValue":"={{ $('Process each leads one by one').item.json.email !== \"\" && ($('Process each leads one by one').item.json.first_name + \" \" + $('Process each leads one by one').item.json.last_name).trim() !== \"\"  }}","rightValue":""}]},"renameOutput":true}]},"options":{}},"typeVersion":3.2},{"id":"f4357d32-0d4f-4131-8367-63ac527bb9e2","name":"If2","type":"n8n-nodes-base.if","position":[-2980,1120],"parameters":{"options":{},"conditions":{"options":{"version":2,"leftValue":"","caseSensitive":true,"typeValidation":"strict"},"combinator":"and","conditions":[{"id":"5a2f38ab-64e6-4e5d-92e2-7a88135e7884","operator":{"name":"filter.operator.equals","type":"string","operation":"equals"},"leftValue":"={{ $json.output.email }}","rightValue":"={{ $('Process each leads one by one').item.json.email }}"}]}},"typeVersion":2.2},{"id":"0efb7c41-869f-4803-b725-7133fe74dfd6","name":"Merge","type":"n8n-nodes-base.merge","position":[-2620,1620],"parameters":{"mode":"chooseBranch","useDataOfInput":2},"typeVersion":3.1},{"id":"5478a933-3704-4282-a043-b61e7c84c86e","name":"If1","type":"n8n-nodes-base.if","position":[-2980,1280],"parameters":{"options":{},"conditions":{"options":{"version":2,"leftValue":"","caseSensitive":true,"typeValidation":"strict"},"combinator":"and","conditions":[{"id":"54ed6517-f4b9-48ff-baf1-37c7551c85ed","operator":{"name":"filter.operator.equals","type":"string","operation":"equals"},"leftValue":"={{ $json.output.first_name }}","rightValue":"={{ $('Process each leads one by one').item.json.first_name }}"},{"id":"465b70a3-9830-4521-8248-a1236795b296","operator":{"name":"filter.operator.equals","type":"string","operation":"equals"},"leftValue":"={{ $json.output.last_name }}","rightValue":"={{ $('Process each leads one by one').item.json.last_name }}"},{"id":"5a2f38ab-64e6-4e5d-92e2-7a88135e7884","operator":{"name":"filter.operator.equals","type":"string","operation":"equals"},"leftValue":"={{ $json.output.email }}","rightValue":"={{ $('Process each leads one by one').item.json.email }}"}]}},"typeVersion":2.2},{"id":"b96100ab-1edf-46ce-8c1d-c16c7617b327","name":"Not matched route","type":"n8n-nodes-base.noOp","position":[-2400,1200],"parameters":{},"typeVersion":1},{"id":"896fdbd8-e6b2-4e5e-8cbb-8c347714f541","name":"Space requests by 5 seconds","type":"n8n-nodes-base.wait","position":[940,1440],"webhookId":"ca47f66b-d536-4751-ab54-7d1e049ca14a","parameters":{},"typeVersion":1.1},{"id":"5e4b65b7-30b6-4980-a851-43b8112d6347","name":"Sticky Note5","type":"n8n-nodes-base.stickyNote","position":[-3740,1960],"parameters":{"color":6,"width":840,"height":560,"content":"## Format the output"},"typeVersion":1},{"id":"146b61b9-cd18-4e72-b07f-4f848d909a66","name":"Scraper AI Agent","type":"@n8n/n8n-nodes-langchain.agent","notes":"\nSteps:\n1. Scrape the url and find for the input fields common in the form such as text, radio buttons, checkboxes.  etc. Identify selectors for these input fields. Find the submit button too or the button to proceed to the next section or step.","position":[-3880,1280],"parameters":{"text":"=Here's the lead's data:\n\n{{ $json.toJsonString() }}","options":{"maxIterations":30,"systemMessage":"=Prompt: Person and Company Enrichment Task\n\nObjective:\nEnrich the lead’s information as completely and accurately as possible. Avoid fabricating data and maintain strict adherence to the correct tool schema for each tool used in the MCP client.\n\n⸻\n\n1. Person Enrichment Instructions:\n- Start with a Google Search:\nPrioritize locating the individual’s LinkedIn profile URL using the available information.\n- Query Guidelines:\n- If the email address is available, use it in your search query.\n- If not, use the person’s first name and last name.\n- Always append keywords like “linkedin”, “facebook”, “instagram”, or other relevant social media platforms to refine the search.\n- LinkedIn-Based Enrichment:\nOnce the LinkedIn URL is found, use it to gather available details from their profile.\n\n⸻\n\n2. Company Enrichment Instructions:\n- Email Domain Extraction:\nIf the person’s email is not from a generic provider (e.g., gmail.com, outlook.com, hotmail.com, icloud.com), extract the domain and use it in your search.\n- Query Composition:\n- Combine the extracted domain with any existing value in the “company” field of the lead’s details.\n- Do not rely on or reuse company data obtained from other tool outputs.\n- Focus on sourcing reliable company information from LinkedIn and Crunchbase.\n\n⸻\n\nOutput Format:\n\nReturn the enriched data in valid JSON format using the original key structure. Exclude any fields that remain empty. Example output:\n\n{\n  \"first_name\": \"John\",\n  \"last_name\": \"Doe\",\n  \"address\": \"123 Maple Street, Apt 4\",\n  \"instagram_handle\": \"johndoe38\"\n}\n\n","returnIntermediateSteps":true},"promptType":"define","hasOutputParser":true},"retryOnFail":true,"typeVersion":1.9},{"id":"bfbf1be5-96a7-470e-a3d2-006dbf948c4d","name":"Merge1","type":"n8n-nodes-base.merge","position":[-1560,1460],"parameters":{"mode":"combine","options":{},"combineBy":"combineByPosition"},"typeVersion":3.1},{"id":"fa2096a7-56d7-45aa-b10f-4ae7456339b4","name":"Judge the accuracy of scraped data","type":"@n8n/n8n-nodes-langchain.openAi","position":[-2020,1280],"parameters":{"modelId":{"__rl":true,"mode":"id","value":"=gpt-4o-mini"},"options":{},"messages":{"values":[{"role":"system","content":"Task:\nEvaluate the accuracy of the scraped data compared to the original source data.\n\nInstructions:\n- Assess how closely the scraped output matches the original data in terms of content, structure, and completeness.\n- Provide a confidence score based on the overall accuracy.\n- Explain your reasoning in concise, clear remarks.\n\nOutput Format (JSON):\n\n{\n  \"confidence\": [decimal between 0 and 1, e.g., 0.98 for 98% accuracy],\n  \"remarks\": \"A brief explanation justifying the confidence score, highlighting any discrepancies or issues found.\"\n}\n"},{"content":"=Original source data:\n{{ $('Remove unneccessary fields for the prompt').item.json.toJsonString() }}\n\nScraped output:\n{{ $json.output.toJsonString() }}"}]},"jsonOutput":true},"credentials":{"openAiApi":{"id":"K4cmCYcro5viwUfR","name":"Thijs 2"}},"typeVersion":1.8},{"id":"32f37490-752b-4ee1-b68f-c56f17615bf4","name":"Just to make the connection neat","type":"n8n-nodes-base.noOp","position":[1480,2480],"parameters":{},"typeVersion":1},{"id":"01f944b6-e821-4ca3-ba09-bbc33f562ef4","name":"Sticky Note6","type":"n8n-nodes-base.stickyNote","position":[-2080,1020],"parameters":{"color":2,"width":1160,"height":740,"content":"# Identify the accuracy of the scraped data\nThis may serve as another layer of accuracy filtering"},"typeVersion":1},{"id":"08a34aec-7419-4cb9-b495-dff406c6f61d","name":"Extract the AI results only","type":"n8n-nodes-base.set","position":[-1820,1280],"parameters":{"options":{},"assignments":{"assignments":[{"id":"298abc40-159e-4aa3-ab4d-039829c2d1a0","name":"confidence","type":"number","value":"={{ $json.message.content.confidence }}"},{"id":"c2662984-8fa9-46eb-bc6d-fb7be5fc4451","name":"remarks","type":"string","value":"={{ $json.message.content.remarks }}"}]}},"typeVersion":3.4},{"id":"716a21d4-230d-4747-a031-ca8aac1bc3af","name":"Check the confidence score","type":"n8n-nodes-base.if","position":[-720,1580],"parameters":{"options":{},"conditions":{"options":{"version":2,"leftValue":"","caseSensitive":true,"typeValidation":"strict"},"combinator":"and","conditions":[{"id":"f153193c-b517-49fc-8ae4-1bea6bd0ff91","operator":{"type":"number","operation":"gte"},"leftValue":"={{ $json.confidence }}","rightValue":0.85}]}},"typeVersion":2.2},{"id":"a4eb12f7-26b9-4f8f-a51a-ff54c769c06b","name":"Prepare the scraped output for Google Sheets","type":"n8n-nodes-base.set","position":[-1340,1560],"parameters":{"mode":"raw","options":{},"jsonOutput":"={{ $json.output }}"},"typeVersion":3.4},{"id":"06bf86dc-c92f-4540-8963-219015d745fb","name":"Add confidence score to Google Sheet","type":"n8n-nodes-base.set","position":[-1140,1580],"parameters":{"options":{},"assignments":{"assignments":[{"id":"3d437c0b-ff3e-4c21-95e0-5557866806c5","name":"remarks","type":"string","value":"={{ $('Merge1').item.json.remarks }}"},{"id":"5ef03fde-ee61-49a3-8c73-1ab4b66654a6","name":"confidence","type":"number","value":"={{ $('Merge1').item.json.confidence }}"},{"id":"745b0dd7-7ac9-4e97-9192-db95ff2d2706","name":"row_id","type":"string","value":"={{ $('Process each leads one by one').item.json.row_id }}"}]},"includeOtherFields":true},"typeVersion":3.4},{"id":"f6ba009f-47f1-428e-95e6-b3d8ca23208d","name":"Add record if the confidence score is below 85%","type":"n8n-nodes-base.googleSheets","position":[-100,2020],"parameters":{"columns":{"value":{"first_name":"={{ $json.output.first_name }}"},"schema":[{"id":"row_id","type":"string","display":true,"removed":false,"required":false,"displayName":"row_id","defaultMatch":false,"canBeUsedToMatch":true},{"id":"first_name","type":"string","display":true,"required":false,"displayName":"first_name","defaultMatch":false,"canBeUsedToMatch":true},{"id":"last_name","type":"string","display":true,"required":false,"displayName":"last_name","defaultMatch":false,"canBeUsedToMatch":true},{"id":"middle_name","type":"string","display":true,"required":false,"displayName":"middle_name","defaultMatch":false,"canBeUsedToMatch":true},{"id":"address","type":"string","display":true,"required":false,"displayName":"address","defaultMatch":false,"canBeUsedToMatch":true},{"id":"city","type":"string","display":true,"required":false,"displayName":"city","defaultMatch":false,"canBeUsedToMatch":true},{"id":"state","type":"string","display":true,"required":false,"displayName":"state","defaultMatch":false,"canBeUsedToMatch":true},{"id":"zip","type":"string","display":true,"required":false,"displayName":"zip","defaultMatch":false,"canBeUsedToMatch":true},{"id":"country","type":"string","display":true,"required":false,"displayName":"country","defaultMatch":false,"canBeUsedToMatch":true},{"id":"email","type":"string","display":true,"required":false,"displayName":"email","defaultMatch":false,"canBeUsedToMatch":true},{"id":"phone","type":"string","display":true,"required":false,"displayName":"phone","defaultMatch":false,"canBeUsedToMatch":true},{"id":"company","type":"string","display":true,"required":false,"displayName":"company","defaultMatch":false,"canBeUsedToMatch":true},{"id":"job_title","type":"string","display":true,"required":false,"displayName":"job_title","defaultMatch":false,"canBeUsedToMatch":true},{"id":"department","type":"string","display":true,"required":false,"displayName":"department","defaultMatch":false,"canBeUsedToMatch":true},{"id":"date_of_birth","type":"string","display":true,"required":false,"displayName":"date_of_birth","defaultMatch":false,"canBeUsedToMatch":true},{"id":"facebook_handle","type":"string","display":true,"removed":false,"required":false,"displayName":"facebook_handle","defaultMatch":false,"canBeUsedToMatch":true},{"id":"linkedin_url","type":"string","display":true,"removed":false,"required":false,"displayName":"linkedin_url","defaultMatch":false,"canBeUsedToMatch":true},{"id":"x_handle","type":"string","display":true,"removed":false,"required":false,"displayName":"x_handle","defaultMatch":false,"canBeUsedToMatch":true},{"id":"instagram_handle","type":"string","display":true,"removed":false,"required":false,"displayName":"instagram_handle","defaultMatch":false,"canBeUsedToMatch":true},{"id":"company_address","type":"string","display":true,"required":false,"displayName":"company_address","defaultMatch":false,"canBeUsedToMatch":true},{"id":"company_city","type":"string","display":true,"required":false,"displayName":"company_city","defaultMatch":false,"canBeUsedToMatch":true},{"id":"company_state","type":"string","display":true,"required":false,"displayName":"company_state","defaultMatch":false,"canBeUsedToMatch":true},{"id":"company_zip","type":"string","display":true,"required":false,"displayName":"company_zip","defaultMatch":false,"canBeUsedToMatch":true},{"id":"company_country","type":"string","display":true,"required":false,"displayName":"company_country","defaultMatch":false,"canBeUsedToMatch":true},{"id":"company_phone","type":"string","display":true,"required":false,"displayName":"company_phone","defaultMatch":false,"canBeUsedToMatch":true},{"id":"company_email","type":"string","display":true,"required":false,"displayName":"company_email","defaultMatch":false,"canBeUsedToMatch":true},{"id":"company_industry","type":"string","display":true,"required":false,"displayName":"company_industry","defaultMatch":false,"canBeUsedToMatch":true},{"id":"company_size","type":"string","display":true,"required":false,"displayName":"company_size","defaultMatch":false,"canBeUsedToMatch":true},{"id":"company_founded_year","type":"string","display":true,"required":false,"displayName":"company_founded_year","defaultMatch":false,"canBeUsedToMatch":true},{"id":"status","type":"string","display":true,"removed":false,"required":false,"displayName":"status","defaultMatch":false,"canBeUsedToMatch":true},{"id":"remarks","type":"string","display":true,"removed":false,"required":false,"displayName":"remarks","defaultMatch":false,"canBeUsedToMatch":true},{"id":"confidence","type":"string","display":true,"removed":false,"required":false,"displayName":"confidence","defaultMatch":false,"canBeUsedToMatch":true}],"mappingMode":"autoMapInputData","matchingColumns":["row_id"],"attemptToConvertTypes":false,"convertFieldsToString":false},"options":{},"operation":"append","sheetName":{"__rl":true,"mode":"list","value":870504645,"cachedResultUrl":"https://docs.google.com/spreadsheets/d/18bkVOsgjONipJNbPe91UiiLgKnSCvsr0b7BDLZUIJh0/edit#gid=870504645","cachedResultName":"sampleATcsv"},"documentId":{"__rl":true,"mode":"list","value":"18bkVOsgjONipJNbPe91UiiLgKnSCvsr0b7BDLZUIJh0","cachedResultUrl":"https://docs.google.com/spreadsheets/d/18bkVOsgjONipJNbPe91UiiLgKnSCvsr0b7BDLZUIJh0/edit?usp=drivesdk","cachedResultName":"Test Database"}},"credentials":{"googleSheetsOAuth2Api":{"id":"TB3Rn9lCQhQ5vKyg","name":"Google Sheets account"}},"typeVersion":4.6},{"id":"9a5a4808-a8d1-4b49-82b5-b33bc48b56f5","name":"Override the record if the confidence score is equal or greater than 85%","type":"n8n-nodes-base.googleSheets","position":[-220,1400],"parameters":{"columns":{"value":{"first_name":"={{ $json.output.first_name }}","row_number":"={{ $('Google Sheets').item.json.row_number }}"},"schema":[{"id":"row_id","type":"string","display":true,"removed":false,"required":false,"displayName":"row_id","defaultMatch":false,"canBeUsedToMatch":true},{"id":"first_name","type":"string","display":true,"required":false,"displayName":"first_name","defaultMatch":false,"canBeUsedToMatch":true},{"id":"last_name","type":"string","display":true,"required":false,"displayName":"last_name","defaultMatch":false,"canBeUsedToMatch":true},{"id":"middle_name","type":"string","display":true,"required":false,"displayName":"middle_name","defaultMatch":false,"canBeUsedToMatch":true},{"id":"address","type":"string","display":true,"required":false,"displayName":"address","defaultMatch":false,"canBeUsedToMatch":true},{"id":"city","type":"string","display":true,"required":false,"displayName":"city","defaultMatch":false,"canBeUsedToMatch":true},{"id":"state","type":"string","display":true,"required":false,"displayName":"state","defaultMatch":false,"canBeUsedToMatch":true},{"id":"zip","type":"string","display":true,"required":false,"displayName":"zip","defaultMatch":false,"canBeUsedToMatch":true},{"id":"country","type":"string","display":true,"required":false,"displayName":"country","defaultMatch":false,"canBeUsedToMatch":true},{"id":"email","type":"string","display":true,"required":false,"displayName":"email","defaultMatch":false,"canBeUsedToMatch":true},{"id":"phone","type":"string","display":true,"required":false,"displayName":"phone","defaultMatch":false,"canBeUsedToMatch":true},{"id":"company","type":"string","display":true,"required":false,"displayName":"company","defaultMatch":false,"canBeUsedToMatch":true},{"id":"job_title","type":"string","display":true,"required":false,"displayName":"job_title","defaultMatch":false,"canBeUsedToMatch":true},{"id":"department","type":"string","display":true,"required":false,"displayName":"department","defaultMatch":false,"canBeUsedToMatch":true},{"id":"date_of_birth","type":"string","display":true,"required":false,"displayName":"date_of_birth","defaultMatch":false,"canBeUsedToMatch":true},{"id":"facebook_handle","type":"string","display":true,"removed":false,"required":false,"displayName":"facebook_handle","defaultMatch":false,"canBeUsedToMatch":true},{"id":"linkedin_url","type":"string","display":true,"removed":false,"required":false,"displayName":"linkedin_url","defaultMatch":false,"canBeUsedToMatch":true},{"id":"x_handle","type":"string","display":true,"removed":false,"required":false,"displayName":"x_handle","defaultMatch":false,"canBeUsedToMatch":true},{"id":"instagram_handle","type":"string","display":true,"removed":false,"required":false,"displayName":"instagram_handle","defaultMatch":false,"canBeUsedToMatch":true},{"id":"company_address","type":"string","display":true,"required":false,"displayName":"company_address","defaultMatch":false,"canBeUsedToMatch":true},{"id":"company_city","type":"string","display":true,"required":false,"displayName":"company_city","defaultMatch":false,"canBeUsedToMatch":true},{"id":"company_state","type":"string","display":true,"required":false,"displayName":"company_state","defaultMatch":false,"canBeUsedToMatch":true},{"id":"company_zip","type":"string","display":true,"required":false,"displayName":"company_zip","defaultMatch":false,"canBeUsedToMatch":true},{"id":"company_country","type":"string","display":true,"required":false,"displayName":"company_country","defaultMatch":false,"canBeUsedToMatch":true},{"id":"company_phone","type":"string","display":true,"required":false,"displayName":"company_phone","defaultMatch":false,"canBeUsedToMatch":true},{"id":"company_email","type":"string","display":true,"required":false,"displayName":"company_email","defaultMatch":false,"canBeUsedToMatch":true},{"id":"company_industry","type":"string","display":true,"required":false,"displayName":"company_industry","defaultMatch":false,"canBeUsedToMatch":true},{"id":"company_size","type":"string","display":true,"required":false,"displayName":"company_size","defaultMatch":false,"canBeUsedToMatch":true},{"id":"company_founded_year","type":"string","display":true,"required":false,"displayName":"company_founded_year","defaultMatch":false,"canBeUsedToMatch":true},{"id":"status","type":"string","display":true,"removed":false,"required":false,"displayName":"status","defaultMatch":false,"canBeUsedToMatch":true},{"id":"remarks","type":"string","display":true,"removed":false,"required":false,"displayName":"remarks","defaultMatch":false,"canBeUsedToMatch":true},{"id":"confidence","type":"string","display":true,"removed":false,"required":false,"displayName":"confidence","defaultMatch":false,"canBeUsedToMatch":true},{"id":"row_number","type":"string","display":true,"removed":false,"readOnly":true,"required":false,"displayName":"row_number","defaultMatch":false,"canBeUsedToMatch":true}],"mappingMode":"autoMapInputData","matchingColumns":["row_id"],"attemptToConvertTypes":false,"convertFieldsToString":false},"options":{},"operation":"update","sheetName":{"__rl":true,"mode":"list","value":870504645,"cachedResultUrl":"https://docs.google.com/spreadsheets/d/18bkVOsgjONipJNbPe91UiiLgKnSCvsr0b7BDLZUIJh0/edit#gid=870504645","cachedResultName":"sampleATcsv"},"documentId":{"__rl":true,"mode":"list","value":"18bkVOsgjONipJNbPe91UiiLgKnSCvsr0b7BDLZUIJh0","cachedResultUrl":"https://docs.google.com/spreadsheets/d/18bkVOsgjONipJNbPe91UiiLgKnSCvsr0b7BDLZUIJh0/edit?usp=drivesdk","cachedResultName":"Test Database"}},"credentials":{"googleSheetsOAuth2Api":{"id":"TB3Rn9lCQhQ5vKyg","name":"Google Sheets account"}},"typeVersion":4.6},{"id":"1eb07d73-aa8f-4cba-a760-5d142eea9734","name":"Sticky Note7","type":"n8n-nodes-base.stickyNote","position":[-400,1260],"parameters":{"color":7,"width":480,"height":360,"content":"## Override the record if the confidence score is equal or greater than 85%"},"typeVersion":1},{"id":"274d8c92-9094-4b26-8d6e-689e38fe9540","name":"Update the status of the record","type":"n8n-nodes-base.googleSheets","position":[-220,1020],"parameters":{"columns":{"value":{"row_id":"={{ $('Process each leads one by one').item.json.row_id }}","status":"no information found"},"schema":[{"id":"row_id","type":"string","display":true,"removed":false,"required":false,"displayName":"row_id","defaultMatch":false,"canBeUsedToMatch":true},{"id":"first_name","type":"string","display":true,"removed":true,"required":false,"displayName":"first_name","defaultMatch":false,"canBeUsedToMatch":true},{"id":"last_name","type":"string","display":true,"removed":true,"required":false,"displayName":"last_name","defaultMatch":false,"canBeUsedToMatch":true},{"id":"middle_name","type":"string","display":true,"removed":true,"required":false,"displayName":"middle_name","defaultMatch":false,"canBeUsedToMatch":true},{"id":"address","type":"string","display":true,"removed":true,"required":false,"displayName":"address","defaultMatch":false,"canBeUsedToMatch":true},{"id":"city","type":"string","display":true,"removed":true,"required":false,"displayName":"city","defaultMatch":false,"canBeUsedToMatch":true},{"id":"state","type":"string","display":true,"removed":true,"required":false,"displayName":"state","defaultMatch":false,"canBeUsedToMatch":true},{"id":"zip","type":"string","display":true,"removed":true,"required":false,"displayName":"zip","defaultMatch":false,"canBeUsedToMatch":true},{"id":"country","type":"string","display":true,"removed":true,"required":false,"displayName":"country","defaultMatch":false,"canBeUsedToMatch":true},{"id":"email","type":"string","display":true,"removed":true,"required":false,"displayName":"email","defaultMatch":false,"canBeUsedToMatch":true},{"id":"phone","type":"string","display":true,"removed":true,"required":false,"displayName":"phone","defaultMatch":false,"canBeUsedToMatch":true},{"id":"company","type":"string","display":true,"removed":true,"required":false,"displayName":"company","defaultMatch":false,"canBeUsedToMatch":true},{"id":"job_title","type":"string","display":true,"removed":true,"required":false,"displayName":"job_title","defaultMatch":false,"canBeUsedToMatch":true},{"id":"department","type":"string","display":true,"removed":true,"required":false,"displayName":"department","defaultMatch":false,"canBeUsedToMatch":true},{"id":"date_of_birth","type":"string","display":true,"removed":true,"required":false,"displayName":"date_of_birth","defaultMatch":false,"canBeUsedToMatch":true},{"id":"facebook_handle","type":"string","display":true,"removed":true,"required":false,"displayName":"facebook_handle","defaultMatch":false,"canBeUsedToMatch":true},{"id":"linkedin_url","type":"string","display":true,"removed":true,"required":false,"displayName":"linkedin_url","defaultMatch":false,"canBeUsedToMatch":true},{"id":"x_handle","type":"string","display":true,"removed":true,"required":false,"displayName":"x_handle","defaultMatch":false,"canBeUsedToMatch":true},{"id":"instagram_handle","type":"string","display":true,"removed":true,"required":false,"displayName":"instagram_handle","defaultMatch":false,"canBeUsedToMatch":true},{"id":"company_address","type":"string","display":true,"removed":true,"required":false,"displayName":"company_address","defaultMatch":false,"canBeUsedToMatch":true},{"id":"company_city","type":"string","display":true,"removed":true,"required":false,"displayName":"company_city","defaultMatch":false,"canBeUsedToMatch":true},{"id":"company_state","type":"string","display":true,"removed":true,"required":false,"displayName":"company_state","defaultMatch":false,"canBeUsedToMatch":true},{"id":"company_zip","type":"string","display":true,"removed":true,"required":false,"displayName":"company_zip","defaultMatch":false,"canBeUsedToMatch":true},{"id":"company_country","type":"string","display":true,"removed":true,"required":false,"displayName":"company_country","defaultMatch":false,"canBeUsedToMatch":true},{"id":"company_phone","type":"string","display":true,"removed":true,"required":false,"displayName":"company_phone","defaultMatch":false,"canBeUsedToMatch":true},{"id":"company_email","type":"string","display":true,"removed":true,"required":false,"displayName":"company_email","defaultMatch":false,"canBeUsedToMatch":true},{"id":"company_industry","type":"string","display":true,"removed":true,"required":false,"displayName":"company_industry","defaultMatch":false,"canBeUsedToMatch":true},{"id":"company_size","type":"string","display":true,"removed":true,"required":false,"displayName":"company_size","defaultMatch":false,"canBeUsedToMatch":true},{"id":"company_founded_year","type":"string","display":true,"removed":true,"required":false,"displayName":"company_founded_year","defaultMatch":false,"canBeUsedToMatch":true},{"id":"status","type":"string","display":true,"removed":false,"required":false,"displayName":"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":["row_id"],"attemptToConvertTypes":false,"convertFieldsToString":false},"options":{},"operation":"update","sheetName":{"__rl":true,"mode":"list","value":870504645,"cachedResultUrl":"https://docs.google.com/spreadsheets/d/18bkVOsgjONipJNbPe91UiiLgKnSCvsr0b7BDLZUIJh0/edit#gid=870504645","cachedResultName":"sampleATcsv"},"documentId":{"__rl":true,"mode":"list","value":"18bkVOsgjONipJNbPe91UiiLgKnSCvsr0b7BDLZUIJh0","cachedResultUrl":"https://docs.google.com/spreadsheets/d/18bkVOsgjONipJNbPe91UiiLgKnSCvsr0b7BDLZUIJh0/edit?usp=drivesdk","cachedResultName":"Test Database"}},"credentials":{"googleSheetsOAuth2Api":{"id":"TB3Rn9lCQhQ5vKyg","name":"Google Sheets account"}},"typeVersion":4.6},{"id":"9958acae-7675-48c2-a400-0ee00267745f","name":"Sticky Note8","type":"n8n-nodes-base.stickyNote","position":[-400,1700],"parameters":{"color":7,"width":480,"height":560,"content":"## Append row if the confidence score is below 85%"},"typeVersion":1},{"id":"ae5d281a-31a3-46a0-b5af-8dcf376d2947","name":"Sticky Note9","type":"n8n-nodes-base.stickyNote","position":[-400,840],"parameters":{"color":7,"width":480,"height":360,"content":"## Scraped data doesn't match the source. This will only update the status of the record."},"typeVersion":1},{"id":"a5aa4f8f-d7ec-4d28-87a2-c774ba627a95","name":"Update row_id and status","type":"n8n-nodes-base.set","position":[-300,2020],"parameters":{"options":{},"assignments":{"assignments":[{"id":"9edb1a8c-d71c-4b13-aa89-6a329a58fd67","name":"row_id","type":"string","value":"={{ $('Process each leads one by one').item.json.row_id }}-{{ $now.toMillis() }}"},{"id":"e95fdab0-79a5-4546-9b6d-0750fd44932c","name":"status","type":"string","value":"human review needed"}]},"includeOtherFields":true},"typeVersion":3.4},{"id":"2eb2c10a-1ab8-408f-9411-13fa356b4664","name":"Update the status of the original record","type":"n8n-nodes-base.googleSheets","position":[-240,1780],"parameters":{"columns":{"value":{"row_id":"={{ $json.row_id }}","status":"human review needed"},"schema":[{"id":"row_id","type":"string","display":true,"removed":false,"required":false,"displayName":"row_id","defaultMatch":false,"canBeUsedToMatch":true},{"id":"first_name","type":"string","display":true,"removed":true,"required":false,"displayName":"first_name","defaultMatch":false,"canBeUsedToMatch":true},{"id":"last_name","type":"string","display":true,"removed":true,"required":false,"displayName":"last_name","defaultMatch":false,"canBeUsedToMatch":true},{"id":"middle_name","type":"string","display":true,"removed":true,"required":false,"displayName":"middle_name","defaultMatch":false,"canBeUsedToMatch":true},{"id":"address","type":"string","display":true,"removed":true,"required":false,"displayName":"address","defaultMatch":false,"canBeUsedToMatch":true},{"id":"city","type":"string","display":true,"removed":true,"required":false,"displayName":"city","defaultMatch":false,"canBeUsedToMatch":true},{"id":"state","type":"string","display":true,"removed":true,"required":false,"displayName":"state","defaultMatch":false,"canBeUsedToMatch":true},{"id":"zip","type":"string","display":true,"removed":true,"required":false,"displayName":"zip","defaultMatch":false,"canBeUsedToMatch":true},{"id":"country","type":"string","display":true,"removed":true,"required":false,"displayName":"country","defaultMatch":false,"canBeUsedToMatch":true},{"id":"email","type":"string","display":true,"removed":true,"required":false,"displayName":"email","defaultMatch":false,"canBeUsedToMatch":true},{"id":"phone","type":"string","display":true,"removed":true,"required":false,"displayName":"phone","defaultMatch":false,"canBeUsedToMatch":true},{"id":"company","type":"string","display":true,"removed":true,"required":false,"displayName":"company","defaultMatch":false,"canBeUsedToMatch":true},{"id":"job_title","type":"string","display":true,"removed":true,"required":false,"displayName":"job_title","defaultMatch":false,"canBeUsedToMatch":true},{"id":"department","type":"string","display":true,"removed":true,"required":false,"displayName":"department","defaultMatch":false,"canBeUsedToMatch":true},{"id":"date_of_birth","type":"string","display":true,"removed":true,"required":false,"displayName":"date_of_birth","defaultMatch":false,"canBeUsedToMatch":true},{"id":"facebook_handle","type":"string","display":true,"removed":true,"required":false,"displayName":"facebook_handle","defaultMatch":false,"canBeUsedToMatch":true},{"id":"linkedin_url","type":"string","display":true,"removed":true,"required":false,"displayName":"linkedin_url","defaultMatch":false,"canBeUsedToMatch":true},{"id":"x_handle","type":"string","display":true,"removed":true,"required":false,"displayName":"x_handle","defaultMatch":false,"canBeUsedToMatch":true},{"id":"instagram_handle","type":"string","display":true,"removed":true,"required":false,"displayName":"instagram_handle","defaultMatch":false,"canBeUsedToMatch":true},{"id":"company_address","type":"string","display":true,"removed":true,"required":false,"displayName":"company_address","defaultMatch":false,"canBeUsedToMatch":true},{"id":"company_city","type":"string","display":true,"removed":true,"required":false,"displayName":"company_city","defaultMatch":false,"canBeUsedToMatch":true},{"id":"company_state","type":"string","display":true,"removed":true,"required":false,"displayName":"company_state","defaultMatch":false,"canBeUsedToMatch":true},{"id":"company_zip","type":"string","display":true,"removed":true,"required":false,"displayName":"company_zip","defaultMatch":false,"canBeUsedToMatch":true},{"id":"company_country","type":"string","display":true,"removed":true,"required":false,"displayName":"company_country","defaultMatch":false,"canBeUsedToMatch":true},{"id":"company_phone","type":"string","display":true,"removed":true,"required":false,"displayName":"company_phone","defaultMatch":false,"canBeUsedToMatch":true},{"id":"company_email","type":"string","display":true,"removed":true,"required":false,"displayName":"company_email","defaultMatch":false,"canBeUsedToMatch":true},{"id":"company_industry","type":"string","display":true,"removed":true,"required":false,"displayName":"company_industry","defaultMatch":false,"canBeUsedToMatch":true},{"id":"company_size","type":"string","display":true,"removed":true,"required":false,"displayName":"company_size","defaultMatch":false,"canBeUsedToMatch":true},{"id":"company_founded_year","type":"string","display":true,"removed":true,"required":false,"displayName":"company_founded_year","defaultMatch":false,"canBeUsedToMatch":true},{"id":"status","type":"string","display":true,"removed":false,"required":false,"displayName":"status","defaultMatch":false,"canBeUsedToMatch":true},{"id":"remarks","type":"string","display":true,"removed":true,"required":false,"displayName":"remarks","defaultMatch":false,"canBeUsedToMatch":true},{"id":"confidence","type":"string","display":true,"removed":true,"required":false,"displayName":"confidence","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":["row_id"],"attemptToConvertTypes":false,"convertFieldsToString":false},"options":{},"operation":"update","sheetName":{"__rl":true,"mode":"list","value":870504645,"cachedResultUrl":"https://docs.google.com/spreadsheets/d/18bkVOsgjONipJNbPe91UiiLgKnSCvsr0b7BDLZUIJh0/edit#gid=870504645","cachedResultName":"sampleATcsv"},"documentId":{"__rl":true,"mode":"list","value":"18bkVOsgjONipJNbPe91UiiLgKnSCvsr0b7BDLZUIJh0","cachedResultUrl":"https://docs.google.com/spreadsheets/d/18bkVOsgjONipJNbPe91UiiLgKnSCvsr0b7BDLZUIJh0/edit?usp=drivesdk","cachedResultName":"Test Database"}},"credentials":{"googleSheetsOAuth2Api":{"id":"TB3Rn9lCQhQ5vKyg","name":"Google Sheets account"}},"typeVersion":4.6},{"id":"e2cb5ff7-3d0d-4766-bda2-2ea5d1b8cf54","name":"Split Out","type":"n8n-nodes-base.splitOut","position":[-5960,780],"parameters":{"options":{},"fieldToSplitOut":"body"},"typeVersion":1},{"id":"da05a953-9e66-49b5-8c62-5cd48f439772","name":"Google Sheets","type":"n8n-nodes-base.googleSheets","position":[-5420,900],"parameters":{"columns":{"value":{"email":"={{ $json.properties.email.value }}","phone":"={{ $json.properties.phone.value }}","row_id":"={{ $json.vid }}","last_name":"={{ $json.properties.lastname.value }}","first_name":"={{ $json.properties.firstname.value }}"},"schema":[{"id":"row_id","type":"string","display":true,"required":false,"displayName":"row_id","defaultMatch":false,"canBeUsedToMatch":true},{"id":"first_name","type":"string","display":true,"required":false,"displayName":"first_name","defaultMatch":false,"canBeUsedToMatch":true},{"id":"last_name","type":"string","display":true,"required":false,"displayName":"last_name","defaultMatch":false,"canBeUsedToMatch":true},{"id":"middle_name","type":"string","display":true,"removed":true,"required":false,"displayName":"middle_name","defaultMatch":false,"canBeUsedToMatch":true},{"id":"address","type":"string","display":true,"removed":true,"required":false,"displayName":"address","defaultMatch":false,"canBeUsedToMatch":true},{"id":"city","type":"string","display":true,"removed":true,"required":false,"displayName":"city","defaultMatch":false,"canBeUsedToMatch":true},{"id":"state","type":"string","display":true,"removed":true,"required":false,"displayName":"state","defaultMatch":false,"canBeUsedToMatch":true},{"id":"zip","type":"string","display":true,"removed":true,"required":false,"displayName":"zip","defaultMatch":false,"canBeUsedToMatch":true},{"id":"country","type":"string","display":true,"removed":true,"required":false,"displayName":"country","defaultMatch":false,"canBeUsedToMatch":true},{"id":"email","type":"string","display":true,"required":false,"displayName":"email","defaultMatch":false,"canBeUsedToMatch":true},{"id":"phone","type":"string","display":true,"removed":false,"required":false,"displayName":"phone","defaultMatch":false,"canBeUsedToMatch":true},{"id":"company","type":"string","display":true,"removed":true,"required":false,"displayName":"company","defaultMatch":false,"canBeUsedToMatch":true},{"id":"job_title","type":"string","display":true,"removed":true,"required":false,"displayName":"job_title","defaultMatch":false,"canBeUsedToMatch":true},{"id":"department","type":"string","display":true,"removed":true,"required":false,"displayName":"department","defaultMatch":false,"canBeUsedToMatch":true},{"id":"date_of_birth","type":"string","display":true,"removed":true,"required":false,"displayName":"date_of_birth","defaultMatch":false,"canBeUsedToMatch":true},{"id":"facebook_handle","type":"string","display":true,"removed":true,"required":false,"displayName":"facebook_handle","defaultMatch":false,"canBeUsedToMatch":true},{"id":"linkedin_url","type":"string","display":true,"removed":true,"required":false,"displayName":"linkedin_url","defaultMatch":false,"canBeUsedToMatch":true},{"id":"x_handle","type":"string","display":true,"removed":true,"required":false,"displayName":"x_handle","defaultMatch":false,"canBeUsedToMatch":true},{"id":"instagram_handle","type":"string","display":true,"removed":true,"required":false,"displayName":"instagram_handle","defaultMatch":false,"canBeUsedToMatch":true},{"id":"company_address","type":"string","display":true,"removed":true,"required":false,"displayName":"company_address","defaultMatch":false,"canBeUsedToMatch":true},{"id":"company_city","type":"string","display":true,"removed":true,"required":false,"displayName":"company_city","defaultMatch":false,"canBeUsedToMatch":true},{"id":"company_state","type":"string","display":true,"removed":true,"required":false,"displayName":"company_state","defaultMatch":false,"canBeUsedToMatch":true},{"id":"company_zip","type":"string","display":true,"removed":true,"required":false,"displayName":"company_zip","defaultMatch":false,"canBeUsedToMatch":true},{"id":"company_country","type":"string","display":true,"removed":true,"required":false,"displayName":"company_country","defaultMatch":false,"canBeUsedToMatch":true},{"id":"company_phone","type":"string","display":true,"removed":true,"required":false,"displayName":"company_phone","defaultMatch":false,"canBeUsedToMatch":true},{"id":"company_email","type":"string","display":true,"removed":true,"required":false,"displayName":"company_email","defaultMatch":false,"canBeUsedToMatch":true},{"id":"company_industry","type":"string","display":true,"removed":true,"required":false,"displayName":"company_industry","defaultMatch":false,"canBeUsedToMatch":true},{"id":"company_size","type":"string","display":true,"removed":true,"required":false,"displayName":"company_size","defaultMatch":false,"canBeUsedToMatch":true},{"id":"company_founded_year","type":"string","display":true,"removed":true,"required":false,"displayName":"company_founded_year","defaultMatch":false,"canBeUsedToMatch":true},{"id":"status","type":"string","display":true,"removed":true,"required":false,"displayName":"status","defaultMatch":false,"canBeUsedToMatch":true},{"id":"remarks","type":"string","display":true,"removed":true,"required":false,"displayName":"remarks","defaultMatch":false,"canBeUsedToMatch":true},{"id":"confidence","type":"string","display":true,"removed":true,"required":false,"displayName":"confidence","defaultMatch":false,"canBeUsedToMatch":true}],"mappingMode":"defineBelow","matchingColumns":[],"attemptToConvertTypes":false,"convertFieldsToString":false},"options":{},"operation":"append","sheetName":{"__rl":true,"mode":"list","value":870504645,"cachedResultUrl":"https://docs.google.com/spreadsheets/d/18bkVOsgjONipJNbPe91UiiLgKnSCvsr0b7BDLZUIJh0/edit#gid=870504645","cachedResultName":"sampleATcsv"},"documentId":{"__rl":true,"mode":"list","value":"18bkVOsgjONipJNbPe91UiiLgKnSCvsr0b7BDLZUIJh0","cachedResultUrl":"https://docs.google.com/spreadsheets/d/18bkVOsgjONipJNbPe91UiiLgKnSCvsr0b7BDLZUIJh0/edit?usp=drivesdk","cachedResultName":"Test Database"}},"credentials":{"googleSheetsOAuth2Api":{"id":"TB3Rn9lCQhQ5vKyg","name":"Google Sheets account"}},"typeVersion":4.6},{"id":"48243a45-396f-4610-b97f-808ca39e90a6","name":"HubSpot","type":"n8n-nodes-base.hubspot","position":[-5680,900],"parameters":{"contactId":{"__rl":true,"mode":"id","value":"={{ $json.contactId || $json.objectId }}"},"operation":"get","authentication":"appToken","additionalFields":{}},"credentials":{"hubspotAppToken":{"id":"udy2ya160kahX72n","name":"HubSpot App Token account 2"}},"typeVersion":2.1},{"id":"1088136d-5530-47f2-b08f-3c91c28bd383","name":"Google Sheets1","type":"n8n-nodes-base.googleSheets","position":[-6280,1620],"parameters":{"options":{},"filtersUI":{"values":[{"lookupColumn":"status"},{"lookupValue":"needs more enrichment","lookupColumn":"status"}]},"sheetName":{"__rl":true,"mode":"list","value":870504645,"cachedResultUrl":"https://docs.google.com/spreadsheets/d/18bkVOsgjONipJNbPe91UiiLgKnSCvsr0b7BDLZUIJh0/edit#gid=870504645","cachedResultName":"sampleATcsv"},"documentId":{"__rl":true,"mode":"list","value":"18bkVOsgjONipJNbPe91UiiLgKnSCvsr0b7BDLZUIJh0","cachedResultUrl":"https://docs.google.com/spreadsheets/d/18bkVOsgjONipJNbPe91UiiLgKnSCvsr0b7BDLZUIJh0/edit?usp=drivesdk","cachedResultName":"Test Database"},"combineFilters":"OR"},"credentials":{"googleSheetsOAuth2Api":{"id":"TB3Rn9lCQhQ5vKyg","name":"Google Sheets account"}},"typeVersion":4.6},{"id":"16a4e5d7-3d4f-4aa4-b802-5bc61c6767b6","name":"When clicking ‘Execute workflow’","type":"n8n-nodes-base.manualTrigger","position":[-6520,1620],"parameters":{},"typeVersion":1},{"id":"2cf15cf0-be32-41d8-82f6-78a142e32b4a","name":"Sticky Note11","type":"n8n-nodes-base.stickyNote","position":[-6500,540],"parameters":{"color":3,"width":1380,"height":720,"content":"# New Contact trigger in Hubspot and Save it to Google Drive"},"typeVersion":1},{"id":"6a2d33a9-c2f9-412e-a70c-8a64b7da252b","name":"New Contact in Hubpost (OAuth2)","type":"n8n-nodes-base.hubspotTrigger","position":[-6340,1020],"webhookId":"dab75ae0-affc-4616-bad6-2e88d1afabc7","parameters":{"eventsUi":{"eventValues":[{}]},"additionalFields":{}},"credentials":{"hubspotDeveloperApi":{"id":"HjFlmcRCWYRjI6nD","name":"New HS Dev"}},"typeVersion":1},{"id":"fd273f08-9d98-4539-bad1-96a1ea6c0fc5","name":"New Contact in Hubpost (Private App)","type":"n8n-nodes-base.webhook","position":[-6320,680],"webhookId":"40d4eddf-4f9f-471f-a029-4a95f5f045b9","parameters":{"path":"hsleads","options":{},"httpMethod":"POST"},"typeVersion":2},{"id":"d348c77a-7782-45c5-9d6d-d7464ff876c6","name":"No Operation, do nothing","type":"n8n-nodes-base.noOp","position":[300,1560],"parameters":{},"typeVersion":1},{"id":"6a1149d6-186f-49ce-a8b3-3a97b83b10a7","name":"Sticky Note10","type":"n8n-nodes-base.stickyNote","position":[440,1840],"parameters":{"color":3,"width":680,"height":500,"content":"# Update the Hubspot contact for the high confidence score"},"typeVersion":1},{"id":"2c3f4e27-a1ee-4a0a-8fb8-180b5de97ae6","name":"Update the Hubspot Contact","type":"n8n-nodes-base.hubspot","position":[880,2080],"parameters":{"email":"={{ $json.email }}","options":{},"authentication":"appToken","additionalFields":{"city":"={{ $json.city }}","degree":"={{ $json.degree }}","gender":"={{ $json.gender }}","school":"={{ $json.school }}","country":"={{ $json.country }}","industry":"={{ $json.company_industry }}","jobTitle":"={{ $json.job_title }}","lastName":"={{ $json.last_name }}","firstName":"={{ $json.first_name }}","postalCode":"={{ $json.zip }}","salutation":"={{ $json.salutation }}","companyName":"={{ $json.company }}","dateOfBirth":"={{ $json.date_of_birth?.toDateTime() }}","jobFunction":"={{ $json.job_function }}","phoneNumber":"={{ $json.phone }}","fieldOfStudy":"={{ $json.field_of_study }}","maritalStatus":"={{ $json.marital_status }}","streetAddress":"={{ $json.address }}","graduationDate":"={{ $json.graduation_date?.toDateTime() }}","twitterUsername":"={{ $json.x_handle }}","customPropertiesUi":{"customPropertiesValues":[{"value":"={{ $json.instagram_handle }}","property":"=instagram_handle"},{"value":"={{ $json.facebook_handle }}","property":"=facebook_handle"},{"value":"={{ $json.linkedin_url }}","property":"=linkedin_url"}]}}},"credentials":{"hubspotAppToken":{"id":"udy2ya160kahX72n","name":"HubSpot App Token account 2"}},"typeVersion":2.1},{"id":"fdadcb0e-f66e-4755-8939-ab28d51301eb","name":"Set Desired Confidence Score","type":"n8n-nodes-base.if","position":[580,2100],"parameters":{"options":{},"conditions":{"options":{"version":2,"leftValue":"","caseSensitive":true,"typeValidation":"strict"},"combinator":"and","conditions":[{"id":"8f546fac-c14d-40f8-9fd0-7c431e1ae7f8","operator":{"type":"number","operation":"gt"},"leftValue":"={{ $json.confidence }}","rightValue":0.89}]}},"typeVersion":2.2}],"connections":{"If":{"main":[[{"node":"Merge","type":"main","index":0}],[{"node":"Not matched route","type":"main","index":0}]]},"If1":{"main":[[{"node":"Merge","type":"main","index":0}],[{"node":"Not matched route","type":"main","index":0}]]},"If2":{"main":[[{"node":"Merge","type":"main","index":0}],[{"node":"Not matched route","type":"main","index":0}]]},"Merge":{"main":[[{"node":"Merge1","type":"main","index":1},{"node":"Judge the accuracy of scraped data","type":"main","index":0}]]},"Merge1":{"main":[[{"node":"Prepare the scraped output for Google Sheets","type":"main","index":0}]]},"Switch":{"main":[[{"node":"If2","type":"main","index":0}],[{"node":"If1","type":"main","index":0}],[{"node":"If","type":"main","index":0}]]},"HubSpot":{"main":[[{"node":"Google Sheets","type":"main","index":0}]]},"Split Out":{"main":[[{"node":"HubSpot","type":"main","index":0}]]},"Google Sheets":{"main":[[{"node":"Process each leads one by one","type":"main","index":0}]]},"Google Sheets1":{"main":[[{"node":"Process each leads one by one","type":"main","index":0}]]},"Scraper AI Agent":{"main":[[{"node":"Switch","type":"main","index":0},{"node":"Merge","type":"main","index":1}]]},"Not matched route":{"main":[[{"node":"Update the status of the record","type":"main","index":0}]]},"OpenAI Chat Model":{"ai_languageModel":[[{"node":"Scraper AI Agent","type":"ai_languageModel","index":0}]]},"OpenAI Chat Model1":{"ai_languageModel":[[{"node":"Auto-fixing Output Parser","type":"ai_languageModel","index":0}]]},"Google Sheets Trigger":{"main":[[{"node":"Filter the leads that needs enrichment","type":"main","index":0}]]},"Bright Data MCP Client":{"ai_tool":[[{"node":"Scraper AI Agent","type":"ai_tool","index":0}]]},"No Operation, do nothing":{"main":[[{"node":"Set Desired Confidence Score","type":"main","index":0}]]},"Structured Output Parser":{"ai_outputParser":[[{"node":"Auto-fixing Output Parser","type":"ai_outputParser","index":0}]]},"Update row_id and status":{"main":[[{"node":"Add record if the confidence score is below 85%","type":"main","index":0}]]},"Auto-fixing Output Parser":{"ai_outputParser":[[{"node":"Scraper AI Agent","type":"ai_outputParser","index":0}]]},"Check the confidence score":{"main":[[{"node":"Override the record if the confidence score is equal or greater than 85%","type":"main","index":0},{"node":"No Operation, do nothing","type":"main","index":0}],[{"node":"Update row_id and status","type":"main","index":0},{"node":"Update the status of the original record","type":"main","index":0}]]},"Extract the AI results only":{"main":[[{"node":"Merge1","type":"main","index":0}]]},"Space requests by 5 seconds":{"main":[[{"node":"Just to make the connection neat","type":"main","index":0}]]},"Set Desired Confidence Score":{"main":[[{"node":"Update the Hubspot Contact","type":"main","index":0}]]},"Process each leads one by one":{"main":[[],[{"node":"Remove unneccessary fields for the prompt","type":"main","index":0}]]},"New Contact in Hubpost (OAuth2)":{"main":[[{"node":"HubSpot","type":"main","index":0}]]},"Update the status of the record":{"main":[[{"node":"Space requests by 5 seconds","type":"main","index":0}]]},"Just to make the connection neat":{"main":[[{"node":"Process each leads one by one","type":"main","index":0}]]},"Judge the accuracy of scraped data":{"main":[[{"node":"Extract the AI results only","type":"main","index":0}]]},"Add confidence score to Google Sheet":{"main":[[{"node":"Check the confidence score","type":"main","index":0}]]},"New Contact in Hubpost (Private App)":{"main":[[{"node":"Split Out","type":"main","index":0}]]},"When clicking ‘Execute workflow’":{"main":[[{"node":"Google Sheets1","type":"main","index":0}]]},"Filter the leads that needs enrichment":{"main":[[{"node":"Process each leads one by one","type":"main","index":0}]]},"Remove unneccessary fields for the prompt":{"main":[[{"node":"Scraper AI Agent","type":"main","index":0}]]},"Prepare the scraped output for Google Sheets":{"main":[[{"node":"Add confidence score to Google Sheet","type":"main","index":0}]]},"Add record if the confidence score is below 85%":{"main":[[{"node":"Space requests by 5 seconds","type":"main","index":0}]]},"Override the record if the confidence score is equal or greater than 85%":{"main":[[{"node":"Space requests by 5 seconds","type":"main","index":0}]]}}}


name: QR Code Generator via Webhook
author_name: ist00dent
author_username: ist00dent
nodes_used: ["n8n-nodes-base.httpRequest"]
categories: []
created_at: 2025-06-02T14:37:16.047Z
updated_at: 2025-06-02T14:37:16.047Z
url: https://n8n.io/workflows/4596
scraped_at: 2025-07-06 21:16:30
description:
  This n8n template allows you to instantly generate QR codes from any text or URL by simply sending a webhook request. It's a versatile tool for creating dynamic QR codes for various purposes, from marketing campaigns to event registrations, directly integrated into your automated workflows.

  🔧 How it works
  Receive Data Webhook: This node acts as the entry point for the workflow. It listens for incoming POST requests and expects a JSON body with a data property containing the text or URL you want to encode into the QR code.
  Generate QR Code: This node makes an HTTP GET request to the QR Server API (api.qrserver.com) to generate the QR code image. The content from your webhook is passed as the data parameter to the API.
  Respond with QR Code: This node sends the response from the QR Server API back to the service that initiated the webhook. The QR Server API directly returns the image data, so your webhook response will be the QR code image itself.

  👤 Who is it for?
  This workflow is ideal for:

  Marketers: Generate QR codes for product links, event registrations, or promotional materials on the fly.
  Developers: Integrate QR code generation into applications, websites, or internal tools.
  Event Organizers: Create dynamic QR codes for ticketing, information access, or check-ins.
  Businesses: Streamline processes requiring physical-to-digital transitions, like menu access or contact sharing.
  Automation Enthusiasts: Add QR code generation capabilities to any workflow.

  📑 Data Structure
  When you trigger the webhook, send a POST request with a JSON body structured as follows:

  {
    "data": "https://www.yourwebsite.com/your-specific-page-or-text-to-encode"
  }

  The workflow will return the QR code image directly in the response.

  ⚙️ Setup Instructions
  Import Workflow: In your n8n editor, click "Import from JSON" and paste the provided workflow JSON.
  Configure Webhook Path:
    Double-click the Receive Data Webhook node.
    In the 'Path' field, set a unique and descriptive path (e.g., /generate-qr).
  Customize QR Code (Optional):
    Double-click the Generate QR Code node.
    You can adjust the size parameter in the URL (e.g., size=200x200 for a larger QR code) or add other parameters supported by the QR Server API (e.g., bgcolor, color, qzone).
  Activate Workflow: Save and activate the workflow.

  📝 Tips
  Handling the Image Output: Since the QR Server API directly returns the image, the webhook response will be the image data. Depending on your use case, you might want to:
    Save to File/Cloud: Insert a node (e.g., Write Binary File, Amazon S3, Google Drive) after Generate QR Code to save the image to a file system or cloud storage.
    Embed in HTML/Email: If you're building an HTML response or sending an email, you might need to convert the image data to a Base64 string or provide a URL to a saved image.
  Error Handling: Enhance workflow robustness by adding an Error Trigger node. This allows you to catch any issues during QR code generation and set up notifications or logging.
  Dynamic Size/Color: You can extend the Receive Data Webhook to accept parameters for size, color, or bgcolor in the incoming JSON. Then, dynamically pass these to the url of the Generate QR Code node to create highly customizable QR codes.
  Input Validation: For more advanced use cases, you could add a Function node after the webhook to validate the incoming data to ensure it's in a valid format (e.g., a URL).

workflow_json:
  {"id":"2Ttwb1pfwNkhBDuB","meta":{"instanceId":"1777696fb9fddfee653e70940936c2b1e28ba1f1bde53b7182fbd6eb01988706"},"name":"QR Code Generator via Webhook","tags":[],"nodes":[{"id":"1a6f0b70-47f1-4a13-9d06-569574438a07","name":"Note for Webhook Trigger","type":"n8n-nodes-base.stickyNote","position":[200,-40],"parameters":{"height":320,"content":"This node listens for incoming POST requests. It expects a JSON body with a 'data' property (or 'sampleData' as currently configured) which will be encoded into the QR code. You can easily adjust the webhook path."},"typeVersion":1},{"id":"b66d7f5a-cf82-43bd-902c-3e9a74fc4e3e","name":"Note for QR Code Generation","type":"n8n-nodes-base.stickyNote","position":[500,-40],"parameters":{"color":2,"width":280,"height":320,"content":"This node makes an HTTP GET request to the QR Server API to generate the QR code image. The 'data' parameter in the URL is populated from the incoming webhook. The 'size' parameter can be adjusted here."},"typeVersion":1},{"id":"e55153df-3269-46d5-8c01-289eb72415ae","name":"Note for Webhook Response","type":"n8n-nodes-base.stickyNote","position":[840,-60],"parameters":{"color":3,"width":300,"height":340,"content":"This node sends the response from the QR Server API (which is typically the QR code image data itself, or a URL to it if you change the API call) back to the original caller of the webhook. You can insert other nodes before this to save the image, send it via email, etc."},"typeVersion":1},{"id":"c9a692b7-62bd-40e2-8c92-0dbbc37f3e12","name":"Generate QR Code","type":"n8n-nodes-base.httpRequest","position":[580,140],"parameters":{"url":"=https://api.qrserver.com/v1/create-qr-code/?size=150x150&data={{ $json.body.data }}","method":"=GET","options":{}},"typeVersion":4.2},{"id":"cb065a0f-562a-432f-9ed4-c942fdd6a808","name":"Receive Data Webhook","type":"n8n-nodes-base.webhook","position":[260,140],"webhookId":"6960391c-83cf-49b3-aa8d-761cd8263d76-unique-id","parameters":{"path":"generate-qr","options":{},"httpMethod":"POST","responseMode":"responseNode"},"typeVersion":2},{"id":"acd3ea0f-7694-4875-994c-3b365c10fc28","name":"Respond with QR Code","type":"n8n-nodes-base.respondToWebhook","position":[920,140],"parameters":{"options":{},"respondWith":"allIncomingItems"},"typeVersion":1.2}],"active":false,"settings":{"executionOrder":"v1"},"versionId":"23aac7b6-e36d-4074-b81d-dbdcb8204451","connections":{"Generate QR Code":{"main":[[{"node":"Respond with QR Code","type":"main","index":0}]]},"Receive Data Webhook":{"main":[[{"node":"Generate QR Code","type":"main","index":0}]]}}}


name: 🤖 AI content generation for Auto Service 🚘 Automate your social media📲!
author_name: N8ner
author_username: n8ner
categories: []
created_at: 2025-06-02T15:08:52.136Z
updated_at: 2025-06-02T15:08:52.136Z
url: https://n8n.io/workflows/4600
scraped_at: 2025-07-06 21:16:30
description:
  Who Is This For?

  🚘This workflow is designed for auto service / car repair businesses looking to streamline their social media marketing with Ai tools and automation via n8n. 
  Whether you’re a small garage owner, a car repair shop, an automotive specialist or automechanic - this tool helps you maintain an active online presence without spending hours creating content.

  💪🏼 Though this template is set up for Auto Service daily content uploads, but the underlying logic is universal. You can easily adapt it for any niche by editing prompts, adding nodes, and creating or uploading a variety of content to any platform. You can use any LLM and generative AI of your choice. Personally, I prefer the smooth and effective results from ChatGPT 4.1 combined with GPT Image 1. But you can generate videos instead of images for your posts as well 😉

  What Problem Is This Workflow Solving?

  🤦‍♂️ Many auto service businesses struggle with consistently posting engaging content due to time constraints or lack of marketing expertise. 
  💎This workflow solves that by automating the content creation and posting process, ensuring your social media channels stay fresh and active, ultimately attracting more customers.

  What This Workflow Does:

  Generates daily social media posts tailored specifically to the auto service niche using AI.
  Allows easy customization of post and image prompts.
  Integrates research links through the Tavily Internet Search tool for relevant content.
  Supports starting posts based on reference article links via Google Sheets.
  Automatically publishes posts to your connected social media platforms.
  Enables scheduled or trigger-based posting for maximum flexibility.

  How It Works?

  Easy, actually ☺️ 

  AI creates daily social media content made just for Auto Service. You can simply edit prompts for both posts and images, set up news or articles research links via the Tavily Internet Search tool. You can also start the workflow with a reference article link through Google Sheets.

  🎯 Consistently posting relevant and actual niche content helps attract new customers, all while leveraging AI and n8n tools to keep the process seamless and cost-effective. 

  Set Up Steps:

  I kept it quick and simple for you ✨

  If you’re happy with the current LLM and image model configurations, just connect your OpenAI API credentials to enable AI content generation.
  Link your social media accounts (Facebook, Telegram, X, etc.) for autoposting.
  Optionally connect Google Sheets if you want to trigger posts based on sheet updates with reference links.
  Customize prompts as needed to match your brand voice, style and marketing tasks.
  Choose between:
  1) Scheduled automatic generation and posting at the same time as socials algorythms like it.
  2) Google Sheets trigger with reference.
  3) Manual start.

  How to Customize This Workflow to Your Needs?
  Switch AI models and edit prompts to better reflect your specific services or promotions.
  Add or modify research links in Tavily to keep your posts timely and relevant.
  Adjust posting schedules to match peak engagement times for your audience.
  Expand or reduce the number of social platforms integrated depending on your marketing strategy.
  Use Google Sheets to batch upload ideas or curate specific content topics.


  After adjusting a few settings, activate the workflow and let it run. 

  🤖 The system will then automatically publish your content across your selected social platforms — saving you time and effort. 



  📌 You’ll find more detailed tips and additional ai models for customizing ai generation process inside the workflow via sticky notes.

  💬 Need help? For additional guidance, feel free to message me — here’s my profile in the n8n community for direct contact  👈 click!

nodes_used:
  ["n8n-nodes-base.httpRequest","n8n-nodes-base.telegram","n8n-nodes-base.facebookGraphApi","n8n-nodes-base.twitter","n8n-nodes-base.linkedIn","n8n-nodes-base.apiTemplateIo","@n8n/n8n-nodes-langchain.agent","@n8n/n8n-nodes-langchain.lmChatAnthropic","@n8n/n8n-nodes-langchain.lmChatOllama","@n8n/n8n-nodes-langchain.lmChatOpenAi","@n8n/n8n-nodes-langchain.lmOpenHuggingFaceInference","@n8n/n8n-nodes-langchain.lmChatMistralCloud","@n8n/n8n-nodes-langchain.openAi","@n8n/n8n-nodes-langchain.lmChatAzureOpenAi","@n8n/n8n-nodes-langchain.lmChatGoogleGemini","@n8n/n8n-nodes-langchain.lmChatDeepSeek","@n8n/n8n-nodes-langchain.lmChatOpenRouter","@n8n/n8n-nodes-langchain.lmChatXAiGrok"]

workflow_json:
  {"id":"JdFtT41G2iqwGt1e","meta":{"instanceId":"c778ccc6e6bdd79c80ccc835bc5d5a950bf07bb2941c80ee5afaeb18d9e2e8ef","templateCredsSetupCompleted":true},"name":"🤖 AI content generation for Auto Service 🚘 Automate your social media📲!","tags":[],"nodes":[{"id":"e4a3ceac-acaa-434c-aefc-19e4fed34ea6","name":"Sticky Note","type":"n8n-nodes-base.stickyNote","position":[340,-1340],"parameters":{"color":5,"width":5760,"height":2920,"content":"![Source example](https://i.ibb.co/PZF4szJr/photo-2025-05-30-13-24-04.jpg#full-width)"},"typeVersion":1},{"id":"d806bec6-ee52-4e7e-9b10-41b2dd16b1ba","name":"Sticky Note2","type":"n8n-nodes-base.stickyNote","position":[340,-500],"parameters":{"color":5,"width":1260,"height":1260,"content":"# [made with ❤️ by N8ner 👈 click! Feel free to message me!](https://community.n8n.io/u/n8ner/badges) ![](https://i.ibb.co/2YyTWq2v/circuit.jpg#full-width#full-width)"},"typeVersion":1},{"id":"6e8ee9ec-fe55-48d8-afab-b5d2a677cedb","name":"Telegram","type":"n8n-nodes-base.telegram","position":[4180,-320],"webhookId":"f33ade31-7243-4d8f-a7e9-fc450ebf7eb5","parameters":{"chatId":"7564233298","operation":"sendPhoto","binaryData":true,"additionalFields":{"caption":"={{ $('GENERATE TEXT').item.json.output }}"},"binaryPropertyName":"={{'data'}}"},"credentials":{"telegramApi":{"id":"5EqQR7c8hHg7JUam","name":"Telegram account"}},"typeVersion":1.2,"alwaysOutputData":false},{"id":"72b10789-5887-49b3-bbc3-06c220bc8150","name":"Schedule Trigger","type":"n8n-nodes-base.scheduleTrigger","position":[1800,-220],"parameters":{"rule":{"interval":[{"triggerAtHour":9}]}},"typeVersion":1.2},{"id":"64bd78e2-2a1b-4ea8-bf92-e6c113acd229","name":"When clicking Execute workflow","type":"n8n-nodes-base.manualTrigger","position":[1800,60],"parameters":{},"typeVersion":1},{"id":"cb7597f8-fdb9-48de-994a-da6b684421c7","name":"Google Sheets Trigger","type":"n8n-nodes-base.googleSheetsTrigger","position":[1800,380],"parameters":{"event":"=rowAdded","options":{"valueRender":"UNFORMATTED_VALUE","columnsToWatch":["Links for articles to refer"],"dataLocationOnSheet":{"values":{"range":"A2:A10","rangeDefinition":"specifyRangeA1"}}},"pollTimes":{"item":[{"mode":"everyX","unit":"minutes","value":1}]},"sheetName":{"__rl":true,"mode":"list","value":"gid=0","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1Y26GgkSEimhjFhNyArFEvHTonv6JaqMWVU9jxnV-y-c/edit#gid=0","cachedResultName":"Sheet1"},"documentId":{"__rl":true,"mode":"id","value":"1Y26GgkSEimhjFhNyArFEvHTonv6JaqMWVU9jxnV-y-c"}},"credentials":{"googleSheetsTriggerOAuth2Api":{"id":"SaouUrFEnn4hWJcQ","name":"Google Sheets Trigger account"}},"notesInFlow":false,"typeVersion":1},{"id":"157ac7c9-54df-4dc0-aa89-1b63b17f3148","name":"Split Out","type":"n8n-nodes-base.splitOut","position":[3640,-140],"parameters":{"options":{},"fieldToSplitOut":"choices[0].message.content"},"typeVersion":1},{"id":"bcd7bc00-fb79-4709-8a97-0a43bc274f4c","name":"Sticky Note3","type":"n8n-nodes-base.stickyNote","position":[3960,-520],"parameters":{"color":7,"width":520,"height":1300,"content":"# Finish - Upload to Platforms![Guide](https://i.ibb.co/d41JsL8q/Screenshot-2025-05-30-122423-1.jpg#full-width#full-width)"},"typeVersion":1},{"id":"2f7884d1-7da0-492b-8503-9a4de0911773","name":"Sticky Note4","type":"n8n-nodes-base.stickyNote","position":[4120,420],"parameters":{"color":7,"width":210,"height":200,"content":""},"typeVersion":1},{"id":"f7181d0c-1bf4-4031-86dd-95761940de68","name":"Sticky Note9","type":"n8n-nodes-base.stickyNote","position":[4120,160],"parameters":{"color":7,"width":210,"height":200,"content":""},"typeVersion":1},{"id":"d1e3f2e4-8f4e-40aa-b512-b7e7d2667f1e","name":"Sticky Note5","type":"n8n-nodes-base.stickyNote","position":[4120,-100],"parameters":{"color":7,"width":210,"height":200,"content":""},"typeVersion":1},{"id":"64b6a403-4913-4d1b-8b61-581dec0223a7","name":"Sticky Note7","type":"n8n-nodes-base.stickyNote","position":[4120,-360],"parameters":{"color":7,"width":210,"height":200,"content":""},"typeVersion":1},{"id":"a48fa4e0-3781-426f-9f48-1fec77acba68","name":"Sticky Note8","type":"n8n-nodes-base.stickyNote","position":[1600,-500],"parameters":{"color":7,"width":500,"height":1260,"content":"# START - Choose a Trigger![Guide](https://i.ibb.co/d41JsL8q/Screenshot-2025-05-30-122423-1.jpg#full-width#full-width)"},"typeVersion":1},{"id":"33dc129d-2784-4fb9-a027-589aa443d37b","name":"Sticky Note10","type":"n8n-nodes-base.stickyNote","position":[1740,320],"parameters":{"color":4,"height":220,"content":""},"typeVersion":1},{"id":"e1666561-2404-460e-b37e-0ebfd15b6261","name":"Sticky Note11","type":"n8n-nodes-base.stickyNote","position":[1740,20],"parameters":{"color":4,"height":220,"content":""},"typeVersion":1},{"id":"d34574fe-5791-4508-b847-e20eda64cd66","name":"Sticky Note12","type":"n8n-nodes-base.stickyNote","position":[1740,-280],"parameters":{"color":4,"height":220,"content":""},"typeVersion":1},{"id":"ac1bb708-89fb-496e-8291-e86d509ff2f8","name":"Sticky Note13","type":"n8n-nodes-base.stickyNote","position":[2160,-360],"parameters":{"color":7,"width":760,"height":460,"content":"### Edit prompt and system message up for you, customize llm and search links, add your own prompts database ![](https://i.ibb.co/TxQrh405/erasebg-transformed-removebg-preview.png#full-width)"},"typeVersion":1},{"id":"1c2803d0-8ea1-48c1-b3df-6e9a5156be07","name":"Sticky Note14","type":"n8n-nodes-base.stickyNote","position":[2520,300],"parameters":{"color":7,"width":760,"height":420,"content":"### Edit prompt and system message up for you, customize llm and add own prompts database ![](https://i.ibb.co/TxQrh405/erasebg-transformed-removebg-preview.png#full-width)"},"typeVersion":1},{"id":"b40ab1d2-e7d4-4dce-8200-41ecb761eb9b","name":"Sticky Note15","type":"n8n-nodes-base.stickyNote","position":[3120,-300],"parameters":{"color":7,"width":760,"height":380,"content":"### Set up Ai model for generating images, customize prompt up for you ![](https://i.ibb.co/TxQrh405/erasebg-transformed-removebg-preview.png#full-width)"},"typeVersion":1},{"id":"4aeadd2d-a393-414d-a584-344934f89586","name":"Sticky Note1","type":"n8n-nodes-base.stickyNote","position":[4480,-520],"parameters":{"color":5,"width":1620,"height":1300,"content":"# The template is set up for Auto Service daily content uploads, but the underlying logic is universal. You can easily adapt it for any niche by editing prompts, adding nodes, and creating or uploading a variety of content to any platform. You can use any LLM and generative AI of your choice. Personally, I prefer the smooth and effective results from ChatGPT 4.1 combined with GPT Image 1.  Enjoy and [message me](https://community.n8n.io/u/n8ner/badges) with your reviews for future improvements! ![](https://i.ibb.co/qLxMHbd5/customize-ride1.jpg#full-width#full-width )"},"typeVersion":1},{"id":"07a0cb9c-fdd6-4120-b9cc-f92d636eed27","name":"Mistral Cloud Chat Model","type":"@n8n/n8n-nodes-langchain.lmChatMistralCloud","position":[4620,-220],"parameters":{"model":"pixtral-large-latest","options":{}},"credentials":{"mistralCloudApi":{"id":"FnOd31BOjfSRcl8F","name":"Mistral Cloud account 2"}},"typeVersion":1},{"id":"765cbb25-897b-408d-ac1d-613c07629a78","name":"OpenRouter Chat Model","type":"@n8n/n8n-nodes-langchain.lmChatOpenRouter","position":[4880,-80],"parameters":{"options":{}},"credentials":{"openRouterApi":{"id":"JH3j9elCwOwmv4CQ","name":"OpenRouter account"}},"typeVersion":1},{"id":"486efc72-84ea-4f1e-bc8d-f3e53f250ddd","name":"Anthropic Chat Model","type":"@n8n/n8n-nodes-langchain.lmChatAnthropic","position":[4620,40],"parameters":{"model":{"__rl":true,"mode":"list","value":"claude-3-7-sonnet-20250219","cachedResultName":"Claude 3.7 Sonnet"},"options":{}},"typeVersion":1.3},{"id":"21d18ef8-7520-476b-a471-5e3a64902a65","name":"Google Gemini Chat Model","type":"@n8n/n8n-nodes-langchain.lmChatGoogleGemini","position":[4980,-220],"parameters":{"options":{}},"typeVersion":1},{"id":"c14142c6-7294-47a9-805a-038bbe367097","name":"xAI Grok Chat Model","type":"@n8n/n8n-nodes-langchain.lmChatXAiGrok","position":[4780,40],"parameters":{"options":{}},"typeVersion":1},{"id":"9460fa92-6e31-448f-b87b-7a440a791426","name":"DeepSeek Chat Model","type":"@n8n/n8n-nodes-langchain.lmChatDeepSeek","position":[4980,40],"parameters":{"options":{}},"typeVersion":1},{"id":"5db59ffd-c09a-4146-b140-47e8399d6c41","name":"Hugging Face Inference Model","type":"@n8n/n8n-nodes-langchain.lmOpenHuggingFaceInference","position":[5160,-220],"parameters":{"model":"https://huggingface.co/black-forest-labs/FLUX.1-dev","options":{}},"credentials":{"huggingFaceApi":{"id":"pTOJMnoQUX7aj7qX","name":"HuggingFaceApi account"}},"typeVersion":1},{"id":"8eea8670-a4a2-4e58-ae04-3a1e7f8cf1de","name":"Freepik API","type":"n8n-nodes-base.httpRequest","position":[4540,400],"parameters":{"url":"https://api.freepik.com/v1/ai/text-to-image/imagen3","method":"POST","options":{},"jsonBody":"{\n  \"prompt\": \"Crazy dog in the space\",\n  \"num_images\": 1,\n  \"aspect_ratio\": \"square_1_1\",\n  \"styling\": {\n    \"style\": \"anime\",\n    \"effects\": {\n      \"color\": \"pastel\",\n      \"lightning\": \"warm\",\n      \"framing\": \"portrait\"\n    }\n  },\n  \"person_generation\": \"allow_all\",\n  \"safety_settings\": \"block_none\"\n}","sendBody":true,"sendHeaders":true,"specifyBody":"json","headerParameters":{"parameters":[{"name":"x-freepik-api-key","value":"FPSX38a53a81a693e71a0e9437a657de6342"}]}},"typeVersion":4.2},{"id":"dc0fb490-d710-4a3d-9c49-2ba3652b2770","name":"Runware API","type":"n8n-nodes-base.httpRequest","position":[4540,580],"parameters":{"url":"https://api.runware.ai/v1","method":"POST","options":{"redirect":{"redirect":{}}},"jsonBody":"[\n  {\n    \"taskType\": \"authentication\",\n    \"apiKey\": \"<API_KEY>\"\n  },\n  {\n    \"taskType\": \"imageInference\",\n    \"taskUUID\": \"39d7207a-87ef-4c93-8082-1431f9c1dc97\",\n    \"positivePrompt\": \"a cat\",\n    \"width\": 512,\n    \"height\": 512,\n    \"model\": \"civitai:102438@133677\",\n    \"numberResults\": 1\n  }\n]","sendBody":true,"specifyBody":"json"},"typeVersion":4.2},{"id":"b2ea776e-4b6f-4f1a-9c3a-1719719209ec","name":"Clipdrop API","type":"n8n-nodes-base.httpRequest","position":[4760,580],"parameters":{"url":"https://clipdrop-api.co/text-to-image/v1","method":"POST","options":{},"sendBody":true,"contentType":"multipart-form-data","authentication":"genericCredentialType","bodyParameters":{"parameters":[{"name":"prompt"}]},"genericAuthType":"httpBearerAuth"},"credentials":{"httpBearerAuth":{"id":"EIcFRRZtIyuSbthu","name":"Bearer YOUR_TOKEN_HERE account"}},"typeVersion":4.2},{"id":"4133831e-0c79-44ae-ba7a-0bf8bead48fd","name":"Ollama Chat Model","type":"@n8n/n8n-nodes-langchain.lmChatOllama","position":[4780,-220],"parameters":{"options":{}},"typeVersion":1},{"id":"c045b699-12cf-48a2-94ce-bcec997434de","name":"Azure OpenAI Chat Model","type":"@n8n/n8n-nodes-langchain.lmChatAzureOpenAi","position":[5160,40],"parameters":{"options":{}},"typeVersion":1},{"id":"d6134f16-65c1-49ee-823a-2b10954707a2","name":"APITemplate.io","type":"n8n-nodes-base.apiTemplateIo","position":[5200,580],"parameters":{},"credentials":{"apiTemplateIoApi":{"id":"8BoC4xP9YSekp9OA","name":"APITemplate.io account"}},"typeVersion":1},{"id":"2f627d07-42e6-4334-8255-24aa86ba7146","name":"Ideogram API","type":"n8n-nodes-base.httpRequest","position":[4980,580],"parameters":{"url":"https://api.ideogram.ai/v1/ideogram-v3/generate","method":"POST","options":{},"sendBody":true,"contentType":"multipart-form-data","sendHeaders":true,"bodyParameters":{"parameters":[{"name":"prompt","value":"A photo of a cat sleeping on a couch."},{"name":"rendering_speed","value":"TURBO"}]},"headerParameters":{"parameters":[{"name":"Api-Key","value":"<apiKey>"}]}},"typeVersion":4.2},{"id":"72377c43-3e1e-4c52-84de-aa8ef825f150","name":"Replicate API","type":"n8n-nodes-base.httpRequest","position":[4760,400],"parameters":{"url":"https://api.replicate.com/v1/models/ideogram-ai/ideogram-v2/predictions","method":"POST","options":{},"jsonBody":"{\n  \"input\": {\n    \"prompt\": \"An illustration of a black running shoe with the text \\\"Run AI with an API\\\" written on the shoe. The shoe is placed on a blue background. The text is white and bold. The overall image has a modern and techy vibe.\",\n    \"aspect_ratio\": \"16:9\"\n  }\n}","sendBody":true,"sendHeaders":true,"specifyBody":"json","headerParameters":{"parameters":[{"name":"Authorization","value":"Bearer $REPLICATE_API_TOKEN"},{"name":"Prefer","value":"wait"}]}},"typeVersion":4.2},{"id":"ae03e3a1-ff22-46ce-b31b-e355611252c0","name":"Imagen Google API","type":"n8n-nodes-base.httpRequest","position":[4980,400],"parameters":{"url":"https://LOCATION-aiplatform.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/publishers/google/models/imagegeneration@002:predict","body":"0","method":"POST","options":{},"sendBody":true,"contentType":"raw","sendHeaders":true,"rawContentType":"application/json; charset=utf-8","headerParameters":{"parameters":[{"name":"Authorization","value":"Bearer $(gcloud auth print-access-token)"}]}},"typeVersion":4.2},{"id":"16eeca87-25b3-42c9-a2d1-7dde51e08db4","name":"HuggingFace API","type":"n8n-nodes-base.httpRequest","position":[5200,400],"parameters":{"url":"https://uu149rez6gw9ehej.eu-west-1.aws.endpoints.huggingface.cloud/distilbert-sentiment","method":"POST","options":{},"sendBody":true,"contentType":"form-urlencoded","sendHeaders":true,"bodyParameters":{"parameters":[{"name":"{\"inputs\": \"Deploying my first endpoint was an amazing experience.\"}"}]},"headerParameters":{"parameters":[{"name":"Authorization","value":"Bearer <Token>"}]}},"typeVersion":4.2},{"id":"ed97601a-7ced-478a-ace3-63ab79f951e8","name":"Runway Images","type":"n8n-nodes-base.httpRequest","position":[4980,220],"parameters":{"url":"https://api.dev.runwayml.com/v1/text_to_image","method":"POST","options":{},"jsonBody":"{\n  \"promptText\": \"string\",\n  \"ratio\": \"1920:1080\",\n  \"seed\": 4294967295,\n  \"model\": \"gen4_image\",\n  \"referenceImages\": [\n    {\n      \"uri\": \"http://example.com\",\n      \"tag\": \"string\"\n    }\n  ],\n  \"contentModeration\": {\n    \"publicFigureThreshold\": \"auto\"\n  }\n}","sendBody":true,"sendHeaders":true,"specifyBody":"json","headerParameters":{"parameters":[{"name":"Authorization","value":"Bearer {{ YOUR API KEY }}"},{"name":"X-Runway-Version","value":"2024-11-06"}]}},"typeVersion":4.2},{"id":"7db2a283-7061-4440-8def-534e96ff7dfe","name":"GENERATE TEXT","type":"@n8n/n8n-nodes-langchain.agent","position":[2340,-180],"parameters":{"text":"=Use link as a main reference article source {{ $json.name }}! IMPORTANT! Actualize up to date information and facts check up, use Internet research with Tavily tool!","options":{"systemMessage":"(!IMPORTANT!) Write short engaging posts under 1024  characters for Telegram. \n\nOverview\nYou are a brand agent for Autoservis, specializing in creating professional and educational posts about car repair. You write random and interesting daily tips, lifehacks, notes, actual news for 2025 year.\n\nGoals:\nAlways start by conducting real-time research using the Tavily tool to gather the most accurate and up-to-date information on the topic. The post should be written to engage the specified target audience.\n\nBased on your research, create a well-structured Telegram post that:\n\nBegins with a captivating hook\n\nMaintains a professional tone\n\nIs clear and easy to read\n\nIs educational and informative\n\nUses minimal emojis (only when very relevant)\n\nIncludes proper source attribution (e.g., \"according to [Source]\")\n\nContains relevant hashtags to improve visibility\n\nEnds with a clear call to action (e.g., ask for thoughts, feedback, or shares)\n\nOutput instructions:\nYour ONLY output should be the final Telegram post text.\n\nDo not include explanations, notes, or anything outside the post itself.\n\nExample workflow:\nReceive the topic (e.g., вЂњReturn on investment in warehouse automationвЂќ)\n\nUse Tavily to research and gather the latest information or case studies\n\nDraft the post using this research\n\nFormat it with references, clear structure, relevant hashtags, and a call to action\n\nAt the end of the post write\nService center address: 123 Main St, New York, NY, for appointments call (212) 555-1234"},"promptType":"define"},"typeVersion":1.8},{"id":"946716eb-39a5-42f6-88a2-bc89b3351c91","name":"GENERATE PROMPT","type":"@n8n/n8n-nodes-langchain.agent","position":[2680,460],"parameters":{"text":"Make it perfect.\nPhoto-realistic to Hyper-realistic style.\nWidescreen aspect ratio with the highest pixel resolution. Generate an extremely detailed and realistic image based on the provided reference description {{ $json.output }}. Include comprehensive visual details covering:\n\n- SubjectвЂ™s appearance: facial features, expressions, skin tone, hair style and texture, clothing fabric, color, and fit, posture, accessories.\n- Environment: specific real-world setting and background elements, natural lighting (direction, intensity, color temperature), and ambient mood.\n- Colors and textures: precise color palettes, authentic fabric and skin textures, natural reflections, and subtle visual cues enhancing lifelike clarity.\n\nExclude any abstract art styles, text, numbers, letters, logos, or non-photographic elements to ensure natural realism.\n\nThe prompt should specify image rendering in 16K photographic resolution with maximum clarity and realism.\n\nAdditionally, provide explicit, practical instructions on enhancing an existing photo to 16K resolution using advanced AI super-resolution upscaling techniques that:\n\n- Preserve fine details without blurriness or unnatural sharpening.\n- Maintain natural textures and lighting.\n- Minimize artifacts like noise, halos, or abnormal edges.\n- Deliver photo-realistic output with enhanced clarity.\n\nEnsure the background is clear, finely detailed, and naturally integrated with the subject to reinforce photographic accuracy.\n\nFocus solely on producing a precise, clear prompt and enhancement guidance centered on natural realism and photographic fidelity for ultra-high resolution images.\n\n","options":{"systemMessage":"=Overview\nYou are an AI agent that converts Telegram posts into visual prompt descriptions for generating graphic marketing materials. These visuals are meant to accompany the Telegram post, effectively conveying the message in a visually appealing, brand-consistent style.\n\nObjective:\nAnalyze the provided Telegram post.\n\nExtract the core message, insight, or key takeaway.\n\nCraft a clear, compelling graphic prompt suitable for a text-to-image generator.\n\nThe final graphic should:\n\nVisually represent or enhance the main idea of the post\n\nBe appropriate for a professional Telegram feed\n\nAppear polished, modern, and engaging\n\nOutput Instructions:\nProvide only the final image prompt without quotation marks.\n\nDo not repeat or paraphrase the Telegram post.\n\nAvoid adding explanations or any additional textвЂ”output only the image prompt.\n\nDo not leave placeholders like вЂњHeader area reserved for customizable callout text.вЂќ\n\nInclude numeric data from the original post when relevant.\n\nStyle Guidelines:\nApproach this like a brand designer or marketing creative.\n\nVisual elements may include text, charts, icons, abstract shapes, overlays, modern illustrations, motion-inspired effects, bold typographic elements (described but not rendered), or metaphorical concepts.\n\nYou may suggest layout styles (e.g., вЂњsplit screen layout,вЂќ вЂњheader with bold title and subtle background illustrationвЂќ).\n\nKeep in mind the prompt will be used by AI image generation toolsвЂ”make it clear and effective.\n\nExample Prompt Format:\nA sleek flat-design graphic featuring a human brain intertwined with mechanical gears, symbolizing the integration of AI and automation.\nMinimalist background with soft gradients, clean sans-serif text areas.\n- - - Important! dont put text on image! - - -"},"promptType":"define"},"typeVersion":1.8},{"id":"bd34e79d-6f3e-4b75-b6cc-ac5e3062ad3e","name":"LinkedIn","type":"n8n-nodes-base.linkedIn","position":[4180,200],"parameters":{"text":"={{ $json['choices[0].message.content'] }}","person":"[CONFIGURE_YOUR_LINKEDIN_PERSON_ID]","authentication":"communityManagement","additionalFields":{}},"typeVersion":1},{"id":"b49aaca1-f326-4fc2-8cc6-265891905f52","name":"X","type":"n8n-nodes-base.twitter","position":[4180,460],"parameters":{"additionalFields":{}},"typeVersion":2},{"id":"d5cc6185-5c6d-4ed4-8b93-c546fe57b804","name":"Facebook","type":"n8n-nodes-base.facebookGraphApi","position":[4180,-60],"parameters":{"options":{},"httpRequestMethod":"POST"},"typeVersion":1},{"id":"7525e88c-eacd-4bb5-8f08-b85dd6aa8777","name":"Minimax Images","type":"n8n-nodes-base.httpRequest","position":[4540,220],"parameters":{"url":"https://api.minimaxi.chat/v1/image_generation","method":"POST","options":{"redirect":{"redirect":{}}},"sendBody":true,"sendHeaders":true,"bodyParameters":{"parameters":[{"name":"model","value":"image-01"},{"name":"prompt","value":"men Dressing in white t shirt, full-body stand front view image :25, outdoor, Venice beach sign, full-body image, Los Angeles, Fashion photography of 90s, documentary, Film grain, photorealistic"},{"name":"aspect_ratio","value":"16:9"},{"name":"response_format","value":"url"},{"name":"n","value":"3"},{"name":"prompt_optimizer","value":"true"}]},"headerParameters":{"parameters":[{"name":"Authorization","value":"Bearer {api_key}"}]}},"typeVersion":4.2},{"id":"02acacfc-fa40-440d-a35c-f615c3369c82","name":"Kling Images","type":"n8n-nodes-base.httpRequest","position":[4760,220],"parameters":{"url":"https://api-singapore.klingai.com/v1/images/text2image","method":"POST","options":{"redirect":{"redirect":{}}},"jsonBody":"{\n\t\"code\": 0, //Error codesпј›Specific definitions can be found in Error codes\n  \"message\": \"string\", //Error information\n  \"request_id\": \"string\", //Request ID, generated by the system, is used to track requests and troubleshoot problems\n  \"data\":[\n    {\n      \"task_id\": \"string\", //Task ID, generated by the system\n      \"task_status\": \"string\", //Task status, Enum valuesпјљsubmittedгЂЃprocessingгЂЃsucceedгЂЃfailed\n      \"task_status_msg\": \"string\", //Task status information, displaying the failure reason when the task fails (such as triggering the content risk control of the platform, etc.)\n      \"created_at\": 1722769557708, //Task creation time, Unix timestamp, unit ms\n      \"updated_at\": 1722769557708, //Task update time, Unix timestamp, unit ms\n      \"task_result\":{\n        \"images\":[\n          {\n            \"index\": int, //Image NumberпјЊ0-9\n            \"url\": \"string\" //URL for generating imagesпјЊsuch asпјљhttps://h1.inkwai.com/bs2/upload-ylab-stunt/1fa0ac67d8ce6cd55b50d68b967b3a59.png(To ensure information security, generated images/videos will be cleared after 30 days. Please make sure to save them promptly.)\n          }\n      \t]\n      }\n    }\n  ]\n}","sendBody":true,"sendHeaders":true,"specifyBody":"json","headerParameters":{"parameters":[{"name":"Authorization","value":"Bearer YOUR_TOKEN_HERE"}]}},"typeVersion":4.2},{"id":"0a394dbb-ae24-456c-b13f-f568edd40b44","name":"Leonardo Images","type":"n8n-nodes-base.httpRequest","position":[5200,220],"parameters":{"url":"https://cloud.leonardo.ai/api/rest/v1/generations/id","options":{"redirect":{"redirect":{}}},"sendHeaders":true,"headerParameters":{"parameters":[{"name":"accept","value":"application/json"}]}},"typeVersion":4.2},{"id":"692e118f-9272-45f9-80c4-6463add4977c","name":"Tavily Internet Search","type":"@tavily/n8n-nodes-tavily.tavilyTool","position":[2260,-280],"parameters":{"query":"={\n  \"query\": \"{searchTerm}\",\n  \"topic\": \"general\",\n  \"search_depth\": \"advanced\",\n  \"chunks_per_source\": 3,\n  \"max_results\": 1,\n  \"time_range\": null,\n  \"days\": 7,\n  \"include_answer\": true,\n  \"include_raw_content\": false,\n  \"include_images\": false,\n  \"include_image_descriptions\": false,\n  \"include_domains\": [],\n  \"exclude_domains\": []\n}","options":{},"descriptionType":"manual","toolDescription":"Search in Tavily"},"credentials":{"tavilyApi":{"id":"v2o6xkt7VGeBiPOs","name":"Tavily account"}},"typeVersion":1},{"id":"de72e33d-5f58-4fbd-80cf-0eb9f4344175","name":"OPENAI GENERATES IMAGE","type":"@n8n/n8n-nodes-langchain.openAi","position":[3280,-140],"parameters":{"model":"gpt-image-1","prompt":"= IMPORTANT! DONT WRITE TEXT ON A PICTURE! Create perfect visual for\n{{ $json.output }}","options":{},"resource":"image"},"credentials":{"openAiApi":{"id":"6oMHBtrEsufBjv61","name":"n8n free OpenAI API credits"}},"typeVersion":1.8},{"id":"0dbe4250-2cd8-4295-bd4b-42ec26ab6cb6","name":"OPENAI WRITES PROMPTS","type":"@n8n/n8n-nodes-langchain.lmChatOpenAi","position":[2620,600],"parameters":{"model":{"__rl":true,"mode":"list","value":"gpt-4.1","cachedResultName":"gpt-4.1"},"options":{}},"credentials":{"openAiApi":{"id":"6oMHBtrEsufBjv61","name":"n8n free OpenAI API credits"}},"typeVersion":1.2},{"id":"07dc3e20-3d51-4bb7-a327-5d961afb2b96","name":"OPENAI WRITES POSTS","type":"@n8n/n8n-nodes-langchain.lmChatOpenAi","position":[2260,-40],"parameters":{"model":{"__rl":true,"mode":"list","value":"gpt-4.1","cachedResultName":"gpt-4.1"},"options":{}},"credentials":{"openAiApi":{"id":"6oMHBtrEsufBjv61","name":"n8n free OpenAI API credits"}},"typeVersion":1.2}],"active":false,"settings":{"executionOrder":"v1"},"versionId":"37a7baec-9442-450f-9373-fad685598558","connections":{"LinkedIn":{"main":[[]]},"Split Out":{"main":[[{"node":"X","type":"main","index":0},{"node":"Facebook","type":"main","index":0},{"node":"LinkedIn","type":"main","index":0},{"node":"Telegram","type":"main","index":0}]]},"GENERATE TEXT":{"main":[[{"node":"GENERATE PROMPT","type":"main","index":0}]]},"APITemplate.io":{"main":[[]]},"Minimax Images":{"main":[[]]},"GENERATE PROMPT":{"main":[[{"node":"OPENAI GENERATES IMAGE","type":"main","index":0}]]},"Schedule Trigger":{"main":[[{"node":"GENERATE TEXT","type":"main","index":0}]]},"OPENAI WRITES POSTS":{"ai_languageModel":[[{"node":"GENERATE TEXT","type":"ai_languageModel","index":0}]]},"Google Sheets Trigger":{"main":[[{"node":"GENERATE TEXT","type":"main","index":0}]]},"OPENAI WRITES PROMPTS":{"ai_languageModel":[[{"node":"GENERATE PROMPT","type":"ai_languageModel","index":0}]]},"OPENAI GENERATES IMAGE":{"main":[[{"node":"Split Out","type":"main","index":0}]]},"Tavily Internet Search":{"ai_tool":[[{"node":"GENERATE TEXT","type":"ai_tool","index":0}]]},"When clicking вЂExecute workflowвЂ™":{"main":[[{"node":"GENERATE TEXT","type":"main","index":0}]]}}}


name: Automate Travel Agent Outreach with Web Scraping, OpenAI, and Google Sheets
author_name: Mohan Gopal
author_username: mohan
categories: []
created_at: 2025-06-02T18:01:17.136Z
updated_at: 2025-06-02T18:01:17.136Z
url: https://n8n.io/workflows/4606
scraped_at: 2025-07-06 21:16:30
description:
  🔧 Automated Workflow: Scrape Travel Agent Contacts and Send Personalized Survey Emails
  This workflow is designed to automate the process of scraping travel agent contact data, standardizing the information, storing it, and then sending out personalized survey emails using AI. It’s especially useful for outreach campaigns, research, or lead generation.

  ⚙️ Workflow Breakdown
  📍 Part 1: Scraping and Storing Travel Agent Data
  HTTP Scrape Website
  Type: HTTP Request (POST)

  Function: Calls a third-party scraping API (https://api.firecrawl.dev...) to scrape data from a travel agent listing site.

  Purpose: Extract raw HTML or structured data from a website containing contact info.

  OpenAI Standardise Data
  Type: OpenAI Message Model

  Function: Uses AI to clean and standardize the raw scraped data into structured JSON (e.g., name, email, agency, location).

  Purpose: Ensures uniformity in formatting, making data easier to process downstream.

  Split Out
  Type: Item Splitter

  Function: Splits the standardized array of agent records into individual items.

  Purpose: Allows appending each agent as a separate row in Google Sheets.

  Google Sheet - Data Store
  Type: Google Sheets (Append)

  Function: Stores each individual record in a spreadsheet.

  Purpose: Maintains a centralized and accessible log of scraped and processed contacts.

  📍 Part 2: Read Records and Send Personalized Survey Emails
  Triggered Manually – when “Test Workflow” button is clicked.

  Trigger – When clicking 'Test workflow'
  Type: Manual Trigger

  Function: Starts the second part of the workflow manually.

  Use Case: Testing or running the outreach email process on demand.

  Google Sheet Data Store (Read)
  Type: Google Sheets (Read)

  Function: Reads the stored travel agent records from the spreadsheet.

  Purpose: Retrieves contact details and context for personalized messaging.

  OpenAI Mail Composer
  Type: OpenAI Message Model

  Function: Generates a custom email for each agent using their details.

  Purpose: Creates human-like, engaging emails that include a survey link (optional input).

  Google Sheet Update Records
  Type: Google Sheets (Update)

  Function: Optionally marks the record as "emailed" or logs the date of outreach.

  Purpose: Prevents duplicate outreach and helps track campaign status.

  Send Email
  Type: Email Node (SMTP or integrated service)

  Function: Sends the personalized email generated by OpenAI.

  Purpose: Delivers the survey to each travel agent with contextually relevant messaging.

  🧠 Use Case:
  Targeted email outreach to travel agents.

  Collect insights or feedback via survey links.

  Use personalized messaging to improve response rates.

  📌 Benefits:
  ✅ Fully automated scraping and processing.

  ✅ Personalized at scale using OpenAI.

  ✅ Easily repeatable for different domains or campaigns.

  ✅ Centralized recordkeeping in Google Sheets.

  🛠️ Tech Stack:
  n8n: Automation and workflow management

  OpenAI: AI-based text standardization and email generation

  Firecrawl (or similar): Web scraping API

  Google Sheets: Data storage and tracking

  Email Node: Survey email delivery

nodes_used:
  ["n8n-nodes-base.emailSend","n8n-nodes-base.googleSheets","n8n-nodes-base.httpRequest","@n8n/n8n-nodes-langchain.openAi"]

workflow_json:
  {"id":"OIDO7J5NqLAuLrKI","meta":{"instanceId":"92e36925b2d06addd7a010605535ce53ac105737436355f7e52e2980c726ed3d","templateCredsSetupCompleted":true},"name":"01 Scraping Site & Storing Records","tags":[{"id":"oKGIn6U0wpeHShTN","name":"working flow","createdAt":"2025-06-02T06:27:44.762Z","updatedAt":"2025-06-02T06:27:44.762Z"}],"nodes":[{"id":"e6b6b5d8-ae51-42e6-8f14-fa94b3b9cc5a","name":"When clicking ‘Test workflow’","type":"n8n-nodes-base.manualTrigger","position":[-360,360],"parameters":{},"typeVersion":1},{"id":"29628132-3a79-4512-b1dd-ed5574e69363","name":"Sticky Note","type":"n8n-nodes-base.stickyNote","position":[-340,-280],"parameters":{"width":580,"height":140,"content":"## This is workflow of scrapping list of travel agents website...\n  \n**use this for scrapping different sites that has information in standard format information information** "},"typeVersion":1},{"id":"a7575f0a-db6a-48e1-9fb8-01f8e543589b","name":"Split Out","type":"n8n-nodes-base.splitOut","position":[240,-100],"parameters":{"options":{},"fieldToSplitOut":"message.content[\"Travel Agents\"]"},"typeVersion":1},{"id":"3cb85d6b-b0e9-4ca9-a4a1-7b241909eccc","name":"Send Email","type":"n8n-nodes-base.emailSend","position":[680,360],"webhookId":"2ce28736-1500-4766-acba-bbae4618197f","parameters":{"text":"=Dear  {{ $json['Agent Name'] }} team,\n{{ $json.Icebreaker }}\n\n{{ $json['AI Agent in Travel'] }}\n\n{{ $json['Call to Action'] }}\n\nBest Regards\nMohan Gopal\n\n{{ $json.PS }}\n\n","options":{"ccEmail":"mohan.gopal001@gmail.com"},"subject":"={{ $json.Subject }}","toEmail":"={{ $json['Email Address'] }}","fromEmail":"contact@mohangopal.com","emailFormat":"text"},"credentials":{"smtp":{"id":"OxDjXwRpd4Ll2OPw","name":"SMTP account"}},"typeVersion":2.1},{"id":"19d9b52b-5ca8-4027-98fe-d3e36fb9e229","name":"Sticky Note1","type":"n8n-nodes-base.stickyNote","position":[-360,200],"parameters":{"width":580,"height":120,"content":"## Read Scrapped and Stored Records in SpreadSheet and Send Survey Email \n** Simple Read and Compose Personalised email and send..."},"typeVersion":1},{"id":"57827b6b-5f62-4b17-99ce-d14b4d0c27bb","name":"Google Sheet - Data Store","type":"n8n-nodes-base.googleSheets","position":[440,-100],"parameters":{"columns":{"value":{"City":"={{ $json.City }}","Status":"InProgress","Country":"={{ $json.Country }}","Summary":"={{ $json.Summary }}","Website":"={{ $json.Website }}","Mail Sent":"ToDo","Telephone":"={{ $json.Telephone }}","Agent Name":"={{ $json[\"Travel Agent Name\"] }}","Email Address":"={{ $json[\"Email Address\"] }}","Survey Received":"Pending","Response Received":"Pending"},"schema":[{"id":"Agent Name","type":"string","display":true,"required":false,"displayName":"Agent Name","defaultMatch":false,"canBeUsedToMatch":true},{"id":"Summary","type":"string","display":true,"required":false,"displayName":"Summary","defaultMatch":false,"canBeUsedToMatch":true},{"id":"Email Address","type":"string","display":true,"required":false,"displayName":"Email Address","defaultMatch":false,"canBeUsedToMatch":true},{"id":"Telephone","type":"string","display":true,"required":false,"displayName":"Telephone","defaultMatch":false,"canBeUsedToMatch":true},{"id":"Website","type":"string","display":true,"required":false,"displayName":"Website","defaultMatch":false,"canBeUsedToMatch":true},{"id":"Country","type":"string","display":true,"required":false,"displayName":"Country","defaultMatch":false,"canBeUsedToMatch":true},{"id":"City","type":"string","display":true,"required":false,"displayName":"City","defaultMatch":false,"canBeUsedToMatch":true},{"id":"Mail Sent","type":"string","display":true,"removed":false,"required":false,"displayName":"Mail Sent","defaultMatch":false,"canBeUsedToMatch":true},{"id":"Response Received","type":"string","display":true,"removed":false,"required":false,"displayName":"Response Received","defaultMatch":false,"canBeUsedToMatch":true},{"id":"Survey Received","type":"string","display":true,"removed":false,"required":false,"displayName":"Survey Received","defaultMatch":false,"canBeUsedToMatch":true},{"id":"Status","type":"string","display":true,"removed":false,"required":false,"displayName":"Status","defaultMatch":false,"canBeUsedToMatch":true}],"mappingMode":"defineBelow","matchingColumns":[],"attemptToConvertTypes":false,"convertFieldsToString":false},"options":{},"operation":"append","sheetName":{"__rl":true,"mode":"list","value":1598367286,"cachedResultUrl":"https://docs.google.com/spreadsheets/d/1r33A-808h3zSgJu7AiENde9eTJkGEOtZgeVe6O-1f_k/edit#gid=1598367286","cachedResultName":"ScrapedList"},"documentId":{"__rl":true,"mode":"list","value":"1r33A-808h3zSgJu7AiENde9eTJkGEOtZgeVe6O-1f_k","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1r33A-808h3zSgJu7AiENde9eTJkGEOtZgeVe6O-1f_k/edit?usp=drivesdk","cachedResultName":"Travel Agents List"}},"credentials":{"googleSheetsOAuth2Api":{"id":"Q8w7Aj2noMqus8kt","name":"Google Sheets account 5"}},"typeVersion":4.6},{"id":"eef292a7-b539-4b38-935e-27b7f6e1e871","name":"Google Sheet Data Store","type":"n8n-nodes-base.googleSheets","position":[-120,360],"parameters":{"options":{},"sheetName":{"__rl":true,"mode":"list","value":1316921362,"cachedResultUrl":"https://docs.google.com/spreadsheets/d/1r33A-808h3zSgJu7AiENde9eTJkGEOtZgeVe6O-1f_k/edit#gid=1316921362","cachedResultName":"TestTravelAgents"},"documentId":{"__rl":true,"mode":"list","value":"1r33A-808h3zSgJu7AiENde9eTJkGEOtZgeVe6O-1f_k","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1r33A-808h3zSgJu7AiENde9eTJkGEOtZgeVe6O-1f_k/edit?usp=drivesdk","cachedResultName":"Travel Agents List"}},"credentials":{"googleSheetsOAuth2Api":{"id":"Q8w7Aj2noMqus8kt","name":"Google Sheets account 5"}},"typeVersion":4.6},{"id":"5428022b-1492-4ed0-8fa7-a13f1b6dd9be","name":"OpenAI1 Mail Composer","type":"@n8n/n8n-nodes-langchain.openAi","position":[100,360],"parameters":{"modelId":{"__rl":true,"mode":"list","value":"gpt-4o","cachedResultName":"GPT-4O"},"options":{},"messages":{"values":[{"role":"system","content":"=You are a helpful and  intelligent writing assistant who understands Travel Domain and have experience in mailing Travel Agents about Surveys "},{"content":"Your task is to personalize an email that will encourage the travel agent to complete the survey and submit. \n\nYou will do this by taking the Travel Agents details as input, and editing 5 sections of email: Subject line, ice-breaker, AI Agent in Travel Business, Call to action and a PS field. \n\nYour template as below: \n\nSubject line: \"Is your {companyname} prepared for AI Agent Revolution.\" \n\nIcebreaker: \n\"I understand you are in the travel business doing {uniquethingsaboutthemortheirUSP} and I've been following the impact on travel business for a while. The travel industry is evolving rapidly with AI-driven tools changing how business is conducted. This survey aims to gather insights from travel agents in Malaysia to assess their awareness, operational challenges, and interest in implementing AI Agents in daily workflows.\n\nYour responses will help us:\n\nUnderstand key pain points in your current operations.\nEvaluate awareness and readiness for AI integration.\nDesign a tailored AI Agent solution to improve productivity, efficiency, and profitability for travel businesses like yours.\n\nAll responses will be kept confidential and used only for aggregate analysis.\"\n\nAI Agent in Treavel Business: \n\"AI Agents are intelligent systems that can independently perform tasks traditionally done by humans. In the travel industry, these agents can:\n\nCompile and price custom tour packages.\nAutomatically follow up with suppliers.\nManage bookings, cancellations, and customer queries.\nHandle payment tracking and reconciliation.\n\nWith automation, AI Agents can reduce manual work, increase accuracy, and free up your team to focus on customer experience and business growth.\"\n\nCall to action: \n\"Your experience matters. We're conducting a brief survey to understand how AI Agents can help travel agencies like yours save time, reduce manual work, and boost efficiency.\n\n📋 Takes less than 5 minutes\n🔐 Your responses are confidential\n📈 Get a free insights report based on aggregated results\n🎁 Early access to our AI Agent pilot program\n\n👉 Click Here to Take the Survey\n\nLet’s build smarter travel solutions together.\nThank you for being part of this industry transformation.\"\n\nPS: \"Even if you ar not interested in survey, kindly respond 'NOT INTERESTED\" in the reply. \n\nGuidelines:\n1. Your tone of voice should be \"Semi-formal conversation\". No fancy language. \n2. Do not repeat sentences or data from the input, make it more natural and human like.\n3. Make sure the Subject line is non-capitalized, even if it is gramatically incorrect. Makes it look more human.   \n4. Respond in JSON using the below format:\n{\"Subject line\":\"\",\"Icebreaker\":\"\",\"AI Agent in Treavel Business:\":\"\",\"Call to action\":\"\",\"PS\":\"\" }"},{"content":"=Agent Name:  {{ $json['Agent Name'] }}\nEmail Address: {{ $json['Email Address'] }}\nSummary: {{ $json.Summary }}\nWebsite: {{ $json.Website }}"}]},"jsonOutput":true},"credentials":{"openAiApi":{"id":"SCKN5KUziIpM8NB7","name":"OpenAi account 5"}},"typeVersion":1.8},{"id":"13922526-19c5-495a-ba65-3cb0c77a1816","name":"OpenAI Standardise Data","type":"@n8n/n8n-nodes-langchain.openAi","position":[-120,-100],"parameters":{"modelId":{"__rl":true,"mode":"list","value":"gpt-4.1-mini-2025-04-14","cachedResultName":"GPT-4.1-MINI-2025-04-14"},"options":{},"messages":{"values":[{"role":"system","content":"=Yor role is to extract the complete list of travel Agents information from the incoming data and standardise them in the below structured format for storing in spreadsheet. \n\nYour output has to be in a structured format that includes the \n - Agent name\n - Summary: summary from introduction section, \n - Email address, \n - Telephone number,\n - Website,\n- Country,\n- City\n\nYou will receive an input of <scrapped-website>\n\nRespond in JSON format:\n{\n    \"Travel Agent Name\": \"\",\n    \"Summary\": \"\",\n    \"Email Address\": \"\",\n    \"Telephone\": \"\",\n    \"Website\": \"\"\n    \"Country\":\"\"\n    \"City\"\": \"\"\n}\ninput N/A where data is not available "},{"role":"system","content":"=<scrapped-website>\n{{ $json.data.markdown }}\n</scrapped-website> "}]},"jsonOutput":true},"credentials":{"openAiApi":{"id":"SCKN5KUziIpM8NB7","name":"OpenAi account 5"}},"typeVersion":1.8},{"id":"f6fda879-81e2-4aa6-ada4-5fff6e645ba4","name":"Google Sheet Update Records","type":"n8n-nodes-base.googleSheets","position":[460,360],"parameters":{"columns":{"value":{"PS":"={{ $json.message.content.PS }}","City":"={{ $('Google Sheet Data Store').item.json.City }}","Status":"In-Progress","Country":"={{ $('Google Sheet Data Store').item.json.Country }}","Subject":"={{ $json.message.content['Subject line'] }}","Summary":"={{ $('Google Sheet Data Store').item.json.Summary }}","Website":"={{ $('Google Sheet Data Store').item.json.Website }}","Mail Sent":"Sent","Telephone":"={{ $('Google Sheet Data Store').item.json.Telephone }}","Agent Name":"={{ $('Google Sheet Data Store').item.json['Agent Name'] }}","Icebreaker":"={{ $json.message.content.Icebreaker }}","Email Address":"={{ $('Google Sheet Data Store').item.json['Email Address'] }}","Call to Action":"={{ $json.message.content['Call to action'] }}","Survey Received":"Pending","Response Received":"Pending","AI Agent in Travel":"={{ $json.message.content['AI Agent in Treavel Business'] }}"},"schema":[{"id":"Agent Name","type":"string","display":true,"required":false,"displayName":"Agent Name","defaultMatch":false,"canBeUsedToMatch":true},{"id":"Summary","type":"string","display":true,"required":false,"displayName":"Summary","defaultMatch":false,"canBeUsedToMatch":true},{"id":"Email Address","type":"string","display":true,"removed":false,"required":false,"displayName":"Email Address","defaultMatch":false,"canBeUsedToMatch":true},{"id":"Telephone","type":"string","display":true,"required":false,"displayName":"Telephone","defaultMatch":false,"canBeUsedToMatch":true},{"id":"Website","type":"string","display":true,"required":false,"displayName":"Website","defaultMatch":false,"canBeUsedToMatch":true},{"id":"Country","type":"string","display":true,"required":false,"displayName":"Country","defaultMatch":false,"canBeUsedToMatch":true},{"id":"City","type":"string","display":true,"required":false,"displayName":"City","defaultMatch":false,"canBeUsedToMatch":true},{"id":"Mail Sent","type":"string","display":true,"required":false,"displayName":"Mail Sent","defaultMatch":false,"canBeUsedToMatch":true},{"id":"Response Received","type":"string","display":true,"required":false,"displayName":"Response Received","defaultMatch":false,"canBeUsedToMatch":true},{"id":"Survey Received","type":"string","display":true,"required":false,"displayName":"Survey Received","defaultMatch":false,"canBeUsedToMatch":true},{"id":"Status","type":"string","display":true,"required":false,"displayName":"Status","defaultMatch":false,"canBeUsedToMatch":true},{"id":"Subject","type":"string","display":true,"removed":false,"required":false,"displayName":"Subject","defaultMatch":false,"canBeUsedToMatch":true},{"id":"Icebreaker","type":"string","display":true,"removed":false,"required":false,"displayName":"Icebreaker","defaultMatch":false,"canBeUsedToMatch":true},{"id":"AI Agent in Travel","type":"string","display":true,"removed":false,"required":false,"displayName":"AI Agent in Travel","defaultMatch":false,"canBeUsedToMatch":true},{"id":"Call to Action","type":"string","display":true,"removed":false,"required":false,"displayName":"Call to Action","defaultMatch":false,"canBeUsedToMatch":true},{"id":"PS","type":"string","display":true,"removed":false,"required":false,"displayName":"PS","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":["Email Address"],"attemptToConvertTypes":false,"convertFieldsToString":false},"options":{},"operation":"update","sheetName":{"__rl":true,"mode":"list","value":1316921362,"cachedResultUrl":"https://docs.google.com/spreadsheets/d/1r33A-808h3zSgJu7AiENde9eTJkGEOtZgeVe6O-1f_k/edit#gid=1316921362","cachedResultName":"TestTravelAgents"},"documentId":{"__rl":true,"mode":"id","value":"=1r33A-808h3zSgJu7AiENde9eTJkGEOtZgeVe6O-1f_k"}},"credentials":{"googleSheetsOAuth2Api":{"id":"Q8w7Aj2noMqus8kt","name":"Google Sheets account 5"}},"typeVersion":4.6},{"id":"c6ab2fe5-8876-4673-a5f3-6eacd4625a4c","name":"HTTP Scrape Website","type":"n8n-nodes-base.httpRequest","position":[-340,-100],"parameters":{"url":"https://api.firecrawl.dev/v1/scrape","method":"POST","options":{},"jsonBody":"{\n  \"url\": \"https://www.japan.travel/en/my/travel-trade/my-travel-agencies-list/\",\n  \"formats\": [\n    \"markdown\"\n  ]\n}","sendBody":true,"sendHeaders":true,"specifyBody":"json","authentication":"genericCredentialType","genericAuthType":"httpHeaderAuth","headerParameters":{"parameters":[{"name":"Content-Type","value":"application/json"}]}},"credentials":{"httpHeaderAuth":{"id":"pbJsYdisPYx3PSPs","name":"Header Auth account 3"}},"typeVersion":4.2}],"active":false,"settings":{"callerPolicy":"workflowsFromSameOwner","executionOrder":"v1"},"versionId":"fa1737d5-7f2f-44b3-a07d-ce85f26adf5e","connections":{"Split Out":{"main":[[{"node":"Google Sheet - Data Store","type":"main","index":0}]]},"HTTP Scrape Website":{"main":[[{"node":"OpenAI Standardise Data","type":"main","index":0}]]},"OpenAI1 Mail Composer":{"main":[[{"node":"Google Sheet Update Records","type":"main","index":0}]]},"Google Sheet Data Store":{"main":[[{"node":"OpenAI1 Mail Composer","type":"main","index":0}]]},"OpenAI Standardise Data":{"main":[[{"node":"Split Out","type":"main","index":0}]]},"Google Sheet Update Records":{"main":[[{"node":"Send Email","type":"main","index":0}]]},"When clicking ‘Test workflow’":{"main":[[{"node":"Google Sheet Data Store","type":"main","index":0}]]}}}


name: Personal Budget & Expense Tracker with Google Sheets and Alerts MCP
author_name: Destiya Wijayanto
author_username: eantz
categories: []
created_at: 2025-06-03T08:01:11.360Z
updated_at: 2025-06-03T08:01:11.360Z
url: https://n8n.io/workflows/4612
scraped_at: 2025-07-06 21:16:30
description:
  This template provides a set of MCP tools to manage personal budgets and expenses. This MCP tools can be integrated to any AI client that support MCP integration.

  How it works
  It stores transaction records and budget in google sheet
  It will give warning if expense is above budget

  How to setup
  Sign in with google in google sheet nodes
  Copy google sheet template (link available in the sticky note)
  Target google sheet nodes to the right sheet
  Integrate with AI client
  Enjoy!!

nodes_used:
  ["n8n-nodes-base.googleSheets","n8n-nodes-base.crypto","n8n-nodes-base.code","@n8n/n8n-nodes-langchain.toolWorkflow"]

workflow_json:
  {"id":"VjYVuVxMuX9MbtGy","meta":{"instanceId":"1d007fe710bcfec364941eac14bfe94a42e89c72adf697a8959f00f5db851ca6","templateCredsSetupCompleted":true},"name":"MCP Personal Expense","tags":[],"nodes":[{"id":"544866c7-9676-4a94-a77d-8637b8b9f6e3","name":"MCP Server Trigger","type":"@n8n/n8n-nodes-langchain.mcpTrigger","position":[-1560,360],"webhookId":"676afb85-ff6d-45ad-ab36-e6cc590ba080","parameters":{"path":"personal-expense"},"typeVersion":1},{"id":"f45e1509-487b-46c6-b7dd-224df465c981","name":"Filter","type":"n8n-nodes-base.filter","position":[1360,-340],"parameters":{"options":{"ignoreCase":true},"conditions":{"options":{"version":2,"leftValue":"","caseSensitive":false,"typeValidation":"strict"},"combinator":"and","conditions":[{"id":"c804feba-d6da-43d9-88a9-24dfa0f7a2ed","operator":{"type":"dateTime","operation":"afterOrEquals"},"leftValue":"={{ $json.date }}","rightValue":"={{ $('Switch').item.json.payload.dateStart }}"},{"id":"512eb3ab-f42d-4a35-bc0e-7ff67ab0d6a5","operator":{"type":"dateTime","operation":"beforeOrEquals"},"leftValue":"={{ $json.date }}","rightValue":"={{ $('Switch').item.json.payload.dateEnd }}"}]}},"typeVersion":2.2},{"id":"f4411283-0efa-4218-8d96-9d9a1c7c19e6","name":"Google Sheets Filter Workflow","type":"n8n-nodes-base.executeWorkflowTrigger","position":[-40,420],"parameters":{"workflowInputs":{"values":[{"name":"function"},{"name":"payload","type":"object"}]}},"typeVersion":1.1},{"id":"827737c1-4466-499c-abae-bc2e03d9191a","name":"Get list transactions","type":"@n8n/n8n-nodes-langchain.toolWorkflow","position":[-1880,560],"parameters":{"workflowId":{"__rl":true,"mode":"list","value":"VjYVuVxMuX9MbtGy","cachedResultName":"MCP Personal Expense"},"description":"Get Transactions","workflowInputs":{"value":{"payload":"={\n  \"dateStart\": \"{{ $fromAI(\"dateStart\", \"Date Start. Format: YYYY-MM-DD\", \"string\") }}\",\n  \"dateEnd\": \"{{ $fromAI(\"dateEnd\", \"Date End. Format: YYYY-MM-Dd\", \"string\") }}\"\n}","function":"list_transaction"},"schema":[{"id":"function","type":"string","display":true,"required":false,"displayName":"function","defaultMatch":false,"canBeUsedToMatch":true},{"id":"payload","type":"object","display":true,"required":false,"displayName":"payload","defaultMatch":false,"canBeUsedToMatch":true}],"mappingMode":"defineBelow","matchingColumns":[],"attemptToConvertTypes":false,"convertFieldsToString":false}},"typeVersion":2.2},{"id":"afb64fd3-d554-4f4f-9447-3a5cd48bae1a","name":"Get By ID","type":"n8n-nodes-base.googleSheetsTool","position":[-1740,560],"parameters":{"options":{},"filtersUI":{"values":[{"lookupValue":"={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('values0_Value', ``, 'string') }}","lookupColumn":"id"}]},"sheetName":{"__rl":true,"mode":"list","value":"gid=0","cachedResultUrl":"","cachedResultName":"transactions"},"documentId":{"__rl":true,"mode":"url","value":""},"descriptionType":"manual","toolDescription":"Get Data by ID"},"credentials":{"googleSheetsOAuth2Api":{"id":"FL23BODpHRnWRCE4","name":"Google Sheets account"}},"typeVersion":4.6},{"id":"05b35a22-757d-411f-ad56-a1b0e3d7a695","name":"Switch","type":"n8n-nodes-base.switch","position":[380,320],"parameters":{"rules":{"values":[{"outputKey":"list_transaction","conditions":{"options":{"version":2,"leftValue":"","caseSensitive":true,"typeValidation":"strict"},"combinator":"and","conditions":[{"id":"3e9f8105-2bd7-4571-8909-86cddbf4e3eb","operator":{"type":"string","operation":"equals"},"leftValue":"={{ $json.function }}","rightValue":"list_transaction"}]},"renameOutput":true},{"outputKey":"remove_transaction","conditions":{"options":{"version":2,"leftValue":"","caseSensitive":true,"typeValidation":"strict"},"combinator":"and","conditions":[{"id":"8bba675d-4f2f-411d-858e-cd0573f2a0d7","operator":{"name":"filter.operator.equals","type":"string","operation":"equals"},"leftValue":"={{ $json.function }}","rightValue":"remove_transaction"}]},"renameOutput":true},{"outputKey":"add_transaction","conditions":{"options":{"version":2,"leftValue":"","caseSensitive":true,"typeValidation":"strict"},"combinator":"and","conditions":[{"id":"1cf7fe89-f22e-4656-9e16-570f4b7088f0","operator":{"name":"filter.operator.equals","type":"string","operation":"equals"},"leftValue":"={{ $json.function }}","rightValue":"add_transaction"}]},"renameOutput":true},{"outputKey":"update_transaction","conditions":{"options":{"version":2,"leftValue":"","caseSensitive":true,"typeValidation":"strict"},"combinator":"and","conditions":[{"id":"f63ece2b-a821-4e79-8797-365fe6b6ce2b","operator":{"name":"filter.operator.equals","type":"string","operation":"equals"},"leftValue":"={{ $json.function }}","rightValue":"update_transaction"}]},"renameOutput":true},{"outputKey":"add_budget","conditions":{"options":{"version":2,"leftValue":"","caseSensitive":true,"typeValidation":"strict"},"combinator":"and","conditions":[{"id":"411a0ece-ac3a-49fe-b357-c7dc56f21042","operator":{"name":"filter.operator.equals","type":"string","operation":"equals"},"leftValue":"={{ $json.function }}","rightValue":"add_budget"}]},"renameOutput":true},{"outputKey":"update_budget","conditions":{"options":{"version":2,"leftValue":"","caseSensitive":true,"typeValidation":"strict"},"combinator":"and","conditions":[{"id":"8bac74de-c55c-4248-a2a7-728d8acae09a","operator":{"name":"filter.operator.equals","type":"string","operation":"equals"},"leftValue":"={{ $json.function }}","rightValue":"update_budget"}]},"renameOutput":true},{"outputKey":"remove_budget","conditions":{"options":{"version":2,"leftValue":"","caseSensitive":true,"typeValidation":"strict"},"combinator":"and","conditions":[{"id":"818c0b7b-c1b0-4150-b683-76287f0fd1f8","operator":{"name":"filter.operator.equals","type":"string","operation":"equals"},"leftValue":"={{ $json.function }}","rightValue":"remove_budget"}]},"renameOutput":true},{"outputKey":"get_budget","conditions":{"options":{"version":2,"leftValue":"","caseSensitive":true,"typeValidation":"strict"},"combinator":"and","conditions":[{"id":"579f8f4d-7ce0-46cf-aee5-290d5025f071","operator":{"name":"filter.operator.equals","type":"string","operation":"equals"},"leftValue":"={{ $json.function }}","rightValue":"get_budget"}]},"renameOutput":true}]},"options":{}},"typeVersion":3.2},{"id":"e7ac76ec-a796-429a-85d0-44490cfe4f00","name":"get by id","type":"n8n-nodes-base.googleSheets","position":[880,100],"parameters":{"options":{},"filtersUI":{"values":[{"lookupValue":"={{ $json.payload.id }}","lookupColumn":"id"}]},"sheetName":{"__rl":true,"mode":"list","value":"gid=0","cachedResultUrl":"","cachedResultName":"transactions"},"documentId":{"__rl":true,"mode":"url","value":""}},"credentials":{"googleSheetsOAuth2Api":{"id":"FL23BODpHRnWRCE4","name":"Google Sheets account"}},"typeVersion":4.6},{"id":"d7ea9a2f-b9ef-4a02-92f7-25ec2c3a9232","name":"remove transaction","type":"n8n-nodes-base.googleSheets","position":[1160,100],"parameters":{"operation":"delete","sheetName":{"__rl":true,"mode":"list","value":"gid=0","cachedResultUrl":"","cachedResultName":"transactions"},"documentId":{"__rl":true,"mode":"url","value":""},"startIndex":"={{ $json.row_number }}"},"credentials":{"googleSheetsOAuth2Api":{"id":"FL23BODpHRnWRCE4","name":"Google Sheets account"}},"typeVersion":4.6},{"id":"f6fe072a-ef50-4f95-87a6-e7b0e047127e","name":"get all transactions","type":"n8n-nodes-base.googleSheets","position":[1120,-200],"parameters":{"options":{},"sheetName":{"__rl":true,"mode":"list","value":"gid=0","cachedResultUrl":"","cachedResultName":"transactions"},"documentId":{"__rl":true,"mode":"url","value":""}},"credentials":{"googleSheetsOAuth2Api":{"id":"FL23BODpHRnWRCE4","name":"Google Sheets account"}},"typeVersion":4.6},{"id":"7af5ea63-d59b-49e6-9a42-c5e85ec4650e","name":"Remove Transaction","type":"@n8n/n8n-nodes-langchain.toolWorkflow","position":[-1600,560],"parameters":{"workflowId":{"__rl":true,"mode":"list","value":"VjYVuVxMuX9MbtGy","cachedResultName":"MCP Personal Expense"},"description":"Remove Transaction","workflowInputs":{"value":{"payload":"={\n  \"id\": \"{{ $fromAI(\"id\", \"ID\", \"string\") }}\"\n}","function":"remove_transaction"},"schema":[{"id":"function","type":"string","display":true,"required":false,"displayName":"function","defaultMatch":false,"canBeUsedToMatch":true},{"id":"payload","type":"object","display":true,"required":false,"displayName":"payload","defaultMatch":false,"canBeUsedToMatch":true}],"mappingMode":"defineBelow","matchingColumns":[],"attemptToConvertTypes":false,"convertFieldsToString":false}},"typeVersion":2.2},{"id":"e8c38268-0876-461a-8b89-ed121c321d4a","name":"Crypto","type":"n8n-nodes-base.crypto","position":[880,520],"parameters":{"action":"generate","dataPropertyName":"id"},"typeVersion":1},{"id":"ed85ffef-9a72-4025-a0e6-7f57eb9c4a0a","name":"If","type":"n8n-nodes-base.if","position":[1280,520],"parameters":{"options":{},"conditions":{"options":{"version":2,"leftValue":"","caseSensitive":true,"typeValidation":"strict"},"combinator":"and","conditions":[{"id":"4e34ce93-3976-4f74-8933-32bc34bc459c","operator":{"name":"filter.operator.equals","type":"string","operation":"equals"},"leftValue":"={{ $json.type }}","rightValue":"expense"}]}},"typeVersion":2.2},{"id":"085c44bd-dfbc-4a37-9f47-c9562e54b699","name":"Get existing budget","type":"n8n-nodes-base.googleSheets","position":[1480,500],"parameters":{"options":{},"filtersUI":{"values":[{"lookupValue":"={{ $json.date.substring(0, 7) }}","lookupColumn":"month"},{"lookupValue":"={{ $json.category }}","lookupColumn":"category"}]},"sheetName":{"__rl":true,"mode":"list","value":1146268703,"cachedResultUrl":"","cachedResultName":"budgets"},"documentId":{"__rl":true,"mode":"url","value":""}},"credentials":{"googleSheetsOAuth2Api":{"id":"FL23BODpHRnWRCE4","name":"Google Sheets account"}},"typeVersion":4.6,"alwaysOutputData":true},{"id":"7e6e1808-4b96-42a0-a696-5ef7a5b1fc6e","name":"Code","type":"n8n-nodes-base.code","position":[1900,320],"parameters":{"jsCode":"\n\nreturn {\n  \"id\": $(\"add transaction\").first().json.id,\n  \"budget\": {},\n  \"task\": \"Ask user to add monthly budget\"\n}"},"typeVersion":2},{"id":"4fe6970d-d46c-42c1-aa32-c5fa9a1f6b80","name":"add transaction","type":"n8n-nodes-base.googleSheets","position":[1080,520],"parameters":{"columns":{"value":{"id":"={{ $json.id }}","date":"={{ $json.payload.date }}","type":"={{ $json.payload.type }}","month":"={{ $json.payload.date.substring(0,7) }}","amount":"={{ $json.payload.amount }}","purpose":"={{ $json.payload.purpose }}","category":"={{ $json.payload.category }}"},"schema":[{"id":"id","type":"string","display":true,"removed":false,"required":false,"displayName":"id","defaultMatch":true,"canBeUsedToMatch":true},{"id":"date","type":"string","display":true,"required":false,"displayName":"date","defaultMatch":false,"canBeUsedToMatch":true},{"id":"purpose","type":"string","display":true,"required":false,"displayName":"purpose","defaultMatch":false,"canBeUsedToMatch":true},{"id":"category","type":"string","display":true,"required":false,"displayName":"category","defaultMatch":false,"canBeUsedToMatch":true},{"id":"amount","type":"string","display":true,"required":false,"displayName":"amount","defaultMatch":false,"canBeUsedToMatch":true},{"id":"type","type":"string","display":true,"required":false,"displayName":"type","defaultMatch":false,"canBeUsedToMatch":true},{"id":"month","type":"string","display":true,"removed":false,"required":false,"displayName":"month","defaultMatch":false,"canBeUsedToMatch":true}],"mappingMode":"defineBelow","matchingColumns":["id"],"attemptToConvertTypes":false,"convertFieldsToString":false},"options":{},"operation":"append","sheetName":{"__rl":true,"mode":"list","value":"gid=0","cachedResultUrl":"","cachedResultName":"transactions"},"documentId":{"__rl":true,"mode":"url","value":""}},"credentials":{"googleSheetsOAuth2Api":{"id":"FL23BODpHRnWRCE4","name":"Google Sheets account"}},"typeVersion":4.6},{"id":"e97f4b19-6d86-4c73-8d64-356c5a6f33fe","name":"budget not found?","type":"n8n-nodes-base.if","position":[1660,500],"parameters":{"options":{},"conditions":{"options":{"version":2,"leftValue":"","caseSensitive":true,"typeValidation":"strict"},"combinator":"and","conditions":[{"id":"d062f954-0a17-4870-b632-aebea115dad9","operator":{"type":"object","operation":"empty","singleValue":true},"leftValue":"={{ $json }}","rightValue":""}]}},"typeVersion":2.2},{"id":"dcebec66-c750-4e64-8974-d659de8c0943","name":"Code1","type":"n8n-nodes-base.code","position":[2140,520],"parameters":{"jsCode":"let totalExpenses = 0;\n\nfor (const item of $('Get Monthly Expenses').all()) {\n  totalExpenses += item.json.amount  \n}\n\nlet result = {\n  \"id\": $('add transaction').first().json.id,\n  \"budget\": {\n    \"monthlyLimit\": $('Get existing budget').first().json.budget,\n    \"remainingLimit\": $('Get existing budget').first().json.budget - totalExpenses\n  },\n  \"task\": \"\"\n}\n\nif (totalExpenses > $('Get existing budget').first().json.budget) {\n  result.task = \"Give warning to user or suggest to adjust the budget\"\n}\n\nreturn result;"},"typeVersion":2},{"id":"9164bfe3-1549-4943-a489-c67da1d32d9d","name":"Get Monthly Expenses","type":"n8n-nodes-base.googleSheets","position":[1900,520],"parameters":{"options":{},"filtersUI":{"values":[{"lookupValue":"={{ $json.month }}","lookupColumn":"month"},{"lookupValue":"={{ $json.category }}","lookupColumn":"category"}]},"sheetName":{"__rl":true,"mode":"list","value":"gid=0","cachedResultUrl":"","cachedResultName":"transactions"},"documentId":{"__rl":true,"mode":"url","value":""}},"credentials":{"googleSheetsOAuth2Api":{"id":"FL23BODpHRnWRCE4","name":"Google Sheets account"}},"typeVersion":4.6},{"id":"ff8d7da3-c567-41f8-af20-88c3248822bb","name":"Add Transaction","type":"@n8n/n8n-nodes-langchain.toolWorkflow","position":[-1440,560],"parameters":{"workflowId":{"__rl":true,"mode":"list","value":"VjYVuVxMuX9MbtGy","cachedResultName":"MCP Personal Expense"},"description":"Add Transaction","workflowInputs":{"value":{"payload":"={   \n  \"date\": \"{{ $fromAI(\"date\", \"Transaction date. Format: YYYY-MM-DD\", \"string\") }}\",   \n  \"purpose\": \"{{ $fromAI(\"purpose\", \"Purpose of the transaction\", \"string\") }}\", \n  \"category\": \"{{ $fromAI(\"category\", \"Transaction category\", \"string\") }}\",\n  \"amount\": {{ $fromAI(\"amount\", \"Transaction amount\", \"number\") }}, \n  \"type\": \"{{ $fromAI(\"type\", \"Transaction type. Can be expense or income\", \"string\") }}\"\n}","function":"add_transaction"},"schema":[{"id":"function","type":"string","display":true,"required":false,"displayName":"function","defaultMatch":false,"canBeUsedToMatch":true},{"id":"payload","type":"object","display":true,"required":false,"displayName":"payload","defaultMatch":false,"canBeUsedToMatch":true}],"mappingMode":"defineBelow","matchingColumns":[],"attemptToConvertTypes":false,"convertFieldsToString":false}},"typeVersion":2.2},{"id":"e71da569-0165-4c3f-917a-b97843aba5bf","name":"Code2","type":"n8n-nodes-base.code","position":[1500,700],"parameters":{"jsCode":"\nreturn {\n  \"id\": $('add transaction').first().json.id,\n  \"budget\": {},\n  \"task\": \"Congratulate user for new income.\"\n}"},"typeVersion":2},{"id":"f601629b-975a-48ba-a832-f53003776246","name":"Update transaction","type":"n8n-nodes-base.googleSheets","position":[900,1020],"parameters":{"columns":{"value":{"id":"={{ $json.payload.id }}","date":"={{ $json.payload.date }}","type":"={{ $json.payload.type }}","month":"={{ $json.payload.date.substring(0,7) }}","amount":"={{ $json.payload.amount }}","purpose":"={{ $json.payload.purpose }}","category":"={{ $json.payload.category }}"},"schema":[{"id":"id","type":"string","display":true,"removed":false,"required":false,"displayName":"id","defaultMatch":true,"canBeUsedToMatch":true},{"id":"date","type":"string","display":true,"required":false,"displayName":"date","defaultMatch":false,"canBeUsedToMatch":true},{"id":"purpose","type":"string","display":true,"required":false,"displayName":"purpose","defaultMatch":false,"canBeUsedToMatch":true},{"id":"category","type":"string","display":true,"required":false,"displayName":"category","defaultMatch":false,"canBeUsedToMatch":true},{"id":"amount","type":"string","display":true,"required":false,"displayName":"amount","defaultMatch":false,"canBeUsedToMatch":true},{"id":"type","type":"string","display":true,"required":false,"displayName":"type","defaultMatch":false,"canBeUsedToMatch":true},{"id":"month","type":"string","display":true,"required":false,"displayName":"month","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":"gid=0","cachedResultUrl":"","cachedResultName":"transactions"},"documentId":{"__rl":true,"mode":"url","value":""}},"credentials":{"googleSheetsOAuth2Api":{"id":"FL23BODpHRnWRCE4","name":"Google Sheets account"}},"typeVersion":4.6},{"id":"0bd3eebb-e341-49cc-87d3-c5ba6fe73da6","name":"If1","type":"n8n-nodes-base.if","position":[1120,1040],"parameters":{"options":{},"conditions":{"options":{"version":2,"leftValue":"","caseSensitive":true,"typeValidation":"strict"},"combinator":"and","conditions":[{"id":"4e34ce93-3976-4f74-8933-32bc34bc459c","operator":{"name":"filter.operator.equals","type":"string","operation":"equals"},"leftValue":"={{ $('Update transaction').item.json.type }}","rightValue":"expense"}]}},"typeVersion":2.2},{"id":"c82171bf-fae5-4407-9af3-c9abddff0b04","name":"Code3","type":"n8n-nodes-base.code","position":[1840,880],"parameters":{"jsCode":"\n\nreturn {\n  \"id\": $(\"Update transaction\").first().json.id,\n  \"budget\": {},\n  \"task\": \"Ask user to add monthly budget\"\n}"},"typeVersion":2},{"id":"740cbba3-76e5-42a4-b8c8-1a33f137a576","name":"budget not found?1","type":"n8n-nodes-base.if","position":[1600,1040],"parameters":{"options":{},"conditions":{"options":{"version":2,"leftValue":"","caseSensitive":true,"typeValidation":"strict"},"combinator":"and","conditions":[{"id":"d062f954-0a17-4870-b632-aebea115dad9","operator":{"type":"object","operation":"empty","singleValue":true},"leftValue":"={{ $json }}","rightValue":""}]}},"typeVersion":2.2},{"id":"d297855a-d70d-43cb-83d6-df2e712698d8","name":"Code4","type":"n8n-nodes-base.code","position":[2080,1060],"parameters":{"jsCode":"let totalExpenses = 0;\n\nfor (const item of $('Get Monthly Expenses1').all()) {\n  totalExpenses += item.json.amount  \n}\n\nlet result = {\n  \"id\": $('Update transaction').first().json.id,\n  \"budget\": {\n    \"monthlyLimit\": $('Get existing budget2').first().json.budget,\n    \"remainingLimit\": $('Get existing budget2').first().json.budget - totalExpenses\n  },\n  \"task\": \"\"\n}\n\nif (totalExpenses > $('Get existing budget2').first().json.budget) {\n  result.task = \"Give warning to user or suggest to adjust the budget\"\n}\n\nreturn result;"},"typeVersion":2},{"id":"3369be8c-67cc-4b2d-9c04-fb712afa6509","name":"Get Monthly Expenses1","type":"n8n-nodes-base.googleSheets","position":[1840,1060],"parameters":{"options":{},"filtersUI":{"values":[{"lookupValue":"={{ $json.month }}","lookupColumn":"month"},{"lookupValue":"={{ $json.category }}","lookupColumn":"category"}]},"sheetName":{"__rl":true,"mode":"list","value":"gid=0","cachedResultUrl":"","cachedResultName":"transactions"},"documentId":{"__rl":true,"mode":"url","value":""}},"credentials":{"googleSheetsOAuth2Api":{"id":"FL23BODpHRnWRCE4","name":"Google Sheets account"}},"typeVersion":4.6},{"id":"4ae8401e-0ad5-43b4-aa72-b04edc150d4d","name":"Code5","type":"n8n-nodes-base.code","position":[1440,1240],"parameters":{"jsCode":"\nreturn {\n  \"id\": $('add transaction').first().json.id,\n  \"budget\": {},\n  \"task\": \"Congratulate user for new income.\"\n}"},"typeVersion":2},{"id":"ebcd4517-f735-4378-8c25-1b48e4593808","name":"Get Existing Budget","type":"n8n-nodes-base.googleSheets","position":[920,1500],"parameters":{"options":{},"filtersUI":{"values":[{"lookupValue":"={{ $json.payload.category }}","lookupColumn":"category"},{"lookupValue":"={{ $json.payload.month }}","lookupColumn":"month"}]},"sheetName":{"__rl":true,"mode":"list","value":1146268703,"cachedResultUrl":"","cachedResultName":"budgets"},"documentId":{"__rl":true,"mode":"url","value":""}},"credentials":{"googleSheetsOAuth2Api":{"id":"FL23BODpHRnWRCE4","name":"Google Sheets account"}},"typeVersion":4.6,"alwaysOutputData":true},{"id":"76132552-d70d-46dd-add6-39436430699f","name":"Get existing budget2","type":"n8n-nodes-base.googleSheets","position":[1420,1040],"parameters":{"options":{},"filtersUI":{"values":[{"lookupValue":"={{ $json.date.substring(0, 7) }}","lookupColumn":"month"},{"lookupValue":"={{ $json.category }}","lookupColumn":"category"}]},"sheetName":{"__rl":true,"mode":"list","value":1146268703,"cachedResultUrl":"","cachedResultName":"budgets"},"documentId":{"__rl":true,"mode":"url","value":""}},"credentials":{"googleSheetsOAuth2Api":{"id":"FL23BODpHRnWRCE4","name":"Google Sheets account"}},"typeVersion":4.6,"alwaysOutputData":true},{"id":"4d91a329-61d5-4ceb-a51a-27278c9112ad","name":"Add budget","type":"n8n-nodes-base.googleSheets","position":[1440,1480],"parameters":{"columns":{"value":{"month":"={{ $('Switch').item.json.payload.month }}","budget":"={{ $('Switch').item.json.payload.amount }}","category":"={{ $('Switch').item.json.payload.category }}"},"schema":[{"id":"month","type":"string","display":true,"required":false,"displayName":"month","defaultMatch":false,"canBeUsedToMatch":true},{"id":"category","type":"string","display":true,"required":false,"displayName":"category","defaultMatch":false,"canBeUsedToMatch":true},{"id":"budget","type":"string","display":true,"required":false,"displayName":"budget","defaultMatch":false,"canBeUsedToMatch":true}],"mappingMode":"defineBelow","matchingColumns":[],"attemptToConvertTypes":false,"convertFieldsToString":false},"options":{},"operation":"append","sheetName":{"__rl":true,"mode":"list","value":1146268703,"cachedResultUrl":"","cachedResultName":"budgets"},"documentId":{"__rl":true,"mode":"url","value":""}},"credentials":{"googleSheetsOAuth2Api":{"id":"FL23BODpHRnWRCE4","name":"Google Sheets account"}},"typeVersion":4.6},{"id":"83c5093e-fa10-4bcc-b684-e5bd22fdfd00","name":"Code6","type":"n8n-nodes-base.code","position":[1440,1680],"parameters":{"jsCode":"\n\nreturn {\n  \"task\": \"Budget already exists. Ask user to update it instead.\"\n}"},"typeVersion":2},{"id":"f83089ee-33de-48a0-8440-f02988ddd736","name":"Get Existing Budget1","type":"n8n-nodes-base.googleSheets","position":[940,1960],"parameters":{"options":{},"filtersUI":{"values":[{"lookupValue":"={{ $json.payload.month }}","lookupColumn":"month"},{"lookupValue":"={{ $json.payload.category }}","lookupColumn":"category"}]},"sheetName":{"__rl":true,"mode":"list","value":1146268703,"cachedResultUrl":"","cachedResultName":"budgets"},"documentId":{"__rl":true,"mode":"url","value":""}},"credentials":{"googleSheetsOAuth2Api":{"id":"FL23BODpHRnWRCE4","name":"Google Sheets account"}},"typeVersion":4.6},{"id":"84bcedda-5a53-4dbe-a2d9-811f96f13fd6","name":"Code7","type":"n8n-nodes-base.code","position":[1360,1940],"parameters":{"jsCode":"\n\nreturn {\n  \"task\": \"Budget not found. Ask user to add budget instead.\"\n}"},"typeVersion":2},{"id":"d761eb69-7f8d-4f7a-9f16-f06a863fa2a6","name":"Update Budget","type":"n8n-nodes-base.googleSheets","position":[1360,2120],"parameters":{"columns":{"value":{"month":"={{ $('Switch').item.json.payload.month }}","budget":"={{ $('Switch').item.json.payload.amount }}","category":"={{ $('Switch').item.json.payload.category }}","row_number":"={{ $json.row_number }}"},"schema":[{"id":"month","type":"string","display":true,"required":false,"displayName":"month","defaultMatch":false,"canBeUsedToMatch":true},{"id":"category","type":"string","display":true,"required":false,"displayName":"category","defaultMatch":false,"canBeUsedToMatch":true},{"id":"budget","type":"string","display":true,"required":false,"displayName":"budget","defaultMatch":false,"canBeUsedToMatch":true},{"id":"row_number","type":"string","display":true,"removed":false,"readOnly":true,"required":false,"displayName":"row_number","defaultMatch":false,"canBeUsedToMatch":true}],"mappingMode":"defineBelow","matchingColumns":["row_number"],"attemptToConvertTypes":false,"convertFieldsToString":false},"options":{},"operation":"update","sheetName":{"__rl":true,"mode":"list","value":1146268703,"cachedResultUrl":"","cachedResultName":"budgets"},"documentId":{"__rl":true,"mode":"url","value":""}},"credentials":{"googleSheetsOAuth2Api":{"id":"FL23BODpHRnWRCE4","name":"Google Sheets account"}},"typeVersion":4.6},{"id":"1ea98857-1eac-4135-87b9-be5b89df0a0f","name":"Get Existing Budget2","type":"n8n-nodes-base.googleSheets","position":[940,2420],"parameters":{"options":{},"filtersUI":{"values":[{"lookupValue":"={{ $json.payload.category }}","lookupColumn":"category"},{"lookupValue":"={{ $json.payload.month }}","lookupColumn":"month"}]},"sheetName":{"__rl":true,"mode":"list","value":1146268703,"cachedResultUrl":"","cachedResultName":"budgets"},"documentId":{"__rl":true,"mode":"url","value":""}},"credentials":{"googleSheetsOAuth2Api":{"id":"FL23BODpHRnWRCE4","name":"Google Sheets account"}},"typeVersion":4.6,"alwaysOutputData":true},{"id":"2c3cc9d2-2001-4698-9529-1373c43bebef","name":"budget not found?4","type":"n8n-nodes-base.if","position":[1120,2420],"parameters":{"options":{},"conditions":{"options":{"version":2,"leftValue":"","caseSensitive":true,"typeValidation":"strict"},"combinator":"and","conditions":[{"id":"d062f954-0a17-4870-b632-aebea115dad9","operator":{"type":"object","operation":"empty","singleValue":true},"leftValue":"={{ $json }}","rightValue":""}]}},"typeVersion":2.2},{"id":"32259e82-ea9f-475f-9b5d-609e1bc63595","name":"Code8","type":"n8n-nodes-base.code","position":[1360,2400],"parameters":{"jsCode":"\n\nreturn {\n  \"task\": \"Budget not found, nothing to remove.\"\n}"},"typeVersion":2},{"id":"d5f55296-427e-4525-b71a-7015b89b9215","name":"Sticky Note","type":"n8n-nodes-base.stickyNote","position":[-2580,260],"parameters":{"width":2040,"height":540,"content":"## MCP Main tools\n\nThis is an MCP main entry point. \nIt has several tools that are available to use by AI client.\n\nMost of the tools will execute another workflow\n\n\n### How to use\n\n* You need to be able to sign in via google in order to use google sheets node. \n  Refer to this [documentation](https://docs.n8n.io/integrations/builtin/credentials/google/) on how to sign in with google.\n* Copy this [google sheet template](https://docs.google.com/spreadsheets/d/1XzoYEZflj1Rdo2MVKosRqXHSjkazE5vuwYWHLybX4b0/edit?usp=sharing)\n* after you copy the sheet, make sure you enable sharing with everyone who has the link\n* In each google sheet nodes, change `document` source to `By URL`, paste the link in the URL field\n* For the nodes that related to transaction, change the `sheet` target to `transactions`\n* For the nodes that related to budget, change the `sheet` target to `budgets`"},"typeVersion":1},{"id":"605dcb3d-1bd9-403a-b50a-75ffdb755c0a","name":"Update Transaction","type":"@n8n/n8n-nodes-langchain.toolWorkflow","position":[-1280,560],"parameters":{"workflowId":{"__rl":true,"mode":"list","value":"VjYVuVxMuX9MbtGy","cachedResultName":"MCP Personal Expense"},"description":"Update Transaction","workflowInputs":{"value":{"payload":"={   \n  \"id\": \"{{ $fromAI(\"id\", \"UUID of the transaction.\", \"string\") }}\",\n  \"date\": \"{{ $fromAI(\"date\", \"Transaction date. Format: YYYY-MM-DD\", \"string\") }}\",   \n  \"purpose\": \"{{ $fromAI(\"purpose\", \"Purpose of the transaction\", \"string\") }}\", \n  \"category\": \"{{ $fromAI(\"category\", \"Transaction category\", \"string\") }}\",\n  \"amount\": {{ $fromAI(\"amount\", \"Transaction amount\", \"number\") }}, \n  \"type\": \"{{ $fromAI(\"type\", \"Transaction type. Can be expense or income\", \"string\") }}\"\n}","function":"update_transaction"},"schema":[{"id":"function","type":"string","display":true,"required":false,"displayName":"function","defaultMatch":false,"canBeUsedToMatch":true},{"id":"payload","type":"object","display":true,"required":false,"displayName":"payload","defaultMatch":false,"canBeUsedToMatch":true}],"mappingMode":"defineBelow","matchingColumns":[],"attemptToConvertTypes":false,"convertFieldsToString":false}},"typeVersion":2.2},{"id":"65352e90-d0b3-4a93-94bc-a31e32efb6ea","name":"Add Budget","type":"@n8n/n8n-nodes-langchain.toolWorkflow","position":[-1120,560],"parameters":{"workflowId":{"__rl":true,"mode":"list","value":"VjYVuVxMuX9MbtGy","cachedResultName":"MCP Personal Expense"},"description":"Add monthly budget","workflowInputs":{"value":{"payload":"={   \n  \"month\": \"{{ $fromAI(\"month\", \"Budget month. Format : YYYY-MM\", \"string\") }}\",\n  \"category\": \"{{ $fromAI(\"category\", \"Budget category\", \"string\") }}\",   \n  \"amount\": {{ $fromAI(\"amount\", \"Budget amount\", \"number\") }}\n}","function":"add_budget"},"schema":[{"id":"function","type":"string","display":true,"required":false,"displayName":"function","defaultMatch":false,"canBeUsedToMatch":true},{"id":"payload","type":"object","display":true,"required":false,"displayName":"payload","defaultMatch":false,"canBeUsedToMatch":true}],"mappingMode":"defineBelow","matchingColumns":[],"attemptToConvertTypes":false,"convertFieldsToString":false}},"typeVersion":2.2},{"id":"6c1666ec-7ebd-4f61-98db-06dc6c892892","name":"Update Budget Tool","type":"@n8n/n8n-nodes-langchain.toolWorkflow","position":[-980,560],"parameters":{"workflowId":{"__rl":true,"mode":"list","value":"VjYVuVxMuX9MbtGy","cachedResultName":"MCP Personal Expense"},"description":"Update monthly budget","workflowInputs":{"value":{"payload":"={   \n  \"month\": \"{{ $fromAI(\"month\", \"Budget month. Format : YYYY-MM\", \"string\") }}\",\n  \"category\": \"{{ $fromAI(\"category\", \"Budget category\", \"string\") }}\",   \n  \"amount\": {{ $fromAI(\"amount\", \"Budget amount\", \"number\") }}\n}","function":"update_budget"},"schema":[{"id":"function","type":"string","display":true,"required":false,"displayName":"function","defaultMatch":false,"canBeUsedToMatch":true},{"id":"payload","type":"object","display":true,"required":false,"displayName":"payload","defaultMatch":false,"canBeUsedToMatch":true}],"mappingMode":"defineBelow","matchingColumns":[],"attemptToConvertTypes":false,"convertFieldsToString":false}},"typeVersion":2.2},{"id":"2544655e-d5fd-476f-9185-5fe67f28b425","name":"Remove Budget","type":"@n8n/n8n-nodes-langchain.toolWorkflow","position":[-820,560],"parameters":{"workflowId":{"__rl":true,"mode":"list","value":"VjYVuVxMuX9MbtGy","cachedResultName":"MCP Personal Expense"},"description":"Remove Budget","workflowInputs":{"value":{"payload":"={   \n  \"month\": \"{{ $fromAI(\"month\", \"Budget month. Format : YYYY-MM\", \"string\") }}\",\n  \"category\": \"{{ $fromAI(\"category\", \"Budget category\", \"string\") }}\"\n}","function":"remove_budget"},"schema":[{"id":"function","type":"string","display":true,"required":false,"displayName":"function","defaultMatch":false,"canBeUsedToMatch":true},{"id":"payload","type":"object","display":true,"required":false,"displayName":"payload","defaultMatch":false,"canBeUsedToMatch":true}],"mappingMode":"defineBelow","matchingColumns":[],"attemptToConvertTypes":false,"convertFieldsToString":false}},"typeVersion":2.2},{"id":"021e523b-c47f-4b06-9104-279e7013df6b","name":"Execution Data","type":"n8n-nodes-base.executionData","position":[180,420],"parameters":{"dataToSave":{"values":[{"key":"function","value":"={{ $('Google Sheets Filter Workflow').item.json.function }}"},{"key":"payload","value":"={{ JSON.stringify($('Google Sheets Filter Workflow').item.json.payload) }}"}]}},"typeVersion":1},{"id":"dc42a268-4b4d-46a2-9caa-04400bccfbbc","name":"Sticky Note1","type":"n8n-nodes-base.stickyNote","position":[1620,-420],"parameters":{"color":6,"width":580,"height":180,"content":"### Get all transaction\n\nIt will get list of transactions. \n\nSince currently google sheets integration doesn't support date range filter, so if the start date and end date criterial fall into same month it will get data by filtering helper column `month`. But if they're different month, then it get all transactions"},"typeVersion":1},{"id":"acaaf56e-62c6-4b08-a7dc-2837fe153229","name":"If2","type":"n8n-nodes-base.if","position":[840,-360],"parameters":{"options":{},"conditions":{"options":{"version":2,"leftValue":"","caseSensitive":true,"typeValidation":"strict"},"combinator":"and","conditions":[{"id":"7fc9f6b2-f43e-41da-b3cb-969c70ac3b46","operator":{"name":"filter.operator.equals","type":"string","operation":"equals"},"leftValue":"={{ $json.payload.dateStart.substring(0,7) }}","rightValue":"={{ $json.payload.dateEnd.substring(0,7) }}"}]}},"typeVersion":2.2},{"id":"31a41bd8-f14f-45a0-8611-5a778b502312","name":"get all transactions1","type":"n8n-nodes-base.googleSheets","position":[1120,-480],"parameters":{"options":{},"filtersUI":{"values":[{"lookupValue":"={{ $json.payload.dateStart.substring(0,7) }}","lookupColumn":"month"}]},"sheetName":{"__rl":true,"mode":"list","value":"gid=0","cachedResultUrl":"","cachedResultName":"transactions"},"documentId":{"__rl":true,"mode":"url","value":""}},"credentials":{"googleSheetsOAuth2Api":{"id":"FL23BODpHRnWRCE4","name":"Google Sheets account"}},"typeVersion":4.6},{"id":"7e99365b-555e-470d-bad1-1a406ba20a15","name":"Sticky Note2","type":"n8n-nodes-base.stickyNote","position":[1400,40],"parameters":{"color":6,"width":320,"height":180,"content":"### Remove transaction\n\nIt will remove transaction by ID. However we need to get the transaction first before removing to get row number. Because removing transaction needs a row number, can't be filtered by anything"},"typeVersion":1},{"id":"b470904a-69db-4e88-9656-ccc736114c87","name":"Sticky Note3","type":"n8n-nodes-base.stickyNote","position":[2380,480],"parameters":{"color":6,"width":500,"height":200,"content":"### Add transaction\n\nIt will add transaction to a new row. In this workflow it will also check for the existing budget.\n\nIn the response, it has `task` field that will tell AI client what to do next. Either it will suggest user to add budget, or give warning if the budget already reached or surpassed."},"typeVersion":1},{"id":"4ddd4f34-be88-40f9-bfbc-84c3707f485d","name":"Sticky Note4","type":"n8n-nodes-base.stickyNote","position":[2380,1020],"parameters":{"color":6,"width":540,"height":200,"content":"### Update transaction\n\nIt will update transaction by ID. In this workflow it will also check for the existing budget.\n\nIt has the same checking budget workflow with the add transaction. I have to duplicate it since in the end it needs to ID from the different previous node. Currently n8n doesn't allow check return value from the node that has not been executed."},"typeVersion":1},{"id":"4fe2b09d-ece3-4686-a3bd-8e80800957d0","name":"Sticky Note5","type":"n8n-nodes-base.stickyNote","position":[1700,1460],"parameters":{"color":6,"width":340,"height":280,"content":"### Add monthly budget\n\nIt will add monthly budget.\n\n#### pro tip :\nYou can ask AI client to add budget for several months by prompting such \n\n```\nAdd budget for fashion for this month until the end of the year, $500 per month\n```"},"typeVersion":1},{"id":"8e7b0528-61e7-43cb-941c-28cd4dd6e423","name":"Sticky Note6","type":"n8n-nodes-base.stickyNote","position":[1620,2020],"parameters":{"color":6,"width":260,"height":120,"content":"### update monthly budget\n\nIt will update budget"},"typeVersion":1},{"id":"7da84021-9af7-496e-8089-ac2237beba24","name":"budget not found?2","type":"n8n-nodes-base.if","position":[1140,1500],"parameters":{"options":{},"conditions":{"options":{"version":2,"leftValue":"","caseSensitive":true,"typeValidation":"strict"},"combinator":"and","conditions":[{"id":"d062f954-0a17-4870-b632-aebea115dad9","operator":{"type":"object","operation":"empty","singleValue":true},"leftValue":"={{ $json }}","rightValue":""}]}},"typeVersion":2.2},{"id":"b6c0e7ff-92b8-43cf-b037-8adfa2b07a05","name":"budget not found?3","type":"n8n-nodes-base.if","position":[1140,1960],"parameters":{"options":{},"conditions":{"options":{"version":2,"leftValue":"","caseSensitive":true,"typeValidation":"strict"},"combinator":"and","conditions":[{"id":"d062f954-0a17-4870-b632-aebea115dad9","operator":{"type":"object","operation":"empty","singleValue":true},"leftValue":"={{ $json }}","rightValue":""}]}},"typeVersion":2.2},{"id":"dd3206eb-134c-44a2-bcd2-08bd28c408de","name":"Sticky Note7","type":"n8n-nodes-base.stickyNote","position":[1620,2460],"parameters":{"color":6,"width":260,"height":120,"content":"### Remove budget\n\nIt will remove existing budget"},"typeVersion":1},{"id":"cb4aae48-7fa0-42ca-8052-441758d8775c","name":"Remove budget","type":"n8n-nodes-base.googleSheets","position":[1360,2580],"parameters":{"operation":"delete","sheetName":{"__rl":true,"mode":"list","value":1146268703,"cachedResultUrl":"","cachedResultName":"budgets"},"documentId":{"__rl":true,"mode":"url","value":""},"startIndex":"={{ $json.row_number }}"},"credentials":{"googleSheetsOAuth2Api":{"id":"FL23BODpHRnWRCE4","name":"Google Sheets account"}},"typeVersion":4.6},{"id":"bb0b7988-c13c-47e7-be28-2e3fc942e566","name":"Get Existing Budget3","type":"n8n-nodes-base.googleSheets","position":[960,2840],"parameters":{"options":{},"filtersUI":{"values":[{"lookupValue":"={{ $json.payload.category }}","lookupColumn":"category"},{"lookupValue":"={{ $json.payload.month }}","lookupColumn":"month"}]},"sheetName":{"__rl":true,"mode":"list","value":1146268703,"cachedResultUrl":"","cachedResultName":"budgets"},"documentId":{"__rl":true,"mode":"url","value":""}},"credentials":{"googleSheetsOAuth2Api":{"id":"FL23BODpHRnWRCE4","name":"Google Sheets account"}},"typeVersion":4.6,"alwaysOutputData":true},{"id":"bca9ba8a-9d65-4d85-bfbb-8fcb71a73dce","name":"Sticky Note8","type":"n8n-nodes-base.stickyNote","position":[1200,2840],"parameters":{"color":6,"width":260,"height":120,"content":"### Get existing budget\n\nIt will get existing budget"},"typeVersion":1},{"id":"bce1c72b-a5e8-415b-8c26-b15405da7d9f","name":"Get Budget","type":"@n8n/n8n-nodes-langchain.toolWorkflow","position":[-680,560],"parameters":{"workflowId":{"__rl":true,"mode":"list","value":"VjYVuVxMuX9MbtGy","cachedResultName":"MCP Personal Expense"},"description":"Get Budget","workflowInputs":{"value":{"payload":"={      \"month\": \"{{ $fromAI(\"month\", \"Budget month. Format : YYYY-MM\", \"string\") }}\",   \"category\": \"{{ $fromAI(\"category\", \"Budget category\", \"string\") }}\" }","function":"get_budget"},"schema":[{"id":"function","type":"string","display":true,"required":false,"displayName":"function","defaultMatch":false,"canBeUsedToMatch":true},{"id":"payload","type":"object","display":true,"required":false,"displayName":"payload","defaultMatch":false,"canBeUsedToMatch":true}],"mappingMode":"defineBelow","matchingColumns":[],"attemptToConvertTypes":false,"convertFieldsToString":false}},"typeVersion":2.2},{"id":"f4485275-c028-4888-90bd-414d488e0a74","name":"Sticky Note9","type":"n8n-nodes-base.stickyNote","position":[-2580,60],"parameters":{"color":4,"width":420,"content":"# MCP Personal Expense\n\nThis is a template for MCP that has tools to manage personal expenses and budget"},"typeVersion":1}],"active":true,"settings":{"executionOrder":"v1"},"versionId":"f79633ea-5057-4b65-b41e-4dbb80470657","connections":{"If":{"main":[[{"node":"Get existing budget","type":"main","index":0}],[{"node":"Code2","type":"main","index":0}]]},"If1":{"main":[[{"node":"Get existing budget2","type":"main","index":0}],[{"node":"Code5","type":"main","index":0}]]},"If2":{"main":[[{"node":"get all transactions1","type":"main","index":0}],[{"node":"get all transactions","type":"main","index":0}]]},"Crypto":{"main":[[{"node":"add transaction","type":"main","index":0}]]},"Filter":{"main":[[]]},"Switch":{"main":[[{"node":"If2","type":"main","index":0}],[{"node":"get by id","type":"main","index":0}],[{"node":"Crypto","type":"main","index":0}],[{"node":"Update transaction","type":"main","index":0}],[{"node":"Get Existing Budget","type":"main","index":0}],[{"node":"Get Existing Budget1","type":"main","index":0}],[{"node":"Get Existing Budget2","type":"main","index":0}],[{"node":"Get Existing Budget3","type":"main","index":0}]]},"Get By ID":{"ai_tool":[[{"node":"MCP Server Trigger","type":"ai_tool","index":0}]]},"get by id":{"main":[[{"node":"remove transaction","type":"main","index":0}]]},"Add Budget":{"ai_tool":[[{"node":"MCP Server Trigger","type":"ai_tool","index":0}]]},"Add budget":{"main":[[]]},"Get Budget":{"ai_tool":[[{"node":"MCP Server Trigger","type":"ai_tool","index":0}]]},"Remove Budget":{"ai_tool":[[{"node":"MCP Server Trigger","type":"ai_tool","index":0}]]},"Execution Data":{"main":[[{"node":"Switch","type":"main","index":0}]]},"Add Transaction":{"ai_tool":[[{"node":"MCP Server Trigger","type":"ai_tool","index":0}]]},"add transaction":{"main":[[{"node":"If","type":"main","index":0}]]},"budget not found?":{"main":[[{"node":"Code","type":"main","index":0}],[{"node":"Get Monthly Expenses","type":"main","index":0}]]},"Remove Transaction":{"ai_tool":[[{"node":"MCP Server Trigger","type":"ai_tool","index":0}]]},"Update Budget Tool":{"ai_tool":[[{"node":"MCP Server Trigger","type":"ai_tool","index":0}]]},"Update Transaction":{"ai_tool":[[{"node":"MCP Server Trigger","type":"ai_tool","index":0}]]},"Update transaction":{"main":[[{"node":"If1","type":"main","index":0}]]},"budget not found?1":{"main":[[{"node":"Code3","type":"main","index":0}],[{"node":"Get Monthly Expenses1","type":"main","index":0}]]},"budget not found?2":{"main":[[{"node":"Add budget","type":"main","index":0}],[{"node":"Code6","type":"main","index":0}]]},"budget not found?3":{"main":[[{"node":"Code7","type":"main","index":0}],[{"node":"Update Budget","type":"main","index":0}]]},"budget not found?4":{"main":[[{"node":"Code8","type":"main","index":0}],[{"node":"Remove budget","type":"main","index":0}]]},"Get Existing Budget":{"main":[[{"node":"budget not found?2","type":"main","index":0}]]},"Get existing budget":{"main":[[{"node":"budget not found?","type":"main","index":0}]]},"Get Existing Budget1":{"main":[[{"node":"budget not found?3","type":"main","index":0}]]},"Get Existing Budget2":{"main":[[{"node":"budget not found?4","type":"main","index":0}]]},"Get Monthly Expenses":{"main":[[{"node":"Code1","type":"main","index":0}]]},"Get existing budget2":{"main":[[{"node":"budget not found?1","type":"main","index":0}]]},"get all transactions":{"main":[[{"node":"Filter","type":"main","index":0}]]},"Get Monthly Expenses1":{"main":[[{"node":"Code4","type":"main","index":0}]]},"Get list transactions":{"ai_tool":[[{"node":"MCP Server Trigger","type":"ai_tool","index":0}]]},"get all transactions1":{"main":[[{"node":"Filter","type":"main","index":0}]]},"Google Sheets Filter Workflow":{"main":[[{"node":"Execution Data","type":"main","index":0}]]}}}


name: Daily AI Stock Briefing Right to Your Email: OpenAI + Tavily + Gmail
author_name: Automate With Marc
author_username: marconi
categories: []
created_at: 2025-06-03T10:36:48.730Z
updated_at: 2025-06-03T10:36:48.730Z
url: https://n8n.io/workflows/4617
scraped_at: 2025-07-06 21:16:30
description:
  This n8n workflow template uses community nodes and is only compatible with the self-hosted version of n8n. 

  📈 StockPulse: AI-Picked Daily News for Your Portfolio
  Stay ahead of the market with this automated, AI-powered stock market news briefing delivered straight to your inbox — no code required.

  Watch Step-by-step Video Tutorial Here:
  https://www.youtube.com/watch?v=iZvPej9eLYE&t=201s

  ⚙️ What it does:
  This workflow runs every morning and:

  Triggers a scheduled prompt to a Langchain AI Agent (OpenAI)

  Uses the Tavily Web Search API to fetch fresh financial news relevant to your watchlist or portfolio

  Summarizes the top stories, highlighting:

  🔍 Key headlines

  💡 Investment opportunities

  ⚠️ Risks and macro trends

  📊 Suggested trades

  Sends a clean, readable email via Gmail to your preferred address

  🔧 Built with:
  🧠 Langchain AI Agent (OpenAI GPT-4o)

  🔍 Tavily Search Tool

  📬 Gmail Node for Email Delivery

  ⏰ Daily Cron Trigger (customizable)

  💼 Who it’s for:
  Investors and traders who want to save time on news gathering

  Financial creators looking for curated, actionable insights

  Non-technical users interested in automating stock news monitoring

  Anyone who wants to combine AI + automation + market data

  🟢 Customize easily: Edit your stock list or news focus inside the Agent prompt
  📨 Email ready: Just plug in your Gmail credentials and you’re good to go
  ⏱️ 10-minute setup — no coding required!

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

workflow_json:
  {"id":"MPdLnvVyvH0V6l32","meta":{"instanceId":"1c7b08fed4406d546caf4a44e8b942ca317e7e207bb9a5701955a1a6e1ce1843","templateCredsSetupCompleted":true},"name":"Stock Market News","tags":[],"nodes":[{"id":"d75e61cc-1661-4690-acbe-44b9b453f81d","name":"Schedule Trigger","type":"n8n-nodes-base.scheduleTrigger","position":[-60,0],"parameters":{"rule":{"interval":[{"triggerAtHour":10}]}},"typeVersion":1.2},{"id":"819d9801-3ffb-47a5-9001-f2163b841e54","name":"AI Agent","type":"@n8n/n8n-nodes-langchain.agent","position":[260,0],"parameters":{"text":"=Today is {{ $json['Readable date'] }} Send me a summary of the stock market news today. Return the output in an easily readable email friendly format.","options":{"systemMessage":"You are a market research assistant responsible for generating a concise yet insightful Daily Stock Market Intelligence Briefing. Your audience is an active investor with holdings in the S&P 500 index, Nvidia (NVDA), Google (GOOGL), Microsoft (MSFT), Amazon (AMZN), gold, Chinese Broad ETF and select U.S. banking stocks.\n\n#Tool\nUse Tavily as the web search tool for your research.\n\nEach day, your job is to:\n\n📰 1. Curate Key Market Headlines (Concise Summary Format)\nInclude 5–7 top headlines affecting the U.S. stock market. These can include:\n\nMacroeconomic indicators (CPI, interest rates, job reports, Fed decisions)\n\nMajor geopolitical developments\n\nSignificant corporate earnings\n\nTech sector or AI innovation news (especially related to NVDA, GOOGL, MSFT, AMZN)\n\nGold price movement triggers\n\nFinancial sector news impacting banks (e.g., regulation, stress tests, default risks)\n\n📈 2. Highlight Noteworthy Investing or Trading Opportunities\nIdentify any:\n\nUndervalued assets based on sentiment/news\n\nBreakouts or technical momentum setups\n\nNew AI or tech developments likely to benefit NVDA, MSFT, GOOGL\n\nBanking trends such as earnings strength, credit risk\n\nGold catalysts (inflation hedge, rate cuts, geopolitical risk)\n\nInclude:\n\nWhat the opportunity is\n\nWhy it matters (news or trend context)\n\nTime sensitivity (short-term/medium-term)\n\n⚠️ 3. Outline Key Risks or Headwinds\nInclude:\n\nMacro risks (e.g., rate hikes, inflationary concerns, China/US tensions)\n\nSector-specific concerns (e.g., chip supply for NVDA, ad spending for GOOGL/AMZN)\n\nBlack swan or tail risks (e.g., systemic banking risk, debt ceiling)\n\n💡 4. Provide Actionable Trade Suggestions\nBased on the analysis above, suggest 1–3 potential trade actions, such as:\n\nBuy/sell/hold recommendations\n\nRebalancing ideas (e.g., shifting from tech to gold if macro risk rises)\n\nThematic ETF ideas (e.g., AI ETFs, inverse financials, S&P sector rotations)\n\nMention if the recommendation is tactical (short-term) or strategic (long-term)\n\nEach suggestion should include:\n\nThe reasoning (based on news/macro)\n\nSuggested time horizon\n\nRisk caveat or alternate view\n"},"promptType":"define"},"typeVersion":2},{"id":"0a3ed626-6c8c-400d-b5de-6a57576a717b","name":"OpenAI Chat Model","type":"@n8n/n8n-nodes-langchain.lmChatOpenAi","position":[200,200],"parameters":{"model":{"__rl":true,"mode":"list","value":"gpt-4o-mini"},"options":{}},"credentials":{},"typeVersion":1.2},{"id":"d6aba54b-a170-4d44-819e-57818932813d","name":"Simple Memory","type":"@n8n/n8n-nodes-langchain.memoryBufferWindow","position":[340,200],"parameters":{"sessionKey":"={{ $workflow.id }}","sessionIdType":"customKey"},"typeVersion":1.3},{"id":"4261f9b3-e714-4152-a5fa-8cc7139f8aa5","name":"Tavily","type":"@tavily/n8n-nodes-tavily.tavilyTool","position":[480,200],"parameters":{"query":"={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Query', ``, 'string') }}","options":{}},"credentials":{},"typeVersion":1},{"id":"4f3a563f-7032-4019-ab47-c44298fb4082","name":"Gmail","type":"n8n-nodes-base.gmail","position":[640,0],"webhookId":"REDACTED_WEBHOOK_ID","parameters":{"sendTo":"your@email.com","message":"={{ $json.output }}","options":{},"subject":"Daily Stock Market Updates","emailType":"text"},"credentials":{},"typeVersion":2.1},{"id":"068a5cd5-55f2-4a3c-9c75-f6e7ae9eef70","name":"Sticky Note","type":"n8n-nodes-base.stickyNote","position":[-140,-100],"parameters":{"width":260,"height":520,"content":"Scheduled Daily Trigger"},"typeVersion":1},{"id":"ed020827-e777-4ee2-8280-623beb40e914","name":"Sticky Note1","type":"n8n-nodes-base.stickyNote","position":[140,-100],"parameters":{"color":3,"width":460,"height":520,"content":"AI Agent & Tavily Information Extractor"},"typeVersion":1},{"id":"c97a9fa7-1bac-457f-bbc8-07db6f7b07fd","name":"Sticky Note2","type":"n8n-nodes-base.stickyNote","position":[620,-100],"parameters":{"color":3,"height":520,"content":"Send to Email"},"typeVersion":1},{"id":"c0ef8936-88e3-45dd-819b-3940e91bc893","name":"Sticky Note3","type":"n8n-nodes-base.stickyNote","position":[-760,-100],"parameters":{"color":4,"width":600,"height":900,"content":"📰 Daily AI-Powered Stock Market Briefing via Email\nAutomate your market research with this intelligent workflow designed for busy investors and professionals.\n\n🔧 What it does:\nEvery morning at 10 AM, this automation:\n\nTriggers a scheduled prompt to an AI Agent\n\nUses Tavily Web Search to pull the latest U.S. stock market headlines\n\nSummarizes insights based on a sample portfolio (S&P 500, NVDA, MSFT, GOOGL, AMZN, gold, and bank stocks)\n\nWatch Step-by-step Tutorial Video Guide here:\nhttps://www.youtube.com/@Automatewithmarc\n\nHighlights:\n\n🗞️ 5–7 key headlines\n\n💡 Investment opportunities\n\n⚠️ Market risks\n\n📈 Trade suggestions\n\nSends the summary directly to your email inbox via Gmail\n\n🧠 Built with:\n🧠 LangChain AI Agent (powered by GPT-4o)\n\n🔍 Tavily Search Tool for real-time financial news\n\n📧 Gmail node for email delivery\n\n⏰ Daily trigger node for automation\n\n\n💼 Perfect for:\nIndividual investors & traders\n\nFinancial content creators\n\nPortfolio managers\n\nAnyone who wants actionable, AI-curated news without lifting a finger"},"typeVersion":1}],"active":false,"settings":{"executionOrder":"v1"},"versionId":"f489a874-59cb-486c-8804-cd4320333c55","connections":{"Tavily":{"ai_tool":[[{"node":"AI Agent","type":"ai_tool","index":0}]]},"AI Agent":{"main":[[{"node":"Gmail","type":"main","index":0}]]},"Simple Memory":{"ai_memory":[[{"node":"AI Agent","type":"ai_memory","index":0}]]},"Schedule Trigger":{"main":[[{"node":"AI Agent","type":"main","index":0}]]},"OpenAI Chat Model":{"ai_languageModel":[[{"node":"AI Agent","type":"ai_languageModel","index":0}]]}}}


name: Generate Custom AI Videos with Digital Avatars using HeyGen API
author_name: Adam Crafts
author_username: adamcrafts
nodes_used: ["n8n-nodes-base.httpRequest"]
categories: []
created_at: 2025-06-03T13:09:09.501Z
updated_at: 2025-06-03T13:09:09.501Z
url: https://n8n.io/workflows/4622
scraped_at: 2025-07-06 21:16:30
description:
  🎥 n8n Workflow: Generate AI Videos with HeyGen

  🚀 Overview

  This automation connects directly to HeyGen's powerful AI video generation platform. It allows you to programmatically create videos with digital avatars and voiceovers, perfect for scaling your content creation for social media, marketing campaigns, or personalized messages without ever opening a video editor.

  😩 The Problem

  Creating video content is incredibly time-consuming and expensive. You have to write scripts, record audio, find actors or create complex animations, piece everything together in an editor, and then wait for it to render. Every minor change or personalization requires repeating the entire frustrating process. This manual work is a major bottleneck, making it nearly impossible to produce large volumes of high-quality video content quickly and affordably.

  ✨ The Solution

  This workflow acts as your personal, automated video production assistant! When you provide a script, the automation instantly sends instructions to HeyGen to begin creating your video. It tells the AI which avatar and voice to use and starts the generation process. Then, it cleverly waits and periodically checks the status until your new video is finished and ready. It’s a completely hands-off process that transforms simple text into professional AI videos on demand.

  🔧 What It Does

  Send a request to HeyGen's API to generate a video with:

     Custom avatar
     Scripted voice-over
     Background color and dimension
  Wait 30 seconds
  Check video status
  Loop until video is completed, failed, or still processing

  ⚙️ Simple Setup

  This workflow is a pre-built blueprint, designed to be up and running in minutes!

  Upload:** Simply upload the provided JSON file into your n8n instance.
  Connect:** Connect your app credentials (e.g., your HeyGen account). The workflow will show you exactly where.
  Activate:** Turn the workflow on, and it's ready to go! Let your new automated employee get to work.

  This free n8n workflow allows you to generate AI videos using HeyGen via their API.
  🌐 Explore more workflows

  ❤️ Buy more workflows at: adamcrafts
  🦾 Custom workflows at: adamcrafts@cloudysoftwares.com
  adamaicrafts@gmail.com

  &gt; Build once, customize endlessly, and scale your video content like never before. 🚀

workflow_json:
  {"meta":{"instanceId":"2d54f61dfd963457efb86a8690aae457934e92fb9e4b8b6490ca74fc37094458"},"nodes":[{"id":"97dcf679-2312-4f61-aff2-ca1fe05ed94b","name":"HeyGen","type":"n8n-nodes-base.httpRequest","onError":"continueErrorOutput","position":[-440,-260],"parameters":{"url":"https://api.heygen.com/v2/video/generate","method":"POST","options":{"redirect":{"redirect":{}}},"jsonBody":"={\n  \"video_inputs\": [\n    {\n      \"character\": {\n        \"type\": \"avatar\",\n        \"avatar_id\": \"{{ $json.AvatarId ?? \"Amy_standing_outdoor_side\"}}\",\n        \"avatar_style\": \"normal\"\n      },\n      \"voice\": {\n        \"type\": \"text\",\n        \"input_text\": \"{{ $json.full_script }}\",\n        \"voice_id\": \"{{ $json.HeygenVoiceId ?? '26b2064088674c80b1e5fc5ab1a068eb' }}\"\n      },\n      \"background\": {\n        \"type\": \"color\",\n        \"value\": \"#000000\"\n      }\n    }\n],\n  \"dimension\": {\"width\": \"340\",\"height\": \"340\"}\n}\n","sendBody":true,"specifyBody":"json","authentication":"genericCredentialType","genericAuthType":"httpHeaderAuth"},"credentials":{"httpHeaderAuth":{"id":"zbfugI9r6Odpg9gQ","name":"Header Auth account (heygen)"}},"typeVersion":4.2},{"id":"660db08f-5b5c-4fd0-aa3b-660619108a1a","name":"Wait4","type":"n8n-nodes-base.wait","position":[-140,-280],"webhookId":"d2c37f01-834e-40d3-888e-6e7e4296f474","parameters":{"amount":30},"typeVersion":1.1},{"id":"32126f57-2d00-465a-a642-3fbecd96943d","name":"HeyGen : Check Video","type":"n8n-nodes-base.httpRequest","onError":"continueErrorOutput","position":[80,-280],"parameters":{"url":"https://api.heygen.com/v1/video_status.get","options":{"redirect":{"redirect":{}}},"sendQuery":true,"sendHeaders":true,"authentication":"genericCredentialType","genericAuthType":"httpHeaderAuth","queryParameters":{"parameters":[{"name":"video_id","value":"={{ $('HeyGen').first().json.data.video_id }}"}]},"headerParameters":{"parameters":[{"name":"Accept","value":"application/json"}]}},"credentials":{"httpHeaderAuth":{"id":"zbfugI9r6Odpg9gQ","name":"Header Auth account (heygen)"}},"typeVersion":4.2},{"id":"157b890c-9684-4695-b110-5a94cc044ccd","name":"heygen_response","type":"n8n-nodes-base.switch","position":[380,-300],"parameters":{"rules":{"values":[{"outputKey":"completed","conditions":{"options":{"version":2,"leftValue":"","caseSensitive":true,"typeValidation":"strict"},"combinator":"and","conditions":[{"operator":{"type":"string","operation":"equals"},"leftValue":"={{ $json.data.status }}","rightValue":"completed"}]},"renameOutput":true},{"outputKey":"processing","conditions":{"options":{"version":2,"leftValue":"","caseSensitive":true,"typeValidation":"strict"},"combinator":"and","conditions":[{"id":"46dfa599-fe04-4b32-8d15-09e963099737","operator":{"type":"boolean","operation":"true","singleValue":true},"leftValue":"={{ $json.data.status == 'processing' || $json.data.status == 'pending' || $json.data.status == 'waiting' }}","rightValue":""}]},"renameOutput":true},{"outputKey":"failed","conditions":{"options":{"version":2,"leftValue":"","caseSensitive":true,"typeValidation":"strict"},"combinator":"and","conditions":[{"id":"22c93926-40a2-49ef-b8f0-aa718da00792","operator":{"name":"filter.operator.equals","type":"string","operation":"equals"},"leftValue":"={{ $json.data.status }}","rightValue":"failed"}]},"renameOutput":true}]},"options":{}},"typeVersion":3.2},{"id":"a4fe631d-58df-4760-9d25-22199f3a6530","name":"Sticky Note","type":"n8n-nodes-base.stickyNote","position":[-100,-40],"parameters":{"width":390,"height":80,"content":"## HeyGen APi generate Video"},"typeVersion":1},{"id":"7867d3bd-d03c-41b3-909b-b1a6540023a7","name":"Sticky Note7","type":"n8n-nodes-base.stickyNote","position":[-840,-740],"parameters":{"width":500,"height":380,"content":"# AdamCrafts\n\nHey there! I'm Adam. 🚀 I specialize in helping people master n8n, land their first client, and scale their automation business efficiently. Let's automate your success!\n\n## Need Help? 📞\n Detailed documentation included in the workflow package covers advanced configuration options and optimization techniques.\n\n\n❤️ Buy more workflows at: [adamcrafts](https://adamcrafts.cloudysoftwares.com)\n🦾 Custom workflows at: [adamcrafts@cloudysoftwares.com](mailto:adamcrafts@cloudysoftwares.com)\n[adamaicrafts@gmail.com](mailto:adamaicrafts@gmail.com)"},"typeVersion":1}],"connections":{"Wait4":{"main":[[{"node":"HeyGen : Check Video","type":"main","index":0}]]},"HeyGen":{"main":[[{"node":"Wait4","type":"main","index":0}],[]]},"heygen_response":{"main":[[],[{"node":"Wait4","type":"main","index":0}]]},"HeyGen : Check Video":{"main":[[{"node":"heygen_response","type":"main","index":0}],[]]}}}


name: Generate Videos with AI, ElevenLabs,PIAPI Shotstack/Creatomate & Post to Youtube
author_name: Immanuel
author_username: spectrabit
categories: []
created_at: 2025-06-03T21:27:45.642Z
updated_at: 2025-06-03T21:27:45.642Z
url: https://n8n.io/workflows/4630
scraped_at: 2025-07-06 21:16:30
description:
  Auto-Generate Long Videos with AI, ElevenLabs,PIAPI,Shotstack/Creatomate & Post to Youtube

  Overview
  This n8n automation workflow automates the creation, scripting, production, and posting of YouTube videos. It leverages AI (OpenAI), image generation (PIAPI), video rendering (Shotstack), and platform integrations (Airtable, Google Sheets, YouTube) to streamline the process.  
  Target Audience
  Content creators, video producers, and YouTubers** seeking to automate video content creation.
  Digital marketing teams** managing video campaigns for travel or history niches.
  Users familiar with n8n, Airtable, Google Sheets, YouTube, and API integrations**.

  Problem Solved
  Manually managing YouTube video production, from ideation to posting, is time-consuming and prone to errors. This workflow addresses:
  Content Sourcing**: Generates video ideas using AI based on "domain of choice".
  Content Formatting**: Automatically creates detailed scripts and scene structures.
  Visual Production**: Produces high-quality images and renders videos with minimal manual input.
  Multi-Platform Integration**: Publishes to YouTube with status tracking in Airtable and Google Sheets.
  Status Tracking**: Monitors progress (Generated, Scripted, Produced, Published) across platforms.
  Prerequisites
  Before setting up, ensure you have:
  An n8n instance (self-hosted or cloud)
  API credentials for:
     OpenAI (for idea generation)
     PIAPI.ai (for image and video generation)
     ElevenLabs (for audio generation)
     Shotstack (for video rendering)
     Creatomate (for video rendering)
     Airtable & Google Sheets and Drive (for storage and tracking)
     Gmail (for notifications)
     YouTube API (for posting to YouTube)

  How the Automation Works (Step by Step)
  Trigger (Schedule Trigger)  
     Initiates the workflow daily 
     Connects to "Generate Idea"

  Generate Idea  
     Uses OpenAI to create a unique 4-minute video idea with a title, description, keywords, scene structure, and intrigue note
     Checks Airtable "Ideas" table via searchAirtable to avoid duplicates
     Connects to "Parse Ideas"

  Parse Ideas  
     Extracts title, description, and notes from the OpenAI output using JavaScript
     Connects to "Add Ideas"

  Add Ideas  
     Stores the initial idea in Google Sheets "Ideas" sheet with fields like "Idea", "Description", and "Progress" (set to "Generated")
     Connects to "Store in Airtable"

  Store in Airtable  
     Saves the idea to Airtable "Ideas" table with mapped fields and typecast enabled
     Connects to "Generate Script"

  Generate Script  
     Creates a 500-600 word script with 8-10 scenes using OpenAI, based on the latest "Generated" idea
     Uses Structured Output Parser to format output
     Connects to "Parse Script Output"

  Parse Script Output  
     Formats the script into readable text and JSON, extracting scenes and closing question
     Connects to "Store Script"

  Store Script  
     Saves the script to Google Sheets "Production" sheet with "Script", "Scenes", and "Status" (set to "Scripted")
     Connects to "Store Script in Airtable"

  Store Script in Airtable  
     Saves the script to Airtable "Production" table with mapped fields and typecast enabled
     Connects to "Updated Idea to Scripted"

  Updated Idea to Scripted  
      Updates the idea status to "Scripted" in Google Sheets "Ideas" sheet
      Connects to "Update Status Ideas Table"

  Update Status Ideas Table  
      Updates the idea status to "Scripted" in Airtable "Ideas" table, matching by "Idea ID"
      Connects to "Extract Scenes"

  Extract Scenes  
      Parses scene data from Airtable "Production" table for image generation
      Connects to "Text-to-Image"

  Text-to-Image  
      Generates images for each scene using PIAPI
      Connects to "Wait for 4 Min"

  Wait for 4 Min  
      Waits 3 minutes to allow image generation to complete
      Connects to  "Get Images" 

  Trigger (Schedule Trigger1)  
      Initiates the posting process daily 
      Connects to "Search for Latest Ready Video"

  Search for Latest Ready Video  
      Searches Airtable "Production" table for the latest video with "Status" = "Ready"
      Connects to "If Ready?"

  If Ready?  
      Checks if a video is ready (condition: Status contains Ready)
      If true, connects to "Download Video" and "Update Production Table"

  Download Video  
      Downloads the video file using the VideoURL from Airtable
      Connects to "Post YouTube"

  Post YouTube  
      Uploads the video to YouTube with title and description, using YouTube OAuth2
  Update Production Table  
      Updates the "Production" sheet in Google Sheets, setting "Status" to "Published" and matching by "Production ID"
  Additional Nodes and Processes
  OpenAI Chat Model**: Powers "Generate Idea" and "Generate Script" with GPT
  Structured Output Parser**: Ensures proper JSON output for scripts
  Get Images**: Retrieves generated images 
  Extract Narration**: Prepares narration for voice generation
  Voice Generation**: Generates voiceovers 
  Generate Music Prompt**: Creates music prompts using OpenAI
  Text-to-Music**: Generates music 
  Build Shotstack Timeline**: Constructs video timeline 
  ShotStack Render Video**: Renders the final video 
  Poll Rendered Videos**: Checks video rendering status 
  Final Video**: Updates Airtable "Production" with final video details
  Final Video Update**: Updates Google Sheets "Production" with video URL
  Music Urls**: Adds music URLs to the process 

  Setup Requirements
  Before starting, ensure you have the following

  1  n8n Instance
     A self-hosted or cloud-based n8n instance to run the workflow
     
  2  API Credentials
     OpenAI: API key 
     Airtable: Personal Access Token (e.g, "Airtable Personal Access Token 
     Google Sheets: OAuth2 credentials 
     PIAPI: HTTP Header Auth key 
     YouTube: OAuth2 credentials
  3  Airtable Configuration
     Base: "Youtube Videos" 
     Tables:
       "Ideas"  
       "Production" 
     Share with the Airtable token

  4  Google Sheets Configuration
     Document: "Youtube Videos" 
     Sheets:
       "Ideas" 
       "Production" 
     Share with the Google Sheets credential email

  Shotstack Configuration (Assumed)
     API key and endpoint for video rendering (not specified in JSON)

  Setup Instructions
  Import the Workflow
     Import the provided JSON file into your n8n instance

  Configure Credentials
     Add OpenAI, Airtable, Google Sheets, PIAPI, and YouTube credentials in n8n’s credential manager

  Set Up Airtable
     Create or update the "Ideas" and "Production" tables with the specified fields
     Ensure proper permissions with the Airtable token

  Configure Google Sheets
     Create or update the "Ideas" and "Production" sheets with the specified columns
     Share the document with the Google Sheets credential email

  Schedule Triggers
     Set "Schedule Trigger" to trigger

  Test the Workflow
     Run manually to verify each node’s functionality
     Check Airtable, Google Sheets, and YouTube for updates
     Ensure PIAPI image generation completes (wait 4 minutes)

  Monitor and Adjust
     Monitor API rate limits (e.g, PIAPI, YouTube)
     Adjust wait times if image or video generation delays occur
     Verify connections for unlinked nodes 

  Benefits
  Efficiency**: Automates the entire process from idea to posting
  Scalability**: Handles daily video production
  Quality**: Ensures cinematic scripts and visuals
  Tracking**: Provides detailed progress monitoring

  Notes
  Rate Limits**: Be aware of PIAPI (150,000 units per task) and YouTube API limits
  Timing**: Adjust wait nodes (e.g, "Wait for 4 Min") based on API response times

  Conclusion and Suggestions to Improve the Automation

  Conclusion
  This workflow streamlines YouTube video production, making it ideal for busy content creators, video producers, and marketing teams. Customize it by adding more platforms, adjusting wait delays for image/video generation, or enhancing notifications for status updates. Share your feedback in the n8n community to help others benefit from this automation.

  Suggestions to Improve

  Customization**: Adjust prompts, timings, and API parameters based on your needs
  Expand "Text-to-Music**" with multiple music styles or integrate a royalty-free music API for variety.
  Improve Video Rendering**: Optimize "Build Shotstack Timeline" and "ShotStack Render Video" with predefined templates to reduce rendering time.
  Add Analytics Tracking**: Include a node to fetch YouTube Analytics post-upload for performance monitoring.
  Error Handling**: Add error-catching nodes (e.g., "If" nodes) to retry failed image or video generations.
  Notification System**: Incorporate email or Slack notifications for key milestones (e.g., script completion, video upload).

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

workflow_json:
  {"meta":{"instanceId":"3aaeb6eaba3494bbdbe57e25fa3d02783cfbc460b1e823f7b741cf26edc7ca3d","templateCredsSetupCompleted":true},"nodes":[{"id":"36a44f23-80ce-49d2-a7c6-112c76db393c","name":"Schedule Trigger","type":"n8n-nodes-base.scheduleTrigger","position":[3060,-480],"parameters":{},"typeVersion":1},{"id":"e20f7123-a3e9-4dbc-9668-707c017811da","name":"Parse Ideas","type":"n8n-nodes-base.code","position":[3620,-480],"parameters":{},"typeVersion":1,"alwaysOutputData":true},{"id":"694638ee-7fbd-42d4-b1c5-317c7880215a","name":"Generate Script","type":"@n8n/n8n-nodes-langchain.agent","position":[4180,-480],"parameters":{},"typeVersion":1.9},{"id":"b4b694c0-8267-4b39-92d1-2d83cdc27ee7","name":"OpenAI Chat Model1","type":"@n8n/n8n-nodes-langchain.lmChatOpenAi","position":[4180,-260],"parameters":{},"typeVersion":1.2},{"id":"eb1f7370-004d-4e7e-ba68-9108f4307426","name":"OpenAI Chat Model","type":"@n8n/n8n-nodes-langchain.lmChatOpenAi","position":[3260,-280],"parameters":{},"typeVersion":1.2},{"id":"34eda2c1-42e9-458d-af0c-d00d2d8fe15a","name":"searchAirtable","type":"n8n-nodes-base.airtableTool","position":[3440,-280],"parameters":{},"typeVersion":2.1},{"id":"80747c80-0854-45c5-9eef-0c61f5bfc424","name":"Add Ideas","type":"n8n-nodes-base.googleSheets","position":[3820,-480],"parameters":{},"executeOnce":true,"typeVersion":4.5,"alwaysOutputData":true},{"id":"24615a9e-6195-4ba4-b76a-c148424b9fb3","name":"Generate Idea","type":"@n8n/n8n-nodes-langchain.agent","position":[3260,-480],"parameters":{},"typeVersion":1.9},{"id":"13f0ec76-27f5-4248-89d6-f0f0755b1335","name":"Store in Airtable","type":"n8n-nodes-base.airtable","position":[4000,-480],"parameters":{},"typeVersion":2.1},{"id":"79a425fd-8663-4952-a848-6d0254441afe","name":"Structured Output Parser","type":"@n8n/n8n-nodes-langchain.outputParserStructured","position":[4360,-260],"parameters":{},"typeVersion":1.2},{"id":"883c9c55-ed99-4442-b848-9c579114fd3c","name":"Store Script","type":"n8n-nodes-base.googleSheets","position":[3220,160],"parameters":{},"typeVersion":4.5},{"id":"89fffcc9-451e-4875-b673-9b82dfd81105","name":"Store Script in Airtable","type":"n8n-nodes-base.airtable","position":[3380,80],"parameters":{},"typeVersion":2.1},{"id":"fbbb5dc9-9d4b-40d3-b616-ef8908be8939","name":"Parse Script Output","type":"n8n-nodes-base.code","position":[3060,160],"parameters":{},"typeVersion":2},{"id":"cc0c5220-1f86-4814-9e95-064059f5d496","name":"Update Status Ideas Table","type":"n8n-nodes-base.airtable","position":[3700,160],"parameters":{},"typeVersion":2.1},{"id":"21953a80-2661-43f0-abfd-412c7077c8a8","name":"Updated Idea to Scripted","type":"n8n-nodes-base.googleSheets","position":[3520,160],"parameters":{},"typeVersion":4.5},{"id":"e25d7a2b-b0db-4f91-8cb8-09231b903e73","name":"Extract Scenes","type":"n8n-nodes-base.code","position":[3860,160],"parameters":{},"typeVersion":2},{"id":"0d814668-3de2-4f7b-9dba-1ca1b4d68a18","name":"Text-to-Image","type":"n8n-nodes-base.httpRequest","position":[4540,-20],"parameters":{},"typeVersion":4.2},{"id":"0b37c05b-3726-4ceb-8f26-1106ce415106","name":"Sticky Note","type":"n8n-nodes-base.stickyNote","position":[3000,-640],"parameters":{"content":""},"typeVersion":1},{"id":"fa946cdf-51b1-4db1-8113-cfae49305a88","name":"Wait for 4 Min","type":"n8n-nodes-base.wait","position":[4700,-20],"webhookId":"2319783c-b9b5-4771-b6c7-1c4f85c5e364","parameters":{},"typeVersion":1.1},{"id":"ce6fd36d-d2f1-4714-a269-c33536f5f603","name":"Store Image Urls in Airtable","type":"n8n-nodes-base.airtable","position":[5540,-80],"parameters":{},"typeVersion":2.1},{"id":"0f12f103-e31d-49bd-b320-107261c3c87a","name":"Get Images","type":"n8n-nodes-base.httpRequest","position":[4860,-20],"parameters":{},"typeVersion":4.2},{"id":"5df31e39-af23-48c5-b060-856741466e11","name":"Get ImageUrls","type":"n8n-nodes-base.code","position":[4580,260],"parameters":{},"typeVersion":2},{"id":"46c95791-9d90-4c47-9041-26f19617b6f7","name":"Scene Image Urls","type":"n8n-nodes-base.code","position":[4740,260],"parameters":{},"typeVersion":2},{"id":"7d15f8a4-38cc-4201-a761-5b6a2a8c448d","name":"Extract Narration","type":"n8n-nodes-base.code","position":[5720,-20],"parameters":{},"typeVersion":2},{"id":"b1d59040-d4ca-49c9-b318-88a724d96922","name":"Voice Generation","type":"n8n-nodes-base.httpRequest","position":[5860,-20],"parameters":{},"typeVersion":4.2},{"id":"486f0401-afc3-4aa8-91bb-d21c7516fade","name":"Store Sound","type":"n8n-nodes-base.googleDrive","position":[6220,-20],"parameters":{},"typeVersion":3},{"id":"2ca32e3e-527c-4fdf-9fcf-fe231a9198ea","name":"Wait 2 Min","type":"n8n-nodes-base.wait","position":[6040,-20],"webhookId":"2fc60693-37f5-445c-ac74-69070cf1349b","parameters":{},"typeVersion":1.1},{"id":"c533403f-3bec-4ddd-a8b7-5d2b803348ae","name":"Sticky Note1","type":"n8n-nodes-base.stickyNote","position":[3000,-20],"parameters":{"content":""},"typeVersion":1},{"id":"e5786afb-3ead-4594-8dc5-9753c72327c7","name":"Store Voice Urls","type":"n8n-nodes-base.airtable","position":[5680,-200],"parameters":{},"typeVersion":2.1},{"id":"28c841dc-efae-4923-97e0-4a871b39fd49","name":"Aggregating Voice Urls","type":"n8n-nodes-base.code","position":[5340,-200],"parameters":{},"typeVersion":2},{"id":"29447c31-b2a8-4717-baee-4b6f97009136","name":"Update VoiceUrls","type":"n8n-nodes-base.googleSheets","position":[5520,-200],"parameters":{},"typeVersion":4.5},{"id":"b7149459-bcc5-4ecc-87cc-302a3f2a1720","name":"Update ImageUrls","type":"n8n-nodes-base.googleSheets","position":[5340,-20],"parameters":{},"typeVersion":4.5,"alwaysOutputData":true},{"id":"19e68b62-90cf-408f-939d-ddb8f3d4a842","name":"Prepare Video Assets","type":"n8n-nodes-base.code","position":[5360,260],"parameters":{},"typeVersion":2,"alwaysOutputData":true},{"id":"21363e02-dd5f-4516-af4c-135c27f9413b","name":"Wait 5 Min","type":"n8n-nodes-base.wait","position":[5920,260],"webhookId":"e34850a6-fc5c-475b-97e8-3a68064ecd4f","parameters":{},"typeVersion":1.1},{"id":"36cee79d-3b8b-44de-ba42-1b47691d2b0e","name":"Allow Access","type":"n8n-nodes-base.googleDrive","position":[6420,-20],"parameters":{},"typeVersion":3},{"id":"d959cc31-f4ec-4592-b59e-23c7b9768e7f","name":"ShotStack Render Video","type":"n8n-nodes-base.httpRequest","position":[5760,260],"parameters":{},"typeVersion":4.2},{"id":"321debb6-6bb1-42cb-ba39-e72868c04426","name":"Build Shotstack Timeline","type":"n8n-nodes-base.code","position":[5560,260],"parameters":{},"typeVersion":2},{"id":"862b6946-b890-44a6-97df-71e60ccf159d","name":"Download video","type":"n8n-nodes-base.httpRequest","position":[6580,260],"parameters":{},"typeVersion":4.2},{"id":"44d57140-f19c-45fc-a249-1f6f84a8864a","name":"Store video","type":"n8n-nodes-base.googleDrive","position":[6740,260],"parameters":{},"typeVersion":3},{"id":"cc2566b3-c9d2-4d34-8717-e6cdfaede637","name":"Limit","type":"n8n-nodes-base.limit","position":[3060,500],"parameters":{},"typeVersion":1},{"id":"c5086e3a-7df0-423a-bc51-560b22852fc3","name":"2 Min Wait","type":"n8n-nodes-base.wait","position":[3540,500],"webhookId":"50f8e100-8e26-4f5a-967e-a55caee1273b","parameters":{},"typeVersion":1.1},{"id":"77cb8c16-3b67-4a5f-b2d3-f16c68c2481a","name":"Generate Music Prompt","type":"@n8n/n8n-nodes-langchain.agent","position":[4040,160],"parameters":{},"typeVersion":1.9},{"id":"58c14cf6-f78f-418b-be91-2c238a81b85b","name":"OpenAI Chat Model2","type":"@n8n/n8n-nodes-langchain.lmChatOpenAi","position":[4000,340],"parameters":{},"typeVersion":1.2},{"id":"b8c66a9f-162b-42ba-8c40-edcdb3087ac6","name":"MusicPrompt","type":"n8n-nodes-base.set","position":[4360,160],"parameters":{},"typeVersion":3.4},{"id":"abb57b0a-9edf-4bf5-a213-cf2e1c9a6fc7","name":"Text toMusic","type":"n8n-nodes-base.httpRequest","position":[3380,500],"parameters":{},"typeVersion":4.2},{"id":"fc9a5fbf-572c-49f9-a7e4-f67cfa18640e","name":"Music Store","type":"n8n-nodes-base.googleDrive","position":[3720,500],"parameters":{},"typeVersion":3},{"id":"6b5b4ea7-24d5-448d-9a38-c013ae7d62b6","name":"Access to Anyone with Link","type":"n8n-nodes-base.googleDrive","position":[3920,500],"parameters":{},"typeVersion":3},{"id":"45aa327a-e4b8-4156-8360-e86115cb3192","name":"Store Music Urls","type":"n8n-nodes-base.airtable","position":[4360,580],"parameters":{},"typeVersion":2.1},{"id":"00d07c43-5802-4047-b96d-62b358d1c55d","name":"Add Aggregate Music URLs","type":"n8n-nodes-base.code","position":[4100,500],"parameters":{},"typeVersion":2},{"id":"21408eb7-b148-45ce-a8c7-786df3291cfa","name":"Parse Music Prompts","type":"n8n-nodes-base.code","position":[3220,500],"parameters":{},"typeVersion":2},{"id":"d5c04b27-dfd4-4bc7-bc69-5669a49820b4","name":"Merge","type":"n8n-nodes-base.merge","position":[5100,260],"parameters":{},"typeVersion":3.1},{"id":"21e70479-888b-4c23-9882-f00c7900d6b7","name":"Poll Rendered Videos","type":"n8n-nodes-base.httpRequest","position":[6060,260],"parameters":{},"typeVersion":4.2},{"id":"ed1b5fec-bc8c-4029-9dfc-bf39d75d9e68","name":"Final Video","type":"n8n-nodes-base.airtable","position":[6240,260],"parameters":{},"typeVersion":2.1},{"id":"888353b0-f6fe-46b3-8df8-4cc65cdd8f37","name":"Sticky Note2","type":"n8n-nodes-base.stickyNote","position":[4540,-260],"parameters":{"content":""},"typeVersion":1},{"id":"e8f3db94-c36a-4a3c-aff6-6e4348a8cd2d","name":"Sticky Note3","type":"n8n-nodes-base.stickyNote","position":[5280,-280],"parameters":{"content":""},"typeVersion":1},{"id":"b34f34f3-3375-416e-a2f6-c86c66db6739","name":"Wait for Render","type":"n8n-nodes-base.wait","position":[5700,1240],"webhookId":"ed710d73-6a8d-4e29-b338-70ba84bb6de2","parameters":{},"typeVersion":1.1},{"id":"3bce253b-047a-4160-b48f-55c185c2609f","name":"Get Final Video","type":"n8n-nodes-base.httpRequest","position":[5860,1240],"parameters":{},"typeVersion":4.2},{"id":"43ca990d-f654-4233-95a7-e504b3c22a3b","name":"Check Video Status","type":"n8n-nodes-base.switch","position":[6020,1240],"parameters":{},"typeVersion":3.2,"alwaysOutputData":true},{"id":"8e65d53d-46b3-4d5e-994a-60edc0f31950","name":"Video Creatomate","type":"n8n-nodes-base.httpRequest","position":[5500,1240],"parameters":{},"typeVersion":4.2},{"id":"a25b1aa1-9131-49bc-b83e-fadaead37b1f","name":"Prepare  Assets For Creatomate","type":"n8n-nodes-base.code","disabled":true,"position":[5480,1060],"parameters":{},"typeVersion":2,"alwaysOutputData":true},{"id":"ca23b9b7-7f23-474b-817d-112a5d1ae031","name":"List Elements","type":"n8n-nodes-base.code","position":[5640,1080],"parameters":{},"typeVersion":2},{"id":"60af65ac-36ef-4ae0-95cf-c66668853136","name":"Download Binary","type":"n8n-nodes-base.httpRequest","position":[6220,1220],"parameters":{},"typeVersion":4.2},{"id":"ee786362-5ca9-411e-9fa7-ff9dc1cffef1","name":"Final Creatomate Video","type":"n8n-nodes-base.googleDrive","position":[6400,1220],"parameters":{},"typeVersion":3},{"id":"07a72990-e402-4cdf-b52a-64268232234d","name":"Youtube Video Created","type":"n8n-nodes-base.gmail","position":[6580,1220],"webhookId":"b2f823fa-ff6b-4cf2-915e-0b9e66663233","parameters":{},"typeVersion":2.1},{"id":"5dec2e5f-4adc-4cee-97f4-b0b002ac52b4","name":"Failed Creation","type":"n8n-nodes-base.gmail","position":[6360,1360],"webhookId":"5bc7c656-a0d4-4abb-a0ab-15bbbd9fba0f","parameters":{},"typeVersion":2.1},{"id":"ce6a796b-cdf4-4793-9b5c-ce2640c5b80b","name":"Final Video Update","type":"n8n-nodes-base.googleSheets","position":[6420,260],"parameters":{},"typeVersion":4.5,"alwaysOutputData":true},{"id":"e3a0bbd1-13a5-45fe-bcb9-c2ffb392beb6","name":"Final Video Creatomate","type":"n8n-nodes-base.airtable","position":[6720,1220],"parameters":{},"typeVersion":2.1},{"id":"f52ff588-0829-4b90-8f9d-9b50dbdf5ad4","name":"Creatomate Final Video","type":"n8n-nodes-base.googleSheets","position":[6720,1400],"parameters":{},"typeVersion":4.5},{"id":"b40b9dde-88c6-440e-99a5-af4f2c6ad309","name":"Music Urls","type":"n8n-nodes-base.googleSheets","position":[4360,380],"parameters":{},"typeVersion":4.5},{"id":"3f1c339f-d66e-4e98-9330-b855896cbfc4","name":"Sticky Note4","type":"n8n-nodes-base.stickyNote","position":[6920,-660],"parameters":{"content":""},"typeVersion":1},{"id":"3c15accd-d96b-4e2e-a7bf-8c28190ed117","name":"Sticky Note5","type":"n8n-nodes-base.stickyNote","position":[6920,1120],"parameters":{"content":""},"typeVersion":1},{"id":"c3d05e27-93b5-46d4-8a0d-009bda573614","name":"Sticky Note7","type":"n8n-nodes-base.stickyNote","position":[5280,960],"parameters":{"content":""},"typeVersion":1},{"id":"73cc5a0c-0828-43db-b740-4bf49165601f","name":"Download Video","type":"n8n-nodes-base.httpRequest","position":[5400,-420],"parameters":{},"typeVersion":4.2},{"id":"63073d8f-e210-4f69-b52e-ceba622fcb97","name":"Post YouTube","type":"n8n-nodes-base.youTube","position":[5580,-480],"parameters":{},"typeVersion":1},{"id":"403e2d54-83c5-4e2c-a0c4-e81857afa65f","name":"Search for Latest Ready Video","type":"n8n-nodes-base.airtable","position":[4920,-480],"parameters":{},"typeVersion":2.1},{"id":"c6e252df-4f94-4a3f-84e3-933df8968624","name":"Update Pepduction Table","type":"n8n-nodes-base.googleSheets","position":[5400,-620],"parameters":{},"typeVersion":4.5},{"id":"c60e3b97-7c27-4597-a36d-aded332fd23a","name":"If Ready?","type":"n8n-nodes-base.if","position":[5120,-480],"parameters":{},"typeVersion":1},{"id":"92513f0e-4b15-42a3-95e1-430cc3cbeefa","name":"Sticky Note6","type":"n8n-nodes-base.stickyNote","position":[4520,-660],"parameters":{"content":""},"typeVersion":1},{"id":"7c730e10-35d9-41f1-959a-f95c87007ce4","name":"Schedule Trigger1","type":"n8n-nodes-base.scheduleTrigger","position":[4720,-480],"parameters":{},"typeVersion":1}],"connections":{"Limit":{"main":[[{"node":"Parse Music Prompts","type":"main","index":0}]]},"Merge":{"main":[[{"node":"Prepare Video Assets","type":"main","index":0}]]},"Add Ideas":{"main":[[{"node":"Store in Airtable","type":"main","index":0}]]},"If Ready?":{"main":[[{"node":"Download Video","type":"main","index":0},{"node":"Update Pepduction Table","type":"main","index":0}]]},"2 Min Wait":{"main":[[{"node":"Music Store","type":"main","index":0}]]},"Get Images":{"main":[[{"node":"Get ImageUrls","type":"main","index":0}]]},"Music Urls":{"main":[[{"node":"Text-to-Image","type":"main","index":0}]]},"Wait 2 Min":{"main":[[{"node":"Store Sound","type":"main","index":0}]]},"Wait 5 Min":{"main":[[{"node":"Poll Rendered Videos","type":"main","index":0}]]},"Final Video":{"main":[[{"node":"Final Video Update","type":"main","index":0}]]},"Music Store":{"main":[[{"node":"Access to Anyone with Link","type":"main","index":0},{"node":"Add Aggregate Music URLs","type":"main","index":0}]]},"MusicPrompt":{"main":[[{"node":"Limit","type":"main","index":0}]]},"Parse Ideas":{"main":[[{"node":"Add Ideas","type":"main","index":0}]]},"Store Sound":{"main":[[{"node":"Allow Access","type":"main","index":0},{"node":"Aggregating Voice Urls","type":"main","index":0}]]},"Allow Access":{"main":[[]]},"Store Script":{"main":[[{"node":"Store Script in Airtable","type":"main","index":0}]]},"Text toMusic":{"main":[[{"node":"2 Min Wait","type":"main","index":0}]]},"Generate Idea":{"main":[[{"node":"Parse Ideas","type":"main","index":0}]]},"Get ImageUrls":{"main":[[{"node":"Scene Image Urls","type":"main","index":0}]]},"List Elements":{"main":[[{"node":"Video Creatomate","type":"main","index":0}]]},"Text-to-Image":{"main":[[{"node":"Wait for 4 Min","type":"main","index":0}]]},"Download Video":{"main":[[{"node":"Post YouTube","type":"main","index":0}]]},"Download video":{"main":[[{"node":"Store video","type":"main","index":0}]]},"Extract Scenes":{"main":[[{"node":"Generate Music Prompt","type":"main","index":0},{"node":"Text-to-Image","type":"main","index":0}]]},"Wait for 4 Min":{"main":[[{"node":"Get Images","type":"main","index":0}]]},"searchAirtable":{"ai_tool":[[{"node":"Generate Idea","type":"ai_tool","index":0}]]},"Download Binary":{"main":[[{"node":"Final Creatomate Video","type":"main","index":0}]]},"Generate Script":{"main":[[{"node":"Parse Script Output","type":"main","index":0}]]},"Get Final Video":{"main":[[{"node":"Check Video Status","type":"main","index":0}]]},"Wait for Render":{"main":[[{"node":"Get Final Video","type":"main","index":0}]]},"Scene Image Urls":{"main":[[{"node":"Update ImageUrls","type":"main","index":0},{"node":"Merge","type":"main","index":1}]]},"Schedule Trigger":{"main":[[{"node":"Generate Idea","type":"main","index":0}]]},"Store Music Urls":{"main":[[{"node":"Music Urls","type":"main","index":0}]]},"Store Voice Urls":{"main":[[]]},"Update ImageUrls":{"main":[[{"node":"Store Image Urls in Airtable","type":"main","index":0},{"node":"Extract Narration","type":"main","index":0}]]},"Update VoiceUrls":{"main":[[{"node":"Store Voice Urls","type":"main","index":0}]]},"Video Creatomate":{"main":[[{"node":"Wait for Render","type":"main","index":0}]]},"Voice Generation":{"main":[[{"node":"Wait 2 Min","type":"main","index":0}]]},"Extract Narration":{"main":[[{"node":"Voice Generation","type":"main","index":0}]]},"OpenAI Chat Model":{"ai_languageModel":[[{"node":"Generate Idea","type":"ai_languageModel","index":0}]]},"Schedule Trigger1":{"main":[[{"node":"Search for Latest Ready Video","type":"main","index":0}]]},"Store in Airtable":{"main":[[{"node":"Generate Script","type":"main","index":0}]]},"Check Video Status":{"main":[[{"node":"Download Binary","type":"main","index":0}],[{"node":"Failed Creation","type":"main","index":0}],[{"node":"Wait for Render","type":"main","index":0}]]},"Final Video Update":{"main":[[{"node":"Download video","type":"main","index":0}]]},"OpenAI Chat Model1":{"ai_languageModel":[[{"node":"Generate Script","type":"ai_languageModel","index":0}]]},"OpenAI Chat Model2":{"ai_languageModel":[[{"node":"Generate Music Prompt","type":"ai_languageModel","index":0}]]},"Parse Music Prompts":{"main":[[{"node":"Text toMusic","type":"main","index":0}]]},"Parse Script Output":{"main":[[{"node":"Store Script","type":"main","index":0}]]},"Poll Rendered Videos":{"main":[[{"node":"Final Video","type":"main","index":0}]]},"Prepare Video Assets":{"main":[[{"node":"Build Shotstack Timeline","type":"main","index":0}]]},"Generate Music Prompt":{"main":[[{"node":"MusicPrompt","type":"main","index":0}]]},"Youtube Video Created":{"main":[[{"node":"Final Video Creatomate","type":"main","index":0}]]},"Aggregating Voice Urls":{"main":[[{"node":"Update VoiceUrls","type":"main","index":0},{"node":"Merge","type":"main","index":0}]]},"Final Creatomate Video":{"main":[[{"node":"Youtube Video Created","type":"main","index":0}]]},"Final Video Creatomate":{"main":[[{"node":"Creatomate Final Video","type":"main","index":0}]]},"ShotStack Render Video":{"main":[[{"node":"Wait 5 Min","type":"main","index":0}]]},"Add Aggregate Music URLs":{"main":[[{"node":"Store Music Urls","type":"main","index":0},{"node":"Merge","type":"main","index":2}]]},"Build Shotstack Timeline":{"main":[[{"node":"ShotStack Render Video","type":"main","index":0}]]},"Store Script in Airtable":{"main":[[{"node":"Updated Idea to Scripted","type":"main","index":0}]]},"Structured Output Parser":{"ai_outputParser":[[{"node":"Generate Script","type":"ai_outputParser","index":0}]]},"Updated Idea to Scripted":{"main":[[{"node":"Update Status Ideas Table","type":"main","index":0}]]},"Update Status Ideas Table":{"main":[[{"node":"Extract Scenes","type":"main","index":0}]]},"Access to Anyone with Link":{"main":[[]]},"Store Image Urls in Airtable":{"main":[[]]},"Search for Latest Ready Video":{"main":[[{"node":"If Ready?","type":"main","index":0}]]},"Prepare  Assets For Creatomate":{"main":[[{"node":"List Elements","type":"main","index":0}]]}}}


name: Extract & Enrich LinkedIn Comments to Leads with Apify → Google Sheets/CSV
author_name: Saverflow AI
author_username: saverflowai
nodes_used: ["n8n-nodes-base.googleSheets","n8n-nodes-base.httpRequest","n8n-nodes-base.code"]
categories: []
created_at: 2025-06-04T02:39:54.846Z
updated_at: 2025-06-04T02:39:54.846Z
url: https://n8n.io/workflows/4635
scraped_at: 2025-07-06 21:16:30
description:
  🚀 LinkedIn Comments to Leads Extractor & Enricher (Apify) → Google Sheets / CSV

  Overview

  Automate LinkedIn lead generation by scraping comments from targeted posts and enriching profiles with detailed data

  This n8n workflow automatically extracts leads from LinkedIn post comments using Apify's powerful scrapers (no LinkedIn login required), enriches the data with additional profile information, and exports everything to Google Sheets or CSV format.

  ✨ Key Features

  🔍 No Login Required: Scrape LinkedIn data without sharing credentials
  💰 Cost-Effective: First 1,000 comments are free with Apify
  📊 Data Enrichment: Enhance basic comment data with full profile details
  📈 Export Options: Choose between Google Sheets or CSV output
  🎯 Targeted Scraping: Focus on specific posts for quality leads

  🛠️ Apify Scrapers Used

  1. LinkedIn Post Comments Scraper
  Tool**: LinkedIn Post Comments, Replies, Engagements Scraper | No Cookies
  Pricing**: $5.00 per 1,000 results
  Function**: Extracts all comments and engagement data from specified LinkedIn posts

  2. LinkedIn Profile Batch Scraper
  Tool**: LinkedIn Profile Details Batch Scraper (No Cookies Required)
  Pricing**: $5.00 per 1,000 results
  Function**: Enriches scraped profiles with detailed information

  &gt; 💡 Free Tier: Apify provides 1,000 free scraped comments to get you started!

  📋 Prerequisites

  Required API Credentials

  Apify Token
     Add your APIFY_TOKEN to the workflow credentials
     Get your token from Apify Console

  Google Sheets Credentials (if using Sheets export)
     Configure OAuth credentials for Google Sheets integration
     Follow n8n's Google Sheets setup guide

  🔄 Workflow Process

  Default Mode: Form-Based Execution

  Manual Trigger → Launches the workflow
  Form Submission → User-friendly form for inputting LinkedIn post URLs
  Comment Scraping → Apify extracts all comments from specified posts
  Profile Enrichment → Additional profile data gathered for each commenter
  Data Processing → Creates unique, enriched lead list
  Google Sheets Export → Automatically populates your spreadsheet

  Result: You'll be redirected to a Google Sheets document containing all enriched leads

  Alternative Mode: CSV Export

  For users preferring CSV output:

  Disable: Form trigger nodes
  Enable: Manual trigger node
  Disable: Google Sheets export nodes
  Enable: CSV download nodes
  Configure: Add post IDs/URLs in "Set manual fields" node
  Execute: Run workflow and download CSV from the CSV node

  📊 Output Data Structure

  Your exported data will include:

  Basic Info**: Name, headline, location
  Profile Details**: Company, position, industry
  Engagement Data**: Comment content, engagement metrics
  Contact Info**: Available profile links and connections
  Enriched Data**: Additional profile insights from Apify

  💡 Pro Tips

  Quality over Quantity**: Target posts with high-quality, relevant engagement
  Monitor Costs**: Track your Apify usage to stay within budget
  Data Hygiene**: Regularly clean and deduplicate your lead lists
  Compliance**: Ensure your scraping activities comply with LinkedIn's terms of service

  🆘 Troubleshooting

  Common Issues:
  Authentication Errors**: Verify your Apify token is correctly configured
  Empty Results**: Check that your LinkedIn post URLs are valid and public
  Export Failures**: Ensure Google Sheets credentials are properly set up

  Need Help? Contact Saverflow.ai for support and custom workflow development.

workflow_json:
  {"meta":{"instanceId":"30e5848b346369e688a90590edfdf72f9e085f2b2ed50b31cf94f3bfb8c384ed","templateId":"4635"},"nodes":[{"id":"66c32da3-373c-42a9-bf51-5bec1fd6c4cd","name":"Trigger manually","type":"n8n-nodes-base.manualTrigger","disabled":true,"position":[1240,1360],"parameters":{},"typeVersion":1},{"id":"6a0decfe-9539-4c10-9474-0031fa91dfc5","name":"Sticky Note1","type":"n8n-nodes-base.stickyNote","position":[380,240],"parameters":{"color":5,"width":1620,"height":1000,"content":"# 🚀 LinkedIn Comments to Leads Extractor & Enricher (Apify) → Google Sheets / CSV\n\n## Overview\n\n**Automate LinkedIn lead generation by scraping comments from targeted posts and enriching profiles with detailed data**\n\nThis n8n workflow automatically extracts leads from LinkedIn post comments using Apify's powerful scrapers (no LinkedIn login required), enriches the data with additional profile information, and exports everything to Google Sheets or CSV format.\n\n---\n\n## ✨ Key Features\n\n- 🔍 **No Login Required**: Scrape LinkedIn data without sharing credentials\n- 💰 **Cost-Effective**: First 1,000 comments are free with Apify\n- 📊 **Data Enrichment**: Enhance basic comment data with full profile details\n- 📈 **Export Options**: Choose between Google Sheets or CSV output\n- 🎯 **Targeted Scraping**: Focus on specific posts for quality leads\n\n---\n\n## 🛠️ Apify Scrapers Used\n\n### 1. LinkedIn Post Comments Scraper\n- **Tool**: [LinkedIn Post Comments, Replies, Engagements Scraper | No Cookies](https://apify.com/apimaestro/linkedin-post-comments-replies-engagements-scraper-no-cookies/api/python)\n- **Pricing**: $5.00 per 1,000 results\n- **Function**: Extracts all comments and engagement data from specified LinkedIn posts\n\n### 2. LinkedIn Profile Batch Scraper\n- **Tool**: [LinkedIn Profile Details Batch Scraper (No Cookies Required)](https://apify.com/apimaestro/linkedin-profile-batch-scraper-no-cookies-required)\n- **Pricing**: $5.00 per 1,000 results\n- **Function**: Enriches scraped profiles with detailed information\n\n> 💡 **Free Tier**: Apify provides 1,000 free scraped comments to get you started!\n\n---\n"},"typeVersion":1},{"id":"e206b173-eb8a-4721-8251-8b0ebb2aa38f","name":"On form submission","type":"n8n-nodes-base.formTrigger","position":[1300,1760],"webhookId":"a81d04b5-169a-4368-b925-91fb0660b6b2","parameters":{"options":{"ignoreBots":true,"buttonLabel":"Submit","appendAttribution":false,"respondWithOptions":{"values":{"redirectUrl":"=https://docs.google.com/spreadsheets/u/0/","respondWith":"redirect"}}},"formTitle":"Linkedin Posts Comments Leads Scraper","formFields":{"values":[{"fieldType":"textarea","fieldLabel":"Post IDs/URLs","placeholder":"e.g. 7334385757769416704, https://www.linkedin.com/feed/update/urn:li:activity:7334385757769416704/","requiredField":true},{"fieldType":"number","fieldLabel":"How many comments you want to scrape?","placeholder":"Default: 100"}]},"responseMode":"lastNode","formDescription":"=<div style=\"font-family: Arial, sans-serif; line-height: 1.8; color: #333; word-wrap: break-word; overflow-wrap: break-word;\">\n\n<p style=\"margin-bottom: 20px;\"><strong style=\"color: #0077b5;\">🔸 Step 1: Add Posts URLs</strong></p>\n<p style=\"margin-bottom: 20px;\">The workflow accepts various LinkedIn post identifier formats:</p>\n\n<p style=\"margin-bottom: 18px;\"><strong>📊 Numeric post IDs:</strong><br>\n<span style=\"font-family: monospace; background: #f5f5f5; padding: 4px 6px; word-break: break-all; margin-top: 8px; display: inline-block;\">7334385757769416704</span></p>\n\n<p style=\"margin-bottom: 18px;\"><strong>🔗 Activity URLs:</strong><br>\n<span style=\"font-family: monospace; background: #f5f5f5; padding: 4px 6px; word-break: break-all; display: block; margin-top: 8px;\">https://www.linkedin.com/feed/update/urn:li:activity:273437/</span></p>\n\n<p style=\"margin-bottom: 25px;\"><strong>🌐 Full post URLs:</strong><br>\n<span style=\"font-family: monospace; background: #f5f5f5; padding: 4px 6px; word-break: break-all; display: block; margin-top: 8px;\">https://www.linkedin.com/posts/username_title-activity-7334385757769416704-dMnz</span></p>\n\n<hr style=\"margin: 30px 0; border: 1px solid #ddd;\">-------------------\n\n<p style=\"margin-bottom: 20px;\"><strong style=\"color: #28a745;\">✅ Step 2: Results</strong></p>\n<p style=\"margin-bottom: 20px;\">Once finished, you'll be redirected to Google Sheets where you can find your result with the name:</p>\n<p style=\"background: #f0f8ff; padding: 15px; border-left: 4px solid #0077b5; margin: 20px 0;\">\n<strong>\"LinkedIn-Posts-Comments-Leads-{{ $now.format('yyyy-MM-dd') }}\"</strong>\n</p>\n\n<hr style=\"margin: 30px 0; border: 1px solid #ddd;\">-------------------\n\n\n<p style=\"color: #666; font-size: 14px; margin-top: 25px;\"><em>💡 Tip: Make sure your LinkedIn URLs are publicly accessible for the best results.</em></p>\n\n</div>"},"typeVersion":2.2},{"id":"d90f3510-b326-4352-90f4-772eca3d5b9b","name":"Set APIFY Token","type":"n8n-nodes-base.set","position":[1820,1460],"parameters":{"options":{},"assignments":{"assignments":[{"id":"20febbcc-0a59-4a89-8932-9bbb34b0e9f9","name":"APIFY_TOKEN","type":"string","value":""},{"id":"291758a3-c73f-4db5-a2b3-5f88664a8b53","name":"limit","type":"number","value":"={{ $json.limit }}"},{"id":"921b72d5-3688-4324-9d36-50668548344e","name":"postIds","type":"array","value":"={{ $json.postIds }}"}]},"includeOtherFields":true},"notesInFlow":true,"typeVersion":3.4},{"id":"36eb3f1f-e0db-4175-964e-9200bf503918","name":"Sticky Note2","type":"n8n-nodes-base.stickyNote","position":[1740,1360],"parameters":{"color":3,"width":260,"height":300,"content":"## 1. Set APIFY TOKEN\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n### _(CLICK ME)_"},"typeVersion":1},{"id":"5237c7a8-e2b4-49ae-a070-9cd885e1bc18","name":"Sticky Note3","type":"n8n-nodes-base.stickyNote","position":[1420,1280],"parameters":{"color":2,"height":300,"content":"_(or if run manually ENABLE this)_  \n### 4. Set Post ID/URL\n\n\n\n\n\n\n\n\n\n\n\n\n\n### _(CLICK ME)_ and Connect\n"},"typeVersion":1},{"id":"9637dc03-c409-477d-a596-c84f4df12d63","name":"Sticky Note4","type":"n8n-nodes-base.stickyNote","position":[1160,1620],"parameters":{"color":3,"width":400,"height":380,"content":"## 3. You can run through the form (check Form URL)\n\n\n\n\n\n\n\n\n\n\n\n\n\n### _(CLICK ME)_ \nIf run manually DISABLE this node"},"typeVersion":1},{"id":"efe492e1-78f7-4f55-89d7-caea70767044","name":"Set fields from the form","type":"n8n-nodes-base.set","position":[1620,1760],"parameters":{"options":{},"assignments":{"assignments":[{"id":"916bb8f7-34c5-4f2f-b13d-f60d228abc1f","name":"postIds","type":"array","value":"={{ $json['Post IDs/URLs'].replaceAll('\\n','').replaceAll('\\r', '').split(',').filter(item => $ifEmpty(item, false))  }}"},{"id":"7ff3d2f4-ab8a-444f-9747-f95166a950bd","name":"limit","type":"number","value":"={{ $json['How many comments you want to scrape?'] || 100 }}"}]}},"notesInFlow":true,"typeVersion":3.4},{"id":"aea3954b-94cf-4785-a692-a46d45b9add5","name":"Set manual fields","type":"n8n-nodes-base.set","disabled":true,"position":[1480,1360],"parameters":{"options":{},"assignments":{"assignments":[{"id":"af09ad86-b3dd-45b7-b17d-cb810e4b48d6","name":"postIds","type":"array","value":"['https://www.linkedin.com/feed/update/urn:li:activity:7334385757769416704/', 'https://www.linkedin.com/feed/update/urn:li:activity:7318557377971023872/']"},{"id":"b2f9412e-4c81-454f-ad84-a1d5f6547a26","name":"limit","type":"number","value":100}]}},"notesInFlow":true,"typeVersion":3.4},{"id":"c9d2e385-9c38-43ea-88bd-e7363f215cc7","name":"More runs needed?","type":"n8n-nodes-base.if","notes":"Per run it's only 100 comments","position":[2620,1460],"parameters":{"options":{},"conditions":{"options":{"version":2,"leftValue":"","caseSensitive":true,"typeValidation":"strict"},"combinator":"and","conditions":[{"id":"19224073-c84d-456f-b694-318df4223d2a","operator":{"type":"number","operation":"gt"},"leftValue":"={{ $json.summary.totalComments }}","rightValue":100},{"id":"8156447e-75dd-4cad-8fc8-17366667d165","operator":{"type":"number","operation":"gt"},"leftValue":"={{ $('Set APIFY Token').first().json.limit }}","rightValue":100}]}},"notesInFlow":true,"typeVersion":2.2},{"id":"021e8ae2-6773-4154-ab59-61dab49b16e9","name":"Set pagination","type":"n8n-nodes-base.code","position":[2840,1320],"parameters":{"jsCode":"const limitPages = Math.ceil($('Set APIFY Token').first().json.limit / 100)\nconst totalComments = $('Run Apify Comments Scraper').last().json.summary.totalComments \nconst availablePages = Math.ceil(totalComments / 100)\n\nconst totalRuns = availablePages <= limitPages ? availablePages : limitPages\n\nlet currentPage = 2\n\n\nreturn {\n  json: {\n    items:\n      Array.from({ length: totalRuns }, (_, i) => {\n        return { currentPage: currentPage + i }\n      })\n  }\n};"},"typeVersion":2},{"id":"5371649d-d032-452d-8af6-13a679b254fd","name":"Split Out","type":"n8n-nodes-base.splitOut","position":[3060,1320],"parameters":{"options":{},"fieldToSplitOut":"items"},"typeVersion":1},{"id":"4003ce75-3e13-4d2a-9199-bac9f5bda6de","name":"Aggregate","type":"n8n-nodes-base.aggregate","position":[2400,1460],"parameters":{"options":{},"aggregate":"aggregateAllItemData","destinationFieldName":"items"},"typeVersion":1},{"id":"c25710e8-c47c-4fb9-91e1-d9fe37ad53fa","name":"Gather All Comments","type":"n8n-nodes-base.set","position":[3720,1120],"parameters":{"options":{},"assignments":{"assignments":[{"id":"b4280f11-a50b-4065-8742-9f994c6ee84d","name":"items","type":"array","value":"={{ $json.items.concat($('Aggregate').item.json.items) }}"}]}},"typeVersion":3.4},{"id":"2876c38b-ed23-4d6b-9a65-97c1b70d245a","name":"Create Unique List of Leads","type":"n8n-nodes-base.code","position":[4180,1480],"parameters":{"jsCode":"// Get all input items\nconst items = $input.first().json.items;\n\n// Use reduce to filter unique profile_url values\nconst uniqueProfiles = items.reduce((acc, item) => {\n  // Check if this profile_url is already in the accumulator\n  console.log(item)\n  if (item.author && !acc.some(i => i.profile_url === item.author.profile_url)) {\n    acc.push(item.author);\n  }\n  return acc;\n}, []);\n\nreturn uniqueProfiles"},"typeVersion":2},{"id":"80336fb8-a783-4907-89eb-82b9877a7b36","name":"Sticky Note","type":"n8n-nodes-base.stickyNote","position":[2000,1040],"parameters":{"color":7,"width":2040,"height":840,"content":"## 🛠 Running Apify LinkedIn Comments Scrapers and processing data\nWe want to run an Apify scraper once to validate the number of available comments and then run it multiple times if necessary."},"typeVersion":1},{"id":"3877d666-27e5-4bf7-8a1c-3c1e4dce32d8","name":"Sticky Note5","type":"n8n-nodes-base.stickyNote","position":[4040,1040],"parameters":{"width":1700,"height":840,"content":"## Create a unique list of Leads, ✨ enrich ✨ it with more data\nOnce we have all of the comment authors, we need to enrich them with more information from LinkedIn\n"},"typeVersion":1},{"id":"fdbf8690-b517-4773-819a-e8bd92ddcd25","name":"Run Apify Comments Scraper","type":"n8n-nodes-base.httpRequest","position":[2180,1460],"parameters":{"url":"={{ 'https://api.apify.com/v2/acts/apimaestro~linkedin-post-comments-replies-engagements-scraper-no-cookies/run-sync-get-dataset-items?token=' +$json.APIFY_TOKEN}}","method":"POST","options":{},"sendBody":true,"bodyParameters":{"parameters":[{"name":"postIds","value":"={{ $json.postIds }}"},{"name":"page_number","value":"={{ 1 }}"},{"name":"sortOrder","value":"most recent"},{"name":"limit","value":"={{ $json.limit }}"}]}},"typeVersion":4.2},{"id":"5b426074-2649-48cf-9a55-cedfe1cb0bf7","name":"Run Apify Comments Scraper Loop","type":"n8n-nodes-base.httpRequest","position":[3500,1340],"parameters":{"url":"={{ 'https://api.apify.com/v2/acts/apimaestro~linkedin-post-comments-replies-engagements-scraper-no-cookies/run-sync-get-dataset-items?token=' + $('Set APIFY Token').first().json.APIFY_TOKEN}}","method":"POST","options":{},"sendBody":true,"bodyParameters":{"parameters":[{"name":"postIds","value":"={{ $('Set APIFY Token').first().json.postIds }}"},{"name":"page_number","value":"={{ $json.currentPage }}"},{"name":"sortOrder","value":"most recent"},{"name":"limit","value":"={{ $('Set APIFY Token').first().json.limit }}"}]}},"typeVersion":4.2},{"id":"b3038b0f-d025-4843-8204-1bb498b193ce","name":"Run Apify Profile Enrichment","type":"n8n-nodes-base.httpRequest","position":[5220,1500],"parameters":{"url":"={{ 'https://api.apify.com/v2/acts/apimaestro~linkedin-profile-batch-scraper-no-cookies-required/run-sync-get-dataset-items?token=' + $('Set APIFY Token').first().json.APIFY_TOKEN}}","method":"POST","options":{},"sendBody":true,"bodyParameters":{"parameters":[{"name":"usernames","value":"={{ $json.batches }}"}]}},"typeVersion":4.2},{"id":"87194dbf-8d63-438a-8081-8ed7a4e93169","name":"Split Out Batches","type":"n8n-nodes-base.splitOut","position":[4640,1480],"parameters":{"include":"allOtherFields","options":{},"fieldToSplitOut":"batches"},"typeVersion":1},{"id":"4fe12998-abdd-4659-aaa7-1aeef2ad241a","name":"Loop Over Comments","type":"n8n-nodes-base.splitInBatches","position":[3280,1320],"parameters":{"options":{}},"typeVersion":3},{"id":"e1a29bde-cfe6-4c89-a601-3ae0b582e052","name":"Loop Over Profiles","type":"n8n-nodes-base.splitInBatches","position":[4940,1480],"parameters":{"options":{}},"typeVersion":3},{"id":"1eb148c9-17a9-4d02-99a0-e647b3398ea4","name":"Split in batches","type":"n8n-nodes-base.code","position":[4400,1480],"parameters":{"jsCode":"const uniqueProfiles = $input.all().map(item => item.json.profile_url)\n\n// Split the uniqueProfiles in batches of 500 for the Apify\nconst chunkSize = 500;\nconst batches = [];\n\nfor (let i = 0; i < uniqueProfiles.length; i += chunkSize) {\n  batches.push(uniqueProfiles.slice(i, i + chunkSize));\n}\n\n\nreturn { batches };"},"typeVersion":2},{"id":"596572a6-7ffe-4cfa-b662-8cd083dbaccc","name":"Aggregate Comments","type":"n8n-nodes-base.aggregate","position":[3780,1340],"parameters":{"options":{},"aggregate":"aggregateAllItemData","destinationFieldName":"items"},"typeVersion":1},{"id":"1dc0b52f-3c86-40ea-8c4b-399872e22259","name":"Aggregate Profiles","type":"n8n-nodes-base.aggregate","position":[5440,1500],"parameters":{"options":{},"aggregate":"aggregateAllItemData","destinationFieldName":"items"},"typeVersion":1},{"id":"21cc6cc8-d4dc-40d9-9cfb-0069786af878","name":"Aggregate All Profiles","type":"n8n-nodes-base.aggregate","position":[5220,1320],"parameters":{"options":{"mergeLists":true},"fieldsToAggregate":{"fieldToAggregate":[{"fieldToAggregate":"items"}]}},"typeVersion":1},{"id":"84708fbf-bed4-4ce3-85c9-3ea16a9358c5","name":"Aggregate All Comments","type":"n8n-nodes-base.aggregate","position":[3500,1120],"parameters":{"options":{"mergeLists":true},"fieldsToAggregate":{"fieldToAggregate":[{"fieldToAggregate":"items"}]}},"typeVersion":1},{"id":"ecab78f3-dcf3-4ddc-afdd-e0d49df4eaca","name":"Convert to File","type":"n8n-nodes-base.convertToFile","disabled":true,"position":[6100,1140],"parameters":{"options":{"headerRow":true}},"executeOnce":true,"typeVersion":1.1},{"id":"36b226d0-a07b-48f1-9a28-85aebf794fd9","name":"Sticky Note6","type":"n8n-nodes-base.stickyNote","position":[5840,1040],"parameters":{"color":2,"width":660,"height":380,"content":"## You can either run it manually (not through form) and download the CSV\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nYou need to activate \"Trigger manual\" nodes first\n\n### _(CLICK ME) and Connect_"},"typeVersion":1},{"id":"f278ede4-329d-4248-9f6c-b9bb14fa13aa","name":"Sticky Note7","type":"n8n-nodes-base.stickyNote","position":[5840,1500],"parameters":{"color":3,"width":660,"height":380,"content":"## 2. Add credentials to Google Sheets\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n### _(CLICK ME)_"},"typeVersion":1},{"id":"49cf9532-0e2f-487e-b6d4-eeb15fec3885","name":"Prepare the list for export","type":"n8n-nodes-base.code","position":[5440,1320],"parameters":{"jsCode":"function flatten(obj, prefix = '', res = {}) {\n  for (const key in obj) {\n    const value = obj[key];\n    const prefixedKey = prefix ? `${prefix}_${key}` : key;\n    if (typeof value === 'object' && value !== null && !Array.isArray(value)) {\n      flatten(value, prefixedKey, res);\n    } else {\n      res[prefixedKey] = value;\n    }\n  }\n  return res;\n}\n\nreturn $input.first().json.items.map(item => ({\n  json: flatten(item)\n}));"},"typeVersion":2},{"id":"33928b41-e209-4240-a636-41874b87b2f8","name":"Create Google Sheet","type":"n8n-nodes-base.googleSheets","position":[5920,1640],"parameters":{"title":"=LinkedIn-Posts-Comments-Leads-{{ $now.format('yyyy-MM-dd+T') }}","options":{},"resource":"spreadsheet","sheetsUi":{"sheetValues":[{"title":"Leads"}]}},"credentials":{"googleSheetsOAuth2Api":{"id":"w7X41eUzPcqOkYCg","name":"Google Sheets account"}},"executeOnce":true,"typeVersion":4.5},{"id":"d6e02f6e-0031-4dd8-922b-7981def48097","name":"Add Leads","type":"n8n-nodes-base.googleSheets","position":[6340,1640],"parameters":{"columns":{"value":{},"schema":[{"id":"profileUrl","type":"string","display":true,"required":false,"displayName":"profileUrl","defaultMatch":false,"canBeUsedToMatch":true},{"id":"basic_info_fullname","type":"string","display":true,"required":false,"displayName":"basic_info_fullname","defaultMatch":false,"canBeUsedToMatch":true},{"id":"basic_info_first_name","type":"string","display":true,"required":false,"displayName":"basic_info_first_name","defaultMatch":false,"canBeUsedToMatch":true},{"id":"basic_info_last_name","type":"string","display":true,"required":false,"displayName":"basic_info_last_name","defaultMatch":false,"canBeUsedToMatch":true},{"id":"basic_info_headline","type":"string","display":true,"required":false,"displayName":"basic_info_headline","defaultMatch":false,"canBeUsedToMatch":true},{"id":"basic_info_public_identifier","type":"string","display":true,"required":false,"displayName":"basic_info_public_identifier","defaultMatch":false,"canBeUsedToMatch":true},{"id":"basic_info_profile_picture_url","type":"string","display":true,"required":false,"displayName":"basic_info_profile_picture_url","defaultMatch":false,"canBeUsedToMatch":true},{"id":"basic_info_about","type":"string","display":true,"required":false,"displayName":"basic_info_about","defaultMatch":false,"canBeUsedToMatch":true},{"id":"basic_info_location_country","type":"string","display":true,"required":false,"displayName":"basic_info_location_country","defaultMatch":false,"canBeUsedToMatch":true},{"id":"basic_info_location_city","type":"string","display":true,"required":false,"displayName":"basic_info_location_city","defaultMatch":false,"canBeUsedToMatch":true},{"id":"basic_info_location_full","type":"string","display":true,"required":false,"displayName":"basic_info_location_full","defaultMatch":false,"canBeUsedToMatch":true},{"id":"basic_info_location_country_code","type":"string","display":true,"required":false,"displayName":"basic_info_location_country_code","defaultMatch":false,"canBeUsedToMatch":true},{"id":"basic_info_creator_hashtags","type":"string","display":true,"required":false,"displayName":"basic_info_creator_hashtags","defaultMatch":false,"canBeUsedToMatch":true},{"id":"basic_info_is_creator","type":"string","display":true,"required":false,"displayName":"basic_info_is_creator","defaultMatch":false,"canBeUsedToMatch":true},{"id":"basic_info_is_influencer","type":"string","display":true,"required":false,"displayName":"basic_info_is_influencer","defaultMatch":false,"canBeUsedToMatch":true},{"id":"basic_info_is_premium","type":"string","display":true,"required":false,"displayName":"basic_info_is_premium","defaultMatch":false,"canBeUsedToMatch":true},{"id":"basic_info_created_timestamp","type":"string","display":true,"required":false,"displayName":"basic_info_created_timestamp","defaultMatch":false,"canBeUsedToMatch":true},{"id":"basic_info_show_follower_count","type":"string","display":true,"required":false,"displayName":"basic_info_show_follower_count","defaultMatch":false,"canBeUsedToMatch":true},{"id":"basic_info_background_picture_url","type":"string","display":true,"required":false,"displayName":"basic_info_background_picture_url","defaultMatch":false,"canBeUsedToMatch":true},{"id":"basic_info_urn","type":"string","display":true,"required":false,"displayName":"basic_info_urn","defaultMatch":false,"canBeUsedToMatch":true},{"id":"basic_info_follower_count","type":"string","display":true,"required":false,"displayName":"basic_info_follower_count","defaultMatch":false,"canBeUsedToMatch":true},{"id":"basic_info_connection_count","type":"string","display":true,"required":false,"displayName":"basic_info_connection_count","defaultMatch":false,"canBeUsedToMatch":true},{"id":"basic_info_current_company","type":"string","display":true,"required":false,"displayName":"basic_info_current_company","defaultMatch":false,"canBeUsedToMatch":true},{"id":"basic_info_current_company_urn","type":"string","display":true,"required":false,"displayName":"basic_info_current_company_urn","defaultMatch":false,"canBeUsedToMatch":true},{"id":"basic_info_current_company_url","type":"string","display":true,"required":false,"displayName":"basic_info_current_company_url","defaultMatch":false,"canBeUsedToMatch":true},{"id":"experience","type":"string","display":true,"required":false,"displayName":"experience","defaultMatch":false,"canBeUsedToMatch":true},{"id":"education","type":"string","display":true,"required":false,"displayName":"education","defaultMatch":false,"canBeUsedToMatch":true},{"id":"certifications","type":"string","display":true,"required":false,"displayName":"certifications","defaultMatch":false,"canBeUsedToMatch":true}],"mappingMode":"autoMapInputData","matchingColumns":[],"attemptToConvertTypes":false,"convertFieldsToString":false},"options":{"useAppend":true,"cellFormat":"USER_ENTERED"},"operation":"append","sheetName":{"__rl":true,"mode":"id","value":"={{ $('Create Google Sheet').first().json.sheets[0].properties.sheetId }}"},"documentId":{"__rl":true,"mode":"id","value":"={{ $('Create Google Sheet').first().json.spreadsheetId }}"}},"credentials":{"googleSheetsOAuth2Api":{"id":"w7X41eUzPcqOkYCg","name":"Google Sheets account"}},"executeOnce":false,"typeVersion":4.5},{"id":"fdb1fb37-bc5a-435d-97b4-aef5fbb8175f","name":"Set the list for sheets","type":"n8n-nodes-base.code","position":[6140,1640],"parameters":{"jsCode":"\nreturn $('Prepare the list for export').all();"},"typeVersion":2},{"id":"fe6d63a8-dadd-4187-814a-7a421bbb6d3f","name":"Sticky Note8","type":"n8n-nodes-base.stickyNote","position":[380,2200],"parameters":{"color":5,"width":1180,"height":280,"content":"\n---\n\n## 📊 Output Data Structure\n\nYour exported data will include:\n\n- **Basic Info**: Name, headline, location\n- **Profile Details**: Company, position, industry\n- **Engagement Data**: Comment content, engagement metrics\n- **Contact Info**: Available profile links and connections\n- **Enriched Data**: Additional profile insights from Apify\n\n"},"typeVersion":1},{"id":"cc6512e8-8b8b-42b6-ba41-02a647bf6f5d","name":"Sticky Note9","type":"n8n-nodes-base.stickyNote","position":[1560,2200],"parameters":{"width":760,"height":540,"content":"---\n\n## 💡 Pro Tips\n\n- **Quality over Quantity**: Target posts with high-quality, relevant engagement\n- **Monitor Costs**: Track your Apify usage to stay within budget\n- **Data Hygiene**: Regularly clean and deduplicate your lead lists\n- **Compliance**: Ensure your scraping activities comply with LinkedIn's terms of service\n\n---\n\n## 🆘 Troubleshooting\n\n**Common Issues:**\n- **Authentication Errors**: Verify your Apify token is correctly configured\n- **Empty Results**: Check that your LinkedIn post URLs are valid and public\n- **Export Failures**: Ensure Google Sheets credentials are properly set up\n\n**Need Help?** Contact [Saverflow.ai](https://saverflow.ai) for support and custom workflow development.\n\n---\n\n*Powered by Saverflow.ai | Streamline your lead generation with intelligent automation*"},"typeVersion":1},{"id":"ad786f97-cc63-4259-a469-5c5d271b17f8","name":"Sticky Note10","type":"n8n-nodes-base.stickyNote","position":[380,1240],"parameters":{"color":6,"width":1620,"height":960,"content":"\n## 📋 Prerequisites\n\n### Required API Credentials\n\n1. **Apify Token**\n   - Add your `APIFY_TOKEN` to the workflow credentials\n   - [Get your token from Apify Console](https://apify.com/account#/integrations)\n\n2. **Google Sheets Credentials** *(if using Sheets export)*\n   - Configure OAuth credentials for Google Sheets integration\n   - [Follow n8n's Google Sheets setup guide](https://docs.n8n.io/integrations/builtin/credentials/google/oauth-single-service/?utm_source=n8n_app&utm_medium=credential_settings&utm_campaign=create_new_credentials_modal)\n\n---\n\n## 🔄 Workflow Process\n\n### Default Mode: Form-Based Execution\n\n1. **Manual Trigger** → Launches the workflow\n2. **Form Submission** → User-friendly form for inputting LinkedIn post URLs\n3. **Comment Scraping** → Apify extracts all comments from specified posts\n4. **Profile Enrichment** → Additional profile data gathered for each commenter\n5. **Data Processing** → Creates unique, enriched lead list\n6. **Google Sheets Export** → Automatically populates your spreadsheet\n\n**Result**: You'll be redirected to a Google Sheets document containing all enriched leads\n\n### Alternative Mode: CSV Export\n\nFor users preferring CSV output:\n\n1. **Disable**: Form trigger nodes\n2. **Enable**: Manual trigger node\n3. **Disable**: Google Sheets export nodes\n4. **Enable**: CSV download nodes\n5. **Configure**: Add post IDs/URLs in \"Set manual fields\" node\n6. **Execute**: Run workflow and download CSV from the CSV node\n"},"typeVersion":1},{"id":"66685e68-953e-41b7-bc24-3de11ec8798a","name":"Done","type":"n8n-nodes-base.noOp","position":[7060,1360],"parameters":{},"typeVersion":1}],"connections":{"Add Leads":{"main":[[{"node":"Done","type":"main","index":0}]]},"Aggregate":{"main":[[{"node":"More runs needed?","type":"main","index":0}]]},"Split Out":{"main":[[{"node":"Loop Over Comments","type":"main","index":0}]]},"Set pagination":{"main":[[{"node":"Split Out","type":"main","index":0}]]},"Convert to File":{"main":[[]]},"Set APIFY Token":{"main":[[{"node":"Run Apify Comments Scraper","type":"main","index":0}]]},"Split in batches":{"main":[[{"node":"Split Out Batches","type":"main","index":0}]]},"Trigger manually":{"main":[[{"node":"Set manual fields","type":"main","index":0}]]},"More runs needed?":{"main":[[{"node":"Set pagination","type":"main","index":0}],[{"node":"Create Unique List of Leads","type":"main","index":0}]]},"Set manual fields":{"main":[[]]},"Split Out Batches":{"main":[[{"node":"Loop Over Profiles","type":"main","index":0}]]},"Aggregate Comments":{"main":[[{"node":"Loop Over Comments","type":"main","index":0}]]},"Aggregate Profiles":{"main":[[{"node":"Loop Over Profiles","type":"main","index":0}]]},"Loop Over Comments":{"main":[[{"node":"Aggregate All Comments","type":"main","index":0}],[{"node":"Run Apify Comments Scraper Loop","type":"main","index":0}]]},"Loop Over Profiles":{"main":[[{"node":"Aggregate All Profiles","type":"main","index":0}],[{"node":"Run Apify Profile Enrichment","type":"main","index":0}]]},"On form submission":{"main":[[{"node":"Set fields from the form","type":"main","index":0}]]},"Create Google Sheet":{"main":[[{"node":"Set the list for sheets","type":"main","index":0}]]},"Gather All Comments":{"main":[[{"node":"Create Unique List of Leads","type":"main","index":0}]]},"Aggregate All Comments":{"main":[[{"node":"Gather All Comments","type":"main","index":0}]]},"Aggregate All Profiles":{"main":[[{"node":"Prepare the list for export","type":"main","index":0}]]},"Set the list for sheets":{"main":[[{"node":"Add Leads","type":"main","index":0}]]},"Set fields from the form":{"main":[[{"node":"Set APIFY Token","type":"main","index":0}]]},"Run Apify Comments Scraper":{"main":[[{"node":"Aggregate","type":"main","index":0}]]},"Create Unique List of Leads":{"main":[[{"node":"Split in batches","type":"main","index":0}]]},"Prepare the list for export":{"main":[[{"node":"Create Google Sheet","type":"main","index":0},{"node":"Convert to File","type":"main","index":0}]]},"Run Apify Profile Enrichment":{"main":[[{"node":"Aggregate Profiles","type":"main","index":0}]]},"Run Apify Comments Scraper Loop":{"main":[[{"node":"Aggregate Comments","type":"main","index":0}]]}}}


name: Automate Social Media Content with AI for Instagram, Facebook, LinkedIn & X
author_name: LukaszB
author_username: lukaszb
categories: []
created_at: 2025-06-04T03:00:43.654Z
updated_at: 2025-06-04T03:00:43.654Z
url: https://n8n.io/workflows/4637
scraped_at: 2025-07-06 21:16:30
description:
  AI Social Media Content Automation – n8n Workflow

  This workflow is built for creators, solopreneurs, SaaS founders, and agencies looking to automate their social media content process from idea to publication. It combines the power of OpenAI, Google Sheets, and official APIs for Instagram, Facebook, X (Twitter), and LinkedIn to deliver fully automated, brand-consistent social media posts — including text, images, hashtags, CTAs, and scheduling.

  No more switching tools, rewriting content, or forgetting to post. Just set it up once and let your brand grow automatically.

  🔧 What the Workflow Does
  Generates platform-specific post ideas based on your brand tone.
  Selects the best idea (or lets you manually input one).
  Writes tailored posts for Instagram, Facebook, X, and LinkedIn.
  Auto-generates platform-specific visuals using OpenAI (DALL·E) and uploads to Cloudinary.
  Publishes content directly using official platform APIs.
  Logs all actions to Google Sheets and optionally sends a summary email via Gmail.

  ⚙️ How It Works
  Trigger the workflow manually, on a schedule, or from a chatbot.
  AI generates multiple post ideas and filters the best one.
  Based on the selected idea, it generates full posts for each platform.
  Custom visuals are created using OpenAI and uploaded to Cloudinary.
  Final post content is merged and sent to Instagram, Facebook, X, and LinkedIn.
  Logs and optional reports are created in Google Sheets and Gmail.

  🛠️ Setup Steps
  Set up your accounts and credentials: OpenAI, Cloudinary, Gmail, Meta, LinkedIn, X, and Google Sheets.
  Import the workflow and subworkflow (Get Brand Brief) into n8n.
  Replace all placeholders (sheet IDs, access tokens, profile/page IDs, brand brief URLs).
  Optionally personalize prompts and output templates to match your brand voice.
  Setup time: ~30–45 minutes (including credentials and testing).

  Detailed configuration notes are included in sticky nodes throughout the workflow.

  📦 Included in Your Package
  JSON workflow file (main flow + brand brief subflow)
  Google Sheets templates for history logging
  Setup documentation (Markdown & PDF)
  Placeholder reference sheet

nodes_used:
  ["n8n-nodes-base.googleSheets","n8n-nodes-base.httpRequest","n8n-nodes-base.facebookGraphApi","n8n-nodes-base.twitter","n8n-nodes-base.gmail","n8n-nodes-base.linkedIn","n8n-nodes-base.notion","n8n-nodes-base.googleDocs","@n8n/n8n-nodes-langchain.agent","@n8n/n8n-nodes-langchain.chainLlm","@n8n/n8n-nodes-langchain.lmChatOpenAi","@n8n/n8n-nodes-langchain.memoryBufferWindow","@n8n/n8n-nodes-langchain.outputParserStructured","@n8n/n8n-nodes-langchain.toolWorkflow","@n8n/n8n-nodes-langchain.openAi"]

workflow_json:
  {"id":"ieuaDljDSKnZW1CR","meta":{"instanceId":"740c1df6d3b1b6ea8a9d2223701f6904173f9e3cf7381cd181644b043420ba09"},"name":"Social media cross posting","tags":[],"nodes":[{"id":"b3a52a5d-7bfe-4fda-8ab7-9d74de088a53","name":"OpenAI Chat Model","type":"@n8n/n8n-nodes-langchain.lmChatOpenAi","position":[2060,820],"parameters":{},"typeVersion":1.2},{"id":"15542640-1d00-41b9-82c5-d5a4ebcfb75e","name":"Get_Brand_Brief","type":"@n8n/n8n-nodes-langchain.toolWorkflow","position":[2340,820],"parameters":{},"typeVersion":2.1},{"id":"e321a191-70dc-40c4-856c-eda6e539fa81","name":"AI Content creator","type":"@n8n/n8n-nodes-langchain.agent","position":[2220,560],"parameters":{},"typeVersion":1.8},{"id":"131f3368-653b-468d-9323-b74c4f86a515","name":"Get Brief","type":"n8n-nodes-base.executeWorkflow","position":[-800,560],"parameters":{},"typeVersion":1.2},{"id":"8fd73c02-63b3-471e-b44f-c1f0c5e29d54","name":"Edit Fields","type":"n8n-nodes-base.set","position":[1440,560],"parameters":{},"typeVersion":3.4},{"id":"49e958ff-a1e4-4e2c-9fbb-e16840bcc997","name":"Structured Output Parser","type":"@n8n/n8n-nodes-langchain.outputParserStructured","position":[-400,780],"parameters":{},"typeVersion":1.2},{"id":"9e7f7e6e-b7f8-4457-84eb-fc24354cb666","name":"Idea creator","type":"@n8n/n8n-nodes-langchain.chainLlm","position":[-580,560],"parameters":{},"typeVersion":1.6},{"id":"2ee53b83-7ab2-4018-805b-9d4dbb235ae6","name":"When clicking ‘Test workflow’","type":"n8n-nodes-base.manualTrigger","position":[-1320,640],"parameters":{},"typeVersion":1},{"id":"3c262ffa-b8c7-4477-a825-92b70e0eb4e4","name":"Sticky Note","type":"n8n-nodes-base.stickyNote","position":[-940,300],"parameters":{"content":""},"typeVersion":1},{"id":"709ecf38-4467-4c9a-821d-b6933d83d215","name":"Sticky Note1","type":"n8n-nodes-base.stickyNote","position":[1880,300],"parameters":{"content":""},"typeVersion":1},{"id":"253f5e80-cb8f-4647-aea9-f23286f7b948","name":"When Executed by Another Workflow","type":"n8n-nodes-base.executeWorkflowTrigger","position":[340,2080],"parameters":{},"typeVersion":1.1},{"id":"1d6e201b-fcad-4319-aa4e-5d5914c4635b","name":"Notion","type":"n8n-nodes-base.notion","position":[560,2080],"parameters":{},"typeVersion":2.2},{"id":"b6274635-b94d-453d-9e8c-6cefe2074e3d","name":"Aggregate","type":"n8n-nodes-base.aggregate","position":[780,2080],"parameters":{},"typeVersion":1},{"id":"f8a72627-9e29-4d76-ac5d-1d159d9775a0","name":"Edit Fields1","type":"n8n-nodes-base.set","position":[1000,2080],"parameters":{},"typeVersion":3.4},{"id":"c6977d95-7cb3-43dc-910b-f34aee49e34c","name":"Sticky Note7","type":"n8n-nodes-base.stickyNote","position":[-40,1860],"parameters":{"content":""},"typeVersion":1},{"id":"a531aba0-1796-498b-aaaf-f89a7f78d1f6","name":"OpenAI Chat Model2","type":"@n8n/n8n-nodes-langchain.lmChatOpenAi","position":[-580,800],"parameters":{},"typeVersion":1.2},{"id":"adb2943b-019d-4b42-b270-fbf57b25ff03","name":"Upload media to Instagram","type":"n8n-nodes-base.facebookGraphApi","position":[5140,420],"parameters":{},"typeVersion":1},{"id":"e34f8e99-636e-44c9-afc2-51ebe17a77c4","name":"Publish Post on IG","type":"n8n-nodes-base.facebookGraphApi","position":[5420,420],"parameters":{},"typeVersion":1},{"id":"97222747-0fa5-4ee4-ba11-7b09ad8e1690","name":"Sticky Note11","type":"n8n-nodes-base.stickyNote","position":[5020,320],"parameters":{"content":""},"typeVersion":1},{"id":"7c9703ab-0948-4d80-bbb1-42620a0cc7e6","name":"Merge3","type":"n8n-nodes-base.merge","position":[4700,420],"parameters":{},"typeVersion":3.1},{"id":"f4a526cf-d3c4-4584-a686-7444c7ed9f9b","name":"Merge4","type":"n8n-nodes-base.merge","position":[4700,1160],"parameters":{},"typeVersion":3.1},{"id":"ac9900d4-c48e-41c5-a318-7fbaeb5664e6","name":"X","type":"n8n-nodes-base.twitter","onError":"continueRegularOutput","position":[5300,1860],"parameters":{},"typeVersion":2},{"id":"feb929f6-032f-47ca-aa79-b9cdbdb631be","name":"Sticky Note16","type":"n8n-nodes-base.stickyNote","position":[3280,300],"parameters":{"content":""},"typeVersion":1},{"id":"e0b2322b-a3da-42e7-9afe-b011e456b4f5","name":"Sticky Note17","type":"n8n-nodes-base.stickyNote","position":[3140,120],"parameters":{"content":""},"typeVersion":1},{"id":"99b486e7-11c5-47e2-a6cb-3a9728627303","name":"Edit Fields4","type":"n8n-nodes-base.set","position":[4520,260],"parameters":{},"typeVersion":3.4},{"id":"efd21c27-e0f3-43e6-966d-4ccecebdc39e","name":"Edit Fields5","type":"n8n-nodes-base.set","position":[4540,1000],"parameters":{},"typeVersion":3.4},{"id":"7309c9ae-8cd2-4aaa-931d-14e4ff8c1894","name":"LinkedIn","type":"n8n-nodes-base.linkedIn","onError":"continueRegularOutput","position":[5280,2580],"parameters":{},"typeVersion":1},{"id":"13e5becb-e793-45c3-a1d4-acd65bcad6aa","name":"Merge5","type":"n8n-nodes-base.merge","position":[4760,2580],"parameters":{},"typeVersion":3.1},{"id":"d738c947-3dd3-48dc-9d6d-6624a545402f","name":"Edit Fields6","type":"n8n-nodes-base.set","position":[4580,2420],"parameters":{},"typeVersion":3.4},{"id":"61673acb-2ece-46a7-ac08-15d3aec3924d","name":"When chat message received","type":"@n8n/n8n-nodes-langchain.chatTrigger","position":[-1320,840],"webhookId":"cc6818c6-10a1-400b-9a17-7773ff0b891f","parameters":{},"typeVersion":1.1},{"id":"40926adb-faca-458c-b433-eb74a26c33d2","name":"AI Agent","type":"@n8n/n8n-nodes-langchain.agent","position":[280,560],"parameters":{},"typeVersion":1.9},{"id":"5bb9b6bb-1e8f-482c-89cb-4d6601413d2a","name":"OpenAI Chat Model3","type":"@n8n/n8n-nodes-langchain.lmChatOpenAi","position":[220,840],"parameters":{},"typeVersion":1.2},{"id":"b1485e4d-d5fc-450f-ae24-465ff08d479e","name":"Google Sheets","type":"n8n-nodes-base.googleSheetsTool","position":[640,840],"parameters":{},"typeVersion":4.6},{"id":"19518d54-18a6-4f9f-9385-9b0205274a0f","name":"Get_Brand_Brief1","type":"@n8n/n8n-nodes-langchain.toolWorkflow","position":[440,840],"parameters":{},"typeVersion":2.1},{"id":"9b69b348-9e52-4cb6-bde8-67fa1acb83fd","name":"Check Examples1","type":"n8n-nodes-base.googleSheetsTool","position":[2500,820],"parameters":{},"typeVersion":4.5},{"id":"81ca8c02-a438-4516-8ef8-4e16f9c84d13","name":"Simple Memory","type":"@n8n/n8n-nodes-langchain.memoryBufferWindow","position":[2200,820],"parameters":{},"typeVersion":1.3},{"id":"531c20c8-85a4-47ee-9e4d-4e2c315019a6","name":"Social Media Content1","type":"@n8n/n8n-nodes-langchain.outputParserStructured","position":[2660,820],"parameters":{},"typeVersion":1.2},{"id":"90c9e8dd-504d-4a50-9002-9b65d08f6bdc","name":"IG Image generator","type":"@n8n/n8n-nodes-langchain.openAi","position":[3520,400],"parameters":{},"typeVersion":1.8},{"id":"3e51e978-3dd7-4c10-a797-b2e3a1acd7bc","name":"FB Image generator","type":"@n8n/n8n-nodes-langchain.openAi","position":[3540,1140],"parameters":{},"typeVersion":1.8},{"id":"0a0b7cc9-27e4-467f-98d3-373df678bb81","name":"LinkedIn Image generator","type":"@n8n/n8n-nodes-langchain.openAi","position":[3560,2580],"parameters":{},"typeVersion":1.8},{"id":"2e0a79ba-b65e-4715-962b-37160983266b","name":"Facebook Post","type":"n8n-nodes-base.facebookGraphApi","onError":"continueRegularOutput","position":[5320,1160],"parameters":{},"typeVersion":1,"alwaysOutputData":true},{"id":"fc70dceb-2700-4ad3-979d-aa35e715a5f4","name":"Merge","type":"n8n-nodes-base.merge","position":[6720,2540],"parameters":{},"typeVersion":3.1},{"id":"aafcb369-d1f0-492b-bb17-213da72e170e","name":"Gmail","type":"n8n-nodes-base.gmail","position":[7360,2560],"webhookId":"531c4f73-015d-4ef7-8436-36c333ecdd71","parameters":{},"typeVersion":2.1},{"id":"e60b7d5e-21c0-4bbe-8db6-8ec61acbf6c8","name":"Aggregate1","type":"n8n-nodes-base.aggregate","position":[6980,2560],"parameters":{},"typeVersion":1},{"id":"5098abdf-7705-49d1-baa9-f377af07376a","name":"Sticky Note21","type":"n8n-nodes-base.stickyNote","position":[6500,2200],"parameters":{"content":""},"typeVersion":1},{"id":"20c6758f-3ee7-4ecd-aca3-8d41ebbfddcb","name":"Add to History","type":"n8n-nodes-base.googleSheets","position":[780,560],"parameters":{},"typeVersion":4.6},{"id":"d2c08180-bb7a-4eaf-b84d-ca5bb101caf1","name":"Sticky Note22","type":"n8n-nodes-base.stickyNote","position":[3140,840],"parameters":{"content":""},"typeVersion":1},{"id":"31ae2efd-9c71-4e7a-8dad-681e7a9b0b6e","name":"Sticky Note19","type":"n8n-nodes-base.stickyNote","position":[3300,1040],"parameters":{"content":""},"typeVersion":1},{"id":"01d9be7a-8b24-4d3d-8203-564c5f8e1959","name":"Sticky Note12","type":"n8n-nodes-base.stickyNote","position":[5020,1040],"parameters":{"content":""},"typeVersion":1},{"id":"b3936140-1db2-43db-8631-4bb2d3fbd409","name":"Sticky Note25","type":"n8n-nodes-base.stickyNote","position":[3140,1540],"parameters":{"content":""},"typeVersion":1},{"id":"2de31058-e1e3-4939-8b64-31c232cda880","name":"Sticky Note26","type":"n8n-nodes-base.stickyNote","position":[3300,1740],"parameters":{"content":""},"typeVersion":1},{"id":"01ee1db0-6142-4353-b25e-8640559c1d81","name":"Merge6","type":"n8n-nodes-base.merge","position":[4420,1860],"parameters":{},"typeVersion":3.1},{"id":"8dd0b5e3-8e8d-42d3-a98e-8c121958d9cd","name":"Edit Fields7","type":"n8n-nodes-base.set","position":[4260,1700],"parameters":{},"typeVersion":3.4},{"id":"4c27e97c-d714-4ed2-8687-ecd5d0432eba","name":"Sticky Note27","type":"n8n-nodes-base.stickyNote","position":[3140,2260],"parameters":{"content":""},"typeVersion":1},{"id":"2b8fdbdf-626c-48f7-b773-0329cafcb2e3","name":"Sticky Note28","type":"n8n-nodes-base.stickyNote","position":[3300,2460],"parameters":{"content":""},"typeVersion":1},{"id":"322e6be4-4354-4ef8-bdb8-2227ff6480d1","name":"Sticky Note14","type":"n8n-nodes-base.stickyNote","position":[5020,2480],"parameters":{"content":""},"typeVersion":1},{"id":"6cf82d22-7c92-4a60-b77a-f7d5dd26d7a0","name":"X Image generator","type":"@n8n/n8n-nodes-langchain.openAi","position":[3540,1840],"parameters":{},"typeVersion":1.8},{"id":"721cf0a1-a1f8-41e8-92cb-dd923d503ad8","name":"Sticky Note15","type":"n8n-nodes-base.stickyNote","position":[5040,1740],"parameters":{"content":""},"typeVersion":1},{"id":"d7f1d581-f19d-4846-a718-22fd9c10451b","name":"Sticky Note2","type":"n8n-nodes-base.stickyNote","position":[4560,1640],"parameters":{"content":""},"typeVersion":1},{"id":"768dbb8a-7732-408a-9239-5bf1e0d05374","name":"Add Examples","type":"n8n-nodes-base.googleSheets","position":[4360,3100],"parameters":{},"typeVersion":4.5},{"id":"56789045-4ea7-4089-97a9-62c2c8d3fec6","name":"Google Docs","type":"n8n-nodes-base.googleDocs","disabled":true,"position":[560,2460],"parameters":{},"typeVersion":2},{"id":"eb01b4e0-d696-44e0-9b40-12c6e2fad559","name":"Sticky Note3","type":"n8n-nodes-base.stickyNote","position":[400,2340],"parameters":{"content":""},"typeVersion":1},{"id":"8bf1b32c-cec0-4ec3-b454-189a1b0f1958","name":"Sticky Note4","type":"n8n-nodes-base.stickyNote","position":[4120,2940],"parameters":{"content":""},"typeVersion":1},{"id":"60f46c2a-8a8d-46bd-a345-e4a7e5999cd1","name":"Sticky Note5","type":"n8n-nodes-base.stickyNote","position":[60,300],"parameters":{"content":""},"typeVersion":1},{"id":"df0707e8-aeaa-4b7b-9412-cc4fba36a4d0","name":"Sticky Note6","type":"n8n-nodes-base.stickyNote","position":[1140,300],"parameters":{"content":""},"typeVersion":1},{"id":"e840dc65-069b-44b9-93e2-17c343670600","name":"HTTP Request","type":"n8n-nodes-base.httpRequest","position":[4020,2580],"parameters":{},"typeVersion":4.2},{"id":"1428375a-be0d-457d-88f3-313694546394","name":"Post image Cloudianry IG","type":"n8n-nodes-base.httpRequest","position":[3820,400],"parameters":{},"typeVersion":4.2},{"id":"044f8b91-1766-4183-a012-36e28287f2eb","name":"Post image Cloudianry FB","type":"n8n-nodes-base.httpRequest","position":[3860,1140],"parameters":{},"typeVersion":4.2},{"id":"e93929b2-9cbc-4826-9e7a-6e3bd651848e","name":"Post image Cloudianry X","type":"n8n-nodes-base.httpRequest","position":[3820,1840],"parameters":{},"typeVersion":4.2},{"id":"898e761d-abfa-4ea5-a5ef-40c2b67c87bf","name":"Post image Cloudianry LIn","type":"n8n-nodes-base.httpRequest","position":[3800,2580],"parameters":{},"typeVersion":4.2},{"id":"6ffdea4c-1f03-4cf4-913f-653019f0965c","name":"Schedule Trigger","type":"n8n-nodes-base.scheduleTrigger","position":[-1320,440],"parameters":{},"typeVersion":1.2},{"id":"ceeb4aee-6c35-4ac1-84df-3ed36147a0f2","name":"Sticky Note9","type":"n8n-nodes-base.stickyNote","position":[-1460,300],"parameters":{"content":""},"typeVersion":1},{"id":"9b18e14c-ead6-42c1-aaa7-918383acab18","name":"Sticky Note8","type":"n8n-nodes-base.stickyNote","position":[6400,160],"parameters":{"content":""},"typeVersion":1}],"active":false,"settings":{"executionOrder":"v1"},"versionId":"881c0ae7-8264-44d8-85a7-70206c98186a","connections":{"X":{"main":[[{"node":"Merge","type":"main","index":2}]]},"Merge":{"main":[[{"node":"Aggregate1","type":"main","index":0}]]},"Merge3":{"main":[[{"node":"Upload media to Instagram","type":"main","index":0}]]},"Merge4":{"main":[[{"node":"Facebook Post","type":"main","index":0}]]},"Merge5":{"main":[[{"node":"LinkedIn","type":"main","index":0}]]},"Merge6":{"main":[[{"node":"X","type":"main","index":0}]]},"Notion":{"main":[[{"node":"Aggregate","type":"main","index":0}]]},"AI Agent":{"main":[[{"node":"Add to History","type":"main","index":0}]]},"LinkedIn":{"main":[[{"node":"Merge","type":"main","index":3}]]},"Aggregate":{"main":[[{"node":"Edit Fields1","type":"main","index":0}]]},"Get Brief":{"main":[[{"node":"Idea creator","type":"main","index":0}]]},"Aggregate1":{"main":[[{"node":"Gmail","type":"main","index":0}]]},"Edit Fields":{"main":[[{"node":"AI Content creator","type":"main","index":0}]]},"Add Examples":{"main":[[]]},"Edit Fields4":{"main":[[{"node":"Merge3","type":"main","index":1}]]},"Edit Fields5":{"main":[[{"node":"Merge4","type":"main","index":1}]]},"Edit Fields6":{"main":[[{"node":"Merge5","type":"main","index":1}]]},"Edit Fields7":{"main":[[{"node":"Merge6","type":"main","index":1}]]},"HTTP Request":{"main":[[{"node":"Merge5","type":"main","index":1}]]},"Idea creator":{"main":[[{"node":"AI Agent","type":"main","index":0}]]},"Facebook Post":{"main":[[{"node":"Merge","type":"main","index":1}]]},"Google Sheets":{"ai_tool":[[{"node":"AI Agent","type":"ai_tool","index":0}]]},"Simple Memory":{"ai_memory":[[{"node":"AI Content creator","type":"ai_memory","index":0}]]},"Add to History":{"main":[[{"node":"Edit Fields","type":"main","index":0}]]},"Check Examples1":{"ai_tool":[[{"node":"AI Content creator","type":"ai_tool","index":0}]]},"Get_Brand_Brief":{"ai_tool":[[{"node":"AI Content creator","type":"ai_tool","index":0}]]},"Get_Brand_Brief1":{"ai_tool":[[{"node":"AI Agent","type":"ai_tool","index":0}]]},"Schedule Trigger":{"main":[[{"node":"Get Brief","type":"main","index":0}]]},"OpenAI Chat Model":{"ai_languageModel":[[{"node":"AI Content creator","type":"ai_languageModel","index":0}]]},"X Image generator":{"main":[[{"node":"Post image Cloudianry X","type":"main","index":0}]]},"AI Content creator":{"main":[[{"node":"LinkedIn Image generator","type":"main","index":0},{"node":"IG Image generator","type":"main","index":0},{"node":"Edit Fields4","type":"main","index":0},{"node":"FB Image generator","type":"main","index":0},{"node":"Edit Fields5","type":"main","index":0},{"node":"X Image generator","type":"main","index":0},{"node":"Edit Fields7","type":"main","index":0},{"node":"Edit Fields6","type":"main","index":0},{"node":"Add Examples","type":"main","index":0}]]},"FB Image generator":{"main":[[{"node":"Post image Cloudianry FB","type":"main","index":0}]]},"IG Image generator":{"main":[[{"node":"Post image Cloudianry IG","type":"main","index":0}]]},"OpenAI Chat Model2":{"ai_languageModel":[[{"node":"Idea creator","type":"ai_languageModel","index":0}]]},"OpenAI Chat Model3":{"ai_languageModel":[[{"node":"AI Agent","type":"ai_languageModel","index":0}]]},"Publish Post on IG":{"main":[[{"node":"Merge","type":"main","index":0}]]},"Social Media Content1":{"ai_outputParser":[[{"node":"AI Content creator","type":"ai_outputParser","index":0}]]},"Post image Cloudianry X":{"main":[[{"node":"Merge6","type":"main","index":0}]]},"LinkedIn Image generator":{"main":[[{"node":"Post image Cloudianry LIn","type":"main","index":0}]]},"Post image Cloudianry FB":{"main":[[{"node":"Merge4","type":"main","index":0}]]},"Post image Cloudianry IG":{"main":[[{"node":"Merge3","type":"main","index":0}]]},"Structured Output Parser":{"ai_outputParser":[[{"node":"Idea creator","type":"ai_outputParser","index":0}]]},"Post image Cloudianry LIn":{"main":[[{"node":"HTTP Request","type":"main","index":0}]]},"Upload media to Instagram":{"main":[[{"node":"Publish Post on IG","type":"main","index":0}]]},"When chat message received":{"main":[[{"node":"Edit Fields","type":"main","index":0}]]},"When Executed by Another Workflow":{"main":[[{"node":"Notion","type":"main","index":0}]]},"When clicking ‘Test workflow’":{"main":[[{"node":"Get Brief","type":"main","index":0}]]}}}


name: 🎙️ VoiceFlow AI: Telegram + Deepgram + OpenAI + Supabase Audio Assistant
author_name: RedOne
author_username: redone
categories: []
created_at: 2025-06-04T03:05:18.646Z
updated_at: 2025-06-04T03:05:18.646Z
url: https://n8n.io/workflows/4638
scraped_at: 2025-07-06 21:16:30
description:
  🎙️ AI Audio Assistant with Voice-to-Voice Response

  Who is this for?
  Businesses, customer service teams, content creators, and organizations who want to provide intelligent voice-based interactions through Telegram. Perfect for accessibility-focused services, multilingual support, or hands-free customer assistance.

  What problem does this solve?
  Enables natural voice conversations with AI
  Breaks down language and accessibility barriers
  Provides instant voice responses to customer queries
  Reduces typing requirements for users
  Offers 24/7 voice-based customer support
  Maintains conversation context across voice interactions

  What this workflow does:
  Receives voice messages via Telegram bot
  Transcribes audio using Deepgram's advanced speech-to-text
  Processes transcribed text through AI agent with knowledge base access
  Generates intelligent responses based on conversation context
  Converts AI response to natural-sounding speech using Deepgram TTS
  Sends audio response back to user via Telegram
  Maintains conversation memory for contextual interactions

  🔧 Technical Architecture

  Core Components:
  Telegram Bot**: Receives and sends voice messages
  Deepgram STT**: Transcribes voice to text with high accuracy
  OpenAI GPT**: Processes queries and generates responses
  Supabase Knowledge Base**: Stores and retrieves business information
  Memory Management**: Maintains conversation context
  Deepgram TTS**: Converts text responses to natural speech

  Data Flow:
  Voice Message → Telegram API → File Download
  Audio File → Deepgram STT → Transcript
  Transcript → AI Agent → Response Generation
  Response → Deepgram TTS → Audio File
  Audio Response → Telegram → User

  🛠️ Setup Instructions

  Prerequisites
  Telegram Bot Token
     Create bot via @BotFather
     Get bot token and configure webhook

  Deepgram API Key
     Sign up at deepgram.com
     Get API key for STT and TTS services
     Note: Currently hardcoded in workflow

  OpenAI API Key
     OpenAI account with API access
     Configure in OpenAI Chat Model node

  Supabase Database
     Create Supabase project
     Set up knowledge_base table
     Configure API credentials

  Step-by-Step Setup

  Configure Telegram Bot
        Update telegramToken in "Prepare Voice Message Data" node
     Set correct bot token in Telegram nodes
     Test bot connectivity
     
  Set Up Deepgram Integration
        Replace API key in "Transcribe with Deepgram" node
     Update TTS endpoint in "HTTP Request" node
     Test voice transcription accuracy
     
  Configure Knowledge Base
        -- Create knowledge_base table in Supabase
     CREATE TABLE knowledge_base (
       id UUID DEFAULT gen_random_uuid() PRIMARY KEY,
       question TEXT NOT NULL,
       answer TEXT NOT NULL,
       category VARCHAR(100),
       keywords TEXT[],
       created_at TIMESTAMP WITH TIME ZONE DEFAULT NOW()
     );
     
  Customize AI Prompts
     Update system message in "Telegram AI Agent" node
     Adjust temperature and max tokens in OpenAI model
     Configure memory session keys

  Test End-to-End Flow
     Send test voice message to bot
     Verify transcription accuracy
     Check AI response quality
     Validate audio output clarity

  🎛️ Configuration Options

  Voice Recognition Settings
  Model**: nova-2 (Deepgram's latest model)
  Language**: English (en) - can be changed
  Smart Format**: Enabled for better punctuation

  AI Response Settings
  Temperature**: 0.3 (conservative responses)
  Max Tokens**: 100 (adjust based on needs)
  Memory**: Session-based conversation context

  Text-to-Speech Settings
  Model**: aura-2-thalia-en (natural female voice)
  Alternative voices**: Available in Deepgram TTS API
  Audio Format**: Optimized for Telegram

  🔒 Security Considerations

  API Key Management
  // Current implementation has hardcoded tokens
  // Recommended: Use environment variables
  const telegramToken = process.env.TELEGRAM_BOT_TOKEN;
  const deepgramKey = process.env.DEEPGRAM_API_KEY;

  Data Privacy
  Voice messages are processed by external APIs
  Consider data retention policies
  Implement user consent mechanisms
  Ensure GDPR compliance if applicable

  📊 Monitoring & Analytics

  Key Metrics to Track
  Voice message processing time
  Transcription accuracy rates
  AI response quality scores
  User engagement metrics
  Error rates and failure points

  Recommended Logging
  // Add to workflow for monitoring
  console.log({
    timestamp: new Date().toISOString(),
    user_id: userData.user_id,
    transcript_confidence: transcriptData.confidence,
    response_length: aiResponse.length,
    processing_time: processingTime
  });

  🚀 Customization Ideas

  Enhanced Features
  Multi-language Support
     Add language detection
     Support multiple TTS voices
     Translate responses

  Voice Commands
     Implement wake words
     Add voice shortcuts
     Create voice menus

  Advanced AI Features
     Sentiment analysis
     Intent classification
     Escalation triggers

  Integration Expansions
     Connect to CRM systems
     Add calendar scheduling
     Integrate with help desk tools

  Performance Optimizations
  Implement audio preprocessing
  Add response caching
  Optimize API call sequences
  Implement retry mechanisms

  🐛 Troubleshooting

  Common Issues

  Voice Not Transcribing
  Check Deepgram API key validity
  Verify audio format compatibility
  Test with shorter voice messages

  Poor Audio Quality
  Adjust TTS model settings
  Check network connectivity
  Verify Telegram audio limits

  AI Responses Too Generic
  Improve knowledge base content
  Adjust system prompts
  Increase context window

  Memory Not Working
  Check session key configuration
  Verify user ID extraction
  Test conversation continuity

  💡 Best Practices

  Voice Interface Design
  Keep responses concise and clear
  Use natural speech patterns
  Avoid technical jargon
  Provide clear next steps

  Knowledge Base Management
  Regular content updates
  Clear categorization
  Keyword optimization
  Quality assurance testing

  User Experience
  Fast response times (&lt;5 seconds)
  Consistent voice personality
  Graceful error handling
  Clear capability communication

  📈 Success Metrics

  Technical KPIs
  Response time: &lt;3 seconds average
  Transcription accuracy: &gt;95%
  User satisfaction: &gt;4.5/5
  Uptime: &gt;99.5%

  Business KPIs
  Customer query resolution rate
  Support ticket reduction
  User engagement increase
  Cost per interaction decrease

  🔄 Maintenance Schedule

  Daily
  Monitor error logs
  Check API rate limits
  Verify service uptime

  Weekly
  Review conversation quality
  Update knowledge base
  Analyze usage patterns

  Monthly
  Performance optimization
  Security audit
  Feature updates
  User feedback review

  📚 Additional Resources

  Documentation Links
  Deepgram STT API
  Deepgram TTS API
  Telegram Bot API
  OpenAI API
  Supabase Documentation

  Community Support
  n8n Community Forum
  Telegram Bot Developers Group
  Deepgram Developer Discord
  OpenAI Developer Community

  Note: This template requires active API subscriptions for Deepgram and OpenAI services. Costs may apply based on usage volume.

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

workflow_json:
  {"id":"X7pMjJBOk8H2tj1W","meta":{"instanceId":"1037e065dca107c3c15857d49fe150792779e136a3c579aed02192a2b3d2a396","templateCredsSetupCompleted":true},"name":"AI Audio Assistant","tags":[],"nodes":[{"id":"ccbc26b7-4e64-467f-844f-287bb51d201b","name":"Transcribe with Deepgram","type":"n8n-nodes-base.httpRequest","position":[1040,-420],"parameters":{"url":"https://api.deepgram.com/v1/listen?model=nova-2&language=en&smart_format=true","method":"POST","options":{"response":{"response":{"fullResponse":true}}},"sendBody":true,"contentType":"binaryData","sendHeaders":true,"headerParameters":{"parameters":[{"name":"Authorization","value":"Token {{YOUR DEEP GRAM TOKEN HERE}}"},{"name":"Content-Type","value":"audio/ogg"}]},"inputDataFieldName":"data"},"typeVersion":3},{"id":"42cb24ce-0ec0-4e29-961f-6aa3271e57c0","name":"Download Voice File","type":"n8n-nodes-base.httpRequest","position":[680,-420],"parameters":{"url":"=https://api.telegram.org/file/bot{{ $json.telegramToken }}/{{ $json.result.file_path }}","options":{}},"typeVersion":3},{"id":"cf10e5a6-08ce-4d6f-bda2-079e4d0cc51f","name":"Get File Path","type":"n8n-nodes-base.httpRequest","position":[760,-280],"parameters":{"url":"=https://api.telegram.org/bot{{ $json.telegramToken }}/getFile?file_id={{ $json.voice_file_id }}","options":{}},"typeVersion":4.2},{"id":"220308ea-8c89-4353-9b41-976feada6d30","name":"Prepare Voice Message Data","type":"n8n-nodes-base.set","position":[460,-280],"parameters":{"options":{},"assignments":{"assignments":[{"id":"e0deb0df-a5f8-4d13-8af6-92d0e1f0ad74","name":"user_id","type":"number","value":"={{ $json.message.from.id }}"},{"id":"d5b76796-10f1-41ef-bff6-1602fb434ad8","name":"chat_id","type":"number","value":"={{ $json.message.chat.id }}"},{"id":"59bda82b-6c18-40fd-b120-ed078a5d4c96","name":"voice_file_id","type":"string","value":"={{ $json.message.voice.file_id }}"},{"id":"9412f498-5e52-4ea9-81a3-9d76379406c0","name":"timestamp","type":"string","value":"={{ new Date().toISOString() }}"},{"id":"telegramToken","name":"telegramToken","type":"string","value":"Token {{YOUR TELEGRAM TOKEN HERE}}"}]}},"typeVersion":3.4},{"id":"8c1732d1-b1d6-492e-a1c8-ed73000fc2ac","name":"Prepare Text Message Data","type":"n8n-nodes-base.set","position":[260,100],"parameters":{"options":{},"assignments":{"assignments":[{"id":"text-user-id","name":"user_id","type":"number","value":"={{ $json.message.from.id }}"},{"id":"text-chat-id","name":"chat_id","type":"number","value":"={{ $json.message.chat.id }}"},{"id":"text-message-text","name":"message_text","type":"string","value":"={{ $json.message.text }}"},{"id":"text-message-id","name":"message_id","type":"number","value":"={{ $json.message.message_id }}"},{"id":"text-timestamp","name":"timestamp","type":"string","value":"={{ new Date().toISOString() }}"}]}},"typeVersion":3.4},{"id":"419734f9-3f9f-46de-a721-8e0ffb71ca0c","name":"Knowledge base","type":"n8n-nodes-base.supabaseTool","position":[980,320],"parameters":{"tableId":"knowledge_base","operation":"getAll"},"credentials":{"supabaseApi":{"id":"0ctKwj9g8dltNi3J","name":"Supabase account"}},"typeVersion":1},{"id":"3ecb0359-7f32-4cb8-a8a7-692b3430df11","name":"Telegram Memory","type":"@n8n/n8n-nodes-langchain.memoryBufferWindow","position":[780,320],"parameters":{"sessionKey":"telegram_{{ $json.user_id }}","sessionIdType":"customKey"},"typeVersion":1.3},{"id":"c0bba125-8492-4bde-a8e3-7fc1733b6d9d","name":"OpenAI Chat Model","type":"@n8n/n8n-nodes-langchain.lmChatOpenAi","position":[580,300],"parameters":{"options":{"maxTokens":200,"temperature":0.3}},"credentials":{"openAiApi":{"id":"IdjfTMR7gLjapSWH","name":"Open Ai"}},"typeVersion":1.1},{"id":"c0d3076c-ae1f-4fa9-85f5-1ecbcc67a91f","name":"AI Agent","type":"@n8n/n8n-nodes-langchain.agent","position":[760,100],"parameters":{"text":"={{ $json.body?.results?.channels?.[0]?.alternatives?.[0]?.transcript || $json.message_text || $json.message?.text || 'Hello' }}","options":{"systemMessage":"You are a helpful and professional AI assistant for voice and text interactions. Your role is to:\n\n1. Understand customer inquiries and provide accurate, helpful responses\n2. Use the knowledge base tool to find relevant information when needed\n3. Maintain a friendly, professional tone\n4. Provide clear, concise responses suitable for both voice and text delivery\n5. Always aim to provide value and resolve customer concerns\n\nImportant guidelines:\n- Be empathetic and understanding\n- Provide clear, actionable responses\n- Keep responses concise for voice delivery (under 200 words)\n- If information is not in the knowledge base, say so honestly\n- For complex technical issues, recommend escalation to human support\n\nCompany context: You represent a professional service business focused on customer satisfaction and quality support."},"promptType":"define"},"typeVersion":1.7},{"id":"763b8a6a-0a33-48a9-a18f-5098fe35e5cc","name":"Has Transcript?","type":"n8n-nodes-base.if","position":[1080,-160],"parameters":{"conditions":{"string":[{"value1":"={{ $json.body && $json.body.results && $json.body.results.channels && $json.body.results.channels[0] && $json.body.results.channels[0].alternatives && $json.body.results.channels[0].alternatives[0] && $json.body.results.channels[0].alternatives[0].transcript }}","operation":"isNotEmpty"}]}},"typeVersion":1},{"id":"8f702d09-8595-4d79-bc7d-442f0a41052e","name":"Is Voice Message?","type":"n8n-nodes-base.if","position":[240,-140],"parameters":{"options":{},"conditions":{"options":{"version":2,"leftValue":"","caseSensitive":true,"typeValidation":"strict"},"combinator":"and","conditions":[{"id":"876dc746-b9cb-4b7f-a0e2-1542f67fbe05","operator":{"type":"boolean","operation":"true","singleValue":true},"leftValue":"={{ Boolean($json.message.voice) }}","rightValue":""}]}},"typeVersion":2.2},{"id":"a1747da7-7e04-4766-b9bd-b3d838f956dc","name":"Telegram Trigger","type":"n8n-nodes-base.telegramTrigger","position":[-20,-140],"webhookId":"8dadd8e7-a415-46d3-99d5-b577014bae48","parameters":{"updates":["message"],"additionalFields":{}},"credentials":{"telegramApi":{"id":"RIK7bBarkKBJAV5R","name":"Telegram account"}},"typeVersion":1.1},{"id":"69cdbf6f-ee97-494a-9f3c-a99ddc917093","name":"Generate Audio Response","type":"n8n-nodes-base.httpRequest","position":[1420,-40],"parameters":{"url":"https://api.deepgram.com/v1/speak","method":"POST","options":{},"sendBody":true,"sendQuery":true,"sendHeaders":true,"bodyParameters":{"parameters":[{"name":"text","value":"={{ $json.output }}"}]},"queryParameters":{"parameters":[{"name":"model","value":"aura-asteria-en"}]},"headerParameters":{"parameters":[{"name":"Authorization","value":"Token {{YOUR DEEP GRAM TOKEN HERE}}"},{"name":"Content-Type","value":"application/json"}]}},"typeVersion":4.2},{"id":"e67b288f-1946-430b-9a45-0e62283c1d6b","name":"Send Audio Response","type":"n8n-nodes-base.telegram","position":[1680,-80],"parameters":{"chatId":"={{ $('Prepare Voice Message Data').item.json.chat_id }}","operation":"sendAudio","binaryData":true,"additionalFields":{"caption":"🎤 Voice response from AI Assistant"}},"credentials":{"telegramApi":{"id":"RIK7bBarkKBJAV5R","name":"Telegram account"}},"typeVersion":1.2},{"id":"8e409205-cad6-41a9-81cf-177c054a7b12","name":"Workflow Guide","type":"n8n-nodes-base.stickyNote","position":[-580,-500],"parameters":{"color":6,"width":360,"height":1160,"content":"## 🎙️ VoiceFlow AI: Telegram + Deepgram + OpenAI + Supabase Audio Assistant\n\n**Who is this for?**\nBusinesses, customer service teams, content creators, and organizations who want to provide intelligent voice-based interactions through Telegram. Perfect for accessibility-focused services, multilingual support, or hands-free customer assistance.\n\n**What problem does this solve?**\n- Enables natural voice conversations with AI\n- Breaks down language and accessibility barriers  \n- Provides instant voice responses to customer queries\n- Reduces typing requirements for users\n- Offers 24/7 voice-based customer support\n- Maintains conversation context across voice interactions\n- Handles both voice and text messages seamlessly\n\n**What this workflow does:**\n1. Receives voice OR text messages via Telegram bot\n2. For voice: Transcribes audio using Deepgram's speech-to-text API\n3. Processes queries through AI agent with knowledge base access\n4. Generates intelligent responses based on conversation context\n5. For voice input: Converts AI response to natural speech using Deepgram TTS\n6. Sends appropriate response (audio for voice, text for text) back to user\n7. Maintains conversation memory for contextual interactions\n\n**Setup Instructions:**\n1. Get Telegram bot token from @BotFather\n2. Sign up for Deepgram API (STT + TTS services)\n3. Configure OpenAI API key for AI responses\n4. Set up Supabase knowledge base table\n5. Update API credentials in workflow nodes\n6. Test with both voice and text messages\n\n**Key Features:**\n- Dual input support (voice and text)\n- Intelligent response routing\n- Voice-to-voice conversation capability\n- Knowledge base integration\n- Conversation memory\n- Professional AI responses"},"typeVersion":1},{"id":"f0600a4a-5671-4cbf-9769-b7a3fcb64474","name":"Was Voice Input?","type":"n8n-nodes-base.if","position":[1120,100],"parameters":{"options":{},"conditions":{"options":{"version":2,"leftValue":"","caseSensitive":true,"typeValidation":"strict"},"combinator":"and","conditions":[{"id":"voice-input-check","operator":{"type":"boolean","operation":"true","singleValue":true},"leftValue":"={{ Boolean($('Telegram Trigger').item.json.message.voice) }}","rightValue":""}]}},"typeVersion":2.2},{"id":"d0d0d41a-fa55-4e6b-8b7f-c52904af284e","name":"Send Text Response","type":"n8n-nodes-base.telegram","position":[1460,180],"parameters":{"text":"={{ $json.output }}","chatId":"={{ $('Prepare Text Message Data').item.json.chat_id }}","additionalFields":{"parse_mode":"Markdown"}},"credentials":{"telegramApi":{"id":"RIK7bBarkKBJAV5R","name":"Telegram account"}},"typeVersion":1.2}],"active":false,"settings":{"executionOrder":"v1"},"versionId":"59537604-b414-4298-9408-8dfbcdf8e213","connections":{"AI Agent":{"main":[[{"node":"Was Voice Input?","type":"main","index":0}]]},"Get File Path":{"main":[[{"node":"Download Voice File","type":"main","index":0}]]},"Knowledge base":{"ai_tool":[[{"node":"AI Agent","type":"ai_tool","index":0}]]},"Has Transcript?":{"main":[[{"node":"AI Agent","type":"main","index":0}]]},"Telegram Memory":{"ai_memory":[[{"node":"AI Agent","type":"ai_memory","index":0}]]},"Telegram Trigger":{"main":[[{"node":"Is Voice Message?","type":"main","index":0}]]},"Was Voice Input?":{"main":[[{"node":"Generate Audio Response","type":"main","index":0}],[{"node":"Send Text Response","type":"main","index":0}]]},"Is Voice Message?":{"main":[[{"node":"Prepare Voice Message Data","type":"main","index":0}],[{"node":"Prepare Text Message Data","type":"main","index":0}]]},"OpenAI Chat Model":{"ai_languageModel":[[{"node":"AI Agent","type":"ai_languageModel","index":0}]]},"Download Voice File":{"main":[[{"node":"Transcribe with Deepgram","type":"main","index":0}]]},"Generate Audio Response":{"main":[[{"node":"Send Audio Response","type":"main","index":0}]]},"Transcribe with Deepgram":{"main":[[{"node":"Has Transcript?","type":"main","index":0}]]},"Prepare Text Message Data":{"main":[[{"node":"AI Agent","type":"main","index":0}]]},"Prepare Voice Message Data":{"main":[[{"node":"Get File Path","type":"main","index":0}]]}}}


name: Competitor Price Monitoring with Web Scraping,Google Sheets & Telegram
author_name: Tony Paul
author_username: tonydatahut
categories: []
created_at: 2025-06-04T03:40:59.974Z
updated_at: 2025-06-04T03:40:59.974Z
url: https://n8n.io/workflows/4640
scraped_at: 2025-07-06 21:16:30
description:
  How it works

  ++Download the google sheet here++ and replace this with the googles sheet node: Google sheet , upload to google sheets and replace in the google sheets node.

  Scheduled trigger: Runs once a day at 8 AM (server time).

  Fetch product list: Reads your “master” sheet (product_url + last known price) from Google Sheets.

  Loop with delay: Iterates over each row (product) one at a time, inserting a short pause (20 s) between HTTP requests to avoid blocking.

  Scrape current price: Loads each product_url, extracts the current price via a simple CSS selector.

  Compare & normalize: Compares the newly scraped price against the “last_price” from your sheet, calculates percentage change, and tags items where price_changed == true.

  On price change:
  Send alert: Formats a Telegram message (“Price Drop” or “Price Hike”) and pushes it to your configured chat.

  Log history: Appends a new row to a separate “price_tracking” tab with timestamp, old price, new price, and % change.

  Update master sheet: After a 1 min pause, writes the updated current_price back to your “master” sheet so future runs use it as the new baseline.

  Set up step
  Google Sheets credentials (~5 min)
  Create a Google Sheets OAuth credential in n8n. 
  Copy your sheet’s ID and ensure you have two tabs: 
  product_data (columns: product_url, price) 
  price_tracking (columns: timestamp, product_url, last_price, current_price, price_diff_pct, price_changed) 
  Paste the sheet ID into both Google Sheets nodes (“Read” and “Append/Update”). 
  Telegram credentials (~5 min) 
  Create a Telegram Bot token via BotFather. 
  Copy your chat_id (for your target group or personal chat). 
  Add those credentials to n8n and drop them into the “Telegram” node.

  Workflow parameters (~5 min)

  Verify the schedule in the Schedule Trigger node is set to 08:00 (or adjust to your preferred run time).

  In the Loop Over Items node, confirm “Batch Size” is 1 (to process one URL at a time).
   
  Adjust the Delay to avoid Request Blocking node if your site requires a longer pause (default is 20 s).
   
  In the Parse Data From The HTML Page node, double-check the CSS selector matches how prices appear on your target site.
   
  Once credentials are in place and your sheet tabs match the expected column names, the flow should be ready to activate. Total setup time is under 15 minutes—detailed notes are embedded as sticky comments throughout the workflow to help you tweak selectors, change timeouts, or adjust sheet names without digging into code.

nodes_used:
  ["n8n-nodes-base.googleSheets","n8n-nodes-base.httpRequest","n8n-nodes-base.telegram","n8n-nodes-base.code","n8n-nodes-base.html"]

workflow_json:
  {"id":"QAneGL7LmmVuAy1G","meta":{"instanceId":"028ba340313b331f33c6b8294672985ed6da7581a7cf3e60fb843f4e8b653dae","templateCredsSetupCompleted":true},"name":"monitoring competitor prices - for free","tags":[{"id":"3ytagip6FSiGNhyx","name":"video","createdAt":"2025-05-31T12:22:41.809Z","updatedAt":"2025-05-31T12:22:41.809Z"},{"id":"AAeX8YOWlYNI5sCL","name":"production","createdAt":"2025-05-31T12:22:39.329Z","updatedAt":"2025-05-31T12:22:39.329Z"},{"id":"xoQDVZ3WQVEfZeAf","name":"final","createdAt":"2025-05-31T12:22:36.344Z","updatedAt":"2025-05-31T12:22:36.344Z"}],"nodes":[{"id":"780a213c-0e81-4d95-910e-a467f316ebf6","name":"Sticky Note1","type":"n8n-nodes-base.stickyNote","position":[-2460,160],"parameters":{"width":420,"height":100,"content":"**Fires every morning at 8:00 AM server time to kick off the price-check cycle). Then it Reads the “master” Google Sheet tab, pulling each row’s product_url + last_price for processing**"},"typeVersion":1},{"id":"9b9932ec-8cfd-4096-965b-592b13a1fb8e","name":"Daily 8 AM Trigger","type":"n8n-nodes-base.scheduleTrigger","position":[-2420,290],"parameters":{"rule":{"interval":[{"triggerAtHour":8}]}},"typeVersion":1.2},{"id":"6427045b-8b73-42f0-9dcc-768cbfac9c4a","name":"Fetch Product List from Sheet","type":"n8n-nodes-base.googleSheets","position":[-2200,290],"parameters":{"options":{},"sheetName":{"__rl":true,"mode":"list","value":"gid=0","cachedResultUrl":"Replace with your google sheet url by downloading the googlesheet in the description of this automation","cachedResultName":"product_data"},"documentId":{"__rl":true,"mode":"list","value":"18ZAjxmwanf6MS7JfrEX6ett6J-tOQi58B257hE6sOS4","cachedResultUrl":"https://docs.google.com/spreadsheets/d/18ZAjxmwanf6MS7JfrEX6ett6J-tOQi58B257hE6sOS4/edit?usp=drivesdk","cachedResultName":"competitor_price_drop_automation"}},"credentials":{"googleSheetsOAuth2Api":{"id":"qxXfj438qZiGMViE","name":"Tony@datahut sheet"}},"typeVersion":4.5},{"id":"0b4a1398-bb29-4f42-9475-eb08ab4dabfc","name":"Process Each Product in Batches of 1","type":"n8n-nodes-base.splitInBatches","position":[-1980,290],"parameters":{"options":{"reset":false}},"typeVersion":3},{"id":"ccf9f9ca-b380-457e-9fc2-c6ffe1636984","name":"Pause Between Requests","type":"n8n-nodes-base.wait","position":[-1760,40],"webhookId":"335e69ac-d8ce-4704-a9c6-5a087f2859f8","parameters":{"amount":20},"typeVersion":1.1},{"id":"aa49653b-cf9f-449b-953d-a9a19ac74187","name":"Load Product Page HTML","type":"n8n-nodes-base.httpRequest","position":[-1540,40],"parameters":{"url":"={{ $json.product_url }}","options":{},"jsonHeaders":"{\n  \"User-Agent\": \"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:119.0) Gecko/20100101 Firefox/119.0\",\n  \"Accept\": \"text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\",\n  \"Accept-Language\": \"en-IN,en;q=0.9\",\n  \"Accept-Encoding\": \"gzip, deflate, br\"\n}","sendHeaders":true,"specifyHeaders":"json"},"typeVersion":4.2},{"id":"5dbc3d45-96d6-4b71-8d3f-2513f960e265","name":"Extract Current Price from HTML","type":"n8n-nodes-base.html","position":[-1320,40],"parameters":{"options":{},"operation":"extractHtmlContent","extractionValues":{"values":[{"key":"current_price","cssSelector":".price__regular > span.price-item--regular"}]}},"typeVersion":1.2},{"id":"76ad9683-bae1-4f95-af09-44598d9448d1","name":"Normalize Price Values","type":"n8n-nodes-base.code","position":[-1100,40],"parameters":{"jsCode":"// HTML Extract result\nconst scraped = items[0].json;\n\n// Original data from Wait node\nconst original = $items(\"Pause Between Requests\")[0].json;\n\n// Clean and parse price\nconst priceNum = parseFloat((scraped.current_price || \"\").replace(/[^0-9.]+/g, \"\"));\n\n// Original price from Google Sheet\nconst lastPrice = parseFloat(original.price);\n\nreturn [{\n  json: {\n    product_url: original.product_url,\n    row_number: original.row_number,\n    last_price: lastPrice,\n    current_price: priceNum\n  }\n}];\n\n"},"typeVersion":2},{"id":"5feae925-0642-40d1-89be-c220a5a1c8a2","name":"Compute Price Change","type":"n8n-nodes-base.code","position":[-880,40],"parameters":{"jsCode":"// Get the incoming item\nconst item = items[0].json;\n\n// Compute whether the price changed\nconst priceChanged = item.last_price !== item.current_price;\n\n// Calculate percentage difference (will be NaN if last_price is null/0)\nlet priceDiffPct = null;\nif (item.last_price && item.last_price !== 0) {\n  priceDiffPct = (\n    ((item.current_price - item.last_price) / item.last_price) *\n    100\n  ).toFixed(2);\n}\n\n// Return everything, including product_url and last_price\nreturn [\n  {\n    json: {\n      product_url: item.product_url,\n      last_price: item.last_price,\n      current_price: item.current_price,\n      price_changed: priceChanged,\n      price_diff_pct: priceDiffPct !== null ? parseFloat(priceDiffPct) : null,\n      timestamp: new Date().toISOString(),\n    },\n  },\n];\n\n\n\n"},"typeVersion":2},{"id":"5dea2082-d5c5-4c13-8c71-ab7ac498632d","name":"Clean Up Parsed Fields","type":"n8n-nodes-base.code","position":[-660,40],"parameters":{"jsCode":"// Function node: 'items' is an array of incoming items\nif (!items.length) {\n  return [];\n}\n\nconst input = items[0].json;\nconst cleaned = {};\n\nfor (const key in input) {\n  const cleanKey = key.replace(/\\t/g, '').trim();\n  cleaned[cleanKey] = input[key];\n}\n\nreturn [\n  {\n    json: {\n      product_url: cleaned.product_url,\n      last_price: cleaned.last_price,\n      current_price: cleaned.current_price,\n      price_changed: cleaned.price_changed,\n      price_diff_pct: cleaned.price_diff_pct,\n      timestamp: cleaned.timestamp,\n    },\n  },\n];\n\n\n"},"typeVersion":2},{"id":"21c27cb9-c6bc-4cc3-9ad1-3d37fc6fbc3d","name":"Is Price Changed?","type":"n8n-nodes-base.if","position":[-440,40],"parameters":{"options":{},"conditions":{"options":{"version":2,"leftValue":"","caseSensitive":true,"typeValidation":"strict"},"combinator":"or","conditions":[{"id":"5e285834-82ef-4c77-b96b-97661760f996","operator":{"type":"boolean","operation":"true","singleValue":true},"leftValue":"={{ $json.price_changed}}","rightValue":"true"}]}},"typeVersion":2.2},{"id":"50274daa-48c7-4c58-aaf5-264013582f97","name":"Build Telegram Alert Message","type":"n8n-nodes-base.code","position":[-220,140],"parameters":{"jsCode":"const itemsFormatted = [];\n\nfor (const item of items) {\n  const data = item.json;\n\n  // Determine alert type\n  const isDrop = data.price_diff_pct < 0;\n  const alertType = isDrop ? \"📉 *Price Drop Alert*\" : \"📈 *Price Hike Alert*\";\n\n  // Format timestamp to IST\n  const date = new Date(data.timestamp);\n  const istOffset = 5.5 * 60 * 60 * 1000;\n  const istDate = new Date(date.getTime() + istOffset);\n  const formattedDate = istDate.toLocaleString(\"en-IN\", {\n    day: \"2-digit\",\n    month: \"short\",\n    year: \"numeric\",\n    hour: \"2-digit\",\n    minute: \"2-digit\",\n    hour12: true\n  });\n\n  // Build message\n  const message = `${alertType}\n\n🛍️ *Product:* (${data.product_url})\n💸 *Last Price:* $${data.last_price}\n💰 *Current Price:* $${data.current_price}\n📊 *Change:* ${data.price_diff_pct > 0 ? \"+\" : \"\"}${data.price_diff_pct}%\n🕒 *Time:* ${formattedDate}`;\n\n  itemsFormatted.push({ json: { message } });\n}\n\nreturn itemsFormatted;\n\n\n"},"typeVersion":2},{"id":"f62b1f32-fe79-43c3-ad17-0ff31fcdc489","name":"Log Price History to Sheet","type":"n8n-nodes-base.googleSheets","position":[-220,-60],"parameters":{"columns":{"value":{"last_price":"={{ $json.last_price }}","timestamp\t":"={{ new Date($json.timestamp).toLocaleString('en-IN', {\n  timeZone: 'Asia/Kolkata',\n  day: '2-digit',\n  month: 'short',\n  year: 'numeric',\n  hour: '2-digit',\n  minute: '2-digit',\n  hour12: true\n}) }}\n","product_url":"={{ $json.product_url }}","current_price":"={{ $json.current_price }}","price_diff_pct":"={{ $json.price_diff_pct}}","price_changed        ":"={{ $json.price_changed }}"},"schema":[{"id":"timestamp\t","type":"string","display":true,"required":false,"displayName":"timestamp\t","defaultMatch":false,"canBeUsedToMatch":true},{"id":"product_url","type":"string","display":true,"required":false,"displayName":"product_url","defaultMatch":false,"canBeUsedToMatch":true},{"id":"current_price","type":"string","display":true,"removed":false,"required":false,"displayName":"current_price","defaultMatch":false,"canBeUsedToMatch":true},{"id":"last_price","type":"string","display":true,"removed":false,"required":false,"displayName":"last_price","defaultMatch":false,"canBeUsedToMatch":true},{"id":"price_changed        ","type":"string","display":true,"removed":false,"required":false,"displayName":"price_changed        ","defaultMatch":false,"canBeUsedToMatch":true},{"id":"price_diff_pct","type":"string","display":true,"removed":false,"required":false,"displayName":"price_diff_pct","defaultMatch":false,"canBeUsedToMatch":true}],"mappingMode":"defineBelow","matchingColumns":[],"attemptToConvertTypes":false,"convertFieldsToString":false},"options":{"useAppend":true},"operation":"append","sheetName":{"__rl":true,"mode":"list","value":2110110902,"cachedResultUrl":"https://docs.google.com/spreadsheets/d/18ZAjxmwanf6MS7JfrEX6ett6J-tOQi58B257hE6sOS4/edit#gid=2110110902","cachedResultName":"price_tracking"},"documentId":{"__rl":true,"mode":"list","value":"18ZAjxmwanf6MS7JfrEX6ett6J-tOQi58B257hE6sOS4","cachedResultUrl":"https://docs.google.com/spreadsheets/d/18ZAjxmwanf6MS7JfrEX6ett6J-tOQi58B257hE6sOS4/edit?usp=drivesdk","cachedResultName":"competitor_price_drop_automation"}},"credentials":{"googleSheetsOAuth2Api":{"id":"qxXfj438qZiGMViE","name":"Tony@datahut sheet"}},"typeVersion":4.5},{"id":"d5555b69-d7ee-4ab0-a851-5288de0d39cf","name":"Pause Before Updating Sheet","type":"n8n-nodes-base.wait","position":[0,-60],"webhookId":"f8ba192a-211d-4b40-be9c-9994343eb162","parameters":{"unit":"minutes","amount":1},"typeVersion":1.1},{"id":"ade41bb7-fbe3-4e08-a7fa-6c85291dc9fa","name":"Update Last Price in Master Sheet","type":"n8n-nodes-base.googleSheets","position":[220,-60],"parameters":{"columns":{"value":{"price":"={{ $json.current_price }}","product_url":"={{ $json.product_url }}"},"schema":[{"id":"product_url","type":"string","display":true,"removed":false,"required":false,"displayName":"product_url","defaultMatch":false,"canBeUsedToMatch":true},{"id":"price","type":"string","display":true,"required":false,"displayName":"price","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":["product_url"],"attemptToConvertTypes":false,"convertFieldsToString":false},"options":{},"operation":"update","sheetName":{"__rl":true,"mode":"list","value":"gid=0","cachedResultUrl":"Replace with your google sheet url by downloading the googlesheet in the description of this automation","cachedResultName":"product_data"},"documentId":{"__rl":true,"mode":"list","value":"18ZAjxmwanf6MS7JfrEX6ett6J-tOQi58B257hE6sOS4","cachedResultUrl":"https://docs.google.com/spreadsheets/d/18ZAjxmwanf6MS7JfrEX6ett6J-tOQi58B257hE6sOS4/edit?usp=drivesdk","cachedResultName":"competitor_price_drop_automation"}},"credentials":{"googleSheetsOAuth2Api":{"id":"qxXfj438qZiGMViE","name":"Tony@datahut sheet"}},"typeVersion":4.5},{"id":"9ebdbe49-fda1-42f5-99d9-a5e1e3ab800f","name":"Send Price Alert via Telegram","type":"n8n-nodes-base.telegram","position":[0,215],"webhookId":"39287ce3-3a7e-4c7e-b8ee-b11ebb83bfb8","parameters":{"text":"={{$json[\"message\"]}}","chatId":"7739958732","additionalFields":{}},"credentials":{"telegramApi":{"id":"aoNA5zsMeU9KNpGg","name":"Telegram Tab Jio"}},"typeVersion":1.2},{"id":"dcb4eff8-9d44-4016-a89a-787be943d0e9","name":"Sticky Note","type":"n8n-nodes-base.stickyNote","position":[-2040,440],"parameters":{"height":100,"content":"**Iterates through all products in groups (e.g., 1 at a time) so we don’t overwhelm the target site with parallel requests.**"},"typeVersion":1},{"id":"1a306c68-e652-4d63-b11e-96366c4a59ed","name":"Sticky Note3","type":"n8n-nodes-base.stickyNote","position":[-1560,-60],"parameters":{"width":360,"height":80,"content":"**fires an HTTP GET for each product_url, then uses a CSS selector to pull the live price text from the returned HTML.**"},"typeVersion":1},{"id":"81f8701a-219f-43a3-aceb-78f2298273cc","name":"Sticky Note4","type":"n8n-nodes-base.stickyNote","position":[-1120,180],"parameters":{"width":380,"height":100,"content":"**Strips currency symbols/commas to convert strings into numbers; compares last_price vs. current_price to calculate % change and set price_changed=true if different**"},"typeVersion":1},{"id":"7fd2108e-5fcb-4ba6-938b-6c940f8a305f","name":"Sticky Note5","type":"n8n-nodes-base.stickyNote","position":[-740,-100],"parameters":{"width":220,"height":120,"content":"\n**Removes stray whitespace or malformed keys (e.g., stray tabs) so downstream nodes can read fields consistently**"},"typeVersion":1},{"id":"7a525b63-e871-46b9-b0b0-4e25a6c7f2bb","name":"Sticky Note6","type":"n8n-nodes-base.stickyNote","position":[-540,180],"parameters":{"height":100,"content":"**Only products with price_changed=true proceed to alerting and logging; unchanged items exit here.**"},"typeVersion":1},{"id":"a6352172-9fa3-47b7-8bf0-c948fbe03701","name":"Sticky Note7","type":"n8n-nodes-base.stickyNote","position":[-180,420],"parameters":{"width":380,"height":80,"content":"\n**Formats a human‐readable message (product name/URL, old vs. new price, % change, timestamp) and pushes it to the configured Telegram chat**\n"},"typeVersion":1},{"id":"90b702f6-6e75-452d-9315-3f70c4157aab","name":"Sticky Note8","type":"n8n-nodes-base.stickyNote","position":[-200,-160],"parameters":{"width":520,"height":80,"content":"\n**Appends a row to Price_History with timestamp, % change, old vs. new price; then waits 1 minute before overwriting last_price in the master sheet with current_price.**\n"},"typeVersion":1},{"id":"3e3a4498-248d-408e-903b-916a035db039","name":"Sticky Note9","type":"n8n-nodes-base.stickyNote","position":[-1300,-520],"parameters":{"width":580,"content":"## Detailed Explanations of this automation\n \nYou can see the detailed step-by-step instructions here:\n\n- [Free n8n Web Scraping Competitor Price Tracking](https://www.blog.datahut.co/post/free-n8n-web-scraping-competitor-price-tracking)\n- [YouTube Tutorial](https://www.youtube.com/watch?v=a9esT732mmE)\n\n\n\n\n\n\nIs this conversation helpful so far?\n\n\n"},"typeVersion":1}],"active":false,"settings":{"executionOrder":"v1"},"versionId":"2c1bce5e-8208-42c3-8fe8-308b5855695c","connections":{"Is Price Changed?":{"main":[[{"node":"Build Telegram Alert Message","type":"main","index":0},{"node":"Log Price History to Sheet","type":"main","index":0}]]},"Daily 8 AM Trigger":{"main":[[{"node":"Fetch Product List from Sheet","type":"main","index":0}]]},"Compute Price Change":{"main":[[{"node":"Clean Up Parsed Fields","type":"main","index":0}]]},"Clean Up Parsed Fields":{"main":[[{"node":"Is Price Changed?","type":"main","index":0}]]},"Load Product Page HTML":{"main":[[{"node":"Extract Current Price from HTML","type":"main","index":0},{"node":"Process Each Product in Batches of 1","type":"main","index":0}]]},"Normalize Price Values":{"main":[[{"node":"Compute Price Change","type":"main","index":0}]]},"Pause Between Requests":{"main":[[{"node":"Load Product Page HTML","type":"main","index":0}]]},"Log Price History to Sheet":{"main":[[{"node":"Pause Before Updating Sheet","type":"main","index":0}]]},"Pause Before Updating Sheet":{"main":[[{"node":"Update Last Price in Master Sheet","type":"main","index":0}]]},"Build Telegram Alert Message":{"main":[[{"node":"Send Price Alert via Telegram","type":"main","index":0}]]},"Fetch Product List from Sheet":{"main":[[{"node":"Process Each Product in Batches of 1","type":"main","index":0}]]},"Send Price Alert via Telegram":{"main":[[{"node":"Process Each Product in Batches of 1","type":"main","index":0}]]},"Extract Current Price from HTML":{"main":[[{"node":"Normalize Price Values","type":"main","index":0}]]},"Process Each Product in Batches of 1":{"main":[[],[{"node":"Pause Between Requests","type":"main","index":0}]]}}}


name: Summarize Calls & Notify Teams via HubSpot, Slack, Email, WhatsApp
author_name: Encoresky
author_username: encoresky
categories: []
created_at: 2025-06-04T08:02:04.432Z
updated_at: 2025-06-04T08:02:04.432Z
url: https://n8n.io/workflows/4641
scraped_at: 2025-07-06 21:16:30
description:
  This workflow automates the process of handling conversation transcriptions and distributing key information across your organization. Here's what it does:

  Trigger: The workflow is initiated via a webhook that receives a transcription (e.g., from a call or meeting).

  Summarization & Extraction: Using AI, the transcription is summarized, and key information is extracted — such as action items, departments involved, and client details.

  Department Notifications: The relevant summarized information is automatically routed to specific departments via email based on content classification.

  CRM Sync: The summarized version is saved to the associated contact or deal in HubSpot for future reference and visibility.

  *Multi-Channel Alerts: *The summary is also sent via WhatsApp and Slack to keep internal teams instantly informed, regardless of platform.

  Use Case:
  Ideal for sales, customer service, or operations teams who manage client conversations and want to ensure seamless cross-departmental communication, documentation, and follow-up.

  Apps Used:

  Webhook (Trigger)

  OpenAI (or other AI/NLP for summarization)

  HubSpot

  Email

  Slack

  WhatsApp (via Twilio or third-party provider)

nodes_used:
  ["n8n-nodes-base.slack","n8n-nodes-base.hubspot","n8n-nodes-base.whatsApp","@n8n/n8n-nodes-langchain.agent","@n8n/n8n-nodes-langchain.chainSummarization","@n8n/n8n-nodes-langchain.lmChatOpenAi"]

workflow_json:
  {"id":"Gn5M1FfXUAVy6h9l","meta":{"instanceId":"f70454a5d1bedfb04805f13a51a4a63e308e7fc8821155a97e93d697feaee047","templateCredsSetupCompleted":true},"tags":[],"nodes":[{"id":"3d621f41-b73a-406a-bfda-fac0d2ed1499","name":"Sticky Note1","type":"n8n-nodes-base.stickyNote","position":[800,340],"parameters":{"color":4,"width":540,"height":560,"content":"## Router agent\nMakes decisions with the help of an LLM  \n- Analyzes the content\n- Decides which part of the transcript is relevant to the different departments\n- Sends the emails to the departments\n"},"typeVersion":1},{"id":"249c22aa-58ca-40df-9157-7a00fbfd3dff","name":"Router Agent","type":"@n8n/n8n-nodes-langchain.agent","notes":"Route the client feedback topics to the relevant department ","position":[960,540],"parameters":{"text":"={{ $('Webhook').item.json.body['Client Conversation'] }}","options":{"systemMessage":"=You are provided with some client-company conversation and should decide who has to be informed about the feedback. Always only inform one person. Those are your options: \n- It's about a product, send an email to {{ $('Define routing emails').item.json['Support Email'] }}\n- It's about an invoicing problem, send an email to {{ $('Define routing emails').item.json['Administrative Email'] }}\n- It's  related to a travelling/trip, send an email to {{ $('Define routing emails').item.json['Commercial Email'] }}\n\nAdd the email of the person (\"{{ $('Webhook').item.json.body['Client Email'] }}\") at the beginning of the text preceded by \"FROM CLIENT: \"\nUse the Mailjet tool to inform each of the most related department. Provide mailjet with a subject, an email, and the email body formated as html which is the client conversation itself."},"promptType":"define"},"notesInFlow":true,"typeVersion":1.8},{"id":"cffeafac-75e0-4a60-91d3-0a7d3bdb7371","name":"Summarization","type":"@n8n/n8n-nodes-langchain.chainSummarization","notes":"The transcript summarized here","position":[360,140],"parameters":{"options":{"summarizationMethodAndPrompts":{"values":{"prompt":"=Summarize the following Converstaion in 2-3 sentences:\n\n\"{{ $('Webhook').item.json.body['Client Conversation'] }}\"\n\nJust output the summarized conversation and nothing else. Use the same language as the input","summarizationMethod":"stuff"}}}},"notesInFlow":true,"typeVersion":2,"alwaysOutputData":false},{"id":"ac5a16de-efb5-4603-bb52-2d85b007bf86","name":"OpenAI Chat Model","type":"@n8n/n8n-nodes-langchain.lmChatOpenAi","position":[460,420],"parameters":{"model":{"__rl":true,"mode":"list","value":"gpt-4o-mini"},"options":{}},"credentials":{"openAiApi":{"id":"7mydLbpOJgXQKswc","name":"OpenAi account"}},"typeVersion":1.2},{"id":"8644b46e-b64c-415b-acfc-103ef5c71903","name":"Gmail","type":"n8n-nodes-base.gmailTool","position":[1040,760],"webhookId":"be3ad85f-a576-44d6-9383-6a038edfb25a","parameters":{"sendTo":"={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('To', ``, 'string') }}","message":"={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Message', ``, 'string') }}","options":{"appendAttribution":false},"subject":"={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Subject', ``, 'string') }}"},"credentials":{"gmailOAuth2":{"id":"Eo7V1LrxcAy38kKf","name":"Harsh"}},"typeVersion":2.1},{"id":"b02e1dad-6f07-4215-a89b-fb0763232bcb","name":"Sticky Note2","type":"n8n-nodes-base.stickyNote","position":[-20,40],"parameters":{"color":4,"width":260,"height":260,"content":"## Set emails here\nFor each responsible person"},"typeVersion":1},{"id":"fec711e6-837a-4722-83b9-dc838770fcb3","name":"Sticky Note3","type":"n8n-nodes-base.stickyNote","position":[-300,40],"parameters":{"color":4,"width":260,"height":260,"content":"## Webhook \nTo be used to send the transcription."},"typeVersion":1},{"id":"2af225aa-95b9-4578-9c8c-0c49bb5e8510","name":"Sticky Note","type":"n8n-nodes-base.stickyNote","position":[800,40],"parameters":{"color":4,"width":540,"height":280,"content":"## Save transcription to Hubspot\n- Search for the client ID based on his email\n- Upload the summarized conversation as meeting notes"},"typeVersion":1},{"id":"fb226ebf-b62f-48ef-b291-17b4beb30ebc","name":"Slack","type":"n8n-nodes-base.slack","position":[880,-160],"webhookId":"ffba5d59-965e-4042-a5cd-d6d89c443e75","parameters":{"text":"=Below is the latest summary.\n\n{{ $json.response.text }}","select":"channel","channelId":{"__rl":true,"mode":"list","value":"C08VCE4AYNL","cachedResultName":"n8n"},"otherOptions":{},"authentication":"oAuth2"},"credentials":{"slackOAuth2Api":{"id":"SbSspavlddGUo8F0","name":"Slack account"}},"typeVersion":2.3},{"id":"5622a2af-726d-468c-88b2-22d66a449128","name":"Sticky Note4","type":"n8n-nodes-base.stickyNote","position":[800,-280],"parameters":{"color":4,"width":540,"height":300,"content":"## Send the summary to Slack and WhatsApp\n- Configure Slack Channel\n- Configure WhatsApp Recepient"},"typeVersion":1},{"id":"d8b2181f-1c52-417b-9fdd-776e64a920ab","name":"WhatsApp Business Cloud","type":"n8n-nodes-base.whatsApp","position":[1120,-160],"webhookId":"36dba7ba-f6f2-45a0-ad5d-cfd5c1622a49","parameters":{"template":"n8n_workflow_latest|en","components":{"component":[{"bodyParameters":{"parameter":[{"text":"={{ $('Webhook').item.json.body['Your Name'] }}"},{"text":"={{ $('Summarization').item.json.response.text }}"}]}}]},"phoneNumberId":"702894569566382","recipientPhoneNumber":"={{ $('Webhook').item.json.body['WhatsApp Contact Number'] }}"},"credentials":{"whatsAppApi":{"id":"bvkhSq7q9MuoWneA","name":"WhatsApp account"}},"typeVersion":1},{"id":"039c62d8-3a33-4436-9577-e2dc45f9e694","name":"Webhook","type":"n8n-nodes-base.webhook","position":[-220,140],"webhookId":"1ffeacc2-1dbd-4a9e-bf3f-6811ddd31642","parameters":{"path":"1ffeacc2-1dbd-4a9e-bf3f-6811ddd31642","options":{},"httpMethod":"POST"},"typeVersion":2},{"id":"941ea710-68a5-46c7-b622-bf88b96430a7","name":"Define routing emails","type":"n8n-nodes-base.set","position":[60,140],"parameters":{"options":{},"assignments":{"assignments":[{"id":"099d5326-3452-47b8-9dc0-acc0e6fd951e","name":"Support Email","type":"string","value":"info@encoresky.com"},{"id":"4ed84290-dbf7-47f7-8693-4f95e0c2fd7e","name":"Administrative Email","type":"string","value":"hr@encoresky.com"},{"id":"614d4a5c-c9f2-4d82-bfcb-cfdcc8a4b07d","name":"Commercial Email","type":"string","value":"sales@encoresky.com"}]}},"typeVersion":3.4},{"id":"8af03b9d-b647-4d4c-8903-dd32e4b6a434","name":"HubSpot Search Client","type":"n8n-nodes-base.hubspot","notes":"Search for the id","position":[880,160],"parameters":{"operation":"search","authentication":"oAuth2","filterGroupsUi":{"filterGroupsValues":[{"filtersUi":{"filterValues":[{"value":"={{ $('Webhook').item.json.body['Client Email'] }}","propertyName":"email|string"}]}}]},"additionalFields":{}},"credentials":{"hubspotOAuth2Api":{"id":"pQcxnwCMnLiFiQOJ","name":"HubSpot account"}},"notesInFlow":true,"typeVersion":2.1},{"id":"cb2bb828-ca8c-473a-a485-c8cde6116388","name":"HubSpot Save Notes","type":"n8n-nodes-base.hubspot","notes":"Add meeting notes in the contact form","position":[1120,160],"parameters":{"type":"meeting","metadata":{"body":"={{ $('Summarization').item.json.response.text }}","title":"New meeting"},"resource":"engagement","authentication":"oAuth2","additionalFields":{"associations":{"contactIds":"={{ $json.properties.hs_object_id }}"}}},"credentials":{"hubspotOAuth2Api":{"id":"pQcxnwCMnLiFiQOJ","name":"HubSpot account"}},"notesInFlow":true,"typeVersion":2.1}],"active":true,"settings":{"executionOrder":"v1"},"versionId":"428e832a-7b0e-4e88-9695-6d793067deb8","connections":{"Gmail":{"ai_tool":[[{"node":"Router Agent","type":"ai_tool","index":0}]]},"Slack":{"main":[[{"node":"WhatsApp Business Cloud","type":"main","index":0}]]},"Webhook":{"main":[[{"node":"Define routing emails","type":"main","index":0}]]},"Router Agent":{"main":[[]]},"Summarization":{"main":[[{"node":"Router Agent","type":"main","index":0},{"node":"HubSpot Search Client","type":"main","index":0},{"node":"Slack","type":"main","index":0}]]},"OpenAI Chat Model":{"ai_languageModel":[[{"node":"Summarization","type":"ai_languageModel","index":0},{"node":"Router Agent","type":"ai_languageModel","index":0}]]},"Define routing emails":{"main":[[{"node":"Summarization","type":"main","index":0}]]},"HubSpot Search Client":{"main":[[{"node":"HubSpot Save Notes","type":"main","index":0}]]}}}


name: SSL Certificate Expiry Notifier (No Paid APIs)
author_name: Evoort Solutions
author_username: evoortsolutions
nodes_used: ["n8n-nodes-base.emailSend","n8n-nodes-base.googleSheets","n8n-nodes-base.httpRequest"]
categories: []
created_at: 2025-06-04T09:49:31.793Z
updated_at: 2025-06-04T09:49:31.793Z
url: https://n8n.io/workflows/4643
scraped_at: 2025-07-06 21:16:30
description:
  Great — here’s a complete Workflow Description for your n8n Creator submission based on the JSON you shared:

  🔒 SSL Expiry Notifier (No Paid APIs)

  🧩 How it Works

  This workflow automatically checks SSL certificate expiry dates for a list of websites and sends timely email alerts if any certificate is close to expiring. It’s ideal for DevOps, IT Operations, or Web Admin teams to stay ahead of certificate issues —
   without relying on any paid API services.

  Here's the high-level logic:

  Trigger: Runs daily at 8 AM using the Schedule Trigger node.
  Fetch URLs: Reads URLs to monitor from a Google Sheet.
  Check SSL: Calls the free ssl-checker.io API to retrieve SSL certificate details (valid from, valid till, days left).
  Conditional Check: Filters any certificates expiring in 7 days or less.
  Send Email: Sends a styled HTML email alert to predefined recipients.
  Update Sheet: Updates the same Google Sheet with the latest SSL info for each domain.

  ⚙️ Set Up Steps (Quick Overview)

  🕐 Estimated setup time: \~10–15 minutes

  Connect Google Sheets – OAuth2 credentials required. Sheet must include a column titled URL with domains to monitor.
  Set Up SMTP – Add your email credentials under the SMTP node to enable notifications.
  Optional – Customize the threshold days in the "Expiry Alert" IF node if you want alerts for a different timeframe.
  Deploy and Activate – That’s it. Once active, the flow runs automatically every day.

  💡 Detailed field mappings and logic notes are included inside the workflow as sticky notes.

  🚀 Ready to Get Started?

  Let’s start your journey on n8n by creating your free account here.  

workflow_json:
  {"id":"NTSkPEG2pcvG3qoH","meta":{"instanceId":"60c025075753afcab9f803964b4caaca9402f435deb4efafbb8e3b93b54d8752","templateCredsSetupCompleted":true},"name":"SSL Expiry Notifier","tags":[{"id":"b2GfRjIENZV9WKpD","name":"IT Ops","createdAt":"2025-05-29T08:33:47.664Z","updatedAt":"2025-05-29T08:33:47.664Z"},{"id":"sfoRiNMRAXjQ31IO","name":"DevOps","createdAt":"2025-05-29T08:33:47.654Z","updatedAt":"2025-05-29T08:33:47.654Z"}],"nodes":[{"id":"b8c160c6-29a3-4b7d-ab78-e126206627b1","name":"URLs to Monitor","type":"n8n-nodes-base.googleSheets","position":[60,140],"parameters":{"columns":{"value":{"URL":"={{ $json.result.host }}","Days Left":"={{ $json.result.days_left }}","Valid From":"={{ $json.result.valid_from }}","Valid Till":"={{ $json.result.valid_till }}"},"schema":[{"id":"URL","type":"string","display":true,"removed":false,"required":false,"displayName":"URL","defaultMatch":false,"canBeUsedToMatch":true},{"id":"Valid From","type":"string","display":true,"required":false,"displayName":"Valid From","defaultMatch":false,"canBeUsedToMatch":true},{"id":"Valid Till","type":"string","display":true,"required":false,"displayName":"Valid Till","defaultMatch":false,"canBeUsedToMatch":true},{"id":"Days Left","type":"string","display":true,"required":false,"displayName":"Days Left","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":["URL"],"attemptToConvertTypes":false,"convertFieldsToString":false},"options":{},"operation":"update","sheetName":{"__rl":true,"mode":"url","value":"https://docs.google.com/spreadsheets/d/1TakDfkHpgB8qQcvy98mgUfEsEZGnIVNlkwqnsWhGDwI/edit?gid=0#gid=0","__regex":"https:\\/\\/docs\\.google\\.com\\/spreadsheets\\/d\\/[0-9a-zA-Z\\-_]+.*\\#gid=([0-9]+)"},"documentId":{"__rl":true,"mode":"url","value":"https://docs.google.com/spreadsheets/d/1TakDfkHpgB8qQcvy98mgUfEsEZGnIVNlkwqnsWhGDwI/edit?gid=0#gid=0"}},"credentials":{"googleSheetsOAuth2Api":{"id":"kXiWCpzbScflZGmW","name":"Google Sheets account"}},"typeVersion":4.5,"alwaysOutputData":true},{"id":"21c4d282-5bb4-4d34-8cad-28e4e91843be","name":"Fetch URLs","type":"n8n-nodes-base.googleSheets","position":[-640,400],"parameters":{"options":{},"sheetName":{"__rl":true,"mode":"url","value":"https://docs.google.com/spreadsheets/d/1TakDfkHpgB8qQcvy98mgUfEsEZGnIVNlkwqnsWhGDwI/edit?gid=0#gid=0"},"documentId":{"__rl":true,"mode":"url","value":"https://docs.google.com/spreadsheets/d/1TakDfkHpgB8qQcvy98mgUfEsEZGnIVNlkwqnsWhGDwI/edit?gid=0#gid=0"}},"credentials":{"googleSheetsOAuth2Api":{"id":"kXiWCpzbScflZGmW","name":"Google Sheets account"}},"typeVersion":4.5},{"id":"3d6ebf5c-a89d-4890-ab64-01c6db1d8486","name":"Check SSL","type":"n8n-nodes-base.httpRequest","position":[-380,400],"parameters":{"url":"=https://ssl-checker.io/api/v1/check/{{ $json[\"URL\"].replace(/^https?:\\/\\//, \"\").replace(/\\/$/, \"\") }}","options":{}},"typeVersion":4.2},{"id":"1b7427f1-41aa-4aea-8a98-dccb44e958e0","name":"Expiry Alert","type":"n8n-nodes-base.if","position":[60,620],"parameters":{"options":{},"conditions":{"options":{"version":2,"leftValue":"","caseSensitive":true,"typeValidation":"strict"},"combinator":"and","conditions":[{"id":"ee6e2ce8-569a-4f1f-91b5-2c55f605a16b","operator":{"type":"number","operation":"lte"},"leftValue":"={{ $json.result.days_left }}","rightValue":7}]}},"typeVersion":2.2},{"id":"8efd16a5-ff9e-4138-aa70-ebd087fb27ef","name":"Send Email","type":"n8n-nodes-base.emailSend","position":[360,400],"webhookId":"64bfb82b-e70f-4831-87b9-599d9187ec4a","parameters":{"html":"=<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n    <meta charset=\"UTF-8\">\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n    <style>\n        body {\n            font-family: Arial, sans-serif;\n            background-color: #f4f4f9;\n            color: #333;\n            margin: 0;\n            padding: 0;\n        }\n        .container {\n            width: 100%;\n            max-width: 600px;\n            margin: 20px auto;\n            padding: 20px;\n            background-color: #ffffff;\n            border-radius: 8px;\n            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);\n        }\n        .header {\n            text-align: center;\n            color: #4CAF50;\n        }\n        .header h1 {\n            font-size: 24px;\n            margin: 0;\n        }\n        .message {\n            font-size: 16px;\n            margin: 20px 0;\n            padding: 10px;\n            background-color: #e3f2fd;\n            border-left: 5px solid #2196F3;\n        }\n        .highlight {\n            color: #d32f2f;\n            font-weight: bold;\n        }\n        .footer {\n            text-align: center;\n            font-size: 14px;\n            color: #888;\n            margin-top: 30px;\n        }\n        .footer a {\n            color: #2196F3;\n            text-decoration: none;\n        }\n    </style>\n</head>\n<body>\n    <div class=\"container\">\n        <div class=\"header\">\n            <h1>SSL Certificate Expiry Notice</h1>\n        </div>\n        <div class=\"message\">\n            <p>Dear Team,</p>\n            <p>The SSL certificate for the website <strong>{{ $json.result.host }}</strong> is set to expire in <span class=\"highlight\">{{ $json.result.days_left }}</span> days.</p>\n            <p>Please take the necessary actions to renew the certificate and ensure uninterrupted service.</p>\n        </div>\n        <div class=\"footer\">\n            <p>Best regards,<br>The IT Operations Team</p>\n        </div>\n    </div>\n</body>\n</html>\n","options":{},"subject":"=SSL Expiry - {{ $json.result.days_left }} Days Left - {{ $json.result.host }}","toEmail":"=team1@gmail.com,team2@gmail.com","fromEmail":"admin@gmail.com"},"credentials":{"smtp":{"id":"H0f4Gja9ECFRA34L","name":"SMTP account 2"}},"typeVersion":2.1},{"id":"7ce561b1-1102-4fc1-972b-7dca1793e023","name":"Daily Trigger","type":"n8n-nodes-base.scheduleTrigger","position":[-900,400],"parameters":{"rule":{"interval":[{"triggerAtHour":8}]}},"typeVersion":1.2},{"id":"12d2c49f-9d56-4ace-bc06-82ea850df133","name":"Sticky Note","type":"n8n-nodes-base.stickyNote","position":[-1620,-380],"parameters":{"width":500,"height":1240,"content":"## 🔐 SSL Expiry Notifier (No Paid APIs)\n\n### 👤 Who is this for?\nThis workflow is designed for IT admins, DevOps engineers, and web professionals who need to **monitor SSL certificate expirations** across multiple domains — **without relying on paid APIs**.\n\n---\n\n### 🧩 What It Does\n1. **Daily Trigger** runs the workflow every morning.\n2. **Google Sheets Integration** fetches the list of website URLs to monitor.\n3. **Free SSL API Check** (`ssl-checker.io`) is used to retrieve certificate validity data.\n4. **Certificate Details** (valid from, valid till, days left) are updated back into the same Google Sheet.\n5. **If Condition** checks if the SSL certificate expires in ≤7 days.\n6. **Email Alert** is sent automatically for soon-to-expire certificates.\n\n---\n\n### ⚙️ Setup Instructions\n1. **Google Sheets**:  \n   - Clone the sample sheet or use your own.  \n   - Update the Sheet URL in the `Fetch URLs` and `Update Sheet` nodes.  \n   - Ensure it contains a `URL` column.\n\n2. **Credentials**:  \n   - Connect your **Google account** (for Sheets) and **SMTP credentials** (for email notifications).\n\n3. **Customize**:  \n   - Change the alert threshold in the **IF node** (currently set to 7 days).  \n   - Modify recipient list and message style in the **Send Email** node.\n\n---\n\n### 🧠 Notes\n- Uses **ssl-checker.io**, a **free public API** — no paid services needed.  \n- Flexible and self-hosted monitoring solution.  \n- Ideal for small teams managing multiple domains.\n"},"typeVersion":1},{"id":"68db9999-8a66-479f-8708-c2b9b6556a76","name":"Sticky Note1","type":"n8n-nodes-base.stickyNote","position":[-1000,220],"parameters":{"height":320,"content":"### 🕒 Daily Trigger\nRuns the workflow every day at 8:00 AM.  \nAdjust the time or frequency as needed using cron or interval settings.\n"},"typeVersion":1},{"id":"b39cd547-196f-48ea-b7b5-8b09561032ce","name":"Sticky Note2","type":"n8n-nodes-base.stickyNote","position":[-700,220],"parameters":{"height":320,"content":"### 📄 Fetch URLs\nReads website URLs from a Google Sheet.  \nMake sure the sheet has a column named `URL` containing the domains you want to monitor.\n"},"typeVersion":1},{"id":"455e64c4-38da-4965-bfd6-b11a699243b1","name":"Sticky Note3","type":"n8n-nodes-base.stickyNote","position":[-420,220],"parameters":{"height":320,"content":"### 🔍 Check SSL\nQueries `ssl-checker.io` (free API) for SSL certificate data of each domain.  \nReturns valid_from, valid_till, days_left, and host info.\n"},"typeVersion":1},{"id":"51b3423d-ea6e-4878-9d2e-177e04222100","name":"Sticky Note4","type":"n8n-nodes-base.stickyNote","position":[0,460],"parameters":{"height":300,"content":"### ⚠️ Expiry Alert\nChecks if `days_left` is less than or equal to 7.  \nOnly domains that meet this condition will trigger an email alert.\n"},"typeVersion":1},{"id":"17cfd4d8-cbfe-46f0-bdf1-3a89f557200b","name":"Sticky Note5","type":"n8n-nodes-base.stickyNote","position":[300,220],"parameters":{"height":320,"content":"### 📧 Send Email\nSends an email to the specified recipients if a certificate is expiring soon.  \nThe message includes days left and the domain name in an HTML template.\n"},"typeVersion":1},{"id":"64c0883c-223f-4276-886b-d9996aa099dd","name":"Sticky Note6","type":"n8n-nodes-base.stickyNote","position":[0,-60],"parameters":{"height":400,"content":"### 🔄 Update Sheet\nUpdates the original Google Sheet with new certificate data:\n- Valid From\n- Valid Till\n- Days Left  \nMatches by URL to ensure correct row is updated.\n"},"typeVersion":1}],"active":true,"settings":{"executionOrder":"v1"},"versionId":"f02670ca-1476-4eb6-acac-205630fa2b1c","connections":{"Check SSL":{"main":[[{"node":"URLs to Monitor","type":"main","index":0},{"node":"Expiry Alert","type":"main","index":0}]]},"Fetch URLs":{"main":[[{"node":"Check SSL","type":"main","index":0}]]},"Send Email":{"main":[[]]},"Expiry Alert":{"main":[[{"node":"Send Email","type":"main","index":0}]]},"Daily Trigger":{"main":[[{"node":"Fetch URLs","type":"main","index":0}]]}}}


name: Create AI-Powered Website Chatbot with Langflow Backend and Custom Branding
author_name: Davide
author_username: n3witalia
nodes_used: ["n8n-nodes-base.httpRequest"]
categories: []
created_at: 2025-06-04T10:02:44.761Z
updated_at: 2025-06-04T10:02:44.761Z
url: https://n8n.io/workflows/4645
scraped_at: 2025-07-06 21:16:30
description:
  This workflow integrates a chatbot frontend with a backend powered by Langflow, a visual low-code AI development tool. The flow is triggered whenever a chat message is received via the n8n chatbot widget embedded on a website. It then sends the message to a Langflow flow for processing and returns the generated response to the user.

  How It Works  
  Chat Trigger: The workflow starts with a webhook trigger (When chat message received) that listens for incoming chat messages from the n8n Chat interface.  
  Langflow Integration: The chat input is sent to a Langflow instance via an HTTP request (Langflow node). The request includes the user's message and expects a response from the Langflow flow.  
  Response Processing: The output from Langflow is extracted and formatted using the Edit Fields node, ensuring the chatbot displays the response correctly.  
  Customization: Sticky notes provide instructions for embedding the n8n Chat widget on a website and customizing its appearance, including welcome messages, language settings, and branding.  

  Set Up Steps  
  Configure Langflow Connection:  
     Replace LANGFLOW_URL and FLOW_ID in the HTTP request node with your Langflow instance details.  
     Ensure the API headers (e.g., Content-Type: application/json) and authentication (if required) are correctly set.  

  Deploy n8n Chat:  
     Add the provided CDN script to your website, replacing YOUR_PRODUCTION_WEBHOOK_URL with the webhook URL generated by the When chat message received node.  
     Customize the chatbot’s UI (e.g., title, placeholder text, initial messages) using the JavaScript snippet in the sticky notes.  

  Activate Workflow:  
     Toggle the workflow to "Active" in n8n.  
     Test the chatbot by sending a message and verifying the Langflow response is processed and displayed correctly.  

  Advantages

  ✅ Seamless Langflow Integration
  It allows n8n to communicate directly with a Langflow flow via API, enabling AI responses using custom-designed Langflow logic.

  ✅ No-Code Chatbot Deployment
  With just a script snippet, the chatbot widget can be embedded into any website. Minimal coding is required to launch a fully functioning AI chatbot.

  ✅ Customizable UI/UX
  The included embed code offers full control over the chatbot's appearance, language, welcome message, input placeholder, and branding—ideal for white-label or customer-facing deployments.

  ✅ Modular and Extensible
  Because it's built in n8n, this chatbot can be easily extended with other services like CRMs, email alerts, or databases, without leaving the platform.

  ✅ Real-Time AI Interactions
  Thanks to Langflow's API and chat response support, users get immediate and dynamic AI-driven replies.

  Need help customizing?  
  Contact me for consulting and support or add me on Linkedin. 

workflow_json:
  {"id":"jChHsZ0OR79bITzc","meta":{"instanceId":"a4bfc93e975ca233ac45ed7c9227d84cf5a2329310525917adaf3312e10d5462","templateCredsSetupCompleted":true},"name":"Import Langflow Flow in n8n Chatbot and Branded it","tags":[],"nodes":[{"id":"5d3d611f-72e9-43b4-98ee-d4e10cd7591d","name":"When chat message received","type":"@n8n/n8n-nodes-langchain.chatTrigger","position":[-720,0],"webhookId":"560cad1a-7d5c-43ae-818e-1ff432e4cae4","parameters":{"mode":"webhook","public":true,"options":{"allowedOrigins":"*"}},"typeVersion":1.1},{"id":"9bc309e9-0878-4140-8a2c-fadb51e3dd65","name":"Edit Fields","type":"n8n-nodes-base.set","position":[-280,0],"parameters":{"options":{},"assignments":{"assignments":[{"id":"6a50a699-9598-452a-bc38-a87e2be9084c","name":"output","type":"string","value":"={{ $json.outputs[0].outputs[0].results.message.data.text }}"}]}},"typeVersion":3.4},{"id":"fe301be1-4845-4e76-aee8-27c61bf894e1","name":"Sticky Note","type":"n8n-nodes-base.stickyNote","position":[-740,-340],"parameters":{"color":6,"width":720,"height":220,"content":"### Enable n8n CDN on your website\n<link href=\"https://cdn.jsdelivr.net/npm/@n8n/chat/dist/style.css\" rel=\"stylesheet\" />\n<script type=\"module\">\n\timport { createChat } from 'https://cdn.jsdelivr.net/npm/@n8n/chat/dist/chat.bundle.es.js';\n\n\tcreateChat({\n\t\twebhookUrl: 'YOUR_PRODUCTION_WEBHOOK_URL'\n\t});\n</script>"},"typeVersion":1},{"id":"ca73efeb-bdbd-4824-9b3f-b6222d1db010","name":"Sticky Note1","type":"n8n-nodes-base.stickyNote","position":[-740,-960],"parameters":{"color":3,"width":720,"height":600,"content":"## Langflow\n\nLangflow is a low-code, visual development platform designed to help users build and deploy AI applications with minimal coding. It provides an intuitive drag-and-drop interface, allowing users to create complex AI workflows by connecting reusable components. Langflow supports integration with various APIs, language models, and databases, making it versatile for tasks such as chatbots, document Q&A systems, and content generation. Its Python-based architecture ensures compatibility with popular AI frameworks and tools, facilitating rapid prototyping and deployment of AI solutions.\n\n### Basic Langflow Flow:\n![image](https://n3wstorage.b-cdn.net/test/langflow_flow.png)"},"typeVersion":1},{"id":"edd68237-94c1-4b21-ac10-fac5512dc7e0","name":"Sticky Note2","type":"n8n-nodes-base.stickyNote","position":[0,-960],"parameters":{"color":6,"width":800,"height":840,"content":"### Customize n8n Chatbot\n\n```js\ncreateChat({\n\twebhookUrl: '',\n\twebhookConfig: {\n\t\tmethod: 'POST',\n\t\theaders: {}\n\t},\n\ttarget: '#n8n-chat',\n\tmode: 'window',\n\tchatInputKey: 'chatInput',\n\tchatSessionKey: 'sessionId',\n\tmetadata: {},\n\tshowWelcomeScreen: false,\n\tdefaultLanguage: 'en',\n\tinitialMessages: [\n\t\t'Hi there! 👋',\n\t\t'My name is Nathan. How can I assist you today?'\n\t],\n\ti18n: {\n\t\ten: {\n\t\t\ttitle: 'Hi there! 👋',\n\t\t\tsubtitle: \"Start a chat. We're here to help you 24/7.\",\n\t\t\tfooter: '',\n\t\t\tgetStarted: 'New Conversation',\n\t\t\tinputPlaceholder: 'Type your question..',\n\t\t},\n\t},\n});\n```"},"typeVersion":1},{"id":"0fb9d211-07fd-4309-b91c-aa21e877a915","name":"Langflow","type":"n8n-nodes-base.httpRequest","position":[-500,0],"parameters":{"url":"https://LANGFLOW_URL/api/v1/run/FLOW_ID?stream=false","method":"POST","options":{},"jsonBody":"={\n  \"input_value\": \"{{ $json.chatInput }}\",\n  \"output_type\": \"chat\",\n  \"input_type\": \"chat\"\n}","sendBody":true,"sendHeaders":true,"specifyBody":"json","authentication":"genericCredentialType","genericAuthType":"httpHeaderAuth","headerParameters":{"parameters":[{"name":"Content-Type","value":"application/json"}]}},"credentials":{"httpHeaderAuth":{"id":"u4ZE9bSDfxZX3Ljj","name":"Langflow API"}},"typeVersion":4.2},{"id":"705ecc2a-b0af-4165-8ef3-c693e82cd1ce","name":"Sticky Note3","type":"n8n-nodes-base.stickyNote","position":[-560,-60],"parameters":{"height":220,"content":"Set LANGFLOW_URL and FLOW_ID"},"typeVersion":1}],"active":false,"settings":{"executionOrder":"v1"},"versionId":"6fe12868-d03f-4c86-a472-3b5ce254d4ef","connections":{"Langflow":{"main":[[{"node":"Edit Fields","type":"main","index":0}]]},"When chat message received":{"main":[[{"node":"Langflow","type":"main","index":0}]]}}}


name: AI Agent Creates Content to Be Picked by ChatGPT, Gemini, Google
author_name: Kritika
author_username: kritika-dagur
categories: []
created_at: 2025-06-04T15:38:35.056Z
updated_at: 2025-06-04T15:38:35.056Z
url: https://n8n.io/workflows/4652
scraped_at: 2025-07-06 21:16:30
description:
  🧠 Who is this for?
  Marketing teams, content creators, solopreneurs, and agencies who want to generate emotionally-resonant, SEO-optimized content tailored to audience psychology and buyer journey stages — and get picked up by AI discovery engines like ChatGPT, Gemini, and Perplexity.

  How it works: 
  ✅ Decodes why people buy (using buyer psychology)
  ✅ Creates SEO + emotionally resonant content for 4 formats:
  → Blog Posts, Newsletters, Landing Pages, Social Media
  ✅ Structures the content to be picked up by ChatGPT, Gemini, Perplexity & Google
  ✅ Automatically routes it to Google Sheets, Gmail, or even WordPress

  This isn’t just about writing better content — it’s about getting seen by the tools that shape the internet.

  How long does it take to set-up: 30 Mins 

nodes_used:
  ["n8n-nodes-base.googleSheets","n8n-nodes-base.mailgun","n8n-nodes-base.wordpress","n8n-nodes-base.gmail","n8n-nodes-base.linkedIn","@n8n/n8n-nodes-langchain.chainLlm","@n8n/n8n-nodes-langchain.lmChatGoogleGemini","@n8n/n8n-nodes-langchain.textClassifier"]

workflow_json:
  {"id":"ceWLt9HQyWq1CZ6U","meta":{"instanceId":"5290d3c06bfcfd39bff2dd1da3399bb72d2288a9a42951dd783fdf4b38c8f0a8","templateCredsSetupCompleted":true},"name":"GEO/SEO content engine","tags":[],"nodes":[{"id":"bf91e77c-4450-4eee-b120-de4f3055df8b","name":"Google Sheets Trigger","type":"n8n-nodes-base.googleSheetsTrigger","position":[-600,-180],"parameters":{},"typeVersion":1},{"id":"9c013ed4-97ea-4bb7-b2f0-1dd676cc993b","name":"Remove Duplicates","type":"n8n-nodes-base.removeDuplicates","position":[-420,-180],"parameters":{},"typeVersion":2},{"id":"bdc60c5c-2c60-458b-9bb8-5a1addc81bd0","name":"Basic LLM Chain","type":"@n8n/n8n-nodes-langchain.chainLlm","position":[-200,-180],"parameters":{},"typeVersion":1.6},{"id":"96159da2-2d46-43a2-912f-63f52f2c240d","name":"Google Gemini Chat Model","type":"@n8n/n8n-nodes-langchain.lmChatGoogleGemini","position":[-180,0],"parameters":{},"typeVersion":1},{"id":"bebbcf6d-1916-44cc-b3fa-23148a0b80f3","name":"Google Sheets","type":"n8n-nodes-base.googleSheets","position":[160,-180],"parameters":{},"typeVersion":4.5},{"id":"7744ea1a-79d3-4711-aed3-95793b8ce002","name":"Text Classifier","type":"@n8n/n8n-nodes-langchain.textClassifier","position":[380,-180],"parameters":{},"typeVersion":1},{"id":"2bc3a564-b61c-4b1c-8321-85512dcb784d","name":"Google Gemini Chat Model1","type":"@n8n/n8n-nodes-langchain.lmChatGoogleGemini","position":[380,0],"parameters":{},"typeVersion":1},{"id":"0d266843-271e-4d69-9c3d-c14336df2d8f","name":"Gmail","type":"n8n-nodes-base.gmail","position":[880,-180],"webhookId":"d1419fca-1366-4aea-a3a1-36060d057c44","parameters":{},"typeVersion":2.1},{"id":"9c403484-1b26-44f8-9524-71b065e8289d","name":"Gmail1","type":"n8n-nodes-base.gmail","position":[780,-320],"webhookId":"d5cdafab-37d7-4c55-92e2-6d5c7de384da","parameters":{},"typeVersion":2.1},{"id":"95c1232b-9566-4d57-bcd4-3138de198106","name":"Gmail2","type":"n8n-nodes-base.gmail","position":[800,180],"webhookId":"9fb21528-4542-4a73-99a7-44fb08fc272f","parameters":{},"typeVersion":2.1},{"id":"f1e7338f-d1e6-4a87-97a7-d631b924cd5d","name":"Gmail3","type":"n8n-nodes-base.gmail","position":[840,0],"webhookId":"bc60a0cc-115f-4a40-8a73-1da1b48836dd","parameters":{},"typeVersion":2.1},{"id":"050e931a-3961-4cd3-8b02-ee1b05b86524","name":"LinkedIn","type":"n8n-nodes-base.linkedIn","position":[1100,-180],"parameters":{},"typeVersion":1},{"id":"622dac71-47f0-44e5-857c-19532da3200e","name":"Wordpress","type":"n8n-nodes-base.wordpress","position":[1000,-320],"parameters":{},"typeVersion":1},{"id":"7fbde12b-50cf-4138-bc7e-58e23a07259d","name":"Wordpress1","type":"n8n-nodes-base.wordpress","position":[1060,0],"parameters":{},"typeVersion":1},{"id":"471f91c5-eab5-4091-97c1-1367c1313f0a","name":"Mailgun","type":"n8n-nodes-base.mailgun","position":[1020,180],"parameters":{},"typeVersion":1}],"active":false,"settings":{"executionOrder":"v1"},"versionId":"2d6d03dc-cf68-4d2d-bb1f-bb8ff9d98a0e","connections":{"Gmail":{"main":[[{"node":"LinkedIn","type":"main","index":0}]]},"Gmail1":{"main":[[{"node":"Wordpress","type":"main","index":0}]]},"Gmail2":{"main":[[{"node":"Mailgun","type":"main","index":0}]]},"Gmail3":{"main":[[{"node":"Wordpress1","type":"main","index":0}]]},"Google Sheets":{"main":[[{"node":"Text Classifier","type":"main","index":0}]]},"Basic LLM Chain":{"main":[[{"node":"Google Sheets","type":"main","index":0}]]},"Text Classifier":{"main":[[{"node":"Gmail1","type":"main","index":0}],[{"node":"Gmail","type":"main","index":0}],[{"node":"Gmail2","type":"main","index":0}],[{"node":"Gmail3","type":"main","index":0}]]},"Remove Duplicates":{"main":[[{"node":"Basic LLM Chain","type":"main","index":0}]]},"Google Sheets Trigger":{"main":[[{"node":"Remove Duplicates","type":"main","index":0}]]},"Google Gemini Chat Model":{"ai_languageModel":[[{"node":"Basic LLM Chain","type":"ai_languageModel","index":0}]]},"Google Gemini Chat Model1":{"ai_languageModel":[[{"node":"Text Classifier","type":"ai_languageModel","index":0}]]}}}


name: LinkedIn Profile Extract and Build JSON Resume with Bright Data & Google Gemini
author_name: Ranjan Dailata
author_username: ranjancse
categories: []
created_at: 2025-06-04T16:01:06.726Z
updated_at: 2025-06-04T16:01:06.726Z
url: https://n8n.io/workflows/4653
scraped_at: 2025-07-06 21:16:30
description:
  Who this is for?

  The LinkedIn Profile Extract and JSON Resume Builder is a powerful workflow that scrapes professional profile data from LinkedIn using Bright Data's infrastructure, then transforms that data into a clean, structured JSON resume using Google Gemini. The workflow is ideal for automating resume parsing, candidate profiling, or integrating into recruiting platforms.

  This workflow is tailored for:

  HR professionals & recruiters automating resume screening

  Talent acquisition platforms enriching candidate profiles

  Developers & AI builders creating resume-parsing AI pipelines

  Data scientists working on labor market analytics

  Growth hackers profiling prospects via public data

  What problem is this workflow solving?

  Parsing resumes or LinkedIn profiles into machine-readable formats is often a manual, error-prone process. Most scraping tools either fail due to anti-bot protections or return unstructured HTML that's hard to work with.

  This workflow solves that by:

  Using Bright Data's Web Unlocker for reliable, CAPTCHA-free LinkedIn scraping

  Extracting clean text and structured profile data via Google Gemini LLM

  Automatically generating a standards-compliant JSON Resume and Skills

  Sending the resume to webhooks or storing it for downstream usage

  What this workflow does

  Accepts LinkedIn Profile URL and required metadata (Bright Data zone, webhook)

  Scrapes LinkedIn profile using Bright Data Web Unlocker

  Extracts clean content and skills using Google Gemini LLM

  Builds a JSON-formatted resume following the JSON resume schema

  Sends the JSON resume via Webhook Notification

  Persists the output by saving the file to disk

  Setup

  Sign up at Bright Data.
  Navigate to Proxies & Scraping and create a new Web Unlocker zone by selecting Web Unlocker API under Scraping Solutions.
  In n8n, configure the Header Auth account under Credentials (Generic Auth Type: Header Authentication).

  The Value field should be set with the
  Bearer XXXXXXXXXXXXXX. The XXXXXXXXXXXXXX should be replaced by the Web Unlocker Token.
  In n8n, configure the Google Gemini(PaLM) Api account with the Google Gemini API key (or access through Vertex AI or proxy).
  Update the Set URL and Bright Data Zone node with the LinkedIn profile, Bright Data Zone and the Webhook notification URL. For testing purposes, you can obtain a webhook url using https://webhook.site/

  How to customize this workflow to your needs

  Add Language Translation

  Insert a translation LLM node to support multilingual profiles.

  Generate PDF Resumes

  Convert JSON to formatted PDF resumes using an HTML-to-PDF module.

  Push to ATS or CRM

  Add integration nodes to pipe data into applicant tracking systems (ATS), CRMs, or databases.

  Use Alternative LLMs

  Swap Gemini with OpenAI or Anthropic Claude if preferred.

nodes_used:
  ["n8n-nodes-base.httpRequest","n8n-nodes-base.code","@n8n/n8n-nodes-langchain.chainLlm","@n8n/n8n-nodes-langchain.lmChatGoogleGemini","@n8n/n8n-nodes-langchain.informationExtractor"]

workflow_json:
  {"id":"V9lUeUsju5cwwmNc","meta":{"instanceId":"885b4fb4a6a9c2cb5621429a7b972df0d05bb724c20ac7dac7171b62f1c7ef40","templateCredsSetupCompleted":true},"name":"LinkedIn Profile Extract and Build JSON Resume with Bright Data & Google Gemini","tags":[{"id":"Kujft2FOjmOVQAmJ","name":"Engineering","createdAt":"2025-04-09T01:31:00.558Z","updatedAt":"2025-04-09T01:31:00.558Z"},{"id":"ZOwtAMLepQaGW76t","name":"Building Blocks","createdAt":"2025-04-13T15:23:40.462Z","updatedAt":"2025-04-13T15:23:40.462Z"},{"id":"ddPkw7Hg5dZhQu2w","name":"AI","createdAt":"2025-04-13T05:38:08.053Z","updatedAt":"2025-04-13T05:38:08.053Z"},{"id":"rKOa98eAi3IETrLu","name":"HR","createdAt":"2025-04-13T04:59:30.580Z","updatedAt":"2025-04-13T04:59:30.580Z"}],"nodes":[{"id":"0bac88f2-4912-4b1e-b511-aab2c3b34db9","name":"When clicking ‘Test workflow’","type":"n8n-nodes-base.manualTrigger","position":[-580,-140],"parameters":{},"typeVersion":1},{"id":"df338f53-cb90-4529-befb-382735043ec2","name":"Set URL and Bright Data Zone","type":"n8n-nodes-base.set","position":[-360,-140],"parameters":{"options":{},"assignments":{"assignments":[{"id":"3aedba66-f447-4d7a-93c0-8158c5e795f9","name":"url","type":"string","value":"https://www.linkedin.com/in/ranjan-dailata"},{"id":"4e7ee31d-da89-422f-8079-2ff2d357a0ba","name":"zone","type":"string","value":"web_unlocker1"},{"id":"20518160-df56-49fe-9a42-05e9f9d743a5","name":"webhook_notification_url","type":"string","value":"https://webhook.site/c9118da2-1c54-460f-a83a-e5131b7098db"}]}},"typeVersion":3.4},{"id":"e3a859aa-b330-4ae5-b0fb-7cd621be6fb3","name":"Perform Bright Data Web Request","type":"n8n-nodes-base.httpRequest","position":[-140,-140],"parameters":{"url":"https://api.brightdata.com/request","method":"POST","options":{},"sendBody":true,"sendHeaders":true,"authentication":"genericCredentialType","bodyParameters":{"parameters":[{"name":"zone","value":"={{ $json.zone }}"},{"name":"url","value":"={{ $json.url }}"},{"name":"format","value":"raw"},{"name":"data_format","value":"markdown"}]},"genericAuthType":"httpHeaderAuth","headerParameters":{"parameters":[{}]}},"credentials":{"httpHeaderAuth":{"id":"kdbqXuxIR8qIxF7y","name":"Header Auth account"}},"typeVersion":4.2},{"id":"078d4a98-9c45-4370-a579-06450798f1a1","name":"Markdown to Textual Data Extractor","type":"@n8n/n8n-nodes-langchain.chainLlm","position":[80,-140],"parameters":{"text":"=You need to analyze the below markdown and convert to textual data. Please do not output with your own thoughts. Make sure to output with textual data only with no links, scripts, css etc.\n\n{{ $json.data }}","messages":{"messageValues":[{"message":"You are a markdown expert"}]},"promptType":"define"},"retryOnFail":true,"typeVersion":1.6},{"id":"2ba19dce-4f9a-439d-b7ae-d701ddb03616","name":"Google Gemini Chat Model for Markdown to Textual","type":"@n8n/n8n-nodes-langchain.lmChatGoogleGemini","position":[100,80],"parameters":{"options":{},"modelName":"models/gemini-2.0-flash-exp"},"credentials":{"googlePalmApi":{"id":"YeO7dHZnuGBVQKVZ","name":"Google Gemini(PaLM) Api account"}},"typeVersion":1},{"id":"a45dbef9-58f3-4730-8e1b-83419e1efc85","name":"Skill Extractor","type":"@n8n/n8n-nodes-langchain.informationExtractor","position":[456,-440],"parameters":{"text":"=Perform Data Mining and extract the skills from the provided resume\n\n {{ $json.text }}","options":{},"schemaType":"manual","inputSchema":"{\n\t\"type\": \"array\",\n\t\"properties\": {\n\t\t\"skill\": {\n\t\t\t\"type\": \"string\"\n\t\t},\n        \"desc\": {\n\t\t\t\"type\": \"string\"\n\t\t}\n\t}\n}"},"retryOnFail":true,"typeVersion":1},{"id":"955af989-3590-49ae-90be-df6424200e42","name":"Google Gemini Chat Model for Skill Extractor","type":"@n8n/n8n-nodes-langchain.lmChatGoogleGemini","position":[544,-220],"parameters":{"options":{},"modelName":"models/gemini-2.0-flash-exp"},"credentials":{"googlePalmApi":{"id":"YeO7dHZnuGBVQKVZ","name":"Google Gemini(PaLM) Api account"}},"typeVersion":1},{"id":"5c32bdeb-666b-4a0f-9722-0c62ec95ac9e","name":"Create a binary data for Structured Data Extract","type":"n8n-nodes-base.function","position":[1052,-40],"parameters":{"functionCode":"items[0].binary = {\n  data: {\n    data: new Buffer(JSON.stringify(items[0].json, null, 2)).toString('base64')\n  }\n};\nreturn items;"},"typeVersion":1},{"id":"b9e899f3-a1a4-4dce-af96-1814fb3c03b7","name":"Write the structured content to disk","type":"n8n-nodes-base.readWriteFile","position":[1280,-40],"parameters":{"options":{},"fileName":"=d:\\Json_Resume.json","operation":"write"},"typeVersion":1},{"id":"db74b347-713e-4ff6-9783-1d3f6b1895a6","name":"Initiate a Webhook Notification for Structured Data","type":"n8n-nodes-base.httpRequest","position":[1060,160],"parameters":{"url":"={{ $('Set URL and Bright Data Zone').item.json.webhook_notification_url }}","options":{},"sendBody":true,"bodyParameters":{"parameters":[{"name":"json_resume","value":"={{ $('JSON Resume Extractor').item.json.output.toJsonString() }}"}]}},"typeVersion":4.2},{"id":"29d27cef-c868-4552-ab41-08276f56e6f9","name":"Write the structured skills content to disk","type":"n8n-nodes-base.readWriteFile","position":[1060,-340],"parameters":{"options":{},"fileName":"=d:\\Resume_Skills.json","operation":"write"},"typeVersion":1},{"id":"c7a77bd9-955c-45ec-b6d7-e10717eda093","name":"Create a binary data for Structured Skill Extract","type":"n8n-nodes-base.function","position":[832,-340],"parameters":{"functionCode":"items[0].binary = {\n  data: {\n    data: new Buffer(JSON.stringify(items[0].json, null, 2)).toString('base64')\n  }\n};\nreturn items;"},"typeVersion":1},{"id":"46dc726e-c939-466b-b834-83f0aed2c95c","name":"Sticky Note4","type":"n8n-nodes-base.stickyNote","position":[-140,-420],"parameters":{"color":5,"width":440,"height":240,"content":"## LLM Usages\n\nGoogle Gemini LLM is being utilized for the structured data extraction handling."},"typeVersion":1},{"id":"a100ebc9-9253-4e80-93d9-60174a08e7d9","name":"Sticky Note5","type":"n8n-nodes-base.stickyNote","position":[-580,-780],"parameters":{"color":7,"width":400,"height":340,"content":"## Logo\n\n\n![logo](https://images.seeklogo.com/logo-png/43/1/brightdata-logo-png_seeklogo-439974.png)\n"},"typeVersion":1},{"id":"097e223c-61e2-4c01-ab8c-3eb2cc48b165","name":"Sticky Note1","type":"n8n-nodes-base.stickyNote","position":[-580,-420],"parameters":{"width":400,"height":240,"content":"## Note\n\nDeals with the LinkedIn profile data extraction by utilizing the Bright Data and Google Gemini LLM for transforming the profile into a structured JSON resume with the structured skill extraction.\n\n**Please make sure to set the input fields node with the LinkedIn profile URL, Bright Data zone name, Webhook notification URL**\n"},"typeVersion":1},{"id":"8260cf1a-bd5e-4c05-a898-e7f74ff1d268","name":"Sticky Note","type":"n8n-nodes-base.stickyNote","position":[360,-520],"parameters":{"color":7,"width":1100,"height":960,"content":"## Structured Data Extract using LLM"},"typeVersion":1},{"id":"e06fcc12-c264-439f-84f2-1988587e21c6","name":"JSON Resume Extractor","type":"@n8n/n8n-nodes-langchain.informationExtractor","position":[460,80],"parameters":{"text":"=Extract the resume in JSON format.\n {{ $json.text }}","options":{},"schemaType":"manual","inputSchema":"{\n  \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n  \"title\": \"JSON Resume\",\n  \"type\": \"object\",\n  \"properties\": {\n    \"basics\": {\n      \"type\": \"object\",\n      \"properties\": {\n        \"name\": { \"type\": \"string\" },\n        \"label\": { \"type\": \"string\" },\n        \"image\": { \"type\": \"string\", \"format\": \"uri\" },\n        \"email\": { \"type\": \"string\", \"format\": \"email\" },\n        \"phone\": { \"type\": \"string\" },\n        \"url\": { \"type\": \"string\", \"format\": \"uri\" },\n        \"summary\": { \"type\": \"string\" },\n        \"location\": {\n          \"type\": \"object\",\n          \"properties\": {\n            \"address\": { \"type\": \"string\" },\n            \"postalCode\": { \"type\": \"string\" },\n            \"city\": { \"type\": \"string\" },\n            \"countryCode\": { \"type\": \"string\" },\n            \"region\": { \"type\": \"string\" }\n          }\n        },\n        \"profiles\": {\n          \"type\": \"array\",\n          \"items\": {\n            \"type\": \"object\",\n            \"properties\": {\n              \"network\": { \"type\": \"string\" },\n              \"username\": { \"type\": \"string\" },\n              \"url\": { \"type\": \"string\", \"format\": \"uri\" }\n            }\n          }\n        }\n      }\n    },\n    \"work\": {\n      \"type\": \"array\",\n      \"items\": {\n        \"type\": \"object\",\n        \"properties\": {\n          \"name\": { \"type\": \"string\" },\n          \"position\": { \"type\": \"string\" },\n          \"url\": { \"type\": \"string\", \"format\": \"uri\" },\n          \"startDate\": { \"type\": \"string\", \"format\": \"date\" },\n          \"endDate\": { \"type\": \"string\", \"format\": \"date\" },\n          \"summary\": { \"type\": \"string\" },\n          \"highlights\": {\n            \"type\": \"array\",\n            \"items\": { \"type\": \"string\" }\n          }\n        }\n      }\n    },\n    \"volunteer\": {\n      \"type\": \"array\",\n      \"items\": {\n        \"type\": \"object\",\n        \"properties\": {\n          \"organization\": { \"type\": \"string\" },\n          \"position\": { \"type\": \"string\" },\n          \"url\": { \"type\": \"string\", \"format\": \"uri\" },\n          \"startDate\": { \"type\": \"string\", \"format\": \"date\" },\n          \"endDate\": { \"type\": \"string\", \"format\": \"date\" },\n          \"summary\": { \"type\": \"string\" },\n          \"highlights\": {\n            \"type\": \"array\",\n            \"items\": { \"type\": \"string\" }\n          }\n        }\n      }\n    },\n    \"education\": {\n      \"type\": \"array\",\n      \"items\": {\n        \"type\": \"object\",\n        \"properties\": {\n          \"institution\": { \"type\": \"string\" },\n          \"url\": { \"type\": \"string\", \"format\": \"uri\" },\n          \"area\": { \"type\": \"string\" },\n          \"studyType\": { \"type\": \"string\" },\n          \"startDate\": { \"type\": \"string\", \"format\": \"date\" },\n          \"endDate\": { \"type\": \"string\", \"format\": \"date\" },\n          \"score\": { \"type\": \"string\" },\n          \"courses\": {\n            \"type\": \"array\",\n            \"items\": { \"type\": \"string\" }\n          }\n        }\n      }\n    },\n    \"awards\": {\n      \"type\": \"array\",\n      \"items\": {\n        \"type\": \"object\",\n        \"properties\": {\n          \"title\": { \"type\": \"string\" },\n          \"date\": { \"type\": \"string\", \"format\": \"date\" },\n          \"awarder\": { \"type\": \"string\" },\n          \"summary\": { \"type\": \"string\" }\n        }\n      }\n    },\n    \"certificates\": {\n      \"type\": \"array\",\n      \"items\": {\n        \"type\": \"object\",\n        \"properties\": {\n          \"name\": { \"type\": \"string\" },\n          \"date\": { \"type\": \"string\", \"format\": \"date\" },\n          \"issuer\": { \"type\": \"string\" },\n          \"url\": { \"type\": \"string\", \"format\": \"uri\" }\n        }\n      }\n    },\n    \"publications\": {\n      \"type\": \"array\",\n      \"items\": {\n        \"type\": \"object\",\n        \"properties\": {\n          \"name\": { \"type\": \"string\" },\n          \"publisher\": { \"type\": \"string\" },\n          \"releaseDate\": { \"type\": \"string\", \"format\": \"date\" },\n          \"url\": { \"type\": \"string\", \"format\": \"uri\" },\n          \"summary\": { \"type\": \"string\" }\n        }\n      }\n    },\n    \"skills\": {\n      \"type\": \"array\",\n      \"items\": {\n        \"type\": \"object\",\n        \"properties\": {\n          \"name\": { \"type\": \"string\" },\n          \"level\": { \"type\": \"string\" },\n          \"keywords\": {\n            \"type\": \"array\",\n            \"items\": { \"type\": \"string\" }\n          }\n        }\n      }\n    },\n    \"languages\": {\n      \"type\": \"array\",\n      \"items\": {\n        \"type\": \"object\",\n        \"properties\": {\n          \"language\": { \"type\": \"string\" },\n          \"fluency\": { \"type\": \"string\" }\n        }\n      }\n    },\n    \"interests\": {\n      \"type\": \"array\",\n      \"items\": {\n        \"type\": \"object\",\n        \"properties\": {\n          \"name\": { \"type\": \"string\" },\n          \"keywords\": {\n            \"type\": \"array\",\n            \"items\": { \"type\": \"string\" }\n          }\n        }\n      }\n    },\n    \"references\": {\n      \"type\": \"array\",\n      \"items\": {\n        \"type\": \"object\",\n        \"properties\": {\n          \"name\": { \"type\": \"string\" },\n          \"reference\": { \"type\": \"string\" }\n        }\n      }\n    },\n    \"projects\": {\n      \"type\": \"array\",\n      \"items\": {\n        \"type\": \"object\",\n        \"properties\": {\n          \"name\": { \"type\": \"string\" },\n          \"startDate\": { \"type\": \"string\", \"format\": \"date\" },\n          \"endDate\": { \"type\": \"string\", \"format\": \"date\" },\n          \"description\": { \"type\": \"string\" },\n          \"highlights\": {\n            \"type\": \"array\",\n            \"items\": { \"type\": \"string\" }\n          },\n          \"url\": { \"type\": \"string\", \"format\": \"uri\" }\n        }\n      }\n    }\n  },\n  \"required\": [\"basics\"]\n}\n"},"retryOnFail":true,"typeVersion":1},{"id":"14c17907-10bb-45a8-b835-39251b742cbe","name":"Google Gemini Chat Model","type":"@n8n/n8n-nodes-langchain.lmChatGoogleGemini","position":[580,260],"parameters":{"options":{},"modelName":"models/gemini-2.0-flash-exp"},"credentials":{"googlePalmApi":{"id":"YeO7dHZnuGBVQKVZ","name":"Google Gemini(PaLM) Api account"}},"typeVersion":1},{"id":"9ec7af7d-72e6-410d-b52e-9eda3e193e30","name":"Code","type":"n8n-nodes-base.code","position":[800,80],"parameters":{"jsCode":"return $input.first().json.output"},"typeVersion":2}],"active":false,"settings":{"executionOrder":"v1"},"versionId":"bcad3928-6913-44b0-b9e5-efc6e738769c","connections":{"Code":{"main":[[{"node":"Initiate a Webhook Notification for Structured Data","type":"main","index":0},{"node":"Create a binary data for Structured Data Extract","type":"main","index":0}]]},"Skill Extractor":{"main":[[{"node":"Create a binary data for Structured Skill Extract","type":"main","index":0}]]},"JSON Resume Extractor":{"main":[[{"node":"Code","type":"main","index":0}]]},"Google Gemini Chat Model":{"ai_languageModel":[[{"node":"JSON Resume Extractor","type":"ai_languageModel","index":0}]]},"Set URL and Bright Data Zone":{"main":[[{"node":"Perform Bright Data Web Request","type":"main","index":0}]]},"Perform Bright Data Web Request":{"main":[[{"node":"Markdown to Textual Data Extractor","type":"main","index":0}]]},"When clicking ‘Test workflow’":{"main":[[{"node":"Set URL and Bright Data Zone","type":"main","index":0}]]},"Markdown to Textual Data Extractor":{"main":[[{"node":"Skill Extractor","type":"main","index":0},{"node":"JSON Resume Extractor","type":"main","index":0}]]},"Google Gemini Chat Model for Skill Extractor":{"ai_languageModel":[[{"node":"Skill Extractor","type":"ai_languageModel","index":0}]]},"Create a binary data for Structured Data Extract":{"main":[[{"node":"Write the structured content to disk","type":"main","index":0}]]},"Google Gemini Chat Model for Markdown to Textual":{"ai_languageModel":[[{"node":"Markdown to Textual Data Extractor","type":"ai_languageModel","index":0}]]},"Create a binary data for Structured Skill Extract":{"main":[[{"node":"Write the structured skills content to disk","type":"main","index":0}]]}}}


name: Automate Instagram Content Discovery & Repurposing w/ Apify, GPT-4o & Perplexity
author_name: Nick Saraev
author_username: nicksaraev
nodes_used: ["n8n-nodes-base.googleSheets","n8n-nodes-base.httpRequest","@n8n/n8n-nodes-langchain.openAi"]
categories: []
created_at: 2025-06-04T17:08:01.951Z
updated_at: 2025-06-04T17:08:01.951Z
url: https://n8n.io/workflows/4658
scraped_at: 2025-07-06 21:16:30
description:
  This workflow creates an end-to-end Instagram content pipeline that automatically discovers trending content from competitor channels, extracts valuable insights, and generates new high-quality scripts for your own content creation. The system helped scale an Instagram channel from 0 to 10,000 followers in just 15 days through intelligent content repurposing.

  Benefits:

  Complete Content Automation - Monitors competitor Instagram accounts, downloads new reels, and processes them without manual intervention
  AI-Powered Script Generation - Uses ChatGPT and Perplexity to analyze content, identify tools/technologies, and rewrite scripts with fresh angles
  Smart Duplicate Prevention - Automatically tracks processed content in a database to avoid redundant work
  Multi-Platform Intelligence - Combines Instagram scraping, AI transcription, web research, and content generation in one seamless flow
  Scalable Content Strategy - Process content from multiple niches and creators to fuel unlimited content ideas
  Revenue-Focused Approach - Specifically designed to identify monetizable tools and technologies for business-focused content

  How It Works:

  Instagram Content Discovery:
  Uses Apify's Instagram scraper to monitor specified creator accounts for new reels
  Automatically downloads video content and metadata from target accounts
  Filters content based on engagement metrics and relevance

  Intelligent Processing Pipeline:

  Transcribes video content using OpenAI Whisper for accurate text extraction
  Filters content using AI to identify tools, technologies, and automation opportunities
  Cross-references against existing database to prevent duplicate processing

  Enhanced Research & Analysis:

  Searches Perplexity AI for additional insights about discovered tools
  Generates step-by-step usage guides and implementation instructions
  Identifies unique angles and opportunities for content improvement

  Script Generation & Optimization:

  Creates new, original scripts optimized for your specific audience
  Maintains consistent brand voice while adding fresh perspectives
  Includes strategic call-to-action elements for audience engagement

  Required Google Sheets Database Setup:
  Before running this workflow, create a Google Sheets database with these exact column headers:
  Essential Columns:

  id - Unique Instagram post identifier (primary key for duplicate detection)
  timestamp - When the reel was posted
  caption - Original reel caption text
  hashtags - Hashtags used in the post
  videoUrl - Direct link to download the video file
  username - Account that posted the reel
  scrapedTranscript - Original transcript from video (added by workflow)
  newTranscript - AI-generated script for your content (added by workflow)

  Additional Tracking Columns:

  shortCode - Instagram's internal post code
  url - Public Instagram post URL
  commentsCount - Number of comments
  firstComment - Top comment on the post
  likesCount - Number of likes
  videoViewCount - View count metrics
  videoDuration - Length of video in seconds

  Setup Instructions:

  Create a new Google Sheet with these column headers in the first row
  Name the sheet "Reels"
  Connect your Google Sheets OAuth credentials in n8n
  Update the document ID in the workflow nodes

  The merge logic relies on the id column to prevent duplicate processing, so this structure is essential for the workflow to function correctly.


  Business Use Cases:

  Content Creators - Scale content production by 10x while maintaining quality and originality
  Marketing Agencies - Offer content research and ideation as a premium service
  Course Creators - Identify trending tools and technologies for educational content

  Revenue Potential:

  This exact system can be sold as a service for $3,000-$5,000 to growing channels or agencies. The automation saves 10+ hours weekly of manual research and content planning.

  Difficulty Level: Intermediate
  Estimated Build Time: 1-2 hours
  Monthly Operating Cost: ~$30 (API usage)

  Watch the Complete Build Process

  Want to see exactly how this system was built from scratch? Nick Saraev walks through the entire development process in this comprehensive tutorial, including all the debugging, dead ends, and problem-solving that goes into building real automation systems.

  🎥 Watch: "The N8N Instagram Parasite System (10K Followers In 15 Days)"


  This 1.5-hour deep-dive shows the actual build process - not a polished demo, but real system development with all the thinking and iteration included.

  Set Up Steps:

  Configure Apify Integration:

  Sign up for Apify account and obtain API key
  Replace the bearer token in the "Run Actor Synchronously" node
  Customize the username array with your target Instagram accounts

  Set Up AI Services:

  Add OpenAI API credentials for transcription and content generation
  Configure Perplexity API for enhanced research capabilities
  Set up appropriate rate limiting for cost control
  Database Configuration:

  Create Google Sheets database with provided column structure
  Connect Google Sheets OAuth credentials
  Configure the merge logic for duplicate detection

  Content Filtering Setup:

  Customize the AI prompts for your specific niche and requirements
  Adjust the filtering criteria for tool/technology detection
  Set up the script generation template to match your brand voice

  Automation Schedule:

  Configure the schedule trigger for daily content monitoring
  Set optimal timing based on your content creation workflow
  Test the complete flow with a small number of accounts first

  Advanced Customization:

  Add additional content sources beyond Instagram
  Integrate with your existing content management systems
  Scale up monitoring to dozens of competitor accounts

  More AI Automation Systems:*
  For more advanced automation tutorials and business systems, check out My YouTube Channel  where I share proven automation strategies that generate real revenue.

workflow_json:
  {"id":"fFfhgyxWDNWQCUtY","meta":{"instanceId":"d7661a849ead114a9aa6d9ceaf4160465aeb79532a35bde62160c840ffba9fc8"},"name":"Apify Scrape New Instagram Reels -> Transcribe -> Add to Sheet","tags":[{"id":"l8MPK4ZirgwFWMno","name":"N8N Course","createdAt":"2025-01-23T18:12:52.273Z","updatedAt":"2025-01-23T18:12:52.273Z"}],"nodes":[{"id":"sticky-note-1","type":"n8n-nodes-base.stickyNote","position":[180,-280],"parameters":{"width":350,"height":200,"content":"## 🎯 STEP 1: Instagram Content Discovery\n\nThis node uses Apify to scrape Instagram reels from competitor accounts. Replace <your-apify-api-key-here> with your actual API key.\n\n**Key Setup:**\n- Add your target Instagram usernames to the JSON body\n- Adjust resultsLimit (5 = latest 5 reels per account)\n- Monitor accounts in your niche for trending content"},"typeVersion":1},{"id":"sticky-note-2","type":"n8n-nodes-base.stickyNote","position":[600,-320],"parameters":{"width":380,"height":180,"content":"## 🔍 STEP 2: Smart Duplicate Prevention\n\nThis section prevents processing the same content twice:\n\n1. **Search for Entries**: Checks if reel ID already exists in database\n2. **Drop Duplicates**: Removes already-processed content using merge logic\n3. **Add Entries**: Only adds genuinely new content to Google Sheets\n\n**Critical**: The merge node compares IDs and keeps only non-matches (new content)"},"typeVersion":1},{"id":"sticky-note-3","type":"n8n-nodes-base.stickyNote","position":[1400,-320],"parameters":{"width":400,"height":200,"content":"## 🧠 STEP 3: AI-Powered Content Analysis\n\nThe AI pipeline processes each reel:\n\n1. **Transcribe Video**: Uses OpenAI Whisper to extract text from videos\n2. **Filter & Generate**: GPT-4o identifies tools/technologies and creates step-by-step guides\n3. **Search Perplexity**: Researches additional insights about discovered tools\n4. **Write New Script**: Generates original, optimized scripts for your audience\n\n**Result**: Transform competitor content into unique, valuable scripts for your channel"},"typeVersion":1},{"id":"sticky-note-4","type":"n8n-nodes-base.stickyNote","position":[2400,-280],"parameters":{"width":350,"height":160,"content":"## 📋 STEP 4: Database Updates\n\nFinal step saves everything back to Google Sheets:\n\n**Update Entries**: Adds the original transcript and newly generated script to your database for future reference and analysis.\n\n**Note**: This creates a complete content intelligence database where you can track:\n- Which content performed best\n- What tools were most popular\n- Script variations and improvements"},"typeVersion":1},{"id":"c55c87f0-868c-4d3a-a0ca-43cc7191cb32","name":"Run Actor Synchronously","type":"n8n-nodes-base.httpRequest","position":[220,0],"parameters":{"url":"https://api.apify.com/v2/acts/xMc5Ga1oCONPmWJIa/run-sync-get-dataset-items","method":"POST","options":{"redirect":{"redirect":{}}},"jsonBody":"{\n  \"resultsLimit\": 5,\n  \"username\": [\n    \"nick_saraev\",\n    \"juliangoldieseo\",\n    \"brand.nat\",\n    \"realrileybrown\",\n    \"hamza_automates\",\n    \"100xengineers\",\n    \"mattfarmerai\",\n    \"nathanhodgson.ai\",\n    \"theaisurfer\",\n    \"shedoesai\",\n    \"aitrendz.xyz\",\n    \"thevarunmayya\",\n    \"rohak_arya\",\n    \"digitalsamaritan\"\n  ]\n}","sendBody":true,"sendHeaders":true,"specifyBody":"json","headerParameters":{"parameters":[{"name":"Accept","value":"application/json"},{"name":"Authorization","value":"Bearer YOUR_TOKEN_HERE"}]}},"typeVersion":4.2},{"id":"df030281-6513-45a2-9c72-b1e59ee4c4b6","name":"Limit","type":"n8n-nodes-base.limit","position":[440,0],"parameters":{"keep":"lastItems","maxItems":2},"typeVersion":1},{"id":"8a0ea140-f361-4208-be52-c1dcb91270a7","name":"Filter & Generate Suggestions","type":"@n8n/n8n-nodes-langchain.openAi","position":[1620,0],"parameters":{"modelId":{"__rl":true,"mode":"list","value":"gpt-4o","cachedResultName":"GPT-4O"},"options":{},"messages":{"values":[{"role":"system","content":"You are a helpful, intelligent admin assistant."},{"content":"I run an AI & automation Instagram channel. I'm looking through news archives to find mentions of tools that I can repurpose into content for my channel.\n\nYour task is to take as input a transcript of a news archive, and then determine if the transcription is about a tool, a technology, or AI.\n\nIf so, you'll identify the tools, then write a list of step-by-step instructions to use the tool easily (ideally for free or for low cost), and one suggestion on exactly how to make this content more palatable to an AI automation audience.\n\nReturn your output in JSON using this format:\n\n{\n  \"verdict\":\"true or false\",\n  \"tools\":[\"list\",\"of\",\"tools\",\"or\",\"resources\"],\n  \"stepByStep\":\"Detailed instructions on how to use the tool(s).\",\n  \"suggestion\":\"Comprehensive, in-depth suggestions on how to make this content more interesting and palatable to my audience (AI automation).\",\n  \"searchPrompt\":\"A short search prompt we'll use to look up the service. Write it like '{toolName}, the {typeOfTool}'\"\n}\n\nIf verdict is \"false\", leave the rest of the fields empty."},{"content":"={\"transcript\":\"{{ $json.text }}\"}"}]},"jsonOutput":true},"credentials":{"openAiApi":{"id":"kRhXLl2JwVGc05AE","name":"YouTube_Feb 4"}},"typeVersion":1.6},{"id":"8dbcc1b2-2bc7-4d4f-bc38-8f2b6384abcf","name":"Search for Entries","type":"n8n-nodes-base.googleSheets","position":[640,-160],"parameters":{"options":{},"filtersUI":{"values":[{"lookupValue":"={{ $json.id }}","lookupColumn":"id"}]},"sheetName":{"__rl":true,"mode":"list","value":"gid=0","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1e1yIubmEXzzUrSCurXdXM2H6ioN2GEb1aOX5UBNNyik/edit#gid=0","cachedResultName":"Reels"},"documentId":{"__rl":true,"mode":"list","value":"1e1yIubmEXzzUrSCurXdXM2H6ioN2GEb1aOX5UBNNyik","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1e1yIubmEXzzUrSCurXdXM2H6ioN2GEb1aOX5UBNNyik/edit?usp=drivesdk","cachedResultName":"Instagram Reel Database"}},"credentials":{"googleSheetsOAuth2Api":{"id":"EOibXIc4U8wcXyRR","name":"YouTube"}},"typeVersion":4.5,"alwaysOutputData":false},{"id":"e2b81a84-6724-4757-8991-a62610943ea0","name":"Drop Duplicates","type":"n8n-nodes-base.merge","position":[820,0],"parameters":{"mode":"combine","options":{},"joinMode":"keepNonMatches","fieldsToMatchString":"id"},"typeVersion":3},{"id":"a2650df2-9375-40ec-9ede-115cd692c9ca","name":"Add Entries","type":"n8n-nodes-base.googleSheets","position":[1020,0],"parameters":{"columns":{"value":{"id":"={{ $json.id }}","url":"={{ $json.url }}","caption":"={{ $json.caption }}","hashtags":"={{ $json.hashtags }}","username":"={{ $json.ownerUsername }}","videoUrl":"={{ $json.videoUrl }}","shortCode":"={{ $json.shortCode }}","timestamp":"={{ $json.timestamp }}","displayUrl":"={{ $json.displayUrl }}","likesCount":"={{ $json.likesCount }}","firstComment":"={{ $json.firstComment }}","commentsCount":"={{ $json.commentsCount }}","videoDuration":"={{ $json.videoDuration }}","videoPlayCount":"={{ $json.videoPlayCount }}","videoViewCount":"={{ $json.videoViewCount }}"},"schema":[{"id":"timestamp","type":"string","display":true,"required":false,"displayName":"timestamp","defaultMatch":false,"canBeUsedToMatch":true},{"id":"id","type":"string","display":true,"removed":false,"required":false,"displayName":"id","defaultMatch":true,"canBeUsedToMatch":true},{"id":"shortCode","type":"string","display":true,"required":false,"displayName":"shortCode","defaultMatch":false,"canBeUsedToMatch":true},{"id":"caption","type":"string","display":true,"required":false,"displayName":"caption","defaultMatch":false,"canBeUsedToMatch":true},{"id":"hashtags","type":"string","display":true,"required":false,"displayName":"hashtags","defaultMatch":false,"canBeUsedToMatch":true},{"id":"url","type":"string","display":true,"required":false,"displayName":"url","defaultMatch":false,"canBeUsedToMatch":true},{"id":"commentsCount","type":"string","display":true,"required":false,"displayName":"commentsCount","defaultMatch":false,"canBeUsedToMatch":true},{"id":"firstComment","type":"string","display":true,"required":false,"displayName":"firstComment","defaultMatch":false,"canBeUsedToMatch":true},{"id":"displayUrl","type":"string","display":true,"required":false,"displayName":"displayUrl","defaultMatch":false,"canBeUsedToMatch":true},{"id":"videoUrl","type":"string","display":true,"required":false,"displayName":"videoUrl","defaultMatch":false,"canBeUsedToMatch":true},{"id":"likesCount","type":"string","display":true,"required":false,"displayName":"likesCount","defaultMatch":false,"canBeUsedToMatch":true},{"id":"videoViewCount","type":"string","display":true,"required":false,"displayName":"videoViewCount","defaultMatch":false,"canBeUsedToMatch":true},{"id":"videoPlayCount","type":"string","display":true,"required":false,"displayName":"videoPlayCount","defaultMatch":false,"canBeUsedToMatch":true},{"id":"username","type":"string","display":true,"required":false,"displayName":"username","defaultMatch":false,"canBeUsedToMatch":true},{"id":"videoDuration","type":"string","display":true,"required":false,"displayName":"videoDuration","defaultMatch":false,"canBeUsedToMatch":true},{"id":"scrapedTranscript","type":"string","display":true,"removed":true,"required":false,"displayName":"scrapedTranscript","defaultMatch":false,"canBeUsedToMatch":true},{"id":"newTranscript","type":"string","display":true,"removed":true,"required":false,"displayName":"newTranscript","defaultMatch":false,"canBeUsedToMatch":true},{"id":"inputUrl","type":"string","display":true,"removed":true,"required":false,"displayName":"inputUrl","defaultMatch":false,"canBeUsedToMatch":true},{"id":"type","type":"string","display":true,"removed":true,"required":false,"displayName":"type","defaultMatch":false,"canBeUsedToMatch":true},{"id":"mentions","type":"string","display":true,"removed":true,"required":false,"displayName":"mentions","defaultMatch":false,"canBeUsedToMatch":true},{"id":"latestComments","type":"string","display":true,"removed":true,"required":false,"displayName":"latestComments","defaultMatch":false,"canBeUsedToMatch":true},{"id":"dimensionsHeight","type":"string","display":true,"removed":true,"required":false,"displayName":"dimensionsHeight","defaultMatch":false,"canBeUsedToMatch":true},{"id":"dimensionsWidth","type":"string","display":true,"removed":true,"required":false,"displayName":"dimensionsWidth","defaultMatch":false,"canBeUsedToMatch":true},{"id":"images","type":"string","display":true,"removed":true,"required":false,"displayName":"images","defaultMatch":false,"canBeUsedToMatch":true},{"id":"alt","type":"string","display":true,"removed":true,"required":false,"displayName":"alt","defaultMatch":false,"canBeUsedToMatch":true},{"id":"childPosts","type":"string","display":true,"removed":true,"required":false,"displayName":"childPosts","defaultMatch":false,"canBeUsedToMatch":true},{"id":"ownerFullName","type":"string","display":true,"removed":true,"required":false,"displayName":"ownerFullName","defaultMatch":false,"canBeUsedToMatch":true},{"id":"ownerUsername","type":"string","display":true,"removed":true,"required":false,"displayName":"ownerUsername","defaultMatch":false,"canBeUsedToMatch":true},{"id":"ownerId","type":"string","display":true,"removed":true,"required":false,"displayName":"ownerId","defaultMatch":false,"canBeUsedToMatch":true},{"id":"productType","type":"string","display":true,"removed":true,"required":false,"displayName":"productType","defaultMatch":false,"canBeUsedToMatch":true},{"id":"isSponsored","type":"string","display":true,"removed":true,"required":false,"displayName":"isSponsored","defaultMatch":false,"canBeUsedToMatch":true},{"id":"musicInfo","type":"string","display":true,"removed":true,"required":false,"displayName":"musicInfo","defaultMatch":false,"canBeUsedToMatch":true}],"mappingMode":"defineBelow","matchingColumns":["id"]},"options":{},"operation":"append","sheetName":{"__rl":true,"mode":"list","value":"gid=0","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1e1yIubmEXzzUrSCurXdXM2H6ioN2GEb1aOX5UBNNyik/edit#gid=0","cachedResultName":"Reels"},"documentId":{"__rl":true,"mode":"list","value":"1e1yIubmEXzzUrSCurXdXM2H6ioN2GEb1aOX5UBNNyik","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1e1yIubmEXzzUrSCurXdXM2H6ioN2GEb1aOX5UBNNyik/edit?usp=drivesdk","cachedResultName":"Instagram Reel Database"}},"credentials":{"googleSheetsOAuth2Api":{"id":"EOibXIc4U8wcXyRR","name":"YouTube"}},"typeVersion":4.5},{"id":"d5f3e37e-af9f-4eee-b184-67104708539b","name":"Download Video","type":"n8n-nodes-base.httpRequest","position":[1240,0],"parameters":{"url":"={{ $json.videoUrl }}","options":{}},"typeVersion":4.2},{"id":"be8bc4fc-de39-41e4-bdda-fa6988b4db71","name":"Transcribe Video","type":"@n8n/n8n-nodes-langchain.openAi","position":[1440,0],"parameters":{"options":{},"resource":"audio","operation":"transcribe"},"credentials":{"openAiApi":{"id":"oLLACDYfGm4C4ouV","name":"YouTube "}},"typeVersion":1.6},{"id":"71217539-540a-447d-9890-76b2b6b32986","name":"Search Perplexity","type":"n8n-nodes-base.httpRequest","position":[1980,0],"parameters":{"url":"https://api.perplexity.ai/chat/completions","method":"POST","options":{"redirect":{"redirect":{}}},"jsonBody":"={\n  \"model\": \"sonar-pro\",\n  \"messages\": [\n    {\n      \"role\": \"system\",\n      \"content\": \"Be precise and concise.\"\n    },\n    {\n      \"role\": \"user\",\n      \"content\": \"Tell me three interesting (peculiar) things about {{ $json.message.content.searchPrompt }}\"\n    }\n  ]\n}","sendBody":true,"sendHeaders":true,"specifyBody":"json","headerParameters":{"parameters":[{"name":"accept","value":"application/json"},{"name":"Authorization","value":"Bearer <your-perplexity-api-key-here>"}]}},"typeVersion":4.2},{"id":"3c8706bb-6796-4b02-83a8-b8e39e6e91dd","name":"Write New Script","type":"@n8n/n8n-nodes-langchain.openAi","position":[2180,0],"parameters":{"modelId":{"__rl":true,"mode":"list","value":"gpt-4o","cachedResultName":"GPT-4O"},"options":{"temperature":0.7},"messages":{"values":[{"role":"system","content":"You are a helpful, intelligent writing assistant."},{"content":"I run an AI & automation Instagram channel.\n\nMy editors would like to make a new video. They've found an interesting tool or technology, compiled a step-by-step guide on how to use it, done some searching on the Internet to find some interesting things about it, wrote a rough draft about it, and we also had our chief editor write concrete suggestions for how to make the content better.\n\nYour task is to take as input all of these things, and then write a new, high quality script for us to feature.\n\nReturn your output in JSON using this format:\n\n{\n  \"script\":\"Your script goes here (~100 words).\n}\n\nRules:\n- Use a casual, spartan tone of voice. No frills. Be straightforward, and don't use poetic language.\n- End the script with a call to action like \"Want {thing}? Just comment {keyword} and I'll send it straight to your DMs\",\n- Add newlines as \\n between sentences."},{"content":"={\n  \"toolNames\":\"Speechma\",\n  \"roughDraftScript\":\"Hey there. So, I just wanted to let you know about a AI text-to-speech generator that has recently become available. It’s doesn’t cost anything at all.\\n\\nIt has a lot of voices! And the best part is you don’t need to sign up for an account in order to use it.\\n\\nThe process is really simple, too. You just go the site and type whatever you want converted into speech. There are lots of voices as well.\\n\\nIf this sounds interesting to you, I’d highly recommend giving it a try for yourself. Just leave a comment saying \"texttospeech,\" and I’ll make sure to send you the link so you can check it out firsthand.\",\n  \"perplexityOutput\": \"Here are three interesting things about Speechma, the AI text-to-speech tool:\\n\\n1. Speechma offers over 400 premium AI voices for text-to-speech conversion, allowing users to find the perfect voice for any project[1].\\n\\n2. The platform provides unlimited free usage with no restrictions on the number of conversions, which is unusual for a premium text-to-speech service[1].\\n\\n3. Speechma grants users commercial rights to use the generated audio for any purpose, including YouTube videos, TikTok content, and business presentations[1].\",\n  \"stepByStepGuide\":\"1. Visit the Speechma website.\\n2. Enter or paste your text into the provided text box.\\n3. Browse through the available 400+ voices and select one that fits your needs.\\n4. Choose the desired language from the 60 supported options.\\n5. Click the 'Generate' button to create your AI-generated speech.\\n6. Download or use your AI-generated speech as needed for projects like YouTube videos or TikToks.\",\n  \"suggestionsForImprovement\":\"Create a short tutorial video showing how to use Speechma, emphasizing its free nature and ease of use. Highlight its unlimited features and vast voice selection. Consider doing a voice comparison test using Speechma versus other popular tools. Discuss potential use cases such as content creation for social media, especially focusing on platforms like Instagram and TikTok, highlighting the benefit of rapid content creation using AI automation.\"\n}"},{"role":"assistant","content":"={\n  \"script\":\"Hey—there’s a completely new AI text to speech generator that’s just as good as ElevenLabs, but FREE.\\nIt allows you to choose from over 400 voices, it supports 60 languages, and it’s all completely unlimited with no signup required.\\nJust head over to this website\\nPaste your text\\nChoose one of the voices\\nAnd click generate\\nThat’s it! Your AI speech is now ready to use.\\nYou can use this voice for YouTube videos, TikToks, or whatever you like.\\nSo go try it yourself.\\nJust Comment \"speech\" and I’ll share the link with you.\"\n}"},{"content":"={\n  \"toolNames\":\"{{ $('Filter & Generate Suggestions').item.json.message.content.tools.join() }}\",\n  \"roughDraftScript\":\"{{ $('Transcribe Video').all().first().json.text }}\",\n  \"perplexityOutput\": \"{{ $json.choices[0].message.content }}\",\n  \"stepByStepGuide\":\"{{ $('Filter & Generate Suggestions').item.json.message.content.stepByStep }}\",\n  \"suggestionsForImprovement\":\"{{ $('Filter & Generate Suggestions').item.json.message.content.suggestion }}\"\n}"}]},"jsonOutput":true},"credentials":{"openAiApi":{"id":"kRhXLl2JwVGc05AE","name":"YouTube_Feb 4"}},"typeVersion":1.6},{"id":"c2e95c8b-cd40-45fd-9b4a-3c7a3c2c35c0","name":"Schedule Trigger","type":"n8n-nodes-base.scheduleTrigger","position":[20,0],"parameters":{"rule":{"interval":[{"triggerAtHour":6}]}},"typeVersion":1.2},{"id":"c91557c0-1051-42bd-bdbb-484995bdda84","name":"Update Entries","type":"n8n-nodes-base.googleSheets","position":[2540,0],"parameters":{"columns":{"value":{"id":"={{ $('Add Entries').item.json.id }}","newTranscript":"={{ $json.message.content.script }}","scrapedTranscript":"={{ $('Transcribe Video').item.json.text }}"},"schema":[{"id":"timestamp","type":"string","display":true,"removed":true,"required":false,"displayName":"timestamp","defaultMatch":false,"canBeUsedToMatch":true},{"id":"id","type":"string","display":true,"removed":false,"required":false,"displayName":"id","defaultMatch":true,"canBeUsedToMatch":true},{"id":"shortCode","type":"string","display":true,"removed":true,"required":false,"displayName":"shortCode","defaultMatch":false,"canBeUsedToMatch":true},{"id":"caption","type":"string","display":true,"removed":true,"required":false,"displayName":"caption","defaultMatch":false,"canBeUsedToMatch":true},{"id":"hashtags","type":"string","display":true,"removed":true,"required":false,"displayName":"hashtags","defaultMatch":false,"canBeUsedToMatch":true},{"id":"url","type":"string","display":true,"removed":true,"required":false,"displayName":"url","defaultMatch":false,"canBeUsedToMatch":true},{"id":"commentsCount","type":"string","display":true,"removed":true,"required":false,"displayName":"commentsCount","defaultMatch":false,"canBeUsedToMatch":true},{"id":"firstComment","type":"string","display":true,"removed":true,"required":false,"displayName":"firstComment","defaultMatch":false,"canBeUsedToMatch":true},{"id":"displayUrl","type":"string","display":true,"removed":true,"required":false,"displayName":"displayUrl","defaultMatch":false,"canBeUsedToMatch":true},{"id":"videoUrl","type":"string","display":true,"removed":true,"required":false,"displayName":"videoUrl","defaultMatch":false,"canBeUsedToMatch":true},{"id":"likesCount","type":"string","display":true,"removed":true,"required":false,"displayName":"likesCount","defaultMatch":false,"canBeUsedToMatch":true},{"id":"videoViewCount","type":"string","display":true,"removed":true,"required":false,"displayName":"videoViewCount","defaultMatch":false,"canBeUsedToMatch":true},{"id":"videoPlayCount","type":"string","display":true,"removed":true,"required":false,"displayName":"videoPlayCount","defaultMatch":false,"canBeUsedToMatch":true},{"id":"username","type":"string","display":true,"removed":true,"required":false,"displayName":"username","defaultMatch":false,"canBeUsedToMatch":true},{"id":"videoDuration","type":"string","display":true,"removed":true,"required":false,"displayName":"videoDuration","defaultMatch":false,"canBeUsedToMatch":true},{"id":"scrapedTranscript","type":"string","display":true,"removed":false,"required":false,"displayName":"scrapedTranscript","defaultMatch":false,"canBeUsedToMatch":true},{"id":"newTranscript","type":"string","display":true,"removed":false,"required":false,"displayName":"newTranscript","defaultMatch":false,"canBeUsedToMatch":true},{"id":"inputUrl","type":"string","display":true,"removed":true,"required":false,"displayName":"inputUrl","defaultMatch":false,"canBeUsedToMatch":true},{"id":"type","type":"string","display":true,"removed":true,"required":false,"displayName":"type","defaultMatch":false,"canBeUsedToMatch":true},{"id":"mentions","type":"string","display":true,"removed":true,"required":false,"displayName":"mentions","defaultMatch":false,"canBeUsedToMatch":true},{"id":"latestComments","type":"string","display":true,"removed":true,"required":false,"displayName":"latestComments","defaultMatch":false,"canBeUsedToMatch":true},{"id":"dimensionsHeight","type":"string","display":true,"removed":true,"required":false,"displayName":"dimensionsHeight","defaultMatch":false,"canBeUsedToMatch":true},{"id":"dimensionsWidth","type":"string","display":true,"removed":true,"required":false,"displayName":"dimensionsWidth","defaultMatch":false,"canBeUsedToMatch":true},{"id":"images","type":"string","display":true,"removed":true,"required":false,"displayName":"images","defaultMatch":false,"canBeUsedToMatch":true},{"id":"alt","type":"string","display":true,"removed":true,"required":false,"displayName":"alt","defaultMatch":false,"canBeUsedToMatch":true},{"id":"childPosts","type":"string","display":true,"removed":true,"required":false,"displayName":"childPosts","defaultMatch":false,"canBeUsedToMatch":true},{"id":"ownerFullName","type":"string","display":true,"removed":true,"required":false,"displayName":"ownerFullName","defaultMatch":false,"canBeUsedToMatch":true},{"id":"ownerUsername","type":"string","display":true,"removed":true,"required":false,"displayName":"ownerUsername","defaultMatch":false,"canBeUsedToMatch":true},{"id":"ownerId","type":"string","display":true,"removed":true,"required":false,"displayName":"ownerId","defaultMatch":false,"canBeUsedToMatch":true},{"id":"productType","type":"string","display":true,"removed":true,"required":false,"displayName":"productType","defaultMatch":false,"canBeUsedToMatch":true},{"id":"isSponsored","type":"string","display":true,"removed":true,"required":false,"displayName":"isSponsored","defaultMatch":false,"canBeUsedToMatch":true},{"id":"musicInfo","type":"string","display":true,"removed":true,"required":false,"displayName":"musicInfo","defaultMatch":false,"canBeUsedToMatch":true}],"mappingMode":"defineBelow","matchingColumns":["id"]},"options":{},"operation":"update","sheetName":{"__rl":true,"mode":"list","value":"gid=0","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1e1yIubmEXzzUrSCurXdXM2H6ioN2GEb1aOX5UBNNyik/edit#gid=0","cachedResultName":"Reels"},"documentId":{"__rl":true,"mode":"list","value":"1e1yIubmEXzzUrSCurXdXM2H6ioN2GEb1aOX5UBNNyik","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1e1yIubmEXzzUrSCurXdXM2H6ioN2GEb1aOX5UBNNyik/edit?usp=drivesdk","cachedResultName":"Instagram Reel Database"}},"credentials":{"googleSheetsOAuth2Api":{"id":"EOibXIc4U8wcXyRR","name":"YouTube"}},"typeVersion":4.5}],"active":true,"settings":{"executionOrder":"v1"},"versionId":"e5bf6014-38f0-43a2-be34-025e4291f0b7","connections":{"Limit":{"main":[[{"node":"Search for Entries","type":"main","index":0},{"node":"Drop Duplicates","type":"main","index":1}]]},"Add Entries":{"main":[[{"node":"Download Video","type":"main","index":0}]]},"Download Video":{"main":[[{"node":"Transcribe Video","type":"main","index":0}]]},"Drop Duplicates":{"main":[[{"node":"Add Entries","type":"main","index":0}]]},"Schedule Trigger":{"main":[[{"node":"Run Actor Synchronously","type":"main","index":0}]]},"Transcribe Video":{"main":[[{"node":"Filter & Generate Suggestions","type":"main","index":0}]]},"Write New Script":{"main":[[{"node":"Update Entries","type":"main","index":0}]]},"Search Perplexity":{"main":[[{"node":"Write New Script","type":"main","index":0}]]},"Search for Entries":{"main":[[{"node":"Drop Duplicates","type":"main","index":0}]]},"Run Actor Synchronously":{"main":[[{"node":"Limit","type":"main","index":0}]]},"Filter & Generate Suggestions":{"main":[[{"node":"Search Perplexity","type":"main","index":0}]]}}}


