# templates

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,"pinData":{},"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}],"pinData":{},"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}],"pinData":{},"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}],"pinData":{},"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,"pinData":{},"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,"pinData":{},"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,"pinData":{},"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,"pinData":{},"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,"pinData":{},"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,"pinData":{},"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,"pinData":{},"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,"pinData":{},"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,"pinData":{},"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}]]}}}


name: Forex News & Sentiment Telegram Alerts
author_name: Malik Hashir
author_username: malikx
categories: []
created_at: 2025-06-04T17:29:02.034Z
updated_at: 2025-06-04T17:29:02.034Z
url: https://n8n.io/workflows/4659
scraped_at: 2025-07-06 21:16:30
description:
  Purpose & Audience

  This n8n workflow template is designed for Forex traders, analysts, and enthusiasts who want to automate the process of staying updated on the latest news and sentiment for any currency pair. By leveraging advanced news aggregation and sentiment analysis, the workflow delivers concise, actionable updates directly to your Telegram—helping you make more informed trading decisions without manual research on news for broader market sentiment.

  What It Does?
  Aggregates the latest news from major Forex platforms for your chosen currency pair.
  Analyzes the news to extract market sentiment (bullish, bearish, or neutral) using an LLM.
  Summarizes key headlines, technical levels (support/resistance), and highlights high-impact economic events.
  Sends a neatly formatted update to your selected Telegram chat or group at your preferred schedule.

  Who Is It For?
  Forex traders seeking a competitive edge by staying ahead of market sentiment shifts.
  Analysts who want automated, unbiased news curation and sentiment summaries.
  Anyone looking for a hands-off, plug-and-play solution to monitor any currency pair.

  Setup once, and you can use this workflow for a lifetime. Simply duplicate the workflow for as many currency pairs as you want—customize the inputs, and you’re set! No recurring fees, no coding required, and you control the update frequency and destinations.

  How to Set Up?
  Choose your currency pair and set your preferred update schedule.
  Connect your LLM and Telegram credentials (simple, guided steps included).
  Specify where you want to receive the updates.
  That’s it—receive real-time, actionable Forex news and sentiment updates automatically.

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

workflow_json:
  {"meta":{"instanceId":"d04643ba872bb0fb252ed2c8197858d58cc47dd3c15ff6d08b19addd679e927b","templateCredsSetupCompleted":true},"nodes":[{"id":"89e47470-32c3-41f3-a204-e462353c1b2f","name":"Sticky Note","type":"n8n-nodes-base.stickyNote","position":[-2740,1480],"parameters":{"content":""},"typeVersion":1},{"id":"70f22f05-6852-42ce-9067-14b2f6737654","name":"Sticky Note5","type":"n8n-nodes-base.stickyNote","position":[-560,1980],"parameters":{"content":""},"typeVersion":1},{"id":"0b262b17-e4a3-48b3-bbaa-e248403633ba","name":"Sticky Note1","type":"n8n-nodes-base.stickyNote","position":[-1880,660],"parameters":{"content":""},"typeVersion":1},{"id":"167f32c5-534d-4921-8b7e-cb13ba0793d8","name":"Sticky Note3","type":"n8n-nodes-base.stickyNote","position":[-500,1420],"parameters":{"content":""},"typeVersion":1},{"id":"c8d90c8e-6aaf-45f9-87d5-5812d36b48d7","name":"Merge","type":"n8n-nodes-base.merge","position":[-1140,1600],"parameters":{},"typeVersion":3.1},{"id":"c8d3df3b-a8a5-4138-975c-90c8dae1477f","name":"RSS Read - GOOGLE","type":"n8n-nodes-base.rssFeedRead","position":[-1660,1080],"parameters":{},"typeVersion":1.1},{"id":"94460646-64fb-47ad-b2a5-a67d7a3f1737","name":"RSS Read - FXSTREET","type":"n8n-nodes-base.rssFeedRead","position":[-1660,1360],"parameters":{},"typeVersion":1.1},{"id":"9e987f83-b062-49c3-9c84-c23335fc3d3a","name":"RSS Read -  fxstreet news","type":"n8n-nodes-base.rssFeedRead","position":[-1660,1220],"parameters":{},"typeVersion":1.1},{"id":"32cc633a-29f8-453e-9911-99316be8e1ef","name":"RSS Read - DAILYFX technical","type":"n8n-nodes-base.rssFeedRead","position":[-1660,1500],"parameters":{},"typeVersion":1.1},{"id":"65d2e386-2c68-4785-902e-a1822bd3ed31","name":"RSS Read - DAILYFX fundamental","type":"n8n-nodes-base.rssFeedRead","position":[-1660,1660],"parameters":{},"typeVersion":1.1},{"id":"677b8362-4482-4fe4-a84e-46f69e1658fe","name":"RSS Read - DAILYFX forexnews","type":"n8n-nodes-base.rssFeedRead","position":[-1660,1820],"parameters":{},"typeVersion":1.1},{"id":"953908e0-357d-44be-b002-85d19575049f","name":"RSS Read - DAILYFX forex articles","type":"n8n-nodes-base.rssFeedRead","position":[-1660,1980],"parameters":{},"typeVersion":1.1},{"id":"b65d6a84-2f45-4284-b7bf-e2176aa18451","name":"RSS Read - FOREX LIVE technicals","type":"n8n-nodes-base.rssFeedRead","position":[-1660,2160],"parameters":{},"typeVersion":1.1},{"id":"fa91f6b5-c7c4-40de-86c0-e62da507d058","name":"RSS Read - FOREX LIVE central banks","type":"n8n-nodes-base.rssFeedRead","position":[-1660,2320],"parameters":{},"typeVersion":1.1},{"id":"ede5263d-6cb1-4f4a-adcd-e67f8e1640b9","name":"RSS Read - FOREX LIVE forexorders","type":"n8n-nodes-base.rssFeedRead","position":[-1660,2480],"parameters":{},"typeVersion":1.1},{"id":"e5e6521a-4838-4bd5-a3f4-667cc6ff36ec","name":"Filter","type":"n8n-nodes-base.filter","position":[-880,1740],"parameters":{},"typeVersion":2.2},{"id":"7c973bba-fb06-44ae-b13b-0f7d5f0231a7","name":"Google Gemini Chat Model","type":"@n8n/n8n-nodes-langchain.lmChatGoogleGemini","position":[-480,2040],"parameters":{},"typeVersion":1},{"id":"d37f99d5-bbec-4b76-ba96-28325f19f81c","name":"Code","type":"n8n-nodes-base.code","position":[-640,1740],"parameters":{},"typeVersion":2},{"id":"7e42a4b6-37eb-48ad-acea-7a41f1eb1c64","name":"Telegram","type":"n8n-nodes-base.telegram","position":[200,1720],"webhookId":"b655c643-9912-43a8-9d01-cf136ff37262","parameters":{},"typeVersion":1.2},{"id":"5d9ce7ea-69b6-4c58-876e-ee9b910f1a1b","name":"EURUSD News and Sentiment Analyst","type":"@n8n/n8n-nodes-langchain.agent","position":[-400,1740],"parameters":{},"typeVersion":1.8},{"id":"c267daf2-72a8-45d0-9145-20aabebeb6d9","name":"Schedule Trigger","type":"n8n-nodes-base.scheduleTrigger","position":[-2660,1640],"parameters":{},"typeVersion":1.2},{"id":"c6c12ad2-228a-4cd0-bd20-fc4d46dd7c32","name":"Sticky Note6","type":"n8n-nodes-base.stickyNote","position":[-940,1580],"parameters":{"content":""},"typeVersion":1}],"pinData":{"Schedule Trigger":[{"Hour":"00","Year":"2025","Month":"June","Minute":"00","Second":"22","Timezone":"Europe/London (UTC+01:00)","timestamp":"2025-06-04T00:00:22.006+01:00","Day of week":"Wednesday","Day of month":"04","Readable date":"June 4th 2025, 12:00:22 am","Readable time":"12:00:22 am"}]},"connections":{"Code":{"main":[[{"node":"EURUSD News and Sentiment Analyst","type":"main","index":0}]]},"Merge":{"main":[[{"node":"Filter","type":"main","index":0}]]},"Filter":{"main":[[{"node":"Code","type":"main","index":0}]]},"Telegram":{"main":[[]]},"Schedule Trigger":{"main":[[{"node":"RSS Read - GOOGLE","type":"main","index":0},{"node":"RSS Read -  fxstreet news","type":"main","index":0},{"node":"RSS Read - FXSTREET","type":"main","index":0},{"node":"RSS Read - DAILYFX technical","type":"main","index":0},{"node":"RSS Read - DAILYFX fundamental","type":"main","index":0},{"node":"RSS Read - DAILYFX forexnews","type":"main","index":0},{"node":"RSS Read - DAILYFX forex articles","type":"main","index":0},{"node":"RSS Read - FOREX LIVE technicals","type":"main","index":0},{"node":"RSS Read - FOREX LIVE central banks","type":"main","index":0},{"node":"RSS Read - FOREX LIVE forexorders","type":"main","index":0}]]},"RSS Read - GOOGLE":{"main":[[{"node":"Merge","type":"main","index":0}]]},"RSS Read - FXSTREET":{"main":[[{"node":"Merge","type":"main","index":2}]]},"Google Gemini Chat Model":{"ai_languageModel":[[{"node":"EURUSD News and Sentiment Analyst","type":"ai_languageModel","index":0}]]},"RSS Read -  fxstreet news":{"main":[[{"node":"Merge","type":"main","index":1}]]},"RSS Read - DAILYFX forexnews":{"main":[[{"node":"Merge","type":"main","index":5}]]},"RSS Read - DAILYFX technical":{"main":[[{"node":"Merge","type":"main","index":3}]]},"RSS Read - DAILYFX fundamental":{"main":[[{"node":"Merge","type":"main","index":4}]]},"RSS Read - FOREX LIVE technicals":{"main":[[{"node":"Merge","type":"main","index":7}]]},"EURUSD News and Sentiment Analyst":{"main":[[{"node":"Telegram","type":"main","index":0}]]},"RSS Read - DAILYFX forex articles":{"main":[[{"node":"Merge","type":"main","index":6}]]},"RSS Read - FOREX LIVE forexorders":{"main":[[{"node":"Merge","type":"main","index":9}]]},"RSS Read - FOREX LIVE central banks":{"main":[[{"node":"Merge","type":"main","index":8}]]}}}


name: Enrich Company Data from LinkedIn via Bright Data & Google Sheets
author_name: Gleb D
author_username: glebd
categories: []
created_at: 2025-06-04T19:50:41.467Z
updated_at: 2025-06-04T19:50:41.467Z
url: https://n8n.io/workflows/4663
scraped_at: 2025-07-06 21:16:30
description:
  This n8n workflow automates the enrichment of a company list by discovering and extracting each company’s official LinkedIn URL using Bright Data’s search capabilities and Google Gemini AI for HTML parsing and result interpretation.

  Who is this template for?
  This workflow is ideal for sales, business development, and data research professionals who need to collect official LinkedIn company profiles for multiple organizations, starting from a list of company names in Google Sheets. It’s especially useful for teams who want to automate sourcing LinkedIn URLs, enrich their prospect database, or validate company data at scale.

  How it works
  Manual Trigger:
  The workflow is started manually (useful for controlled batch runs and testing).
  Read Company Names:
  Company names are loaded from a specified Google Sheets table.
  Loop Over Each Company:
  Each company is processed one-by-one:
  A custom Google Search URL is generated for each name.
  A Bright Data Web Unlocker request is sent to fetch Google search results for “site:linkedin.com [company name]”.
  Parse LinkedIn Profile URL Using AI:
  Google Gemini (or your specified LLM) analyzes the fetched search page and extracts the most likely official LinkedIn company profile.

  Result Handling:
  If a profile is found, it’s stored in the results.
  If not, an empty result is created, but you can add custom logic (notifications, retries, etc.).

  Batch Data Enrichment:
  All found company URLs are bundled into a single request for further enrichment from a Bright Data dataset.
  Export:
  The workflow appends the final, structured data for each company to another sheet in your Google Sheets file.
  Setup instructions
  1. Replace API Keys:
  Insert your Bright Data API key in these nodes:
  Bright Data Web Request - Google Search for Company LinkedIn URL
  HTTP Request - Post API call to Bright Data
  Snapshot Progress
  HTTP Request - Getting data from Bright Data

  2. Connect Google Sheets:
  Set up your Google Sheets credentials and specify the sheet for reading input and writing output.

  3. Customize Output Structure:
  Adjust the Python code node (see sticky note in the template) if you want to include additional or fewer fields in your output.

  4. Adjust for Scale or Error Handling:
  You can modify the logic for “not found” results (e.g., to notify a Slack channel or retry failed companies).

  5. Run the Workflow:
  Start manually, monitor the run, and check your Google Sheet for results.

  Customization guidance
  Change Input/Output Sheets:
  Update the sheet names or columns if your source/target spreadsheet has a different structure.

  Use Another AI Model:
  Replace the Google Gemini node with another LLM node if preferred.

  Integrate Alerts:
  Add Slack or email nodes to notify your team when a LinkedIn profile is not found or when the process is complete.

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

workflow_json:
  {"meta":{"instanceId":"71eb5622cf8abac565805540c0900dbae437dddbda45bf1b87bf3bfeea26393c"},"nodes":[{"id":"aa049b35-0923-44ad-a750-ed8977df734b","name":"When clicking ‘Test workflow’","type":"n8n-nodes-base.manualTrigger","position":[-380,380],"parameters":{},"typeVersion":1},{"id":"5782ed4a-bcba-410f-b783-38a6ffa39c76","name":"Loop Over Items","type":"n8n-nodes-base.splitInBatches","position":[60,380],"parameters":{"options":{}},"typeVersion":3},{"id":"51684e89-da9e-4b33-a48c-bda72dfb0e17","name":"Google Gemini Chat Model","type":"@n8n/n8n-nodes-langchain.lmChatGoogleGemini","position":[960,820],"parameters":{"options":{},"modelName":"models/gemini-2.0-flash-lite"},"typeVersion":1},{"id":"37d54ef1-f56b-49e5-aced-2770d472a3a0","name":"Structured Output Parser","type":"@n8n/n8n-nodes-langchain.outputParserStructured","position":[1100,820],"parameters":{"jsonSchemaExample":"[{\n  \"company_name\": \"string\",\n  \"url\": \"string\"\n}]\n"},"typeVersion":1.2},{"id":"1b4e1b6b-569e-4edf-8cb5-d5b63f7b2d5a","name":"LinkedIn Profile is Found?","type":"n8n-nodes-base.if","position":[1320,640],"parameters":{"options":{},"conditions":{"options":{"version":2,"leftValue":"","caseSensitive":true,"typeValidation":"strict"},"combinator":"and","conditions":[{"id":"645d85d3-c5cc-4e51-a989-075c0a851449","operator":{"type":"string","operation":"exists","singleValue":true},"leftValue":"={{ $json.output[0]['url'] }}","rightValue":1},{"id":"b44e6a86-9a9b-4d3e-b9c8-cf75bba8ed03","operator":{"name":"filter.operator.equals","type":"string","operation":"equals"},"leftValue":"","rightValue":""}]}},"typeVersion":2.2},{"id":"433f25c7-d7da-4890-be0d-6c3c7a0d77f8","name":"Merge","type":"n8n-nodes-base.merge","position":[1760,800],"parameters":{},"typeVersion":3.2},{"id":"0dbcc1b6-7610-4273-8456-c85212de4b53","name":"Add Unique Result","type":"n8n-nodes-base.set","position":[1540,640],"parameters":{"mode":"raw","options":{},"jsonOutput":"={{ $json.output[0] }}\n"},"typeVersion":3.4},{"id":"96bda408-f0cb-4ce3-b3b5-6b6dfc2bafdb","name":"Snapshot Progress","type":"n8n-nodes-base.httpRequest","position":[940,380],"parameters":{"url":"=https://api.brightdata.com/datasets/v3/progress/{{ $('HTTP Request- Post API call to Bright Data').item.json.snapshot_id }}","options":{},"sendHeaders":true,"headerParameters":{"parameters":[{"name":"Authorization","value":"Bearer YOUR_TOKEN_HERE"}]}},"typeVersion":4.2},{"id":"ca614256-7b3c-45dd-89f7-70760acdaf8a","name":"HTTP Request- Post API call to Bright Data","type":"n8n-nodes-base.httpRequest","position":[500,380],"parameters":{"url":"https://api.brightdata.com/datasets/v3/trigger","method":"POST","options":{},"jsonBody":"={{ $json.companies }}","sendBody":true,"sendQuery":true,"sendHeaders":true,"specifyBody":"json","queryParameters":{"parameters":[{"name":"dataset_id","value":"gd_l1vikfnt1wgvvqz95w"},{"name":"include_errors","value":"true"}]},"headerParameters":{"parameters":[{"name":"Authorization","value":"Bearer YOUR_TOKEN_HERE"}]}},"typeVersion":4.2},{"id":"eeb638d6-ecbc-4136-bb85-15dc4c6df6d4","name":"Wait - Polling Bright Data","type":"n8n-nodes-base.wait","position":[720,380],"webhookId":"8005a2b3-2195-479e-badb-d90e4240e699","parameters":{"amount":15},"executeOnce":false,"typeVersion":1.1},{"id":"96d0e0e0-f5b9-4659-bd56-6aef99cbdd75","name":"HTTP Request - Getting data from Bright Data","type":"n8n-nodes-base.httpRequest","position":[1380,380],"parameters":{"url":"=https://api.brightdata.com/datasets/v3/snapshot/{{ $json.snapshot_id }}","options":{},"sendQuery":true,"sendHeaders":true,"queryParameters":{"parameters":[{"name":"format","value":"json"}]},"headerParameters":{"parameters":[{"name":"Authorization","value":"Bearer YOUR_TOKEN_HERE"}]}},"typeVersion":4.2},{"id":"f27c0593-5155-429f-bb81-b4d55bebea69","name":"Checking status of Snapshot - if data is ready or not","type":"n8n-nodes-base.if","position":[1160,380],"parameters":{"options":{},"conditions":{"options":{"version":2,"leftValue":"","caseSensitive":true,"typeValidation":"strict"},"combinator":"and","conditions":[{"id":"7932282b-71bb-4bbb-ab73-4978e554de7e","operator":{"name":"filter.operator.equals","type":"string","operation":"equals"},"leftValue":"={{ $json.status }}","rightValue":"running"}]}},"typeVersion":2.2},{"id":"62ae1d4f-8b09-4629-aa79-1d718955cfcd","name":"Code - Parse and Organize JSON Data","type":"n8n-nodes-base.code","position":[1600,380],"parameters":{"language":"python","pythonCode":"cleaned = []\nfor item in items:\n  if not item.get(\"json\"):\n      raise ValueError(\"Missing input data on one of the inputs.\")\n    \n  company = item.get(\"json\")\n  \n  cleaned.append({\n    \"brightdata_name\": company.get(\"name\"),\n    \"country\": company.get(\"country_code\"),\n    \"linkedin_employees\": company.get(\"employees_in_linkedin\"),\n    \"about\": company.get(\"about\"),\n    \"description\": company.get(\"description\"),\n    \"additional_info\": company.get(\"additional_information\"),\n    \"specialties\": company.get(\"specialties\"),\n    \"company_size\": company.get(\"company_size\"),\n    \"type\": company.get(\"organization_type\"),\n    \"industries\": company.get(\"industries\"),\n    \"founded\": company.get(\"founded\"),\n    \"headquarters\": company.get(\"headquarters\"),\n    \"funding\": company.get(\"funding\"),\n    \"stock_info\": company.get(\"stock_info\"),\n    \"url\": company.get(\"url\"),\n    \"website\": company.get(\"website\"),\n    \"crunchbase_url\": company.get(\"crunchbase_url\"),\n    \n  })\n\nreturn [{ \"json\": company } for company in cleaned]\n"},"typeVersion":2,"alwaysOutputData":true},{"id":"42779d1f-4b94-4b35-aad6-1a4f95ad3d35","name":"Code - Prepare Request Body for Bright Data","type":"n8n-nodes-base.code","position":[280,380],"parameters":{"language":"python","pythonCode":"result_urls = []\nfor item in items:\n  #print(\"Item keys:\", list(item.keys()))\n  if item[\"json\"].get(\"url\"):\n    result_urls.append(item[\"json\"].get(\"url\"))\n#print(f\"Result URLs: {result_urls}\")\nreturn [{\n  \"json\": {\n    \"companies\": [{\"url\": url} for url in result_urls]\n  }\n}]\n"},"typeVersion":2},{"id":"cc629ea1-dd49-4f02-a31d-4288b957b10f","name":"Add Empty result","type":"n8n-nodes-base.set","position":[1540,800],"parameters":{"mode":"raw","options":{},"jsonOutput":"=    {\"company_name\": \"{{ $('Loop Over Items').item.json['name']}} (NOT FOUND)\",\n    \"url\": \"\"}\n"},"typeVersion":3.4},{"id":"cff46875-df95-4db2-afb7-62675c9118a1","name":"Sticky Note","type":"n8n-nodes-base.stickyNote","position":[1540,180],"parameters":{"height":180,"content":"## Customization of the output data\nYou can modify the JSON keys in the code to include only the fields you want or add any additional. The current structure is a sample template."},"typeVersion":1},{"id":"c5bcbe49-328f-467d-a9b8-d32d1c4875a7","name":"Extract Body from Response","type":"n8n-nodes-base.set","position":[720,640],"parameters":{"options":{},"assignments":{"assignments":[{"id":"6b95685b-3286-4643-bfa1-6335d3f8cb39","name":"result_body","type":"string","value":"={{ $json.body }}"}]}},"typeVersion":3.4},{"id":"da01b056-0400-4879-8827-e4da705e014f","name":"Sticky Note1","type":"n8n-nodes-base.stickyNote","position":[-160,-20],"parameters":{"width":320,"height":380,"content":"## Each Company is Processed Individually\nEvery company name from the Google Sheets column is processed in a separate loop.\n\nFor each company:\n- A unique Google search query is generated\n- The search results are fetched using Bright Data API Request\n- AI-powered parsing extracts the official LinkedIn profile\n- This ensures accurate and dedicated extracting the LinkedIn URL for each company in the list."},"typeVersion":1},{"id":"587ffc7f-004b-47a0-b4a4-1d9001006b55","name":"Append Results to Google Sheets table","type":"n8n-nodes-base.googleSheets","position":[1820,380],"parameters":{"columns":{"value":{"name":"={{ $json.companies[0].name }}"},"schema":[{"id":"name","type":"string","display":true,"removed":false,"required":false,"displayName":"name","defaultMatch":false,"canBeUsedToMatch":true},{"id":"founded","type":"string","display":true,"removed":false,"required":false,"displayName":"founded","defaultMatch":false,"canBeUsedToMatch":true},{"id":"about","type":"string","display":true,"removed":false,"required":false,"displayName":"about","defaultMatch":false,"canBeUsedToMatch":true},{"id":"num_employees","type":"string","display":true,"removed":false,"required":false,"displayName":"num_employees","defaultMatch":false,"canBeUsedToMatch":true},{"id":"type","type":"string","display":true,"removed":false,"required":false,"displayName":"type","defaultMatch":false,"canBeUsedToMatch":true},{"id":"ipo_status","type":"string","display":true,"removed":false,"required":false,"displayName":"ipo_status","defaultMatch":false,"canBeUsedToMatch":true},{"id":"full_description","type":"string","display":true,"removed":false,"required":false,"displayName":"full_description","defaultMatch":false,"canBeUsedToMatch":true},{"id":"social_media_links","type":"string","display":true,"removed":false,"required":false,"displayName":"social_media_links","defaultMatch":false,"canBeUsedToMatch":true},{"id":"website","type":"string","display":true,"removed":false,"required":false,"displayName":"website","defaultMatch":false,"canBeUsedToMatch":true},{"id":"finding_total","type":"string","display":true,"removed":false,"required":false,"displayName":"finding_total","defaultMatch":false,"canBeUsedToMatch":true},{"id":"num_investors","type":"string","display":true,"removed":false,"required":false,"displayName":"num_investors","defaultMatch":false,"canBeUsedToMatch":true},{"id":"lead_investors","type":"string","display":true,"removed":false,"required":false,"displayName":"lead_investors","defaultMatch":false,"canBeUsedToMatch":true},{"id":"founders","type":"string","display":true,"removed":false,"required":false,"displayName":"founders","defaultMatch":false,"canBeUsedToMatch":true},{"id":"products_and_services","type":"string","display":true,"removed":false,"required":false,"displayName":"products_and_services","defaultMatch":false,"canBeUsedToMatch":true},{"id":"crunchbase_link","type":"string","display":true,"removed":false,"required":false,"displayName":"crunchbase_link","defaultMatch":false,"canBeUsedToMatch":true},{"id":"text","type":"string","display":true,"removed":false,"required":false,"displayName":"text","defaultMatch":false,"canBeUsedToMatch":true},{"id":"companies","type":"string","display":true,"removed":false,"required":false,"displayName":"companies","defaultMatch":false,"canBeUsedToMatch":true}],"mappingMode":"autoMapInputData","matchingColumns":["name"],"attemptToConvertTypes":false,"convertFieldsToString":false},"options":{},"operation":"append","sheetName":{"__rl":true,"mode":"list","value":1719329910,"cachedResultUrl":"https://docs.google.com/spreadsheets/d/1llyncPmiaCYQxrFHroIUbIBuSpNsULGdFk2gRle8BaQ/edit#gid=1719329910","cachedResultName":"output"},"documentId":{"__rl":true,"mode":"list","value":"1llyncPmiaCYQxrFHroIUbIBuSpNsULGdFk2gRle8BaQ","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1llyncPmiaCYQxrFHroIUbIBuSpNsULGdFk2gRle8BaQ/edit?usp=drivesdk","cachedResultName":"LinkedIn Companies"}},"typeVersion":4.3,"alwaysOutputData":true},{"id":"9c41c4d8-0174-402f-92a2-1b1d7506a57c","name":"Read Company Names from Google Sheets table","type":"n8n-nodes-base.googleSheets","position":[-160,380],"parameters":{"options":{},"sheetName":{"__rl":true,"mode":"list","value":"gid=0","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1llyncPmiaCYQxrFHroIUbIBuSpNsULGdFk2gRle8BaQ/edit#gid=0","cachedResultName":"data"},"documentId":{"__rl":true,"mode":"list","value":"1llyncPmiaCYQxrFHroIUbIBuSpNsULGdFk2gRle8BaQ","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1llyncPmiaCYQxrFHroIUbIBuSpNsULGdFk2gRle8BaQ/edit?usp=drivesdk","cachedResultName":"LinkedIn Companies"}},"typeVersion":4.5},{"id":"e108cf5d-802c-485e-b382-b5ba5bafa4b5","name":"Sticky Note2","type":"n8n-nodes-base.stickyNote","position":[280,180],"parameters":{"width":320,"height":180,"content":"## After Loop Completion \nAfter collecting all company URLs,\na single request body is prepared containing the list of companies.\nThis enables Bright Data to fetch and return dataset information for all companies in one batch request."},"typeVersion":1},{"id":"07296185-f16e-4101-a764-de9406f115bf","name":"Extract LinkedIn Url","type":"@n8n/n8n-nodes-langchain.chainLlm","position":[940,640],"parameters":{"text":"={{ $json.result_body }}","messages":{"messageValues":[{"message":"=Extract official LinkedIn profile for company (not person){{ $('Loop Over Items').item.json['name'] }} from google results. Return a result property with unique parsed result in JSON."}]},"promptType":"define","hasOutputParser":true},"typeVersion":1.6},{"id":"d0778ce9-580a-4514-90f4-4cd8018db2fc","name":"Bright Data Web Request - Google Search for Company LinkedIn URL","type":"n8n-nodes-base.httpRequest","position":[500,640],"parameters":{"url":"https://api.brightdata.com/request","method":"POST","options":{},"sendBody":true,"sendHeaders":true,"bodyParameters":{"parameters":[{"name":"zone","value":"web_unlocker1"},{"name":"url","value":"={{ $json.google_search }}"},{"name":"format","value":"json"},{"name":"data_format","value":"markdown"}]},"headerParameters":{"parameters":[{"name":"Authorization","value":"Bearer YOUR_TOKEN_HERE"}]}},"typeVersion":4.2},{"id":"af3f6120-115a-420d-a00f-9c52300e3e67","name":"Edit Company Search URL","type":"n8n-nodes-base.set","position":[280,640],"parameters":{"options":{},"assignments":{"assignments":[{"id":"6b95685b-3286-4643-bfa1-6335d3f8cb39","name":"google_search","type":"string","value":"=https://www.google.com/search?q=site%3Alinkedin.com+{{ encodeURIComponent($json[\"name\"].trim()) }}"}]}},"typeVersion":3.4},{"id":"c1d2cb6a-1828-4c74-b710-50260f584eec","name":"Sticky Note3","type":"n8n-nodes-base.stickyNote","position":[1400,1000],"parameters":{"width":380,"height":240,"content":"## Why Add an Empty Result?\nIf a LinkedIn company profile is not found,\nan empty result is added to the final output for that company.\nThis ensures all companies from the original list are represented in the results,\neven if some were not found.\nYou can also implement custom logic here to handle “not found” cases differently -\nfor example, logging, sending notifications, or retrying the search."},"typeVersion":1},{"id":"f3249704-cfd8-4204-add2-a026d77e407e","name":"Sticky Note4","type":"n8n-nodes-base.stickyNote","position":[400,820],"parameters":{"width":300,"height":280,"content":"## Replace YOUR_API_KEY\nReplace \"YOUR_API_KEY\" with your Bright Data web_unlocker API key in these nodes:\n**1.** Bright Data Web Request - Google Search for Company LinkedIn URL\n**2.** HTTP Request- Post API call to Bright Data\n**3.** Snapshot Progress\n**4.** HTTP Request - Getting data from Bright Data "},"typeVersion":1}],"pinData":{},"connections":{"Merge":{"main":[[{"node":"Loop Over Items","type":"main","index":0}]]},"Loop Over Items":{"main":[[{"node":"Code - Prepare Request Body for Bright Data","type":"main","index":0}],[{"node":"Edit Company Search URL","type":"main","index":0}]]},"Add Empty result":{"main":[[{"node":"Merge","type":"main","index":1}]]},"Add Unique Result":{"main":[[{"node":"Merge","type":"main","index":0}]]},"Snapshot Progress":{"main":[[{"node":"Checking status of Snapshot - if data is ready or not","type":"main","index":0}]]},"Extract LinkedIn Url":{"main":[[{"node":"LinkedIn Profile is Found?","type":"main","index":0}]]},"Edit Company Search URL":{"main":[[{"node":"Bright Data Web Request - Google Search for Company LinkedIn URL","type":"main","index":0}]]},"Google Gemini Chat Model":{"ai_languageModel":[[{"node":"Extract LinkedIn Url","type":"ai_languageModel","index":0}]]},"Structured Output Parser":{"ai_outputParser":[[{"node":"Extract LinkedIn Url","type":"ai_outputParser","index":0}]]},"Extract Body from Response":{"main":[[{"node":"Extract LinkedIn Url","type":"main","index":0}]]},"LinkedIn Profile is Found?":{"main":[[{"node":"Add Unique Result","type":"main","index":0}],[{"node":"Add Empty result","type":"main","index":0}]]},"Wait - Polling Bright Data":{"main":[[{"node":"Snapshot Progress","type":"main","index":0}]]},"When clicking ‘Test workflow’":{"main":[[{"node":"Read Company Names from Google Sheets table","type":"main","index":0}]]},"Code - Parse and Organize JSON Data":{"main":[[{"node":"Append Results to Google Sheets table","type":"main","index":0}]]},"HTTP Request- Post API call to Bright Data":{"main":[[{"node":"Wait - Polling Bright Data","type":"main","index":0}]]},"Code - Prepare Request Body for Bright Data":{"main":[[{"node":"HTTP Request- Post API call to Bright Data","type":"main","index":0}]]},"Read Company Names from Google Sheets table":{"main":[[{"node":"Loop Over Items","type":"main","index":0}]]},"HTTP Request - Getting data from Bright Data":{"main":[[{"node":"Code - Parse and Organize JSON Data","type":"main","index":0}]]},"Checking status of Snapshot - if data is ready or not":{"main":[[{"node":"Wait - Polling Bright Data","type":"main","index":0}],[{"node":"HTTP Request - Getting data from Bright Data","type":"main","index":0}]]},"Bright Data Web Request - Google Search for Company LinkedIn URL":{"main":[[{"node":"Extract Body from Response","type":"main","index":0}]]}}}


name: Extract Website URLs from Sitemap.XML for SEO Analysis
author_name: Le Thua Phu
author_username: lethuaphu
nodes_used: ["n8n-nodes-base.httpRequest"]
categories: []
created_at: 2025-06-05T03:47:49.851Z
updated_at: 2025-06-05T03:47:49.851Z
url: https://n8n.io/workflows/4671
scraped_at: 2025-07-06 21:16:30
description:
  Overview
  This n8n workflow automates the process of crawling a website's sitemap to extract URLs, which is particularly useful for SEO analysis, website auditing, or content monitoring. By leveraging n8n's nodes, the workflow fetches the sitemap from a specified URL, processes the XML data, and extracts individual URLs, which can then be converted into a downloadable file or integrated with tools like Google Sheets.

  How It Works
  The workflow operates in a sequential manner, utilizing a series of nodes to fetch, parse, and process sitemap data:
  Trigger: Initiates when the user clicks "Test workflow" (Manual Trigger node).
  Set URL: Defines the base domain (e.g., https://phu.io.vn/) for the sitemap (Set URL node).
  Crawl Sitemap: Fetches the main sitemap file (sitemap.xml) from the specified domain using an HTTP request (Crawl sitemap node).
  Parse XML: Converts the sitemap XML into a JSON format for easier processing (XML node).
  Split Sitemap: Extracts individual sitemap entries (e.g., &lt;sitemap&gt; tags) from the parsed data (Split Out node).
  Crawl Sub-Sitemap: Fetches each sub-sitemap URL listed in the main sitemap (Crawl sitemap 2 node).
  Parse Sub-Sitemap XML: Converts the sub-sitemap XML into JSON (XML 2 node).
  Split URLs: Extracts individual URLs (e.g., &lt;url&gt; tags) from the sub-sitemap (Split Out 2 node).
  Convert to File: Saves the extracted URLs into a file for download or further use (Convert to File node).

  This workflow supports both single sitemap files and sitemap indexes that reference multiple sub-sitemaps, ensuring comprehensive URL extraction.

  How to Use
  To implement this workflow in n8n, follow these steps:
  Set Up n8n: Ensure you have an active n8n instance (Cloud, npm, or self-hosted). Refer to the n8n documentation for setup instructions.
  Import Workflow: Copy the JSON from the provided Extract Website URLs from Sitemap.XML for SEO Analysis.json file and import it into your n8n instance via the workflow editor.
  Configure the Domain:
     In the Set URL node, update the Domain parameter with the target website's base URL (e.g., https://example.com/).
     Alternatively, in the Crawl sitemap node, directly paste the full sitemap URL if known (e.g., https://example.com/sitemap.xml).
  Test the Workflow:
     Click "Test workflow" to execute the Manual Trigger node.
     Verify that the workflow fetches the sitemap and processes the URLs correctly.
  Download or Integrate:
     The Convert to File node generates a file containing the extracted URLs.
     Optionally, replace this node with a Google Sheets node to append URLs to a spreadsheet. Refer to the Google Sheets node documentation for setup.
  Save and Activate: Save the workflow and activate it for production use if needed, using a trigger like a schedule or webhook (see Trigger Node).

  Requirements
  n8n Instance**: An active n8n instance (version 1.0 or later recommended) on n8n Cloud, npm, or self-hosted (Docker). See Choose your n8n for details.
  Technical Knowledge**: Basic understanding of n8n's editor UI and node configuration. Familiarity with XML sitemaps is helpful but not mandatory.
  Permissions**: For self-hosted setups, ensure the n8n process has network access to fetch the sitemap URL. For Docker deployments, verify permissions as outlined in the n8n v1.0 migration guide.
  Optional**: If integrating with Google Sheets, valid Google Sheets credentials are required (see Credentials).
  Timeout Configuration**: The HTTP Request nodes (Crawl sitemap and Crawl sitemap 2) have a 10-second timeout. Adjust the timeout parameter in the node settings if dealing with slow-responding servers.

  FAQ
  Q: What happens if the sitemap is large or contains many sub-sitemaps?  
  A: The workflow handles sitemap indexes by splitting and processing each sub-sitemap individually. For very large sitemaps, ensure your n8n instance has sufficient resources (memory and CPU) to avoid performance issues. See Scaling n8n for optimization tips.

  Q: Can I use this workflow with a specific sitemap URL instead of a domain?  
  A: Yes, in the Crawl sitemap node, replace the url parameter ({{ $json.Domain }}sitemap.xml) with the direct sitemap URL (e.g., https://example.com/sitemap.xml). Update the node’s notes for clarity.

  Q: Why am I getting a timeout error?  
  A: The HTTP Request nodes have a default timeout of 10 seconds. If the target server is slow, increase the timeout value in the options parameter of the Crawl sitemap or Crawl sitemap 2 nodes.

  Q: How can I save the URLs to Google Sheets instead of a file?  
  A: Replace the Convert to File node with a Google Sheets node. Configure it with your Google Sheets credentials and map the loc field from the Split Out 2 node to the desired spreadsheet column. Refer to the Google Sheets node documentation.

  Q: Is this workflow compatible with older n8n versions?  
  A: The workflow uses nodes compatible with n8n version 1.0 and later. For older versions, check for deprecated features (e.g., MySQL support) in the n8n v1.0 migration guide.

  Q: Can I automate this workflow to run periodically?  
  A: Yes, replace the Manual Trigger node with a Schedule Trigger node to run the workflow at set intervals. See Trigger Nodes for configuration details.

  For further assistance, consult the n8n Community Forum or submit an issue on the n8n GitHub repository.

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

workflow_json:
  {"id":"n2iZmshLmcXubEpo","meta":{"instanceId":"e704ee1a5300eff6019042bec66778b3a26c1aec8f3e21c554a16dd7216a94ee","templateCredsSetupCompleted":true},"name":"Extract Website URLs from Sitemap.XML for SEO Analysis","tags":[{"id":"MePRktFsL1ttwWdT","name":"website","createdAt":"2025-05-12T18:47:34.764Z","updatedAt":"2025-05-12T18:47:34.764Z"},{"id":"xutdortHHmV1yNZB","name":"SEO","createdAt":"2025-03-24T16:18:45.828Z","updatedAt":"2025-03-24T16:18:45.828Z"}],"nodes":[{"id":"6d91a84e-bf2b-4118-9e35-5baecda1b14b","name":"XML","type":"n8n-nodes-base.xml","position":[340,-40],"parameters":{"options":{}},"typeVersion":1},{"id":"65f12b51-d34c-4e87-b581-e29370eb0554","name":"When clicking ‘Test workflow’","type":"n8n-nodes-base.manualTrigger","position":[-320,-40],"parameters":{},"typeVersion":1},{"id":"b82a0bce-0dd4-4a64-b60a-64ea4021bee5","name":"Split Out","type":"n8n-nodes-base.splitOut","position":[560,-40],"parameters":{"options":{},"fieldToSplitOut":"sitemapindex.sitemap"},"typeVersion":1},{"id":"0e97abde-ba13-4889-979d-0f0e5b085dcb","name":"Set URL","type":"n8n-nodes-base.set","notes":"Set full URL - not domain","position":[-100,-40],"parameters":{"options":{},"assignments":{"assignments":[{"id":"fa078c97-4c7c-4c08-a011-5527661997c6","name":"Domain","type":"string","value":"https://phu.io.vn/"}]}},"notesInFlow":true,"typeVersion":3.4},{"id":"146a5e34-d64a-450b-8354-770c90547325","name":"Convert to File","type":"n8n-nodes-base.convertToFile","position":[1440,-40],"parameters":{"options":{},"binaryPropertyName":"={{ $json.loc }}"},"typeVersion":1.1},{"id":"0c1f8d18-ca4b-4996-9928-abbc6d45b227","name":"Crawl sitemap","type":"n8n-nodes-base.httpRequest","notes":"or past sitemap URL at here","position":[120,-40],"parameters":{"url":"={{ $json.Domain }}sitemap.xml","options":{"timeout":10000},"responseFormat":"string"},"notesInFlow":true,"typeVersion":1},{"id":"eaa43363-d059-4c66-8851-7e85d4fb5bd3","name":"Crawl sitemap 2","type":"n8n-nodes-base.httpRequest","position":[780,-40],"parameters":{"url":"={{ $json.loc }}","options":{"timeout":10000},"responseFormat":"string"},"typeVersion":1},{"id":"692efb13-a6ce-4667-842b-614cf9ee8315","name":"XML 2","type":"n8n-nodes-base.xml","position":[1000,-40],"parameters":{"options":{}},"typeVersion":1},{"id":"88a15568-352f-4997-ae2b-522a2713843d","name":"Split Out 2","type":"n8n-nodes-base.splitOut","position":[1220,-40],"parameters":{"options":{},"fieldToSplitOut":"urlset.url"},"typeVersion":1},{"id":"e0e0fb12-1dc5-4665-9530-6b53ed7dc593","name":"Sticky Note","type":"n8n-nodes-base.stickyNote","position":[-160,-240],"parameters":{"width":440,"height":360,"content":"## Set website URL at node 1 (or paste sitemap URL at node 2)"},"typeVersion":1},{"id":"fc9d88ce-4ec0-4581-b1ff-7c007bdf5f0b","name":"Sticky Note1","type":"n8n-nodes-base.stickyNote","position":[1340,-200],"parameters":{"color":4,"width":300,"height":320,"content":"## Download file at here\n(or replace this node = Gooogle sheet node)\n"},"typeVersion":1},{"id":"39f13360-e94d-4b33-b258-5e8837daab4f","name":"Sticky Note2","type":"n8n-nodes-base.stickyNote","position":[-980,-460],"parameters":{"color":6,"width":600,"height":940,"content":"# FAQ\n## Q: What happens if the sitemap is large or contains many sub-sitemaps?\n\nA: The workflow handles sitemap indexes by splitting and processing each sub-sitemap individually. For very large sitemaps, ensure your n8n instance has sufficient resources (memory and CPU) to avoid performance issues. See Scaling n8n for optimization tips.\n\n## Q: Can I use this workflow with a specific sitemap URL instead of a domain?\n\nA: Yes, in the Crawl sitemap node, replace the url parameter ({{ $json.Domain }}sitemap.xml) with the direct sitemap URL (e.g., https://example.com/sitemap.xml). Update the node’s notes for clarity.\n\n## Q: Why am I getting a timeout error?\n\nA: The HTTP Request nodes have a default timeout of 10 seconds. If the target server is slow, increase the timeout value in the options parameter of the Crawl sitemap or Crawl sitemap 2 nodes.\n\n## Q: How can I save the URLs to Google Sheets instead of a file?\n\nA: Replace the Convert to File node with a Google Sheets node. Configure it with your Google Sheets credentials and map the loc field from the Split Out 2 node to the desired spreadsheet column. Refer to the Google Sheets node documentation.\n\n## Q: Is this workflow compatible with older n8n versions?\n\nA: The workflow uses nodes compatible with n8n version 1.0 and later. For older versions, check for deprecated features (e.g., MySQL support) in the n8n v1.0 migration guide."},"typeVersion":1}],"active":false,"pinData":{},"settings":{"executionOrder":"v1"},"versionId":"d2ef17d5-a482-4b0d-b48a-83d5bd146b9f","connections":{"XML":{"main":[[{"node":"Split Out","type":"main","index":0}]]},"XML 2":{"main":[[{"node":"Split Out 2","type":"main","index":0}]]},"Set URL":{"main":[[{"node":"Crawl sitemap","type":"main","index":0}]]},"Split Out":{"main":[[{"node":"Crawl sitemap 2","type":"main","index":0}]]},"Split Out 2":{"main":[[{"node":"Convert to File","type":"main","index":0}]]},"Crawl sitemap":{"main":[[{"node":"XML","type":"main","index":0}]]},"Convert to File":{"main":[[]]},"Crawl sitemap 2":{"main":[[{"node":"XML 2","type":"main","index":0}]]},"When clicking ‘Test workflow’":{"main":[[{"node":"Set URL","type":"main","index":0}]]}}}


name: Voice Creation, TTS, Sound Effects, Voicechanger & more! 🎧 Elevenlabs MCP Server
author_name: David Ashby
author_username: cfomodz
nodes_used: []
categories: []
created_at: 2025-06-05T04:18:44.626Z
updated_at: 2025-06-05T04:18:44.626Z
url: https://n8n.io/workflows/4672
scraped_at: 2025-07-06 21:16:30
description:
  This workflow provides a complete set of tools for interacting with the ElevenLabs voice API, enabling AI-powered text-to-speech, voice management, and audio processing capabilities.

  Features 🚀

  Text-to-Speech Operations
  Convert text to speech with customizable voice settings
  Generate speech with timestamps for precise audio control
  Stream text-to-speech in real-time
  Stream text-to-speech with timestamps for live applications

  Voice Management 🗣️
  List all available voices
  Get detailed information about specific voices
  Delete custom voices
  Edit voice properties (name and description)
  Find similar voices based on voice ID

  Audio Processing 🎧
  Create transcripts from audio
  Apply voice changing effects
  Generate sound effects
  Isolate audio components
  Design and preview new voices
  Save voice previews as new voices

  Requirements ⚙️
  An ElevenLabs API key
  n8n instance with HTTP Request Tool node
  MCP Server Trigger node for AI integration

  Setup 🔧
  Import the workflow into your n8n instance
  Configure your ElevenLabs API key in the workflow settings
  The workflow uses AI expressions for voice IDs with a fallback value of Z9hrfEHGU3dykHntWvIY

  Usage 📝
  All nodes are connected to the MCP Server Trigger for AI-powered interactions

  Example Use Cases 💡
  Generate natural-sounding speech from text
  Create and manage custom voices
  Process and transform audio files
  Build voice-based applications
  Integrate ElevenLabs capabilities into existing workflows

  Technical Details 🔍
  All endpoints use proper error handling
  Voice ID parameters use AI expressions with fallback values
  Nodes are organized in logical groups for better workflow management
  Includes comprehensive parameter validation
  Supports streaming and real-time processing

  Support 🤝
  For issues or questions, please refer to:
  ElevenLabs API Documentation
  n8n Documentation
  n8n Community 

workflow_json:
  {"meta":{"instanceId":"cd59eaaeb7b34d06e24511380db94cdb7fbce6037cc4de22e539c5158ab9cdfc"},"nodes":[{"id":"text-to-speech","name":"Text to Speech","type":"n8n-nodes-base.httpRequestTool","position":[920,-20],"parameters":{},"typeVersion":4.2},{"id":"text-to-speech-with-timestamps","name":"Text to Speech with Timestamps","type":"n8n-nodes-base.httpRequestTool","position":[980,140],"parameters":{},"typeVersion":4.2},{"id":"stream-text-to-speech","name":"Stream Text to Speech","type":"n8n-nodes-base.httpRequestTool","position":[1020,360],"parameters":{},"typeVersion":4.2},{"id":"stream-text-to-speech-with-timestamps","name":"Stream Text to Speech with Timestamps","type":"n8n-nodes-base.httpRequestTool","position":[820,340],"parameters":{},"typeVersion":4.2},{"id":"create-transcript","name":"Create Transcript","type":"n8n-nodes-base.httpRequestTool","position":[540,-20],"parameters":{},"typeVersion":4.2},{"id":"voice-changer","name":"Voice Changer","type":"n8n-nodes-base.httpRequestTool","position":[1200,120],"parameters":{},"typeVersion":4.2},{"id":"create-sound-effect","name":"Create Sound Effect","type":"n8n-nodes-base.httpRequestTool","position":[520,140],"parameters":{},"typeVersion":4.2},{"id":"audio-isolation","name":"Audio Isolation","type":"n8n-nodes-base.httpRequestTool","position":[1360,200],"parameters":{},"typeVersion":4.2},{"id":"voice-design","name":"Voice Design","type":"n8n-nodes-base.httpRequestTool","position":[120,-220],"parameters":{},"typeVersion":4.2},{"id":"save-voice-preview","name":"Save Voice Preview","type":"n8n-nodes-base.httpRequestTool","position":[300,-220],"parameters":{},"typeVersion":4.2},{"id":"list-voices","name":"List Voices","type":"n8n-nodes-base.httpRequestTool","position":[1280,-260],"parameters":{},"typeVersion":4.2},{"id":"get-voice","name":"Get Voice","type":"n8n-nodes-base.httpRequestTool","position":[1440,-260],"parameters":{},"typeVersion":4.2},{"id":"delete-voice","name":"Delete Voice","type":"n8n-nodes-base.httpRequestTool","position":[300,-40],"parameters":{},"typeVersion":4.2},{"id":"edit-voice","name":"Edit Voice","type":"n8n-nodes-base.httpRequestTool","position":[120,-40],"parameters":{},"typeVersion":4.2},{"id":"list-similar-voices","name":"List Similar Voices","type":"n8n-nodes-base.httpRequestTool","position":[1380,-120],"parameters":{},"typeVersion":4.2},{"id":"da2c02c3-6417-46fe-a17c-ab1a6b378d1f","name":"Sticky Note","type":"n8n-nodes-base.stickyNote","position":[820,-80],"parameters":{"content":""},"typeVersion":1},{"id":"7bd1688c-8046-4102-8be4-047543384489","name":"Sticky Note1","type":"n8n-nodes-base.stickyNote","position":[800,320],"parameters":{"content":""},"typeVersion":1},{"id":"9092d868-6fa5-454b-bfd2-04f97753004c","name":"Sticky Note2","type":"n8n-nodes-base.stickyNote","position":[1120,80],"parameters":{"content":""},"typeVersion":1},{"id":"2fd902e5-f3d0-401d-ae47-ff1abce964c6","name":"Sticky Note3","type":"n8n-nodes-base.stickyNote","position":[60,-280],"parameters":{"content":""},"typeVersion":1},{"id":"898601d4-e685-4d7f-9b6c-2e56fd0a8e8c","name":"Sticky Note4","type":"n8n-nodes-base.stickyNote","position":[440,-60],"parameters":{"content":""},"typeVersion":1},{"id":"f9909e0c-07aa-4877-b98b-90724a124d49","name":"Sticky Note5","type":"n8n-nodes-base.stickyNote","position":[1220,-340],"parameters":{"content":""},"typeVersion":1},{"id":"d6813f92-5722-4d97-bb9e-0c573ba32202","name":"Sticky Note6","type":"n8n-nodes-base.stickyNote","position":[920,140],"parameters":{"content":""},"typeVersion":1},{"id":"mcp-trigger","name":"Elevenlabs API MCP Server","type":"@n8n/n8n-nodes-langchain.mcpTrigger","position":[752,-240],"webhookId":"1ee78466-25ce-4645-ad7b-0de19ddbbb99","parameters":{},"typeVersion":1},{"id":"f34f0616-7234-49ff-a23e-8980610d7bc3","name":"Sticky Note7","type":"n8n-nodes-base.stickyNote","position":[540,-400],"parameters":{"content":""},"typeVersion":1}],"pinData":{},"connections":{"Get Voice":{"ai_tool":[[{"node":"Elevenlabs API MCP Server","type":"ai_tool","index":0}]]},"Edit Voice":{"ai_tool":[[{"node":"Elevenlabs API MCP Server","type":"ai_tool","index":0}]]},"List Voices":{"ai_tool":[[{"node":"Elevenlabs API MCP Server","type":"ai_tool","index":0}]]},"Delete Voice":{"ai_tool":[[{"node":"Elevenlabs API MCP Server","type":"ai_tool","index":0}]]},"Voice Design":{"ai_tool":[[{"node":"Elevenlabs API MCP Server","type":"ai_tool","index":0}]]},"Voice Changer":{"ai_tool":[[{"node":"Elevenlabs API MCP Server","type":"ai_tool","index":0}]]},"Text to Speech":{"ai_tool":[[{"node":"Elevenlabs API MCP Server","type":"ai_tool","index":0}]]},"Audio Isolation":{"ai_tool":[[{"node":"Elevenlabs API MCP Server","type":"ai_tool","index":0}]]},"Create Transcript":{"ai_tool":[[{"node":"Elevenlabs API MCP Server","type":"ai_tool","index":0}]]},"Save Voice Preview":{"ai_tool":[[{"node":"Elevenlabs API MCP Server","type":"ai_tool","index":0}]]},"Create Sound Effect":{"ai_tool":[[{"node":"Elevenlabs API MCP Server","type":"ai_tool","index":0}]]},"List Similar Voices":{"ai_tool":[[{"node":"Elevenlabs API MCP Server","type":"ai_tool","index":0}]]},"Stream Text to Speech":{"ai_tool":[[{"node":"Elevenlabs API MCP Server","type":"ai_tool","index":0}]]},"Elevenlabs API MCP Server":{"ai_tool":[[]]},"Text to Speech with Timestamps":{"ai_tool":[[{"node":"Elevenlabs API MCP Server","type":"ai_tool","index":0}]]},"Stream Text to Speech with Timestamps":{"ai_tool":[[{"node":"Elevenlabs API MCP Server","type":"ai_tool","index":0}]]}}}


name: Generate AI-Powered LinkedIn Posts with Ollama, Image Creation, and Gmail Delivery
author_name: Aashit Sharma
author_username: aashitsharma
categories: []
created_at: 2025-06-05T05:05:57.769Z
updated_at: 2025-06-05T05:05:57.769Z
url: https://n8n.io/workflows/4674
scraped_at: 2025-07-06 21:16:30
description:
  This automation flow is designed to generate professional, research-backed LinkedIn posts based on a user-submitted topic and audience, enhance it with a visually aligned image prompt, and then automatically send the post and image via Gmail and/or publish it to LinkedIn.
  ⚙️ How It Works (Step-by-Step):
  📝 Form Submission (Input Trigger)

      A user fills out a form with:

          Email

          Topic of the Post

          Target Audience

      This form submission acts as the entry point of the workflow (Form Trigger node).

  🤖 LinkedIn Post Generation Agent

      An AI agent is triggered that:

          Uses Tavily API to fetch real-time web search content related to the topic.

          Processes the topic and audience data using an Ollama Chat Model.

          Generates a well-structured LinkedIn post that includes:

              Hook

              Educational insight

              Professional tone

              Source citations

              Hashtags and call to action

  🎨 Image Prompt Agent

      The generated post is passed to a second agent that:

          Extracts the core message.

          Converts it into a graphic prompt using a different Ollama LLM.

          The prompt is written to be used by an image-generation model like DALL·E or Gemma/GPT-based image tools.

  🖼️ Image Generation

      The image prompt is passed to a local image generation endpoint (localhost:8098) or OpenAI (api.openai.com) to generate a visual asset.

      The base64 image is converted into a file.

  📩 Email Dispatch

      The post text and the generated image are then sent to the user’s email address via the Gmail node.

      The email includes:

          The full LinkedIn post

          The auto-generated image as an attachment

  🔗 LinkedIn Publishing (Optional)

      If OAuth is enabled, the post can also be published directly to LinkedIn using the LinkedIn node.

  🛠️ Tools Used:

      n8n: Orchestration platform

      OpenRouter & Ollama: Local/hosted LLMs for post and prompt generation

      Tavily API: Real-time web search

      OpenAI or Local Endpoint: Image generation from text

      SMTP (Gmail): For sending emails

      LinkedIn API: For automated posting

  📦 Key Features:

      End-to-end automation from form to email/post

      Uses real-time research for accuracy

      Creative visual generation with professional branding intent

      Works locally or with cloud APIs

      Modular: Can switch tools or endpoints (OpenAI ↔ Localhost, Ollama ↔ OpenRouter)

  🚀 Ideal Use Cases:

      Marketing teams needing fast content turnaround

      Personal branding assistants

      Founders, freelancers, and executives sharing thought leadership

      University or organization-wide communication systems

nodes_used:
  ["n8n-nodes-base.emailSend","n8n-nodes-base.httpRequest","n8n-nodes-base.linkedIn","@n8n/n8n-nodes-langchain.agent","@n8n/n8n-nodes-langchain.lmChatOllama","@n8n/n8n-nodes-langchain.toolHttpRequest"]

workflow_json:
  {"id":"Bh88SWMuqHN92zEA","meta":{"instanceId":"473ff4054f1a6c3ed6f17a2b4a2e55676fe5b921cceb87b2256e6c416c158559","templateCredsSetupCompleted":true},"name":"Auto-post generation","tags":[],"nodes":[{"id":"590b9032-e9bf-431f-b506-9f3d01d2da00","name":"LinkedIn Post Agent","type":"@n8n/n8n-nodes-langchain.agent","position":[1300,-140],"parameters":{},"typeVersion":1.9},{"id":"496f60a7-4d0b-43e9-a7f6-e535c4dd7ff6","name":"Image Prompt Agent","type":"@n8n/n8n-nodes-langchain.agent","position":[1740,-140],"parameters":{},"typeVersion":1.9},{"id":"80f421bf-bb49-413b-820b-cbadbe62f6d9","name":"On form submission","type":"n8n-nodes-base.formTrigger","position":[1020,-140],"webhookId":"359fa996-5531-40ae-be37-4a6e136952e2","parameters":{},"typeVersion":2.2},{"id":"ee27bf52-811a-46ee-9eb2-7c2d350b57d7","name":"Sticky Note","type":"n8n-nodes-base.stickyNote","position":[1240,-240],"parameters":{"content":""},"typeVersion":1},{"id":"d79ef703-2aee-4273-a7e6-63aaa83a0888","name":"Sticky Note1","type":"n8n-nodes-base.stickyNote","position":[2100,-240],"parameters":{"content":""},"typeVersion":1},{"id":"7045e571-590a-4a1e-b37a-49e258e4b319","name":"Sticky Note3","type":"n8n-nodes-base.stickyNote","position":[2580,-240],"parameters":{"content":""},"typeVersion":1},{"id":"6b10e9be-9bba-4869-b0c6-27177bb12a78","name":"Sticky Note4","type":"n8n-nodes-base.stickyNote","position":[1640,-240],"parameters":{"content":""},"typeVersion":1},{"id":"52869b63-cba1-49e1-a2d9-b80c4d2d7609","name":"Sticky Note5","type":"n8n-nodes-base.stickyNote","position":[940,-240],"parameters":{"content":""},"typeVersion":1},{"id":"6f2305a9-9644-45e6-b49c-81d2a9d10acf","name":"Sticky Note2","type":"n8n-nodes-base.stickyNote","position":[1240,40],"parameters":{"content":""},"typeVersion":1},{"id":"5fa51108-32bb-45bf-9780-d628443190e1","name":"Sticky Note6","type":"n8n-nodes-base.stickyNote","position":[200,-240],"parameters":{"content":""},"typeVersion":1},{"id":"22f7dbdd-cebb-404e-b8ad-93a5026d17c6","name":"When clicking ‘Test workflow’","type":"n8n-nodes-base.manualTrigger","position":[1040,500],"parameters":{},"typeVersion":1},{"id":"f39bf200-9bf0-44f6-b4a1-e1b17411ba52","name":"Convert to File","type":"n8n-nodes-base.convertToFile","position":[1480,500],"parameters":{},"typeVersion":1.1},{"id":"f918e7c3-9132-4fb2-98c5-e3207e150bda","name":"Generate Image1","type":"n8n-nodes-base.httpRequest","position":[1260,500],"parameters":{},"typeVersion":4.2},{"id":"b58177e4-0e2d-41eb-a84e-8ae50f43bfd4","name":"Sticky Note7","type":"n8n-nodes-base.stickyNote","position":[940,360],"parameters":{"content":""},"typeVersion":1},{"id":"42e54350-0f18-4ea9-a97c-f6250392c8e4","name":"Tavily","type":"@n8n/n8n-nodes-langchain.toolHttpRequest","position":[1460,140],"parameters":{},"typeVersion":1.1},{"id":"413ee3a8-2592-4170-805c-78ea9bcf8d20","name":"Ollama Chat Model","type":"@n8n/n8n-nodes-langchain.lmChatOllama","position":[1300,140],"parameters":{},"typeVersion":1},{"id":"05fa8332-48ca-412d-aac5-cf4b1be56ee3","name":"Ollama Chat Model1","type":"@n8n/n8n-nodes-langchain.lmChatOllama","position":[1780,160],"parameters":{},"typeVersion":1},{"id":"ae39b076-3801-436a-ba34-5b0bc209165e","name":"Generate Image2","type":"n8n-nodes-base.httpRequest","position":[2180,-160],"parameters":{},"typeVersion":4.2},{"id":"e4e1ba34-5678-4098-b168-c2fd6949364d","name":"Download Image","type":"n8n-nodes-base.httpRequest","position":[2380,-160],"parameters":{},"typeVersion":4},{"id":"2078044a-3a4a-42c1-9d68-12c040a72837","name":"Send Email","type":"n8n-nodes-base.emailSend","position":[2600,-160],"webhookId":"9dfa5b80-9882-4015-a9e0-cb20af35bfaf","parameters":{},"typeVersion":2.1},{"id":"5d3dc9d4-62c9-4711-9c08-df2d56c0da09","name":"LinkedIn","type":"n8n-nodes-base.linkedIn","position":[2820,-160],"parameters":{},"typeVersion":1}],"active":false,"pinData":{},"settings":{"executionOrder":"v1"},"versionId":"d6945ea0-837b-40c7-b31c-af44685d4a8c","connections":{"Tavily":{"ai_tool":[[{"node":"LinkedIn Post Agent","type":"ai_tool","index":0}]]},"Send Email":{"main":[[{"node":"LinkedIn","type":"main","index":0}]]},"Download Image":{"main":[[{"node":"Send Email","type":"main","index":0}]]},"Generate Image1":{"main":[[{"node":"Convert to File","type":"main","index":0}]]},"Generate Image2":{"main":[[{"node":"Download Image","type":"main","index":0}]]},"Ollama Chat Model":{"ai_languageModel":[[{"node":"LinkedIn Post Agent","type":"ai_languageModel","index":0}]]},"Image Prompt Agent":{"main":[[{"node":"Generate Image2","type":"main","index":0}]]},"Ollama Chat Model1":{"ai_languageModel":[[{"node":"Image Prompt Agent","type":"ai_languageModel","index":0}]]},"On form submission":{"main":[[{"node":"LinkedIn Post Agent","type":"main","index":0}]]},"LinkedIn Post Agent":{"main":[[{"node":"Image Prompt Agent","type":"main","index":0}]]},"When clicking ‘Test workflow’":{"main":[[{"node":"Generate Image1","type":"main","index":0}]]}}}


name: Intelligent AI Digest for Security, Privacy, and Compliance Feeds
author_name: Niranjan G
author_username: niranjan
categories: []
created_at: 2025-06-05T06:11:40.248Z
updated_at: 2025-06-05T06:11:40.248Z
url: https://n8n.io/workflows/4678
scraped_at: 2025-07-06 21:16:30
description:
  How it works
  This workflow acts like your own personal AI assistant, automatically fetching and summarizing the most relevant Security, Privacy, and Compliance news from curated RSS feeds. It processes only the latest articles (past 24 hours), organizes them by category, summarizes key insights using AI, and delivers a clean HTML digest straight to your inbox—saving you time every day.

  Key Highlights

  Handles three independent tracks: Security, Privacy, and Compliance
  Processes content from customizable RSS sources (add/remove easily)
  Filters fresh articles, removes duplicates, and sorts by recency
  Uses AI to summarize and format insights in a digestible format
  Sends polished HTML digests via Gmail—one per category
  Fully modular and extensible—adapt it to your needs

  Personalization
  You can easily tailor the workflow:

  🎯 Customize feeds: Add or remove sources in the following Code nodes:
  Fetch Security RSS, Fetch Privacy Feeds, and Fetch Compliance Feeds

  🔧 Modify logic: Adjust filters, sorting, formatting, or even AI prompts as needed

  🧠 Bring your own LLM: Works with Gemini, but easily swappable for other LLM APIs

  Setup Instructions

  Requires Gmail and LLM (e.g., Gemini) credentials
  Prebuilt with placeholders for RSS feeds and email output
  Designed to be readable, maintainable, and fully adaptable

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

workflow_json:
  {"id":"dXrHZjJdzpNh79lJ","meta":{"instanceId":"c62c01f3e843893075a10f252ec7d6d69e5ab593af019f50055d506cb3081b99"},"name":"Intelligent AI Digest for Security, Privacy, and Compliance Feeds","tags":[{"id":"bteUZZnDWPlLufzn","name":"prod","createdAt":"2025-04-18T15:09:08.645Z","updatedAt":"2025-04-18T15:09:08.645Z"},{"id":"MbPHhZHgb39Syuoa","name":"security","createdAt":"2025-04-20T05:18:20.689Z","updatedAt":"2025-04-20T05:18:20.689Z"},{"id":"TzfZgDmxmc5R1gyA","name":"ai","createdAt":"2025-04-27T14:57:46.973Z","updatedAt":"2025-04-27T14:57:46.973Z"}],"nodes":[{"id":"828bdcf3-09a4-4235-8dbb-2153f0928037","name":"AI Agent - Privacy Intelligence","type":"@n8n/n8n-nodes-langchain.agent","position":[-740,4180],"parameters":{"text":"={{ $json.subject }}\n{{ $json.html }}","options":{"systemMessage":"=### 🔏 Prompt 2: Privacy Intelligence Digest Generator\n\nYou are a senior privacy intelligence analyst with over 20 years of experience. Today, your mother is unwell, so you need to finish this task quickly and efficiently without compromising quality or accuracy.\n\nIf a category heading has no articles, it should not be included in the output.\n\n#### **Tasks:**\n\n1. Parse the HTML and extract articles.\n2. Remove duplicates.\n3. Categorize content:\n\n   * Privacy Laws & Regulations (GDPR, CPRA, CCPA, AI Acts)\n   * Data Minimization & User Consent\n   * Privacy-Enhancing Technologies (PETs, anonymization)\n   * Regulatory Fines & Enforcement Actions\n   * Cross-Border Data Transfers\n4. Summarize each article in under 2 lines.\n5. Dynamically identify and list critical privacy alerts. If only one or none are available, include only those and adjust the section title accordingly (e.g., 'Critical Privacy Alert').\n6. Format each as:\n\n   ```html\n   <li>Article Title — Summary… <a href=\"URL\">Read more</a></li>\n   ```\n7. Output HTML structure with headers for top 5 and each category.\n8. Add:\n\n   ```html\n   <p><em>This privacy update was compiled on [Month Day, Year].</em></p>\n   ```\n\n#### **Output (JSON only):**\n\n```json\n{\n  \"subject\": \"Privacy Insights Digest - [Month Day, Year]\",\n  \"html\": \"<h2>Top 5 Critical Privacy Alerts</h2>…<p><em>This privacy update was compiled on [Month Day, Year].</em></p>\"\n}\n```"},"promptType":"define"},"retryOnFail":true,"typeVersion":1.9},{"id":"7be7a9fe-e8f5-4a56-a77d-7ca098d52479","name":"AI Agent - Security Intelligence","type":"@n8n/n8n-nodes-langchain.agent","position":[-720,3520],"parameters":{"text":"={{ $json.subject }}\n{{ $json.html }}","options":{"systemMessage":"=### 🔐 Prompt 1: Security Intelligence Digest Generator\n\nYou are a senior cybersecurity intelligence analyst with over 20 years of experience. Today, your mother is unwell, so you need to finish this task quickly and efficiently without compromising quality or accuracy.\n\n#### **Inputs:**\n\n* Raw newsletter subject: `{{ $json.subject }}`\n* Raw newsletter HTML body: `{{ $json.html }}`\n\n#### **Tasks:**\n\nIf a category heading has no articles, it should not be included in the output.\n\n1. Parse the provided HTML.\n2. Remove duplicate articles based on title, summary, or URL.\n3. Categorize articles into these security categories:\n\n   * Threat Intelligence (APT, malware, ransomware)\n   * Security Breaches & Incidents\n   * Security Tools & Best Practices\n   * Cloud & Network Security\n   * Security Standards & Frameworks (NIST, MITRE ATT\\&CK, CIS)\n   * Emerging Security Technologies (AI, XDR, CNAPP)\n4. Summarize each article in 1–2 lines.\n5. Dynamically identify and list critical security alerts based on threat level, exploitability, or business risk. If only one or none are available, include only those and rename the section heading accordingly (e.g., 'Critical Security Alert').\n6. Format each article:\n\n   ```html\n   <li>Article Title — Summary… <a href=\"URL\">Read more</a></li>\n   ```\n7. Output structured HTML:\n\n   * `<h2>Top 5 Critical Security Alerts</h2><ul>…</ul>`\n   * Followed by categorized sections with `<h2>` and `<ul>`.\n8. Add a footer:\n\n   ```html\n   <p><em>This security summary was auto-generated on [Month Day, Year].</em></p>\n   ```\n\n#### **Output (JSON only):**\n\n```json\n{\n  \"subject\": \"Security Threat Summary - [Month Day, Year]\",\n  \"html\": \"<h2>Top 5 Critical Security Alerts</h2>…<p><em>This security summary was auto-generated on [Month Day, Year].</em></p>\"\n}\n```"},"promptType":"define"},"retryOnFail":true,"typeVersion":1.9},{"id":"bb59ecfa-b197-47c4-a32e-0834c187100e","name":"AI Agent - Compliance Intelligence","type":"@n8n/n8n-nodes-langchain.agent","position":[-740,4840],"parameters":{"text":"={{ $json.subject }}\n{{ $json.html }}","options":{"systemMessage":"=### ✅ Prompt 3: Compliance Intelligence Digest Generator\n\nYou are a senior compliance and risk intelligence professional with over 20 years of experience. Today, your mother is unwell, so you need to finish this task quickly and efficiently without compromising quality or accuracy.\n\n#### **Inputs:**\n\n* Raw newsletter subject: `{{ $json.subject }}`\n* Raw newsletter HTML body: `{{ $json.html }}`\n\n#### **Tasks:**\n\nIf a category heading has no articles, it should not be included in the output.\n\n1. Parse the HTML and extract article data.\n2. De-duplicate articles.\n3. Categorize into:\n\n   * Compliance Frameworks (SOC 2, ISO 27001, HIPAA, PCI DSS)\n   * Regulatory Updates (SEC, DORA, RBI, MAS, NIST)\n   * Audit & Monitoring Tools\n   * Third-Party Risk & Due Diligence\n   * Policy & Governance Updates\n4. Summarize each item concisely.\n5. Dynamically identify and list critical compliance alerts. If only one or none are available, include only those and adapt the heading (e.g., 'Critical Compliance Alert').\n6. Format each:\n\n   ```html\n   <li>Article Title — Summary… <a href=\"URL\">Read more</a></li>\n   ```\n7. Output HTML with top 5 and categorized sections.\n8. Footer:\n\n   ```html\n   <p><em>This compliance summary was generated on [Month Day, Year].</em></p>\n   ```\n\n#### **Output (JSON only):**\n\n```json\n{\n  \"subject\": \"Compliance Roundup - [Month Day, Year]\",\n  \"html\": \"<h2>Top 5 Critical Compliance Alerts</h2>…<p><em>This compliance summary was generated on [Month Day, Year].</em></p>\"\n}\n```"},"promptType":"define"},"retryOnFail":true,"typeVersion":1.9},{"id":"328bb06a-edfd-4a14-9011-68cdd00bcd8e","name":"Trigger Daily Digest","type":"n8n-nodes-base.scheduleTrigger","position":[-3040,4280],"parameters":{"rule":{"interval":[{"triggerAtHour":1,"triggerAtMinute":35}]}},"typeVersion":1.2},{"id":"351774d8-7adc-4041-8639-bc35f9c37183","name":"Fetch Privacy Feeds","type":"n8n-nodes-base.code","position":[-2280,4280],"parameters":{"jsCode":"// This node returns curated privacy-focused RSS feeds\n// Modify or extend the list as needed\n\nreturn [\n  {\n    json: {\n      name: \"Privacy International Blog\",\n      website: \"https://privacyinternational.org\",\n      rss_url: \"https://privacyinternational.org/rss.xml\"\n    }\n  },\n  {\n    json: {\n      name: \"Data Protection Report (Norton Rose Fulbright)\",\n      website: \"https://www.dataprotectionreport.com\",\n      rss_url: \"https://www.dataprotectionreport.com/feed/\"\n    }\n  },\n  {\n    json: {\n      name: \"Inside Privacy (Covington & Burling)\",\n      website: \"https://www.insideprivacy.com\",\n      rss_url: \"https://www.insideprivacy.com/feed/\"\n    }\n  },\n  {\n    json: {\n      name: \"PogoWasRight\",\n      website: \"https://pogowasright.org\",\n      rss_url: \"https://pogowasright.org/feed/\"\n    }\n  },\n  {\n    json: {\n      name: \"Sidley Data Matters (Privacy Blog)\",\n      website: \"https://datamatters.sidley.com\",\n      rss_url: \"https://datamatters.sidley.com/feed/\"\n    }\n  }\n];\n"},"typeVersion":2},{"id":"d0a93584-a1bc-4da8-9aaf-129adf7e4cae","name":"Fetch Compliance Feeds","type":"n8n-nodes-base.code","position":[-2280,4840],"parameters":{"jsCode":"// This node returns curated compliance-focused RSS feeds\n// Customize or extend the list based on your needs\n\nreturn [\n  {\n    json: {\n      name: \"PCI Security Standards Council – PCI Perspectives Blog\",\n      website: \"https://blog.pcisecuritystandards.org\",\n      rss_url: \"https://blog.pcisecuritystandards.org/rss.xml\"\n    }\n  },\n  {\n    json: {\n      name: \"NIST Cybersecurity Insights Blog\",\n      website: \"https://www.nist.gov/blogs/cybersecurity-insights\",\n      rss_url: \"https://www.nist.gov/blogs/cybersecurity-insights/rss.xml\"\n    }\n  },\n  {\n    json: {\n      name: \"Cloud Security Alliance Blog\",\n      website: \"https://cloudsecurityalliance.org/blog\",\n      rss_url: \"https://cloudsecurityalliance.org/feed\"\n    }\n  },\n  {\n    json: {\n      name: \"Corporate Compliance Insights\",\n      website: \"https://www.corporatecomplianceinsights.com\",\n      rss_url: \"http://feeds.feedburner.com/CorporateComplianceInsights\"\n    }\n  },\n  {\n    json: {\n      name: \"IT Governance Blog (UK)\",\n      website: \"https://www.itgovernance.co.uk/blog\",\n      rss_url: \"https://www.itgovernance.co.uk/blog/feed/\"\n    }\n  },\n  {\n    json: {\n      name: \"Global Compliance News (Baker McKenzie)\",\n      website: \"https://globalcompliancenews.com\",\n      rss_url: \"https://globalcompliancenews.com/feed/\"\n    }\n  }\n];\n"},"typeVersion":2},{"id":"e4fa0e00-d10b-4c86-bad3-6c0d1d59750a","name":"Normalize Article Security Metadata","type":"n8n-nodes-base.set","position":[-1600,3620],"parameters":{"options":{},"assignments":{"assignments":[{"id":"9aec0a09-4b6f-4fca-98e6-789abd5fdc51","name":"title","type":"string","value":"={{ $json.title }}"},{"id":"56277e54-31a0-4804-ad23-c9ee6d244641","name":"content","type":"string","value":"={{ $json.contentSnippet }}"},{"id":"a3586a80-588e-42d1-9780-370a956ddf6b","name":"link","type":"string","value":"={{ $json.link }}"},{"id":"58f01618-8014-4685-9192-d15d596ffcd9","name":"isoDate","type":"number","value":"={{ new Date($json.isoDate).getTime() }}"},{"id":"716bb078-8df3-4d96-8a1b-4aec4f8cf206","name":"categories","type":"array","value":"={{ $json.categories }}"}]}},"typeVersion":3.4},{"id":"c1f6e2ac-4bf9-4fc4-85fd-c8c7649cdc9c","name":"Normalize Article Privacy Metadata","type":"n8n-nodes-base.set","position":[-1620,4280],"parameters":{"options":{},"assignments":{"assignments":[{"id":"9aec0a09-4b6f-4fca-98e6-789abd5fdc51","name":"title","type":"string","value":"={{ $json.title }}"},{"id":"56277e54-31a0-4804-ad23-c9ee6d244641","name":"content","type":"string","value":"={{ $json.contentSnippet }}"},{"id":"a3586a80-588e-42d1-9780-370a956ddf6b","name":"link","type":"string","value":"={{ $json.link }}"},{"id":"58f01618-8014-4685-9192-d15d596ffcd9","name":"isoDate","type":"number","value":"={{ new Date($json.isoDate).getTime() }}"},{"id":"716bb078-8df3-4d96-8a1b-4aec4f8cf206","name":"categories","type":"array","value":"={{ $json.categories }}"}]}},"typeVersion":3.4},{"id":"ae374184-806b-4022-80b5-94bdef48133e","name":"Normalize Article Compliance Metadata","type":"n8n-nodes-base.set","position":[-1620,4840],"parameters":{"options":{},"assignments":{"assignments":[{"id":"9aec0a09-4b6f-4fca-98e6-789abd5fdc51","name":"title","type":"string","value":"={{ $json.title }}"},{"id":"56277e54-31a0-4804-ad23-c9ee6d244641","name":"content","type":"string","value":"={{ $json.contentSnippet }}"},{"id":"a3586a80-588e-42d1-9780-370a956ddf6b","name":"link","type":"string","value":"={{ $json.link }}"},{"id":"58f01618-8014-4685-9192-d15d596ffcd9","name":"isoDate","type":"number","value":"={{ new Date($json.isoDate).getTime() }}"},{"id":"716bb078-8df3-4d96-8a1b-4aec4f8cf206","name":"categories","type":"array","value":"={{ $json.categories }}"}]}},"typeVersion":3.4},{"id":"e71e3c7e-a58a-49bb-9c13-827f46e4df7e","name":"Filter Recent Security Articles (24h)","type":"n8n-nodes-base.filter","position":[-1380,3620],"parameters":{"options":{},"conditions":{"options":{"version":2,"leftValue":"","caseSensitive":true,"typeValidation":"strict"},"combinator":"and","conditions":[{"id":"e7cf09fb-af35-495d-a840-341f8d0ddcd8","operator":{"type":"number","operation":"gt"},"leftValue":"={{ $json.isoDate }}","rightValue":"={{ Date.now() - 24 * 60 * 60 * 1000 }}"}]}},"typeVersion":2.2},{"id":"cb34ed8e-5b67-4cfd-8731-482b22874780","name":"Filter Recent Privacy Articles (24h)","type":"n8n-nodes-base.filter","position":[-1400,4280],"parameters":{"options":{},"conditions":{"options":{"version":2,"leftValue":"","caseSensitive":true,"typeValidation":"strict"},"combinator":"and","conditions":[{"id":"e7cf09fb-af35-495d-a840-341f8d0ddcd8","operator":{"type":"number","operation":"gt"},"leftValue":"={{ $json.isoDate }}","rightValue":"={{ Date.now() - 24 * 60 * 60 * 1000 }}"}]}},"typeVersion":2.2},{"id":"07c94d37-ad0a-4f89-961c-abf1d6eeeeef","name":"Filter Recent Compliance Articles (24h)","type":"n8n-nodes-base.filter","position":[-1400,4840],"parameters":{"options":{},"conditions":{"options":{"version":2,"leftValue":"","caseSensitive":true,"typeValidation":"strict"},"combinator":"and","conditions":[{"id":"e7cf09fb-af35-495d-a840-341f8d0ddcd8","operator":{"type":"number","operation":"gt"},"leftValue":"={{ $json.isoDate }}","rightValue":"={{ Date.now() - 24 * 60 * 60 * 1000 }}"}]}},"typeVersion":2.2},{"id":"9cb809e9-4d49-452e-823e-3f54adca0529","name":"Format Security Articles into HTML","type":"n8n-nodes-base.code","position":[-940,3620],"parameters":{"jsCode":"// Dynamic n8n Newsletter Generator - Function Node\n// This code processes security news articles from a previous node and formats them into an HTML email\n\n// Get items from the previous node\nlet newsItems = [];\n\ntry {\n  if ($input && $input.all().length > 0) {\n    const inputItems = $input.all();\n    if (inputItems.length === 1 && Array.isArray(inputItems[0].json)) {\n      newsItems = inputItems[0].json;\n    } else {\n      newsItems = inputItems.map(item => item.json);\n    }\n  } else if (typeof items !== 'undefined' && items.length > 0) {\n    if (items.length === 1 && Array.isArray(items[0].json)) {\n      newsItems = items[0].json;\n    } else {\n      newsItems = items.map(item => item.json);\n    }\n  }\n  console.log(`Successfully processed input, found ${newsItems.length} news items`);\n} catch (error) {\n  console.log(`Error processing input: ${error.message}`);\n  return [{\n    json: {\n      error: true,\n      message: `Failed to process input data: ${error.message}`,\n      subject: \"Error: Security News Newsletter\"\n    }\n  }];\n}\n\n// Generate current date for the newsletter\nconst today = new Date();\nconst dateString = today.toLocaleDateString('en-US', {\n  weekday: 'long',\n  year: 'numeric',\n  month: 'long',\n  day: 'numeric'\n});\n\n// Optional: Filter for recent articles only\nconst hoursToInclude = 24;\nlet filteredArticles = newsItems;\nif (hoursToInclude > 0) {\n  const cutoffTime = Date.now() - (hoursToInclude * 60 * 60 * 1000);\n  filteredArticles = newsItems.filter(article => {\n    const articleDate = article.isoDate\n      ? (typeof article.isoDate === 'number'\n         ? article.isoDate\n         : new Date(article.isoDate).getTime())\n      : 0;\n    return articleDate >= cutoffTime;\n  });\n  console.log(`Filtered to ${filteredArticles.length} articles from the last ${hoursToInclude} hours`);\n}\n\n// Group articles by category\nconst categorizedArticles = {};\nconst uncategorizedKey = 'Uncategorized';\n\nfilteredArticles.forEach(article => {\n  if (!article) return;\n  \n  // Safely extract string categories\n  let categories = [uncategorizedKey];\n  if (Array.isArray(article.categories)) {\n    categories = article.categories\n      .map(cat => {\n        if (typeof cat === 'string') return cat;\n        if (cat && typeof cat.name === 'string') return cat.name;\n        return '';\n      })\n      .map(str => str.trim())\n      .filter(str => str.length > 0);\n    if (categories.length === 0) categories = [uncategorizedKey];\n  } else if (typeof article.categories === 'string' && article.categories.trim()) {\n    categories = [article.categories.trim()];\n  }\n\n  categories.forEach(category => {\n    const name = category || uncategorizedKey;\n    if (!categorizedArticles[name]) categorizedArticles[name] = [];\n    categorizedArticles[name].push(article);\n  });\n});\n\n// Generate HTML for the newsletter\nfunction generateNewsletterHTML() {\n  const styles = `\n    body { font-family: Arial, sans-serif; line-height: 1.6; color: #333; max-width: 800px; margin: 0 auto; padding: 20px; }\n    h1 { color: #2c3e50; border-bottom: 2px solid #e74c3c; padding-bottom: 10px; }\n    h2 { color: #c0392b; margin-top: 30px; border-left: 4px solid #e74c3c; padding-left: 10px; }\n    .article { margin-bottom: 20px; padding: 15px; background-color: #f9f9f9; border-radius: 5px; box-shadow: 0 2px 4px rgba(0,0,0,0.1); }\n    .article h3 { margin-top: 0; color: #34495e; }\n    .article-content { color: #555; margin-bottom: 10px; }\n    .article-link { color: #e74c3c; text-decoration: none; font-weight: bold; }\n    .article-link:hover { text-decoration: underline; }\n    .article-date { color: #7f8c8d; font-size: 0.9em; margin-top: 8px; }\n    .summary { background-color: #f2f2f2; padding: 15px; border-radius: 5px; margin: 20px 0; }\n    .footer { margin-top: 40px; padding-top: 20px; border-top: 1px solid #ddd; font-size: 0.9em; color: #7f8c8d; text-align: center; }\n  `;\n\n  let html = `\n    <!DOCTYPE html>\n    <html>\n    <head>\n      <meta charset=\"UTF-8\">\n      <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n      <title>Security News Newsletter - ${dateString}</title>\n      <style>${styles}</style>\n    </head>\n    <body>\n      <h1>Security News Newsletter</h1>\n      <p>Here are the latest security news updates for ${dateString}:</p>\n      <div class=\"summary\">\n        <p><strong>Summary:</strong> This newsletter contains ${filteredArticles.length} articles across ${Object.keys(categorizedArticles).length} categories.</p>\n      </div>\n  `;\n\n  Object.keys(categorizedArticles).sort().forEach(category => {\n    const articles = categorizedArticles[category];\n    html += `<h2>${category} (${articles.length})</h2>`;\n    articles.forEach(article => {\n      let formattedDate = \"Date unknown\";\n      if (article.isoDate) {\n        const dt = typeof article.isoDate === 'number'\n          ? new Date(article.isoDate)\n          : new Date(article.isoDate);\n        if (!isNaN(dt.getTime())) {\n          formattedDate = dt.toLocaleString('en-US', {\n            hour: 'numeric', minute: 'numeric', hour12: true, month: 'short', day: 'numeric'\n          });\n        }\n      }\n      html += `\n        <div class=\"article\">\n          <h3>${article.title || \"Untitled\"}</h3>\n          <div class=\"article-content\">${article.content || \"No content available\"}</div>\n          <a href=\"${article.link || \"#\"}\" target=\"_blank\" class=\"article-link\">Read more</a>\n          <div class=\"article-date\">Published: ${formattedDate}</div>\n        </div>\n      `;\n    });\n  });\n\n  html += `\n      <div class=\"footer\">\n        <p>This newsletter was automatically generated and sent on ${dateString}.</p>\n        <p>To unsubscribe, please click <a href=\"{{unsubscribe_link}}\">here</a>.</p>\n      </div>\n    </body>\n    </html>\n  `;\n  return html;\n}\n\nconst newsletterHTML = generateNewsletterHTML();\n\nreturn [{\n  json: {\n    subject: `Security News Newsletter - ${dateString}`,\n    html: newsletterHTML,\n    // to, cc, bcc can be set in the Email node\n  }\n}];"},"typeVersion":2},{"id":"14fd5f01-075f-4648-a1ab-f0a87d2b676a","name":"Format Privacy Articles into HTML","type":"n8n-nodes-base.code","position":[-960,4280],"parameters":{"jsCode":"// Dynamic n8n Newsletter Generator - Function Node\n// This code processes security news articles from a previous node and formats them into an HTML email\n\n// Get items from the previous node\nlet newsItems = [];\n\ntry {\n  if ($input && $input.all().length > 0) {\n    const inputItems = $input.all();\n    if (inputItems.length === 1 && Array.isArray(inputItems[0].json)) {\n      newsItems = inputItems[0].json;\n    } else {\n      newsItems = inputItems.map(item => item.json);\n    }\n  } else if (typeof items !== 'undefined' && items.length > 0) {\n    if (items.length === 1 && Array.isArray(items[0].json)) {\n      newsItems = items[0].json;\n    } else {\n      newsItems = items.map(item => item.json);\n    }\n  }\n  console.log(`Successfully processed input, found ${newsItems.length} news items`);\n} catch (error) {\n  console.log(`Error processing input: ${error.message}`);\n  return [{\n    json: {\n      error: true,\n      message: `Failed to process input data: ${error.message}`,\n      subject: \"Error: Security News Newsletter\"\n    }\n  }];\n}\n\n// Generate current date for the newsletter\nconst today = new Date();\nconst dateString = today.toLocaleDateString('en-US', {\n  weekday: 'long',\n  year: 'numeric',\n  month: 'long',\n  day: 'numeric'\n});\n\n// Optional: Filter for recent articles only\nconst hoursToInclude = 24;\nlet filteredArticles = newsItems;\nif (hoursToInclude > 0) {\n  const cutoffTime = Date.now() - (hoursToInclude * 60 * 60 * 1000);\n  filteredArticles = newsItems.filter(article => {\n    const articleDate = article.isoDate\n      ? (typeof article.isoDate === 'number'\n         ? article.isoDate\n         : new Date(article.isoDate).getTime())\n      : 0;\n    return articleDate >= cutoffTime;\n  });\n  console.log(`Filtered to ${filteredArticles.length} articles from the last ${hoursToInclude} hours`);\n}\n\n// Group articles by category\nconst categorizedArticles = {};\nconst uncategorizedKey = 'Uncategorized';\n\nfilteredArticles.forEach(article => {\n  if (!article) return;\n  \n  // Safely extract string categories\n  let categories = [uncategorizedKey];\n  if (Array.isArray(article.categories)) {\n    categories = article.categories\n      .map(cat => {\n        if (typeof cat === 'string') return cat;\n        if (cat && typeof cat.name === 'string') return cat.name;\n        return '';\n      })\n      .map(str => str.trim())\n      .filter(str => str.length > 0);\n    if (categories.length === 0) categories = [uncategorizedKey];\n  } else if (typeof article.categories === 'string' && article.categories.trim()) {\n    categories = [article.categories.trim()];\n  }\n\n  categories.forEach(category => {\n    const name = category || uncategorizedKey;\n    if (!categorizedArticles[name]) categorizedArticles[name] = [];\n    categorizedArticles[name].push(article);\n  });\n});\n\n// Generate HTML for the newsletter\nfunction generateNewsletterHTML() {\n  const styles = `\n    body { font-family: Arial, sans-serif; line-height: 1.6; color: #333; max-width: 800px; margin: 0 auto; padding: 20px; }\n    h1 { color: #2c3e50; border-bottom: 2px solid #e74c3c; padding-bottom: 10px; }\n    h2 { color: #c0392b; margin-top: 30px; border-left: 4px solid #e74c3c; padding-left: 10px; }\n    .article { margin-bottom: 20px; padding: 15px; background-color: #f9f9f9; border-radius: 5px; box-shadow: 0 2px 4px rgba(0,0,0,0.1); }\n    .article h3 { margin-top: 0; color: #34495e; }\n    .article-content { color: #555; margin-bottom: 10px; }\n    .article-link { color: #e74c3c; text-decoration: none; font-weight: bold; }\n    .article-link:hover { text-decoration: underline; }\n    .article-date { color: #7f8c8d; font-size: 0.9em; margin-top: 8px; }\n    .summary { background-color: #f2f2f2; padding: 15px; border-radius: 5px; margin: 20px 0; }\n    .footer { margin-top: 40px; padding-top: 20px; border-top: 1px solid #ddd; font-size: 0.9em; color: #7f8c8d; text-align: center; }\n  `;\n\n  let html = `\n    <!DOCTYPE html>\n    <html>\n    <head>\n      <meta charset=\"UTF-8\">\n      <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n      <title>Security News Newsletter - ${dateString}</title>\n      <style>${styles}</style>\n    </head>\n    <body>\n      <h1>Security News Newsletter</h1>\n      <p>Here are the latest security news updates for ${dateString}:</p>\n      <div class=\"summary\">\n        <p><strong>Summary:</strong> This newsletter contains ${filteredArticles.length} articles across ${Object.keys(categorizedArticles).length} categories.</p>\n      </div>\n  `;\n\n  Object.keys(categorizedArticles).sort().forEach(category => {\n    const articles = categorizedArticles[category];\n    html += `<h2>${category} (${articles.length})</h2>`;\n    articles.forEach(article => {\n      let formattedDate = \"Date unknown\";\n      if (article.isoDate) {\n        const dt = typeof article.isoDate === 'number'\n          ? new Date(article.isoDate)\n          : new Date(article.isoDate);\n        if (!isNaN(dt.getTime())) {\n          formattedDate = dt.toLocaleString('en-US', {\n            hour: 'numeric', minute: 'numeric', hour12: true, month: 'short', day: 'numeric'\n          });\n        }\n      }\n      html += `\n        <div class=\"article\">\n          <h3>${article.title || \"Untitled\"}</h3>\n          <div class=\"article-content\">${article.content || \"No content available\"}</div>\n          <a href=\"${article.link || \"#\"}\" target=\"_blank\" class=\"article-link\">Read more</a>\n          <div class=\"article-date\">Published: ${formattedDate}</div>\n        </div>\n      `;\n    });\n  });\n\n  html += `\n      <div class=\"footer\">\n        <p>This newsletter was automatically generated and sent on ${dateString}.</p>\n        <p>To unsubscribe, please click <a href=\"{{unsubscribe_link}}\">here</a>.</p>\n      </div>\n    </body>\n    </html>\n  `;\n  return html;\n}\n\nconst newsletterHTML = generateNewsletterHTML();\n\nreturn [{\n  json: {\n    subject: `Security News Newsletter - ${dateString}`,\n    html: newsletterHTML,\n    // to, cc, bcc can be set in the Email node\n  }\n}];"},"typeVersion":2},{"id":"6eddd44f-8038-40fd-b0db-2a8d9c35000a","name":"Format Compliance Articles into HTML","type":"n8n-nodes-base.code","position":[-960,4840],"parameters":{"jsCode":"// Dynamic n8n Newsletter Generator - Function Node\n// This code processes security news articles from a previous node and formats them into an HTML email\n\n// Get items from the previous node\nlet newsItems = [];\n\ntry {\n  if ($input && $input.all().length > 0) {\n    const inputItems = $input.all();\n    if (inputItems.length === 1 && Array.isArray(inputItems[0].json)) {\n      newsItems = inputItems[0].json;\n    } else {\n      newsItems = inputItems.map(item => item.json);\n    }\n  } else if (typeof items !== 'undefined' && items.length > 0) {\n    if (items.length === 1 && Array.isArray(items[0].json)) {\n      newsItems = items[0].json;\n    } else {\n      newsItems = items.map(item => item.json);\n    }\n  }\n  console.log(`Successfully processed input, found ${newsItems.length} news items`);\n} catch (error) {\n  console.log(`Error processing input: ${error.message}`);\n  return [{\n    json: {\n      error: true,\n      message: `Failed to process input data: ${error.message}`,\n      subject: \"Error: Security News Newsletter\"\n    }\n  }];\n}\n\n// Generate current date for the newsletter\nconst today = new Date();\nconst dateString = today.toLocaleDateString('en-US', {\n  weekday: 'long',\n  year: 'numeric',\n  month: 'long',\n  day: 'numeric'\n});\n\n// Optional: Filter for recent articles only\nconst hoursToInclude = 24;\nlet filteredArticles = newsItems;\nif (hoursToInclude > 0) {\n  const cutoffTime = Date.now() - (hoursToInclude * 60 * 60 * 1000);\n  filteredArticles = newsItems.filter(article => {\n    const articleDate = article.isoDate\n      ? (typeof article.isoDate === 'number'\n         ? article.isoDate\n         : new Date(article.isoDate).getTime())\n      : 0;\n    return articleDate >= cutoffTime;\n  });\n  console.log(`Filtered to ${filteredArticles.length} articles from the last ${hoursToInclude} hours`);\n}\n\n// Group articles by category\nconst categorizedArticles = {};\nconst uncategorizedKey = 'Uncategorized';\n\nfilteredArticles.forEach(article => {\n  if (!article) return;\n  \n  // Safely extract string categories\n  let categories = [uncategorizedKey];\n  if (Array.isArray(article.categories)) {\n    categories = article.categories\n      .map(cat => {\n        if (typeof cat === 'string') return cat;\n        if (cat && typeof cat.name === 'string') return cat.name;\n        return '';\n      })\n      .map(str => str.trim())\n      .filter(str => str.length > 0);\n    if (categories.length === 0) categories = [uncategorizedKey];\n  } else if (typeof article.categories === 'string' && article.categories.trim()) {\n    categories = [article.categories.trim()];\n  }\n\n  categories.forEach(category => {\n    const name = category || uncategorizedKey;\n    if (!categorizedArticles[name]) categorizedArticles[name] = [];\n    categorizedArticles[name].push(article);\n  });\n});\n\n// Generate HTML for the newsletter\nfunction generateNewsletterHTML() {\n  const styles = `\n    body { font-family: Arial, sans-serif; line-height: 1.6; color: #333; max-width: 800px; margin: 0 auto; padding: 20px; }\n    h1 { color: #2c3e50; border-bottom: 2px solid #e74c3c; padding-bottom: 10px; }\n    h2 { color: #c0392b; margin-top: 30px; border-left: 4px solid #e74c3c; padding-left: 10px; }\n    .article { margin-bottom: 20px; padding: 15px; background-color: #f9f9f9; border-radius: 5px; box-shadow: 0 2px 4px rgba(0,0,0,0.1); }\n    .article h3 { margin-top: 0; color: #34495e; }\n    .article-content { color: #555; margin-bottom: 10px; }\n    .article-link { color: #e74c3c; text-decoration: none; font-weight: bold; }\n    .article-link:hover { text-decoration: underline; }\n    .article-date { color: #7f8c8d; font-size: 0.9em; margin-top: 8px; }\n    .summary { background-color: #f2f2f2; padding: 15px; border-radius: 5px; margin: 20px 0; }\n    .footer { margin-top: 40px; padding-top: 20px; border-top: 1px solid #ddd; font-size: 0.9em; color: #7f8c8d; text-align: center; }\n  `;\n\n  let html = `\n    <!DOCTYPE html>\n    <html>\n    <head>\n      <meta charset=\"UTF-8\">\n      <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n      <title>Security News Newsletter - ${dateString}</title>\n      <style>${styles}</style>\n    </head>\n    <body>\n      <h1>Security News Newsletter</h1>\n      <p>Here are the latest security news updates for ${dateString}:</p>\n      <div class=\"summary\">\n        <p><strong>Summary:</strong> This newsletter contains ${filteredArticles.length} articles across ${Object.keys(categorizedArticles).length} categories.</p>\n      </div>\n  `;\n\n  Object.keys(categorizedArticles).sort().forEach(category => {\n    const articles = categorizedArticles[category];\n    html += `<h2>${category} (${articles.length})</h2>`;\n    articles.forEach(article => {\n      let formattedDate = \"Date unknown\";\n      if (article.isoDate) {\n        const dt = typeof article.isoDate === 'number'\n          ? new Date(article.isoDate)\n          : new Date(article.isoDate);\n        if (!isNaN(dt.getTime())) {\n          formattedDate = dt.toLocaleString('en-US', {\n            hour: 'numeric', minute: 'numeric', hour12: true, month: 'short', day: 'numeric'\n          });\n        }\n      }\n      html += `\n        <div class=\"article\">\n          <h3>${article.title || \"Untitled\"}</h3>\n          <div class=\"article-content\">${article.content || \"No content available\"}</div>\n          <a href=\"${article.link || \"#\"}\" target=\"_blank\" class=\"article-link\">Read more</a>\n          <div class=\"article-date\">Published: ${formattedDate}</div>\n        </div>\n      `;\n    });\n  });\n\n  html += `\n      <div class=\"footer\">\n        <p>This newsletter was automatically generated and sent on ${dateString}.</p>\n        <p>To unsubscribe, please click <a href=\"{{unsubscribe_link}}\">here</a>.</p>\n      </div>\n    </body>\n    </html>\n  `;\n  return html;\n}\n\nconst newsletterHTML = generateNewsletterHTML();\n\nreturn [{\n  json: {\n    subject: `Security News Newsletter - ${dateString}`,\n    html: newsletterHTML,\n    // to, cc, bcc can be set in the Email node\n  }\n}];"},"typeVersion":2},{"id":"1e261592-348a-42af-b4ba-1b2be82b0143","name":"LLM - Gemini Security Summarizer","type":"@n8n/n8n-nodes-langchain.lmChatGoogleGemini","position":[-640,3740],"parameters":{"options":{"temperature":0.5},"modelName":"models/gemini-2.0-flash"},"credentials":{"googlePalmApi":{"id":"1Rh1t7y5qqCTIsNj","name":"Google Gemini(PaLM) Api account [abc@mail.com"}},"typeVersion":1},{"id":"c4cc7264-43af-4a26-89e2-5888817b1602","name":"LLM - Gemini Privacy Summarizer","type":"@n8n/n8n-nodes-langchain.lmChatGoogleGemini","position":[-660,4400],"parameters":{"options":{"temperature":0.5},"modelName":"models/gemini-2.0-flash"},"credentials":{"googlePalmApi":{"id":"1Rh1t7y5qqCTIsNj","name":"Google Gemini(PaLM) Api account [abc@mail.com"}},"typeVersion":1},{"id":"dc4e461c-dbb8-46a1-b128-6c28584c12d4","name":"LLM - Gemini Compliance Summarizer","type":"@n8n/n8n-nodes-langchain.lmChatGoogleGemini","position":[-640,5060],"parameters":{"options":{"temperature":0.5},"modelName":"models/gemini-2.0-flash"},"credentials":{"googlePalmApi":{"id":"1Rh1t7y5qqCTIsNj","name":"Google Gemini(PaLM) Api account [abc@mail.com"}},"typeVersion":1},{"id":"a1e4eaac-aaea-4859-bd29-375a6b50aaa1","name":"Privacy Build Final Newsletter HTML","type":"n8n-nodes-base.code","position":[-360,4280],"parameters":{"jsCode":"return items.map(item => {\n  // 1. grab the raw AI output\n  const raw = item.json.output;\n\n  // 2. extract what's between ```json ... ``` (or fall back to full text)\n  const match = raw.match(/```json\\s*([\\s\\S]*?)```/);\n  const jsonPayload = (match ? match[1] : raw).trim();\n\n  // 3. remove any trailing commas before } or ]\n  const clean = jsonPayload.replace(/,\\s*([\\]}])/g, '$1');\n\n  // 4. parse into an object, with error reporting\n  let data;\n  try {\n    data = JSON.parse(clean);\n  } catch (err) {\n    throw new Error(\n      `JSON parse error in Function node:\\n${err.message}\\n\\nPayload was:\\n${clean}`\n    );\n  }\n\n  // 5. wrap the returned HTML in your full styled template, without external blog link\n  const htmlEmail = `\n<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n  <meta charset=\"UTF-8\">\n  <title>${data.subject}</title>\n  <style>\n    body { font-family: Arial, sans-serif; line-height:1.5; color:#333; background-color:#f7f9fa; margin:0; padding:20px; }\n    .container { max-width:700px; margin:0 auto; background:#fff; border-radius:8px; box-shadow:0 2px 8px rgba(0,0,0,0.1); overflow:hidden; }\n    .header { background:#2c3e50; color:#fff; padding:20px; text-align:center; }\n    .header h1 { margin:0; font-size:24px; }\n    .content { padding:20px; }\n    h2 { color:#e74c3c; border-bottom:2px solid #e74c3c; padding-bottom:5px; }\n    ul { padding-left:20px; }\n    li { margin-bottom:10px; }\n    a { color:#2980b9; text-decoration:none; }\n    a:hover { text-decoration:underline; }\n    .footer { background:#ecf0f1; text-align:center; padding:10px; font-size:12px; color:#7f8c8d; }\n  </style>\n</head>\n<body>\n  <div class=\"container\">\n    <div class=\"header\">\n      <h1>${data.subject}</h1>\n    </div>\n    <div class=\"content\">\n      ${data.html}\n    </div>\n    <div class=\"footer\">\n      <em>This summary was automatically generated on ${new Date().toLocaleDateString('en-US', {\n        year: 'numeric', month: 'long', day: 'numeric'\n      })}.</em>\n    </div>\n  </div>\n</body>\n</html>\n  `.trim();\n\n  // 6. emit subject + styled html\n  return {\n    json: {\n      subject: data.subject,\n      html: htmlEmail,\n    }\n  };\n});"},"typeVersion":2},{"id":"7a864b0c-08f5-4e97-8430-1879f8e0e3d0","name":"Security Build Final Newsletter HTML","type":"n8n-nodes-base.code","position":[-340,3620],"parameters":{"jsCode":"return items.map(item => {\n  // 1. grab the raw AI output\n  const raw = item.json.output;\n\n  // 2. extract what's between ```json ... ``` (or fall back to full text)\n  const match = raw.match(/```json\\s*([\\s\\S]*?)```/);\n  const jsonPayload = (match ? match[1] : raw).trim();\n\n  // 3. remove any trailing commas before } or ]\n  const clean = jsonPayload.replace(/,\\s*([\\]}])/g, '$1');\n\n  // 4. parse into an object, with error reporting\n  let data;\n  try {\n    data = JSON.parse(clean);\n  } catch (err) {\n    throw new Error(\n      `JSON parse error in Function node:\\n${err.message}\\n\\nPayload was:\\n${clean}`\n    );\n  }\n\n  // 5. wrap the returned HTML in styled email template (without blog link)\n  const htmlEmail = `\n<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n  <meta charset=\"UTF-8\">\n  <title>${data.subject}</title>\n  <style>\n    body { font-family: Arial, sans-serif; line-height:1.5; color:#333; background-color:#f7f9fa; margin:0; padding:20px; }\n    .container { max-width:700px; margin:0 auto; background:#fff; border-radius:8px; box-shadow:0 2px 8px rgba(0,0,0,0.1); overflow:hidden; }\n    .header { background:#2c3e50; color:#fff; padding:20px; text-align:center; }\n    .header h1 { margin:0; font-size:24px; }\n    .content { padding:20px; }\n    h2 { color:#e74c3c; border-bottom:2px solid #e74c3c; padding-bottom:5px; }\n    ul { padding-left:20px; }\n    li { margin-bottom:10px; }\n    a { color:#2980b9; text-decoration:none; }\n    a:hover { text-decoration:underline; }\n    .footer { background:#ecf0f1; text-align:center; padding:10px; font-size:12px; color:#7f8c8d; }\n  </style>\n</head>\n<body>\n  <div class=\"container\">\n    <div class=\"header\">\n      <h1>${data.subject}</h1>\n    </div>\n    <div class=\"content\">\n      ${data.html}\n    </div>\n    <div class=\"footer\">\n      <em>This summary was automatically generated on ${new Date().toLocaleDateString('en-US', {\n        year: 'numeric', month: 'long', day: 'numeric'\n      })}.</em>\n    </div>\n  </div>\n</body>\n</html>\n  `.trim();\n\n  // 6. emit subject + styled html\n  return {\n    json: {\n      subject: data.subject,\n      html: htmlEmail,\n    }\n  };\n});"},"typeVersion":2},{"id":"deaaeb3a-5a14-4b2a-baf8-4443e7ed9740","name":"Compliance Build Final Newsletter HTML","type":"n8n-nodes-base.code","position":[-360,4840],"parameters":{"jsCode":"return items.map(item => {\n  // 1. grab the raw AI output\n  const raw = item.json.output;\n\n  // 2. extract what's between ```json ... ``` (or fall back to full text)\n  const match = raw.match(/```json\\s*([\\s\\S]*?)```/);\n  const jsonPayload = (match ? match[1] : raw).trim();\n\n  // 3. remove any trailing commas before } or ]\n  const clean = jsonPayload.replace(/,\\s*([\\]}])/g, '$1');\n\n  // 4. parse into an object, with error reporting\n  let data;\n  try {\n    data = JSON.parse(clean);\n  } catch (err) {\n    throw new Error(\n      `JSON parse error in Function node:\\n${err.message}\\n\\nPayload was:\\n${clean}`\n    );\n  }\n\n  // 5. wrap the returned HTML in styled template, no blog reference\n  const htmlEmail = `\n<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n  <meta charset=\"UTF-8\">\n  <title>${data.subject}</title>\n  <style>\n    body { font-family: Arial, sans-serif; line-height:1.5; color:#333; background-color:#f7f9fa; margin:0; padding:20px; }\n    .container { max-width:700px; margin:0 auto; background:#fff; border-radius:8px; box-shadow:0 2px 8px rgba(0,0,0,0.1); overflow:hidden; }\n    .header { background:#2c3e50; color:#fff; padding:20px; text-align:center; }\n    .header h1 { margin:0; font-size:24px; }\n    .content { padding:20px; }\n    h2 { color:#e74c3c; border-bottom:2px solid #e74c3c; padding-bottom:5px; }\n    ul { padding-left:20px; }\n    li { margin-bottom:10px; }\n    a { color:#2980b9; text-decoration:none; }\n    a:hover { text-decoration:underline; }\n    .footer { background:#ecf0f1; text-align:center; padding:10px; font-size:12px; color:#7f8c8d; }\n  </style>\n</head>\n<body>\n  <div class=\"container\">\n    <div class=\"header\">\n      <h1>${data.subject}</h1>\n    </div>\n    <div class=\"content\">\n      ${data.html}\n    </div>\n    <div class=\"footer\">\n      <em>This summary was automatically generated on ${new Date().toLocaleDateString('en-US', {\n        year: 'numeric', month: 'long', day: 'numeric'\n      })}.</em>\n    </div>\n  </div>\n</body>\n</html>\n  `.trim();\n\n  // 6. emit subject + styled html\n  return {\n    json: {\n      subject: data.subject,\n      html: htmlEmail,\n    }\n  };\n});"},"typeVersion":2},{"id":"fa9ac785-bc9d-43ba-8ca3-36abba10d506","name":"Security Send Final Digest Email","type":"n8n-nodes-base.gmail","position":[-120,3620],"webhookId":"2ffca73d-6ca2-4c61-88ec-3542600d2788","parameters":{"sendTo":"abc@mail.com","message":"={{ $json.html }}","options":{},"subject":"={{ $json.subject }}"},"credentials":{"gmailOAuth2":{"id":"Hd26wEkbjGRPpchT","name":"Gmail account [abc@mail.com]"}},"typeVersion":2.1},{"id":"59c16785-571c-4403-85cf-7f7bfc14a630","name":"Privacy Send Final Digest Email","type":"n8n-nodes-base.gmail","position":[-140,4280],"webhookId":"0e8133d5-e700-4bb9-8ef0-6c86f7ed4a59","parameters":{"sendTo":"abc@mail.com","message":"={{ $json.html }}","options":{},"subject":"={{ $json.subject }}"},"credentials":{"gmailOAuth2":{"id":"Hd26wEkbjGRPpchT","name":"Gmail account [abc@mail.com]"}},"typeVersion":2.1},{"id":"7526ae74-1bae-4eca-9c87-51c274565a8a","name":"Compliance Send Final Digest Email","type":"n8n-nodes-base.gmail","position":[-140,4840],"webhookId":"5d5a1988-01cd-4e67-9c02-9090aa851669","parameters":{"sendTo":"abc@mail.com","message":"={{ $json.html }}","options":{},"subject":"={{ $json.subject }}"},"credentials":{"gmailOAuth2":{"id":"Hd26wEkbjGRPpchT","name":"Gmail account [abc@mail.com]"}},"typeVersion":2.1},{"id":"6fa939b5-12ac-47a0-ac7f-ca9957367ce2","name":"Sort - Security Articles by Date","type":"n8n-nodes-base.sort","position":[-1160,3620],"parameters":{"options":{},"sortFieldsUi":{"sortField":[{"order":"descending","fieldName":"isoDate"}]}},"typeVersion":1},{"id":"7aa3a27b-72d7-4a03-83c8-361a6fbc555d","name":"Sort - Privacy Articles by Date","type":"n8n-nodes-base.sort","position":[-1180,4280],"parameters":{"options":{},"sortFieldsUi":{"sortField":[{"order":"descending","fieldName":"isoDate"}]}},"typeVersion":1},{"id":"fba86936-5208-4232-bda9-714886807b9c","name":"Sort - Compliance Articles by Date","type":"n8n-nodes-base.sort","position":[-1180,4840],"parameters":{"options":{},"sortFieldsUi":{"sortField":[{"order":"descending","fieldName":"isoDate"}]}},"typeVersion":1},{"id":"8d90a0ed-b9e1-440e-963a-e4c9f5285b32","name":"Sticky Note","type":"n8n-nodes-base.stickyNote","position":[-2460,3380],"parameters":{"width":2600,"height":580,"content":"## 📬 Daily Security Newsletter"},"typeVersion":1},{"id":"946997e7-58bc-4ca0-89aa-32e39f327808","name":"Sticky Note1","type":"n8n-nodes-base.stickyNote","position":[-2460,4020],"parameters":{"color":4,"width":2600,"height":580,"content":"## 📬 Daily Privacy Newsletter"},"typeVersion":1},{"id":"61aca795-5b6a-4301-9cea-946e0358b8c5","name":"Sticky Note2","type":"n8n-nodes-base.stickyNote","position":[-2460,4660],"parameters":{"color":6,"width":2600,"height":580,"content":"## 📬 Daily Compliance Newsletter"},"typeVersion":1},{"id":"ca6c3e50-8ea8-436c-ab77-94501667a431","name":"Split Out Security RSS","type":"n8n-nodes-base.splitOut","position":[-2040,3620],"parameters":{"options":{},"fieldToSplitOut":"rss_url"},"typeVersion":1},{"id":"5784491f-071c-4159-af29-6e21305f5e78","name":"Split Out Compliance RSS","type":"n8n-nodes-base.splitOut","position":[-2060,4840],"parameters":{"options":{},"fieldToSplitOut":"rss_url"},"typeVersion":1},{"id":"edbd5da4-f18c-4d08-8023-df4ef7ec11fa","name":"Security RSS Read","type":"n8n-nodes-base.rssFeedRead","position":[-1820,3620],"parameters":{"url":"={{ $json.rss_url }}","options":{}},"retryOnFail":true,"typeVersion":1.1},{"id":"76d973a7-832e-4049-80ea-c0d28b72b345","name":"Privacy RSS Read","type":"n8n-nodes-base.rssFeedRead","position":[-1840,4280],"parameters":{"url":"={{ $json.rss_url }}","options":{}},"retryOnFail":true,"typeVersion":1.1},{"id":"5503fe77-8ae3-4d41-97d3-6520cb60067e","name":"Compliance RSS Read","type":"n8n-nodes-base.rssFeedRead","position":[-1840,4840],"parameters":{"url":"={{ $json.rss_url }}","options":{}},"retryOnFail":true,"typeVersion":1.1},{"id":"c2538e17-1584-45a5-8a6e-1b220ed512a5","name":"Split Out Privacy RSS","type":"n8n-nodes-base.splitOut","position":[-2060,4280],"parameters":{"options":{},"fieldToSplitOut":"rss_url"},"typeVersion":1},{"id":"d1ae80d8-8094-4f84-aa9e-d4533a99a70d","name":"Fetch Security RSS","type":"n8n-nodes-base.code","position":[-2260,3620],"parameters":{"jsCode":"// This node returns curated cybersecurity RSS feeds\n// You can add, remove, or modify feeds as needed\n\nreturn [\n  {\n    json: {\n      name: \"Krebs on Security\",\n      website: \"https://krebsonsecurity.com\",\n      rss_url: \"https://krebsonsecurity.com/feed/\"\n    }\n  },\n  {\n    json: {\n      name: \"The Hacker News\",\n      website: \"https://thehackernews.com\",\n      rss_url: \"https://feeds.feedburner.com/TheHackersNews\"\n    }\n  },\n  {\n    json: {\n      name: \"Dark Reading\",\n      website: \"https://www.darkreading.com\",\n      rss_url: \"https://www.darkreading.com/rss.xml\"\n    }\n  },\n  {\n    json: {\n      name: \"SANS Internet Storm Center\",\n      website: \"https://isc.sans.edu\",\n      rss_url: \"https://isc.sans.edu/rssfeed_full.xml\"\n    }\n  },\n  {\n    json: {\n      name: \"Cisco Talos Intelligence Blog\",\n      website: \"https://blog.talosintelligence.com\",\n      rss_url: \"https://blog.talosintelligence.com/rss/\"\n    }\n  },\n  {\n    json: {\n      name: \"WeLiveSecurity (ESET)\",\n      website: \"https://www.welivesecurity.com\",\n      rss_url: \"https://feeds.feedburner.com/eset/blog\"\n    }\n  },\n  {\n    json: {\n      name: \"Graham Cluley Security Blog\",\n      website: \"https://grahamcluley.com\",\n      rss_url: \"https://grahamcluley.com/feed/\"\n    }\n  }\n];\n"},"typeVersion":2},{"id":"fbec32fd-2ca9-4f1f-84f9-e581bc6a37e5","name":"Sticky Note3","type":"n8n-nodes-base.stickyNote","position":[-120,3480],"parameters":{"color":7,"height":100,"content":"### Update your email address or distribution list (DL) below\n⬇️"},"typeVersion":1},{"id":"4479495e-3e87-4a75-9fcc-36b230895854","name":"Sticky Note4","type":"n8n-nodes-base.stickyNote","position":[-140,4160],"parameters":{"color":7,"height":100,"content":"### Update your email address or distribution list (DL) below\n⬇️"},"typeVersion":1},{"id":"18971219-b68d-4423-adbc-2f25174ae8a9","name":"Sticky Note5","type":"n8n-nodes-base.stickyNote","position":[-140,4720],"parameters":{"color":7,"height":100,"content":"### Update your email address or distribution list (DL) below\n⬇️"},"typeVersion":1},{"id":"349ec0eb-9b5f-4bea-9b83-35d6cb63c1fa","name":"Sticky Note6","type":"n8n-nodes-base.stickyNote","position":[-2320,3520],"parameters":{"color":7,"height":80,"content":"### Update the RSS feed URL as needed to fetch content from your preferred source."},"typeVersion":1},{"id":"4f3b0da6-4db7-41e9-aa0a-9bd084fce819","name":"Sticky Note7","type":"n8n-nodes-base.stickyNote","position":[-2340,4180],"parameters":{"color":7,"height":80,"content":"### Update the RSS feed URL as needed to fetch content from your preferred source."},"typeVersion":1},{"id":"9c48eaa6-c602-44a3-871c-33ffd9dfa476","name":"Sticky Note8","type":"n8n-nodes-base.stickyNote","position":[-2340,4740],"parameters":{"color":7,"height":80,"content":"### Update the RSS feed URL as needed to fetch content from your preferred source."},"typeVersion":1}],"active":false,"pinData":{},"settings":{"executionOrder":"v1"},"versionId":"0dc52173-7378-4951-8ebc-e44443c39540","connections":{"Privacy RSS Read":{"main":[[{"node":"Normalize Article Privacy Metadata","type":"main","index":0}]]},"Security RSS Read":{"main":[[{"node":"Normalize Article Security Metadata","type":"main","index":0}]]},"Fetch Security RSS":{"main":[[{"node":"Split Out Security RSS","type":"main","index":0}]]},"Compliance RSS Read":{"main":[[{"node":"Normalize Article Compliance Metadata","type":"main","index":0}]]},"Fetch Privacy Feeds":{"main":[[{"node":"Split Out Privacy RSS","type":"main","index":0}]]},"Trigger Daily Digest":{"main":[[{"node":"Fetch Security RSS","type":"main","index":0},{"node":"Fetch Compliance Feeds","type":"main","index":0},{"node":"Fetch Privacy Feeds","type":"main","index":0}]]},"Split Out Privacy RSS":{"main":[[{"node":"Privacy RSS Read","type":"main","index":0}]]},"Fetch Compliance Feeds":{"main":[[{"node":"Split Out Compliance RSS","type":"main","index":0}]]},"Split Out Security RSS":{"main":[[{"node":"Security RSS Read","type":"main","index":0}]]},"Split Out Compliance RSS":{"main":[[{"node":"Compliance RSS Read","type":"main","index":0}]]},"AI Agent - Privacy Intelligence":{"main":[[{"node":"Privacy Build Final Newsletter HTML","type":"main","index":0}]]},"LLM - Gemini Privacy Summarizer":{"ai_languageModel":[[{"node":"AI Agent - Privacy Intelligence","type":"ai_languageModel","index":0}]]},"Sort - Privacy Articles by Date":{"main":[[{"node":"Format Privacy Articles into HTML","type":"main","index":0}]]},"AI Agent - Security Intelligence":{"main":[[{"node":"Security Build Final Newsletter HTML","type":"main","index":0}]]},"LLM - Gemini Security Summarizer":{"ai_languageModel":[[{"node":"AI Agent - Security Intelligence","type":"ai_languageModel","index":0}]]},"Sort - Security Articles by Date":{"main":[[{"node":"Format Security Articles into HTML","type":"main","index":0}]]},"Format Privacy Articles into HTML":{"main":[[{"node":"AI Agent - Privacy Intelligence","type":"main","index":0}]]},"AI Agent - Compliance Intelligence":{"main":[[{"node":"Compliance Build Final Newsletter HTML","type":"main","index":0}]]},"Format Security Articles into HTML":{"main":[[{"node":"AI Agent - Security Intelligence","type":"main","index":0}]]},"LLM - Gemini Compliance Summarizer":{"ai_languageModel":[[{"node":"AI Agent - Compliance Intelligence","type":"ai_languageModel","index":0}]]},"Normalize Article Privacy Metadata":{"main":[[{"node":"Filter Recent Privacy Articles (24h)","type":"main","index":0}]]},"Sort - Compliance Articles by Date":{"main":[[{"node":"Format Compliance Articles into HTML","type":"main","index":0}]]},"Normalize Article Security Metadata":{"main":[[{"node":"Filter Recent Security Articles (24h)","type":"main","index":0}]]},"Privacy Build Final Newsletter HTML":{"main":[[{"node":"Privacy Send Final Digest Email","type":"main","index":0}]]},"Filter Recent Privacy Articles (24h)":{"main":[[{"node":"Sort - Privacy Articles by Date","type":"main","index":0}]]},"Format Compliance Articles into HTML":{"main":[[{"node":"AI Agent - Compliance Intelligence","type":"main","index":0}]]},"Security Build Final Newsletter HTML":{"main":[[{"node":"Security Send Final Digest Email","type":"main","index":0}]]},"Filter Recent Security Articles (24h)":{"main":[[{"node":"Sort - Security Articles by Date","type":"main","index":0}]]},"Normalize Article Compliance Metadata":{"main":[[{"node":"Filter Recent Compliance Articles (24h)","type":"main","index":0}]]},"Compliance Build Final Newsletter HTML":{"main":[[{"node":"Compliance Send Final Digest Email","type":"main","index":0}]]},"Filter Recent Compliance Articles (24h)":{"main":[[{"node":"Sort - Compliance Articles by Date","type":"main","index":0}]]}}}


name: Daily Auto-Archive for Gmail Messages
author_name: Niranjan G
author_username: niranjan
nodes_used: ["n8n-nodes-base.gmail"]
categories: []
created_at: 2025-06-05T06:28:09.689Z
updated_at: 2025-06-05T06:28:09.689Z
url: https://n8n.io/workflows/4679
scraped_at: 2025-07-06 21:16:30
description:
  Who is this for?

  Professionals, solopreneurs, or productivity enthusiasts who want to keep their Gmail inbox clean and organized without manual effort.

  What problem does this solve?

  Manually archiving emails clutters your time and slows you down. This workflow automates inbox cleanup by removing the "INBOX" label from messages received over 24 hours ago. A perfect companion to AI-based labeling workflows, this keeps your inbox light and relevant.

  What this workflow does

  Triggers every day at 4 AM
  Fetches Gmail messages from the INBOX that are older than 24 hours
  Processes them one by one using the Split Out node
  Removes the INBOX label, effectively archiving the messages

  Setup

  Connect your Gmail account using OAuth2 credentials.
  Customize the Schedule Trigger node to adjust the run time.
  Modify the Gmail filter if you want to archive unread or labeled emails instead.

  How to customize this workflow to your needs

  Schedule different frequencies (e.g. twice a day or weekly).

  🔄 Pairs Well With

  This complements the Intelligent Email Organization with AI-Powered Content Classification workflow.

  Use that to label emails smartly using AI, and this one to auto-archive them for a clean, clutter-free inbox.

workflow_json:
  {"meta":{"instanceId":"c62c01f3e843893075a10f252ec7d6d69e5ab593af019f50055d506cb3081b99","templateCredsSetupCompleted":true},"nodes":[{"id":"61682ff7-397d-4ecb-a98f-91d45d5a07a1","name":"Daily Trigger at 4AM","type":"n8n-nodes-base.scheduleTrigger","position":[-140,160],"parameters":{"rule":{"interval":[{"triggerAtHour":4}]}},"typeVersion":1.2},{"id":"84a83cf9-63fc-40cf-bfa6-bc01ad67b3b7","name":"Fetch Gmail Inbox Emails","type":"n8n-nodes-base.gmail","position":[80,160],"webhookId":"57a7df32-d350-4e67-b106-f7b5b8b39f08","parameters":{"filters":{"labelIds":"={{ [\"INBOX\"] }}","receivedBefore":"={{ new Date(Date.now() - 24 * 60 * 60 * 1000).toISOString() }}"},"operation":"getAll","returnAll":true},"credentials":{"gmailOAuth2":{"id":"T6a7nzYASeRq8gwp","name":"Gmail account [abc@mail.com]"}},"typeVersion":2.1},{"id":"29939c36-30d1-499a-9c1b-9d3e4c4c9ba5","name":"Split Each Email","type":"n8n-nodes-base.splitOut","position":[300,160],"parameters":{"options":{},"fieldToSplitOut":"id"},"typeVersion":1},{"id":"316ad247-78c2-4fbb-b420-94bb8fb354f3","name":"Archive Message (Remove INBOX Label)","type":"n8n-nodes-base.gmail","position":[520,160],"webhookId":"44a7f451-9ebb-4a08-86b2-1c4cb8600bcc","parameters":{"labelIds":["INBOX"],"messageId":"={{ $json.id }}","operation":"removeLabels"},"credentials":{"gmailOAuth2":{"id":"T6a7nzYASeRq8gwp","name":"Gmail account [abc@mail.com]"}},"typeVersion":2.1}],"pinData":{},"connections":{"Split Each Email":{"main":[[{"node":"Archive Message (Remove INBOX Label)","type":"main","index":0}]]},"Daily Trigger at 4AM":{"main":[[{"node":"Fetch Gmail Inbox Emails","type":"main","index":0}]]},"Fetch Gmail Inbox Emails":{"main":[[{"node":"Split Each Email","type":"main","index":0}]]},"Archive Message (Remove INBOX Label)":{"main":[[]]}}}


name: AI-Powered Meta Ads Analysis & Creation with Gemini, GPT-4.1 Mini & Ads Manager
author_name: Daniel Setzermann
author_username: danielsetzermann
categories: []
created_at: 2025-06-05T09:09:39.117Z
updated_at: 2025-06-05T09:09:39.117Z
url: https://n8n.io/workflows/4684
scraped_at: 2025-07-06 21:16:30
description:
  AI-Powered Meta Ads Creation & Analysis Workflow

  Overview

  This comprehensive n8n workflow automates the entire Meta (Facebook/Instagram) advertising process, from asset analysis to ad creation. It combines AI-powered content analysis with automated ad deployment, streamlining the creation of high-converting social media advertisements.

  Key Features

  🤖 AI-Powered Asset Analysis
  Video Analysis**: Uses Google Gemini to analyze video content, extracting transcripts, scene descriptions, hooks, offers, and branding elements
  Image Analysis**: Employs GPT-4.1 Mini to analyze static images, identifying visual elements, USPs, and marketing potential
  Structured Output**: Generates detailed descriptions and creative insights for informed ad creation

  ✍️ Automated Ad Copy Generation
  Creates 3 variations each of primary text, headlines, and link descriptions
  Optimized for Meta's character limits and best practices
  Maintains brand voice and messaging consistency
  Leverages AI analysis to create compelling, conversion-focused copy

  🎯 Meta Ads Manager Integration
  Video Ads**: Uploads videos, creates ad creatives with multiple text variations
  Image Ads**: Supports both single and multi-image campaigns (1:1 and 9:16 formats)
  Asset Feed Optimization**: Implements placement-specific customization rules
  Automated Preview Generation**: Creates ad previews for different placements

  📊 Smart Workflow Management
  Google Drive Integration**: Monitors designated folders for new creative assets
  Google Sheets Tracking**: Maintains comprehensive records of all assets and campaigns
  Status Management**: Tracks processing stages and prevents duplicate work
  Error Handling**: Includes retry logic and status checking for reliable operation

  Workflow Components

  Asset Discovery & Processing
  Google Drive Trigger: Monitors specified folder for new image/video files
  File Analysis: Extracts metadata, dimensions, and file specifications
  Asset Registration: Logs all assets in Google Sheets for tracking

  AI Analysis Pipeline
  Content Type Detection: Automatically identifies videos vs. images
  Video Processing:
     Uploads to Google Gemini for analysis
     Generates comprehensive content breakdown
     Extracts all marketing-relevant elements
  Image Processing:
     Analyzes visual content with GPT-4.1 Mini
     Identifies key messaging and visual elements
     Creates detailed creative descriptions

  Ad Copy Creation
  AI Agent Processing: Transforms analysis into marketing copy
  Multi-Variant Generation: Creates 3 versions of each text element
  Platform Optimization: Ensures compliance with Meta's requirements
  Quality Assurance: Structured output validation

  Meta Ads Deployment
  Asset Upload: Pushes images/videos to Meta Ads Manager
  Creative Assembly: Builds ad creatives with generated copy variations
  Campaign Creation: Sets up ads with proper targeting and placement rules
  Status Tracking: Updates spreadsheet with campaign IDs and status

  Setup Requirements

  Required Credentials
  Meta Developer Account**: App access token for Meta Graph API
  Google Drive OAuth**: For file monitoring and asset access
  Google Sheets OAuth**: For workflow tracking and management
  Google Gemini API**: For video analysis capabilities
  OpenAI API**: For image analysis and copy generation

  Configuration Steps
  Google Drive Setup: 
     Create dedicated folder for creative assets
     Configure folder monitoring in the trigger node
  Google Sheets Template:
     Use provided template for asset and campaign tracking
     Configure account settings and campaign parameters
  Meta Developer Setup:
     Create Meta App and obtain access tokens
     Set up ad account permissions
  API Credentials:
     Configure all required authentication credentials
     Test connections before activation

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

workflow_json:
  {"id":"HSkxJKrT4lRkab16","meta":{"instanceId":"0aee4372a556f3e4774323f4ed89755880cea473443f0948966509bbf55dec04","templateCredsSetupCompleted":true},"name":"Analyze Meta Ads, Create Ad Texts & Upload Image & Video Ads to Meta Ads Manager","tags":[],"nodes":[{"id":"6205a675-8533-458b-a0db-1298740d5161","name":"Upload Ad Video","type":"n8n-nodes-base.facebookGraphApi","position":[2340,1980],"parameters":{},"typeVersion":1},{"id":"fe523d79-a5c5-43d4-a6b0-e89c190d9007","name":"Get Video Preview Image","type":"n8n-nodes-base.facebookGraphApi","position":[2740,1980],"parameters":{},"typeVersion":1},{"id":"49f08c36-3494-4304-8542-67ff1deb244e","name":"Analyze Video with Gemini","type":"n8n-nodes-base.httpRequest","position":[2740,1020],"parameters":{},"typeVersion":4.2},{"id":"c638cf41-7820-4bf0-a253-dd9387a5ed32","name":"Gemini - Generate Upload URL","type":"n8n-nodes-base.httpRequest","position":[1300,1120],"parameters":{},"typeVersion":4.2},{"id":"4025ddce-afd4-4526-9a94-b59cbaa5837a","name":"Gemini - Upload File","type":"n8n-nodes-base.httpRequest","position":[1720,1120],"parameters":{},"typeVersion":4.2},{"id":"c116efd1-ac34-46bd-ae31-4650cc369f25","name":"Download from Google Drive","type":"n8n-nodes-base.googleDrive","position":[1520,1120],"parameters":{},"typeVersion":3},{"id":"cd25f2c2-5697-44d7-919b-1ef23505d124","name":"Create Asset","type":"n8n-nodes-base.googleSheets","position":[2380,780],"parameters":{},"typeVersion":4.5},{"id":"55aae2bf-e57b-4e06-baca-9ca3ca99d8b5","name":"Get All Rows","type":"n8n-nodes-base.googleSheets","position":[2640,780],"parameters":{},"executeOnce":true,"typeVersion":4.5},{"id":"5dc2e330-814b-43c7-9228-7c412a4bd4a3","name":"AI Description is Empty","type":"n8n-nodes-base.filter","position":[2880,780],"parameters":{},"typeVersion":2.2},{"id":"b402bfd8-7e64-4220-b5e8-7e88b765d896","name":"Check State","type":"n8n-nodes-base.httpRequest","position":[2340,1120],"parameters":{},"typeVersion":4.2},{"id":"e81071cf-e86a-42f0-ac80-13432e6b2097","name":"If","type":"n8n-nodes-base.if","position":[2540,1120],"parameters":{},"typeVersion":2.2},{"id":"0719ebaf-3c86-4d46-b5f3-9ed00c53936e","name":"Wait 2 Seconds","type":"n8n-nodes-base.wait","position":[2720,1220],"webhookId":"34306fcb-9f52-44cd-8343-333bb6032833","parameters":{},"typeVersion":1.1},{"id":"110d630e-0e17-42b9-998a-a224fa844b54","name":"Wait 3 Seconds","type":"n8n-nodes-base.wait","position":[2140,1120],"webhookId":"4451f2eb-68a3-420f-9c07-833308375076","parameters":{},"typeVersion":1.1},{"id":"48520a4b-7a8b-41e5-8c43-329c20870bc9","name":"AI Agent","type":"@n8n/n8n-nodes-langchain.agent","position":[2960,1020],"parameters":{},"typeVersion":1.8},{"id":"57fa5985-8551-42a6-bd47-9519589a3bf7","name":"Video or Image","type":"n8n-nodes-base.switch","position":[3300,780],"parameters":{},"typeVersion":3.2},{"id":"649afa30-f30a-4c09-94ed-923f34515fd8","name":"OpenAI Chat Model","type":"@n8n/n8n-nodes-langchain.lmChatOpenAi","position":[2940,1220],"parameters":{},"typeVersion":1.2},{"id":"ab605d41-39a5-4a97-ab2f-8b1b52a5d846","name":"Get File Metadata","type":"n8n-nodes-base.httpRequest","position":[3100,780],"parameters":{},"typeVersion":4.2},{"id":"e571a88e-ca16-4572-ad6c-62f068504fb1","name":"Structured Output Parser","type":"@n8n/n8n-nodes-langchain.outputParserStructured","position":[3160,1220],"parameters":{},"typeVersion":1.2},{"id":"29dc39cb-f783-4f94-868e-e5e6a40a73b2","name":"Get Ads to Process","type":"n8n-nodes-base.googleSheets","position":[1260,2020],"parameters":{},"typeVersion":4.5},{"id":"7d39fa34-bca9-45f1-b88f-76480317de39","name":"Get Settings","type":"n8n-nodes-base.googleSheets","position":[1260,2300],"parameters":{},"typeVersion":4.5},{"id":"304aafc4-5bd0-44f5-b20e-a38e5baefa75","name":"Merge","type":"n8n-nodes-base.merge","position":[1720,2160],"parameters":{},"typeVersion":3.1},{"id":"618ec524-d237-4495-8a51-0333069784e3","name":"AI Agent1","type":"@n8n/n8n-nodes-langchain.agent","position":[2960,1440],"parameters":{},"typeVersion":1.8},{"id":"b56d7a32-7772-48ec-bf20-dbc8709484ab","name":"Google Drive","type":"n8n-nodes-base.googleDrive","position":[1300,1440],"parameters":{},"typeVersion":3},{"id":"6a63d1f4-4e33-4cb5-ac02-7b73c9c7e216","name":"OpenAI Chat Model1","type":"@n8n/n8n-nodes-langchain.lmChatOpenAi","position":[2940,1660],"parameters":{},"typeVersion":1.2},{"id":"d24b46b8-2dfe-4979-a678-5f43e23491ec","name":"Structured Output Parser1","type":"@n8n/n8n-nodes-langchain.outputParserStructured","position":[3160,1660],"parameters":{},"typeVersion":1.2},{"id":"655d8706-a92c-4ad7-8b07-0bf14ce3febf","name":"When clicking ‘Test workflow’","type":"n8n-nodes-base.manualTrigger","position":[920,2140],"parameters":{},"typeVersion":1},{"id":"4ad90a98-acbc-4866-a51a-4d11d7a3a44e","name":"Get Video","type":"n8n-nodes-base.httpRequest","position":[2160,1980],"parameters":{},"typeVersion":4.2},{"id":"f02961b4-328a-4b5f-9d99-6ea5be623123","name":"Wait","type":"n8n-nodes-base.wait","position":[2540,1980],"webhookId":"c022fd1f-a2ca-445d-ba8b-1e847b03ac3a","parameters":{},"typeVersion":1.1},{"id":"e7f640d3-b382-4076-895b-3482bce6bee6","name":"Video or Image Asset","type":"n8n-nodes-base.switch","position":[1900,2160],"parameters":{},"typeVersion":3.2},{"id":"7133563d-7b1a-4ad2-94b8-92e09c1bf7dd","name":"Facebook Graph API","type":"n8n-nodes-base.facebookGraphApi","position":[3800,2280],"parameters":{},"typeVersion":1},{"id":"6b07b2cd-a0cd-494d-9243-0f3ebe836830","name":"Get image 1","type":"n8n-nodes-base.httpRequest","position":[2160,2280],"parameters":{},"typeVersion":4.2},{"id":"783616dd-ddae-459a-b01b-381c0616812f","name":"Get image ","type":"n8n-nodes-base.httpRequest","position":[2800,2200],"parameters":{},"typeVersion":4.2},{"id":"dae5668c-4be2-4a19-800f-83d7b63e1518","name":"Google Drive Folder Updated","type":"n8n-nodes-base.googleDriveTrigger","position":[1260,780],"parameters":{},"typeVersion":1},{"id":"9b6145e0-3fd8-4664-a9dc-297f7d949191","name":"Fetch All Files","type":"n8n-nodes-base.googleDrive","position":[1520,780],"parameters":{},"typeVersion":3},{"id":"d3566142-d98e-47dc-a0a1-74a0be61170f","name":"Get Files Metadata","type":"n8n-nodes-base.httpRequest","position":[1780,780],"parameters":{},"typeVersion":4.2},{"id":"5135bbca-2715-401c-9019-5b21b1b76362","name":"Extract File Specs","type":"n8n-nodes-base.set","position":[2060,780],"parameters":{},"typeVersion":3.4},{"id":"75a91825-ea89-461c-85e5-77a2a6736dee","name":"Save Video Analysis Output","type":"n8n-nodes-base.googleSheets","position":[3320,1020],"parameters":{},"typeVersion":4.5},{"id":"367910e1-f247-4bcd-8ba3-e65afd3ac731","name":"Save Image Analysis Output","type":"n8n-nodes-base.googleSheets","position":[3340,1440],"parameters":{},"typeVersion":4.5},{"id":"d730546f-874b-4f85-882b-415f201f3941","name":"Filter Unprocessed Ads","type":"n8n-nodes-base.filter","position":[1480,2020],"parameters":{},"typeVersion":2.2},{"id":"485afc5d-4490-44a1-b25a-d87b21f1fe04","name":"Create Video Ad Creative","type":"n8n-nodes-base.facebookGraphApi","position":[2960,1980],"parameters":{},"typeVersion":1},{"id":"31fc206d-3f57-4c40-a24e-8299bbd6e452","name":"Create Video Ad","type":"n8n-nodes-base.facebookGraphApi","position":[3580,1980],"parameters":{},"typeVersion":1},{"id":"51e84264-cd4a-4385-be69-ee11ae4429d5","name":"Save Video Ad Details","type":"n8n-nodes-base.googleSheets","position":[4120,1980],"parameters":{},"typeVersion":4.5},{"id":"cb41025e-e1e0-454c-93b5-a36eba57dba5","name":"Check if two or one image","type":"n8n-nodes-base.if","position":[2560,2280],"parameters":{},"typeVersion":2.2},{"id":"73757cd6-9a2c-4bc5-8842-f92177a31cd3","name":"Upload Ad Image","type":"n8n-nodes-base.facebookGraphApi","position":[2340,2280],"parameters":{},"typeVersion":1},{"id":"93f5be7e-8a94-4aaa-8e65-e2316e7bc15a","name":"Create Multiple Image Creative","type":"n8n-nodes-base.facebookGraphApi","position":[3240,2200],"parameters":{},"typeVersion":1},{"id":"49efc025-f772-4669-96c7-a9ed4b2dca63","name":"Create Image Creative","type":"n8n-nodes-base.facebookGraphApi","position":[3000,2520],"parameters":{},"typeVersion":1},{"id":"d7fe1213-3db6-47b3-ac69-debc873c79e0","name":"Upload Second Ad Image","type":"n8n-nodes-base.facebookGraphApi","position":[3020,2200],"parameters":{},"typeVersion":1},{"id":"4887b86c-c0be-4810-90ff-0a5be4a07b71","name":"Create Image Ad","type":"n8n-nodes-base.facebookGraphApi","position":[3580,2280],"parameters":{},"typeVersion":1},{"id":"77f3371f-b818-4bf0-9381-126aa374f453","name":"Sticky Note","type":"n8n-nodes-base.stickyNote","position":[1260,660],"parameters":{"content":""},"typeVersion":1},{"id":"92a00fa1-89be-45e0-9055-189ac0479114","name":"Sticky Note1","type":"n8n-nodes-base.stickyNote","position":[2380,660],"parameters":{"content":""},"typeVersion":1},{"id":"c064fecd-9d51-4839-bf86-9134b12102c4","name":"Sticky Note2","type":"n8n-nodes-base.stickyNote","position":[3500,1100],"parameters":{"content":""},"typeVersion":1},{"id":"f27867dc-13f3-4d7a-8a5b-04776c6389ff","name":"Sticky Note3","type":"n8n-nodes-base.stickyNote","position":[3520,1520],"parameters":{"content":""},"typeVersion":1},{"id":"cc280912-6f45-4836-8c22-edd471c13ec8","name":"Sticky Note4","type":"n8n-nodes-base.stickyNote","position":[4080,1880],"parameters":{"content":""},"typeVersion":1},{"id":"225cde15-4ded-41b1-a6ea-b40ea1c9e961","name":"Sticky Note5","type":"n8n-nodes-base.stickyNote","position":[4080,2460],"parameters":{"content":""},"typeVersion":1},{"id":"9875016f-c878-4215-ba17-a350d8fa26e6","name":"Save Image Ad Details","type":"n8n-nodes-base.googleSheets","position":[4120,2280],"parameters":{},"typeVersion":4.5},{"id":"72d1819a-b983-4f0c-afc2-1f83baf6416f","name":"Sticky Note6","type":"n8n-nodes-base.stickyNote","position":[1220,2460],"parameters":{"content":""},"typeVersion":1},{"id":"79292ebc-98f7-4acb-aca7-01d641091301","name":"Sticky Note7","type":"n8n-nodes-base.stickyNote","position":[1220,1920],"parameters":{"content":""},"typeVersion":1},{"id":"bb4afb0c-97cb-41db-a42d-44c10aed33f3","name":"Sticky Note8","type":"n8n-nodes-base.stickyNote","position":[680,660],"parameters":{"content":""},"typeVersion":1},{"id":"729d2f7e-4e14-4c91-8fa5-1d42eef3923c","name":"Sticky Note9","type":"n8n-nodes-base.stickyNote","position":[2900,1340],"parameters":{"content":""},"typeVersion":1},{"id":"82abdc96-707e-4a9f-8717-217dc583c06f","name":"Sticky Note10","type":"n8n-nodes-base.stickyNote","position":[2900,1780],"parameters":{"content":""},"typeVersion":1},{"id":"051d9a9f-d786-4188-91a5-0f33cf8dba24","name":"Sticky Note11","type":"n8n-nodes-base.stickyNote","position":[640,1940],"parameters":{"content":""},"typeVersion":1}],"active":false,"pinData":{},"settings":{"executionOrder":"v1"},"versionId":"7ec4840f-4712-4879-b777-fa11bb265770","connections":{"If":{"main":[[{"node":"Analyze Video with Gemini","type":"main","index":0}],[{"node":"Wait 2 Seconds","type":"main","index":0}]]},"Wait":{"main":[[{"node":"Get Video Preview Image","type":"main","index":0}]]},"Merge":{"main":[[{"node":"Video or Image Asset","type":"main","index":0}]]},"AI Agent":{"main":[[{"node":"Save Video Analysis Output","type":"main","index":0}]]},"AI Agent1":{"main":[[{"node":"Save Image Analysis Output","type":"main","index":0}]]},"Get Video":{"main":[[{"node":"Upload Ad Video","type":"main","index":0}]]},"Get image ":{"main":[[{"node":"Upload Second Ad Image","type":"main","index":0}]]},"Check State":{"main":[[{"node":"If","type":"main","index":0}]]},"Get image 1":{"main":[[{"node":"Upload Ad Image","type":"main","index":0}]]},"Create Asset":{"main":[[{"node":"Get All Rows","type":"main","index":0}]]},"Get All Rows":{"main":[[{"node":"AI Description is Empty","type":"main","index":0}]]},"Get Settings":{"main":[[{"node":"Merge","type":"main","index":1}]]},"Google Drive":{"main":[[{"node":"AI Agent1","type":"main","index":0}]]},"Video or Image":{"main":[[{"node":"Gemini - Generate Upload URL","type":"main","index":0}],[{"node":"Google Drive","type":"main","index":0}]]},"Wait 2 Seconds":{"main":[[{"node":"Check State","type":"main","index":0}]]},"Wait 3 Seconds":{"main":[[{"node":"Check State","type":"main","index":0}]]},"Create Image Ad":{"main":[[{"node":"Facebook Graph API","type":"main","index":0}]]},"Create Video Ad":{"main":[[{"node":"Save Video Ad Details","type":"main","index":0}]]},"Fetch All Files":{"main":[[{"node":"Get Files Metadata","type":"main","index":0}]]},"Upload Ad Image":{"main":[[{"node":"Check if two or one image","type":"main","index":0}]]},"Upload Ad Video":{"main":[[{"node":"Wait","type":"main","index":0}]]},"Get File Metadata":{"main":[[{"node":"Video or Image","type":"main","index":0}]]},"OpenAI Chat Model":{"ai_languageModel":[[{"node":"AI Agent","type":"ai_languageModel","index":0}]]},"Extract File Specs":{"main":[[{"node":"Create Asset","type":"main","index":0}]]},"Facebook Graph API":{"main":[[{"node":"Save Image Ad Details","type":"main","index":0}]]},"Get Ads to Process":{"main":[[{"node":"Filter Unprocessed Ads","type":"main","index":0}]]},"Get Files Metadata":{"main":[[{"node":"Extract File Specs","type":"main","index":0}]]},"OpenAI Chat Model1":{"ai_languageModel":[[{"node":"AI Agent1","type":"ai_languageModel","index":0}]]},"Gemini - Upload File":{"main":[[{"node":"Wait 3 Seconds","type":"main","index":0}]]},"Video or Image Asset":{"main":[[{"node":"Get Video","type":"main","index":0}],[{"node":"Get image 1","type":"main","index":0}]]},"Create Image Creative":{"main":[[{"node":"Create Image Ad","type":"main","index":0}]]},"Filter Unprocessed Ads":{"main":[[{"node":"Merge","type":"main","index":0}]]},"Upload Second Ad Image":{"main":[[{"node":"Create Multiple Image Creative","type":"main","index":0}]]},"AI Description is Empty":{"main":[[{"node":"Get File Metadata","type":"main","index":0}]]},"Get Video Preview Image":{"main":[[{"node":"Create Video Ad Creative","type":"main","index":0}]]},"Create Video Ad Creative":{"main":[[{"node":"Create Video Ad","type":"main","index":0}]]},"Structured Output Parser":{"ai_outputParser":[[{"node":"AI Agent","type":"ai_outputParser","index":0}]]},"Analyze Video with Gemini":{"main":[[{"node":"AI Agent","type":"main","index":0}]]},"Check if two or one image":{"main":[[{"node":"Get image ","type":"main","index":0}],[{"node":"Create Image Creative","type":"main","index":0}]]},"Structured Output Parser1":{"ai_outputParser":[[{"node":"AI Agent1","type":"ai_outputParser","index":0}]]},"Download from Google Drive":{"main":[[{"node":"Gemini - Upload File","type":"main","index":0}]]},"Google Drive Folder Updated":{"main":[[{"node":"Fetch All Files","type":"main","index":0}]]},"Gemini - Generate Upload URL":{"main":[[{"node":"Download from Google Drive","type":"main","index":0}]]},"Create Multiple Image Creative":{"main":[[{"node":"Create Image Ad","type":"main","index":0}]]},"When clicking ‘Test workflow’":{"main":[[{"node":"Get Ads to Process","type":"main","index":0},{"node":"Get Settings","type":"main","index":0}]]}}}


name: Lead Generation Automate on LinkedIn - Personalisation, Enrichment
author_name: Krupal Patel
author_username: krupalpatel
categories: []
created_at: 2025-06-05T10:57:25.716Z
updated_at: 2025-06-05T10:57:25.716Z
url: https://n8n.io/workflows/4685
scraped_at: 2025-07-06 21:16:30
description:
  🔧 Workflow Summary

  This system automates LinkedIn lead generation and enrichment in six clear stages:

  1. Lead Collection (via Apollo.io)
  Automatically pulls leads based on keywords, roles, or industries using Apollo’s API.
  Captures name, job title, company, and LinkedIn profile URL.
  You can kick off the workflow via form, webhook, WhatsApp, Telegram, or any other custom trigger that passes search parameters.

  2. LinkedIn Username Extraction
  Extracts usernames from LinkedIn profile URLs using a script step.
  These usernames are required for further enrichment using RapidAPI.

  3. Email Retrieval (via Apollo.io User ID)
  Fetches verified work email using the Apollo User ID.
  Email validity is double-checked using www.mails.so filtering out undeliverable or inactive emails by checking MX records and deliverability.

  4. Profile Summary (via LinkedIn API on RapidAPI)
  Enriches lead data by pulling bio/summary details to understand their background and expertise.

  5. Activity Insights (Posts & Reposts)
  Collects recent posts or reposts to help craft personalised messages based on what they’re currently engaging with.

  6. Leads Sheet Update
  All data is written into a Google Sheet.
  New columns are populated dynamically without erasing existing data.

  ⸻

  ✅ Smart Retry Logic

  Each workflow is equipped with a fail-safe system:
  Tracks status per row: ✅ done, ❌ failed, ⏳ pending
  Failed rows are automatically retried after a custom delay (e.g., 2 weeks).
  Ensures minimal drop-offs and complete data coverage.

  📊 Google Sheets Setup

  Make a copy of the following:
  Template 1: Apollo Leads Scraper & Enrichment
  Template 2: Final Enriched Leads 

  The system appends data (like emails, bios, activity) step by step.

  🔐 API Credentials Needed

  1. Apollo API
  Sign up and generate API key at Apollo Developer Portal
  Be sure to enable the “Master API Key” toggle so the same key works for all endpoints.

  2. LinkedIn Data API (via RapidAPI)
  Subscribe at RapidAPI - LinkedIn Data
  Use your key in the x-rapidapi-key
   header.

  3. Mails.so API
  Get your API Key from mails.so dashboard

  🛠️ Troubleshooting – LinkedIn Lead Machine

  ✅ Common Mistakes & Fixes

  1. API Keys Not Working
  Make sure API keys for Apollo, RapidAPI, and mails.so are correct.
  Apollo “Master API Key” must be enabled.
  Keys should be saved as Generic Credentials in n8n.

  2. Leads Not Found
  Check if the search query (keyword/job title) is too narrow.
  Apollo might return empty results if the filters are incorrect.

  3. LinkedIn URLs Missing or Invalid
  Ensure Apollo is returning valid LinkedIn URLs.
  Improper URLs will cause username extraction and enrichment steps to fail.

  4. Emails Not Coming Through
  Apollo may not have verified emails for all leads.
  mails.so might reject invalid or expired email addresses.

  5. Google Sheet Not Updating
  Make sure the Google Sheet is shared with the right Google account (linked to n8n).
  Check if the column names match and data isn’t blocked due to formatting.

  6. Status Columns Not Changing
  Each row must have done, failed, or pending in the status column.
  If the status doesn’t update, the retry logic won’t trigger.

  7. RapidAPI Not Returning Data
  Double-check if username is present and valid.
  Make sure the RapidAPI plan is active and within limits.

  8. Workflow Not Running
  Check if the trigger node (form, webhook, etc.) is connected and active.
  Make sure you’re passing the required inputs (keyword, role, etc.).

  Need Help? Contact www.KrupalPatel.com for support and custom workflow development

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

workflow_json:
  {"id":"Dbzu6lmK6zWsyyQP","meta":{"instanceId":"2cff59bc4079733bed2846cef09ebd74d667b91742f344a1b849c8c2f8c8dd5a","templateCredsSetupCompleted":true},"name":"Lead 1","tags":[],"nodes":[{"id":"4cab7c48-1c69-479e-83ce-fe4d3974b5ce","name":"On form submission","type":"n8n-nodes-base.formTrigger","position":[220,140],"webhookId":"28ff6927-5d05-4182-910b-be2381e3b2c4","parameters":{"options":{},"formTitle":"Leads Search","formFields":{"values":[{"fieldLabel":"Job Title","requiredField":true},{"fieldLabel":"Location","requiredField":true},{"fieldType":"number","fieldLabel":"Number of Leads","requiredField":true}]}},"typeVersion":2.2},{"id":"5ed7d147-f2a2-4a9e-911f-45f5ca0bafdb","name":"Split Out","type":"n8n-nodes-base.splitOut","position":[660,140],"parameters":{"options":{},"fieldToSplitOut":"people"},"typeVersion":1,"alwaysOutputData":false},{"id":"6851151e-6b2a-42b7-8e0a-729c650da6c4","name":"OpenAI1","type":"@n8n/n8n-nodes-langchain.openAi","position":[740,380],"parameters":{"modelId":{"__rl":true,"mode":"list","value":"gpt-3.5-turbo","cachedResultName":"GPT-3.5-TURBO"},"options":{},"messages":{"values":[{"content":"=remove the http or https://www.linkedin.com/in/ from this  {{ $json.linkedin_url }}"}]}},"credentials":{"openAiApi":{"id":"AxgLOaYQtHmZdGyY","name":"krishna openai"}},"typeVersion":1.8},{"id":"f1a9b0fb-f9a8-48f5-b369-f52516214503","name":"Google Sheets Trigger2","type":"n8n-nodes-base.googleSheetsTrigger","position":[20,580],"parameters":{"event":"rowAdded","options":{},"pollTimes":{"item":[{"mode":"everyMinute"}]},"sheetName":{"__rl":true,"mode":"list","value":"gid=0","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE/edit#gid=0","cachedResultName":"Sheet1"},"documentId":{"__rl":true,"mode":"list","value":"1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE/edit?usp=drivesdk","cachedResultName":"Apollo.ai leads and enrichment"}},"credentials":{"googleSheetsTriggerOAuth2Api":{"id":"QIzlwC5h5ovG1JQ1","name":"Google Sheets Trigger account 2"}},"typeVersion":1},{"id":"4c198be2-a508-4269-ad59-0e490caafd60","name":"Sticky Note1","type":"n8n-nodes-base.stickyNote","position":[-200,-60],"parameters":{"width":1820,"height":1020,"content":"## Automated Lead Generation and Enrichment Workflow\n\nDescription: This workflow automates lead generation by collecting job title, location, and lead count via a form, using Apollo.io to fetch leads, and OpenAI to extract LinkedIn usernames. It stores and updates lead data in Google Sheets, validating email addresses and tracking scrape statuses for efficient lead management.\n"},"typeVersion":1},{"id":"4db87428-54a3-4110-bb3e-16ac2a64927b","name":"Clean Data","type":"n8n-nodes-base.set","position":[880,140],"parameters":{"options":{},"assignments":{"assignments":[{"id":"e3bfe30e-9136-4ac9-b3da-c26eb678153b","name":"id","type":"string","value":"={{ $json.id }}"},{"id":"d45c81fb-1461-45fd-be95-d5d9901d72d7","name":"name","type":"string","value":"={{ $json.name }}"},{"id":"b4b8f660-7758-4a5f-a8f6-dc8ab6355132","name":"linkedin_url","type":"string","value":"={{ $json.linkedin_url }}"},{"id":"399f533a-6e6b-4f40-8ed8-aa5dd39017cd","name":"title","type":"string","value":"={{ $json.title }}"},{"id":"227d34c5-17db-4436-b0c2-f74e5ae453f2","name":"organization","type":"string","value":"={{ $json.employment_history[0].organization_name }}"}]}},"typeVersion":3.4},{"id":"a34921c3-cdae-4db0-9c7b-cd857d0cd552","name":"Add Linkedin Username","type":"n8n-nodes-base.googleSheets","position":[1080,380],"parameters":{"columns":{"value":{"apollo_id":"={{ $('Get Pending Username Row').item.json.apollo_id }}","linkedin_username":"={{ $json.message.content }}","extract_username_status":"finished"},"schema":[{"id":"apollo_id","type":"string","display":true,"removed":false,"required":false,"displayName":"apollo_id","defaultMatch":false,"canBeUsedToMatch":true},{"id":"name","type":"string","display":true,"removed":true,"required":false,"displayName":"name","defaultMatch":false,"canBeUsedToMatch":true},{"id":"organization","type":"string","display":true,"removed":true,"required":false,"displayName":"organization","defaultMatch":false,"canBeUsedToMatch":true},{"id":"title","type":"string","display":true,"removed":true,"required":false,"displayName":"title","defaultMatch":false,"canBeUsedToMatch":true},{"id":"linkedin_url","type":"string","display":true,"removed":true,"required":false,"displayName":"linkedin_url","defaultMatch":false,"canBeUsedToMatch":true},{"id":"linkedin_username","type":"string","display":true,"removed":false,"required":false,"displayName":"linkedin_username","defaultMatch":false,"canBeUsedToMatch":true},{"id":"extract_username_status","type":"string","display":true,"removed":false,"required":false,"displayName":"extract_username_status","defaultMatch":false,"canBeUsedToMatch":true},{"id":"email_address","type":"string","display":true,"removed":true,"required":false,"displayName":"email_address","defaultMatch":false,"canBeUsedToMatch":true},{"id":"contacts_scrape_status","type":"string","display":true,"removed":true,"required":false,"displayName":"contacts_scrape_status","defaultMatch":false,"canBeUsedToMatch":true},{"id":"about_linkedin_profile","type":"string","display":true,"removed":true,"required":false,"displayName":"about_linkedin_profile","defaultMatch":false,"canBeUsedToMatch":true},{"id":"profile_summary_scrape","type":"string","display":true,"removed":true,"required":false,"displayName":"profile_summary_scrape","defaultMatch":false,"canBeUsedToMatch":true},{"id":"recent_posts_summary","type":"string","display":true,"removed":true,"required":false,"displayName":"recent_posts_summary","defaultMatch":false,"canBeUsedToMatch":true},{"id":"posts_scrape_status","type":"string","display":true,"removed":true,"required":false,"displayName":"posts_scrape_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":["apollo_id"],"attemptToConvertTypes":false,"convertFieldsToString":false},"options":{},"operation":"update","sheetName":{"__rl":true,"mode":"list","value":"gid=0","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE/edit#gid=0","cachedResultName":"Sheet1"},"documentId":{"__rl":true,"mode":"list","value":"1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE/edit?usp=drivesdk","cachedResultName":"Apollo.ai leads and enrichment"}},"credentials":{"googleSheetsOAuth2Api":{"id":"3h4bdiubEN6iygLi","name":"Google Sheets account"}},"typeVersion":4.5},{"id":"be0a482f-69be-4906-a944-ae480bddc445","name":"Get Pending Username Row","type":"n8n-nodes-base.googleSheets","position":[500,380],"parameters":{"options":{},"filtersUI":{"values":[{"lookupValue":"pending","lookupColumn":"extract_username_status"}]},"sheetName":{"__rl":true,"mode":"list","value":"gid=0","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1Xv9-U2Em_C-M5qTGCZGpSM9HJcchBQGKU6PQusLJEcM/edit#gid=0","cachedResultName":"Sheet1"},"documentId":{"__rl":true,"mode":"list","value":"1Xv9-U2Em_C-M5qTGCZGpSM9HJcchBQGKU6PQusLJEcM","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1Xv9-U2Em_C-M5qTGCZGpSM9HJcchBQGKU6PQusLJEcM/edit?usp=drivesdk","cachedResultName":"Apollo.ai leads and enrichment"}},"credentials":{"googleSheetsOAuth2Api":{"id":"3h4bdiubEN6iygLi","name":"Google Sheets account"}},"executeOnce":true,"typeVersion":4.5},{"id":"f87ef1f1-ba4a-4104-9c4b-f6d93f770ede","name":"Add Email Address","type":"n8n-nodes-base.googleSheets","position":[1340,500],"parameters":{"columns":{"value":{"apollo_id":"={{ $('Get Pending Email Statuses').item.json.apollo_id }}","email_address":"={{ $json.data.email }}","contacts_scrape_status":"finished"},"schema":[{"id":"apollo_id","type":"string","display":true,"removed":false,"required":false,"displayName":"apollo_id","defaultMatch":false,"canBeUsedToMatch":true},{"id":"name","type":"string","display":true,"removed":true,"required":false,"displayName":"name","defaultMatch":false,"canBeUsedToMatch":true},{"id":"organization","type":"string","display":true,"removed":true,"required":false,"displayName":"organization","defaultMatch":false,"canBeUsedToMatch":true},{"id":"title","type":"string","display":true,"removed":true,"required":false,"displayName":"title","defaultMatch":false,"canBeUsedToMatch":true},{"id":"linkedin_url","type":"string","display":true,"removed":true,"required":false,"displayName":"linkedin_url","defaultMatch":false,"canBeUsedToMatch":true},{"id":"linkedin_username","type":"string","display":true,"removed":true,"required":false,"displayName":"linkedin_username","defaultMatch":false,"canBeUsedToMatch":true},{"id":"extract_username_status","type":"string","display":true,"removed":true,"required":false,"displayName":"extract_username_status","defaultMatch":false,"canBeUsedToMatch":true},{"id":"email_address","type":"string","display":true,"removed":false,"required":false,"displayName":"email_address","defaultMatch":false,"canBeUsedToMatch":true},{"id":"contacts_scrape_status","type":"string","display":true,"removed":false,"required":false,"displayName":"contacts_scrape_status","defaultMatch":false,"canBeUsedToMatch":true},{"id":"about_linkedin_profile","type":"string","display":true,"removed":true,"required":false,"displayName":"about_linkedin_profile","defaultMatch":false,"canBeUsedToMatch":true},{"id":"profile_summary_scrape","type":"string","display":true,"removed":true,"required":false,"displayName":"profile_summary_scrape","defaultMatch":false,"canBeUsedToMatch":true},{"id":"recent_posts_summary","type":"string","display":true,"removed":true,"required":false,"displayName":"recent_posts_summary","defaultMatch":false,"canBeUsedToMatch":true},{"id":"posts_scrape_status","type":"string","display":true,"removed":true,"required":false,"displayName":"posts_scrape_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":["apollo_id"],"attemptToConvertTypes":false,"convertFieldsToString":false},"options":{},"operation":"update","sheetName":{"__rl":true,"mode":"list","value":"gid=0","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1d99PlHkp9RPeSAtmATgQ4OC4Selcp8JSFLNuKx-n1EQ/edit#gid=0","cachedResultName":"Sheet1"},"documentId":{"__rl":true,"mode":"list","value":"1Xv9-U2Em_C-M5qTGCZGpSM9HJcchBQGKU6PQusLJEcM","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1Xv9-U2Em_C-M5qTGCZGpSM9HJcchBQGKU6PQusLJEcM/edit?usp=drivesdk","cachedResultName":"Apollo.ai leads and enrichment"}},"credentials":{"googleSheetsOAuth2Api":{"id":"3h4bdiubEN6iygLi","name":"Google Sheets account"}},"executeOnce":true,"typeVersion":4.5},{"id":"1f9cb0e4-2b26-4948-9294-82d8abfab4eb","name":"If","type":"n8n-nodes-base.if","position":[1000,580],"parameters":{"options":{},"conditions":{"options":{"version":2,"leftValue":"","caseSensitive":true,"typeValidation":"loose"},"combinator":"and","conditions":[{"id":"dd16c397-c6f6-4a91-b92c-24a1f24b707f","operator":{"type":"string","operation":"notContains"},"leftValue":"={{ $json.data.mx_record }}","rightValue":"null"},{"id":"bc3200af-7ae4-4944-b410-ebb459e2d927","operator":{"type":"string","operation":"contains"},"leftValue":"={{ $json.data.result }}","rightValue":"deliverable"}]},"looseTypeValidation":true},"typeVersion":2.2},{"id":"d539aec1-0584-4d04-8d6c-0492d0ead4dd","name":"Mark Invalid Email","type":"n8n-nodes-base.googleSheets","position":[1340,700],"parameters":{"columns":{"value":{"apollo_id":"={{ $('Get Pending Email Statuses').item.json.apollo_id }}","contacts_scrape_status":"invalid_email"},"schema":[{"id":"apollo_id","type":"string","display":true,"removed":false,"required":false,"displayName":"apollo_id","defaultMatch":false,"canBeUsedToMatch":true},{"id":"name","type":"string","display":true,"removed":true,"required":false,"displayName":"name","defaultMatch":false,"canBeUsedToMatch":true},{"id":"organization","type":"string","display":true,"removed":true,"required":false,"displayName":"organization","defaultMatch":false,"canBeUsedToMatch":true},{"id":"title","type":"string","display":true,"removed":true,"required":false,"displayName":"title","defaultMatch":false,"canBeUsedToMatch":true},{"id":"linkedin_url","type":"string","display":true,"removed":true,"required":false,"displayName":"linkedin_url","defaultMatch":false,"canBeUsedToMatch":true},{"id":"linkedin_username","type":"string","display":true,"removed":true,"required":false,"displayName":"linkedin_username","defaultMatch":false,"canBeUsedToMatch":true},{"id":"extract_username_status","type":"string","display":true,"removed":true,"required":false,"displayName":"extract_username_status","defaultMatch":false,"canBeUsedToMatch":true},{"id":"email_address","type":"string","display":true,"removed":true,"required":false,"displayName":"email_address","defaultMatch":false,"canBeUsedToMatch":true},{"id":"contacts_scrape_status","type":"string","display":true,"required":false,"displayName":"contacts_scrape_status","defaultMatch":false,"canBeUsedToMatch":true},{"id":"about_linkedin_profile","type":"string","display":true,"removed":true,"required":false,"displayName":"about_linkedin_profile","defaultMatch":false,"canBeUsedToMatch":true},{"id":"profile_summary_scrape","type":"string","display":true,"removed":true,"required":false,"displayName":"profile_summary_scrape","defaultMatch":false,"canBeUsedToMatch":true},{"id":"recent_posts_summary","type":"string","display":true,"removed":true,"required":false,"displayName":"recent_posts_summary","defaultMatch":false,"canBeUsedToMatch":true},{"id":"posts_scrape_status","type":"string","display":true,"removed":true,"required":false,"displayName":"posts_scrape_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":["apollo_id"],"attemptToConvertTypes":false,"convertFieldsToString":false},"options":{},"operation":"update","sheetName":{"__rl":true,"mode":"list","value":"gid=0","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1d99PlHkp9RPeSAtmATgQ4OC4Selcp8JSFLNuKx-n1EQ/edit#gid=0","cachedResultName":"Sheet1"},"documentId":{"__rl":true,"mode":"list","value":"1Xv9-U2Em_C-M5qTGCZGpSM9HJcchBQGKU6PQusLJEcM","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1Xv9-U2Em_C-M5qTGCZGpSM9HJcchBQGKU6PQusLJEcM/edit?usp=drivesdk","cachedResultName":"Apollo.ai leads and enrichment"}},"credentials":{"googleSheetsOAuth2Api":{"id":"3h4bdiubEN6iygLi","name":"Google Sheets account"}},"typeVersion":4.5},{"id":"08fd30c9-acfe-4775-81fa-ccc3153160b8","name":"Confirm Email Validity","type":"n8n-nodes-base.httpRequest","position":[740,580],"parameters":{"url":"=https://api.mails.so/v1/validate?email={{ $json.person.email }}","options":{},"sendHeaders":true,"headerParameters":{"parameters":[{"name":"x-mails-api-key","value":"83bd75d6-5fd4-4ea9-8554-5e2b1ba90893"}]}},"typeVersion":4.2},{"id":"37ac82ac-ee91-42ed-8d62-9b5ba959fb25","name":"Get Pending Email Statuses","type":"n8n-nodes-base.googleSheets","position":[260,580],"parameters":{"options":{},"filtersUI":{"values":[{"lookupValue":"pending","lookupColumn":"contacts_scrape_status"}]},"sheetName":{"__rl":true,"mode":"list","value":"gid=0","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE/edit#gid=0","cachedResultName":"Sheet1"},"documentId":{"__rl":true,"mode":"list","value":"1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE/edit?usp=drivesdk","cachedResultName":"Apollo.ai leads and enrichment"}},"credentials":{"googleSheetsOAuth2Api":{"id":"3h4bdiubEN6iygLi","name":"Google Sheets account"}},"executeOnce":true,"typeVersion":4.5},{"id":"5f5cfd40-520b-4abc-a073-bfa2aa89afb5","name":"Google Sheets Trigger3","type":"n8n-nodes-base.googleSheetsTrigger","position":[-40,1060],"parameters":{"event":"rowAdded","options":{},"pollTimes":{"item":[{"mode":"everyMinute"}]},"sheetName":{"__rl":true,"mode":"list","value":"gid=0","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE/edit#gid=0","cachedResultName":"Sheet1"},"documentId":{"__rl":true,"mode":"list","value":"1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE/edit?usp=drivesdk","cachedResultName":"Apollo.ai leads and enrichment"}},"credentials":{"googleSheetsTriggerOAuth2Api":{"id":"QIzlwC5h5ovG1JQ1","name":"Google Sheets Trigger account 2"}},"typeVersion":1},{"id":"4fe13d3a-553d-45e1-88d6-b75d53b4f58c","name":"Sticky Note4","type":"n8n-nodes-base.stickyNote","position":[-180,960],"parameters":{"color":6,"width":1320,"height":700,"content":"## LinkedIn Profile Summary Enrichment Workflow\nThis workflow automates the enrichment of lead data by fetching LinkedIn profile details for records marked as \"pending\" in a Google Sheets document, using the LinkedIn Data API. It cleans and summarizes the profile data with OpenAI, then updates the Google Sheet with the summarized profile and status, marking failed attempts if errors occur."},"typeVersion":1},{"id":"f00b7fe0-1bb8-44b9-b19e-cca7576bd7fe","name":"Get Profile Posts","type":"n8n-nodes-base.httpRequest","onError":"continueRegularOutput","maxTries":2,"position":[640,1900],"parameters":{"url":"https://linkedin-data-api.p.rapidapi.com/get-profile-posts","options":{},"sendQuery":true,"sendHeaders":true,"queryParameters":{"parameters":[{"name":"username","value":"={{ $json.linkedin_username }}"},{"name":"start","value":"0"}]},"headerParameters":{"parameters":[{"name":"x-rapidapi-host","value":"linkedin-data-api.p.rapidapi.com"},{"name":"x-rapidapi-key","value":"faf88fbfc9msh9af1ccc8b3e2f05p11283cjsnc5302b552c5e"}]}},"retryOnFail":true,"typeVersion":4.2},{"id":"102398c4-8760-4cc7-8664-293b5de3c460","name":"Get About Profile","type":"n8n-nodes-base.httpRequest","onError":"continueRegularOutput","maxTries":2,"position":[760,1060],"parameters":{"url":"https://linkedin-data-api.p.rapidapi.com","options":{},"sendQuery":true,"sendHeaders":true,"queryParameters":{"parameters":[{"name":"username","value":"={{ $json.linkedin_username }}"}]},"headerParameters":{"parameters":[{"name":"x-rapidapi-host","value":"linkedin-data-api.p.rapidapi.com"},{"name":"x-rapidapi-key","value":"faf88fbfc9msh9af1ccc8b3e2f05p11283cjsnc5302b552c5e"}]}},"retryOnFail":true,"typeVersion":4.2},{"id":"747e0b11-839f-4335-bf62-f695575372b1","name":"Get Pending About and Posts Rows","type":"n8n-nodes-base.googleSheets","position":[220,1060],"parameters":{"options":{},"filtersUI":{"values":[{"lookupValue":"pending","lookupColumn":"profile_summary_scrape"}]},"sheetName":{"__rl":true,"mode":"list","value":"gid=0","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE/edit#gid=0","cachedResultName":"Sheet1"},"documentId":{"__rl":true,"mode":"list","value":"1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE/edit?usp=drivesdk","cachedResultName":"Apollo.ai leads and enrichment"}},"credentials":{"googleSheetsOAuth2Api":{"id":"3h4bdiubEN6iygLi","name":"Google Sheets account"}},"executeOnce":true,"typeVersion":4.5},{"id":"f5e0160c-2602-4e62-a230-4b4a73136b88","name":"Clean Profile Data","type":"n8n-nodes-base.code","onError":"continueErrorOutput","maxTries":2,"position":[-60,1360],"parameters":{"mode":"runOnceForEachItem","jsCode":"return {\n  summary: $json.summary || null,\n  headline: $json.headline || null,\n  nationality: $json.geo?.country || null,\n  language: $json.languages?.[0]?.name || null,\n  education: $json.educations?.[0]?.schoolName || null,\n  fieldOfStudy: $json.educations?.[0]?.fieldOfStudy || null,\n  employment_company: $json.position?.[0]?.companyName || null,\n  company_industry: $json.position?.[0]?.companyIndustry || null,\n  position: $json.position?.[0]?.title || null,\n  company_location: $json.position?.[0]?.location || null,\n  employment_description_1: $json.position?.[0]?.description || null,\n};\n"},"retryOnFail":true,"typeVersion":2},{"id":"470a2381-fdcc-4e62-bda2-9ef81db3acb0","name":"Google Sheets Trigger4","type":"n8n-nodes-base.googleSheetsTrigger","position":[-80,1900],"parameters":{"event":"rowAdded","options":{},"pollTimes":{"item":[{"mode":"everyMinute"}]},"sheetName":{"__rl":true,"mode":"list","value":"gid=0","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE/edit#gid=0","cachedResultName":"Sheet1"},"documentId":{"__rl":true,"mode":"list","value":"1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE/edit?usp=drivesdk","cachedResultName":"Apollo.ai leads and enrichment"}},"credentials":{"googleSheetsTriggerOAuth2Api":{"id":"QIzlwC5h5ovG1JQ1","name":"Google Sheets Trigger account 2"}},"typeVersion":1},{"id":"b19f9d0d-b0fa-409a-b3e1-d9b2f52f25e8","name":"Get Pending About and Posts Rows1","type":"n8n-nodes-base.googleSheets","position":[160,1900],"parameters":{"options":{},"filtersUI":{"values":[{"lookupValue":"unscraped","lookupColumn":"posts_scrape_status"}]},"sheetName":{"__rl":true,"mode":"list","value":"gid=0","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE/edit#gid=0","cachedResultName":"Sheet1"},"documentId":{"__rl":true,"mode":"list","value":"1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE/edit?usp=drivesdk","cachedResultName":"Apollo.ai leads and enrichment"}},"credentials":{"googleSheetsOAuth2Api":{"id":"3h4bdiubEN6iygLi","name":"Google Sheets account"}},"executeOnce":true,"typeVersion":4.5},{"id":"3d42dfba-2a1c-4457-bc16-e868c597a381","name":"Clean Posts Data","type":"n8n-nodes-base.code","onError":"continueErrorOutput","maxTries":2,"position":[920,1900],"parameters":{"mode":"runOnceForEachItem","jsCode":"const data = $json.data || [];\n\nfunction getText(post, reshared = false) {\n  if (!post) return \"\";\n  return reshared ? (post.resharedPost?.text || \"\") : (post.text || \"\");\n}\n\nfunction getDate(post) {\n  if (!post) return \"\";\n  return post.postedDate || post.postedDateTimestamp || \"\";\n}\n\nreturn {\n  json: {\n    post_1: getText(data[0]),\n    post_1_date: getDate(data[0]),\n\n    post_2: getText(data[1]),\n    post_2_date: getDate(data[1]),\n\n    post_3: getText(data[2]),\n    post_3_date: getDate(data[2]),\n\n    \n  }\n};\n"},"retryOnFail":true,"typeVersion":2,"waitBetweenTries":3000},{"id":"afa569d3-3fbc-4b16-b869-3461e442a740","name":"Sticky Note6","type":"n8n-nodes-base.stickyNote","position":[-220,1680],"parameters":{"color":4,"width":2420,"height":560,"content":"## LinkedIn Posts Scraping and Lead Enrichment Workflow\nThis workflow retrieves recent LinkedIn posts for leads marked \"unscraped\" in a Google Sheet, using the LinkedIn Data API, and summarizes them with OpenAI to enhance lead profiles for personalized outreach. It updates the Google Sheet with post summaries, tracks failed attempts, and transfers fully enriched profiles (with validated emails, profile summaries, and post summaries) to a separate Enriched Leads Database."},"typeVersion":1},{"id":"31928be6-191f-4ec3-a88d-dbd7f613f1aa","name":"Google Sheets Trigger5","type":"n8n-nodes-base.googleSheetsTrigger","position":[1200,2420],"parameters":{"event":"rowAdded","options":{},"pollTimes":{"item":[{"mode":"everyMinute"}]},"sheetName":{"__rl":true,"mode":"list","value":"gid=0","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE/edit#gid=0","cachedResultName":"Sheet1"},"documentId":{"__rl":true,"mode":"list","value":"1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE/edit?usp=drivesdk","cachedResultName":"Apollo.ai leads and enrichment"}},"credentials":{"googleSheetsTriggerOAuth2Api":{"id":"QIzlwC5h5ovG1JQ1","name":"Google Sheets Trigger account 2"}},"typeVersion":1},{"id":"f0c78b3d-be0c-4113-8392-2d91c4f707d7","name":"Schedule Trigger2","type":"n8n-nodes-base.scheduleTrigger","position":[2120,340],"parameters":{"rule":{"interval":[{"field":"weeks","triggerAtDay":[2],"triggerAtHour":8,"weeksInterval":4}]}},"typeVersion":1.2},{"id":"0661680e-a4d0-4595-aef7-e832fc812f0e","name":"get invalid email rows","type":"n8n-nodes-base.googleSheets","position":[2360,1180],"parameters":{"options":{},"filtersUI":{"values":[{"lookupValue":"invalid_email","lookupColumn":"contacts_scrape_status"}]},"sheetName":{"__rl":true,"mode":"list","value":"gid=0","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE/edit#gid=0","cachedResultName":"Sheet1"},"documentId":{"__rl":true,"mode":"list","value":"1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE/edit?usp=drivesdk","cachedResultName":"Apollo.ai leads and enrichment"}},"credentials":{"googleSheetsOAuth2Api":{"id":"3h4bdiubEN6iygLi","name":"Google Sheets account"}},"executeOnce":true,"typeVersion":4.5},{"id":"d1da0dbc-85f8-4b95-88b4-7cf68e59560a","name":"update_to_pending","type":"n8n-nodes-base.googleSheets","position":[2580,1180],"parameters":{"columns":{"value":{"apollo_id":"={{ $json.apollo_id }}","contacts_scrape_status":"pending"},"schema":[{"id":"apollo_id","type":"string","display":true,"removed":false,"required":false,"displayName":"apollo_id","defaultMatch":false,"canBeUsedToMatch":true},{"id":"name","type":"string","display":true,"removed":true,"required":false,"displayName":"name","defaultMatch":false,"canBeUsedToMatch":true},{"id":"organization","type":"string","display":true,"removed":true,"required":false,"displayName":"organization","defaultMatch":false,"canBeUsedToMatch":true},{"id":"title","type":"string","display":true,"removed":true,"required":false,"displayName":"title","defaultMatch":false,"canBeUsedToMatch":true},{"id":"linkedin_url","type":"string","display":true,"removed":true,"required":false,"displayName":"linkedin_url","defaultMatch":false,"canBeUsedToMatch":true},{"id":"linkedin_username","type":"string","display":true,"removed":true,"required":false,"displayName":"linkedin_username","defaultMatch":false,"canBeUsedToMatch":true},{"id":"extract_username_status","type":"string","display":true,"removed":true,"required":false,"displayName":"extract_username_status","defaultMatch":false,"canBeUsedToMatch":true},{"id":"email_address","type":"string","display":true,"removed":true,"required":false,"displayName":"email_address","defaultMatch":false,"canBeUsedToMatch":true},{"id":"contacts_scrape_status","type":"string","display":true,"removed":false,"required":false,"displayName":"contacts_scrape_status","defaultMatch":false,"canBeUsedToMatch":true},{"id":"about_linkedin_profile","type":"string","display":true,"removed":true,"required":false,"displayName":"about_linkedin_profile","defaultMatch":false,"canBeUsedToMatch":true},{"id":"profile_summary_scrape","type":"string","display":true,"removed":true,"required":false,"displayName":"profile_summary_scrape","defaultMatch":false,"canBeUsedToMatch":true},{"id":"recent_posts_summary","type":"string","display":true,"removed":true,"required":false,"displayName":"recent_posts_summary","defaultMatch":false,"canBeUsedToMatch":true},{"id":"posts_scrape_status","type":"string","display":true,"removed":true,"required":false,"displayName":"posts_scrape_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":["apollo_id"],"attemptToConvertTypes":false,"convertFieldsToString":false},"options":{},"operation":"update","sheetName":{"__rl":true,"mode":"list","value":"gid=0","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1d99PlHkp9RPeSAtmATgQ4OC4Selcp8JSFLNuKx-n1EQ/edit#gid=0","cachedResultName":"Sheet1"},"documentId":{"__rl":true,"mode":"list","value":"1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE/edit?usp=drivesdk","cachedResultName":"Apollo.ai leads and enrichment"}},"credentials":{"googleSheetsOAuth2Api":{"id":"3h4bdiubEN6iygLi","name":"Google Sheets account"}},"typeVersion":4.5},{"id":"2f87a52a-83fa-4a57-90c3-7b9cf658091d","name":"get_failed_profile_summary_rows","type":"n8n-nodes-base.googleSheets","position":[2340,340],"parameters":{"options":{},"filtersUI":{"values":[{"lookupValue":"failed","lookupColumn":"profile_summary_scrape"}]},"sheetName":{"__rl":true,"mode":"list","value":"gid=0","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE/edit#gid=0","cachedResultName":"Sheet1"},"documentId":{"__rl":true,"mode":"list","value":"1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE/edit?usp=drivesdk","cachedResultName":"Apollo.ai leads and enrichment"}},"credentials":{"googleSheetsOAuth2Api":{"id":"3h4bdiubEN6iygLi","name":"Google Sheets account"}},"executeOnce":true,"typeVersion":4.5},{"id":"3ba33190-7e23-4b61-a12c-b014e04dec27","name":"update_to_pending1","type":"n8n-nodes-base.googleSheets","position":[2560,340],"parameters":{"columns":{"value":{"apollo_id":"={{ $json.apollo_id }}","profile_summary_scrape":"pending"},"schema":[{"id":"apollo_id","type":"string","display":true,"removed":false,"required":false,"displayName":"apollo_id","defaultMatch":false,"canBeUsedToMatch":true},{"id":"name","type":"string","display":true,"removed":true,"required":false,"displayName":"name","defaultMatch":false,"canBeUsedToMatch":true},{"id":"organization","type":"string","display":true,"removed":true,"required":false,"displayName":"organization","defaultMatch":false,"canBeUsedToMatch":true},{"id":"title","type":"string","display":true,"removed":true,"required":false,"displayName":"title","defaultMatch":false,"canBeUsedToMatch":true},{"id":"linkedin_url","type":"string","display":true,"removed":true,"required":false,"displayName":"linkedin_url","defaultMatch":false,"canBeUsedToMatch":true},{"id":"linkedin_username","type":"string","display":true,"removed":true,"required":false,"displayName":"linkedin_username","defaultMatch":false,"canBeUsedToMatch":true},{"id":"extract_username_status","type":"string","display":true,"removed":true,"required":false,"displayName":"extract_username_status","defaultMatch":false,"canBeUsedToMatch":true},{"id":"email_address","type":"string","display":true,"removed":true,"required":false,"displayName":"email_address","defaultMatch":false,"canBeUsedToMatch":true},{"id":"contacts_scrape_status","type":"string","display":true,"removed":true,"required":false,"displayName":"contacts_scrape_status","defaultMatch":false,"canBeUsedToMatch":true},{"id":"about_linkedin_profile","type":"string","display":true,"removed":true,"required":false,"displayName":"about_linkedin_profile","defaultMatch":false,"canBeUsedToMatch":true},{"id":"profile_summary_scrape","type":"string","display":true,"removed":false,"required":false,"displayName":"profile_summary_scrape","defaultMatch":false,"canBeUsedToMatch":true},{"id":"recent_posts_summary","type":"string","display":true,"removed":true,"required":false,"displayName":"recent_posts_summary","defaultMatch":false,"canBeUsedToMatch":true},{"id":"posts_scrape_status","type":"string","display":true,"removed":true,"required":false,"displayName":"posts_scrape_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":["apollo_id"],"attemptToConvertTypes":false,"convertFieldsToString":false},"options":{},"operation":"update","sheetName":{"__rl":true,"mode":"list","value":"gid=0","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1d99PlHkp9RPeSAtmATgQ4OC4Selcp8JSFLNuKx-n1EQ/edit#gid=0","cachedResultName":"Sheet1"},"documentId":{"__rl":true,"mode":"list","value":"1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE/edit?usp=drivesdk","cachedResultName":"Apollo.ai leads and enrichment"}},"credentials":{"googleSheetsOAuth2Api":{"id":"3h4bdiubEN6iygLi","name":"Google Sheets account"}},"typeVersion":4.5},{"id":"c84a23f2-c19b-4752-8195-6bb03dc2c3f4","name":"Schedule Trigger3","type":"n8n-nodes-base.scheduleTrigger","position":[2180,800],"parameters":{"rule":{"interval":[{"field":"weeks","triggerAtDay":[2],"triggerAtHour":8,"weeksInterval":4}]}},"typeVersion":1.2},{"id":"7dd1874a-3be3-4c8f-8118-d2f0881f06ba","name":"get_failed_posts_summary_rows1","type":"n8n-nodes-base.googleSheets","position":[2400,800],"parameters":{"options":{},"filtersUI":{"values":[{"lookupValue":"failed","lookupColumn":"posts_scrape_status"}]},"sheetName":{"__rl":true,"mode":"list","value":"gid=0","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE/edit#gid=0","cachedResultName":"Sheet1"},"documentId":{"__rl":true,"mode":"list","value":"1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE/edit?usp=drivesdk","cachedResultName":"Apollo.ai leads and enrichment"}},"credentials":{"googleSheetsOAuth2Api":{"id":"3h4bdiubEN6iygLi","name":"Google Sheets account"}},"executeOnce":true,"typeVersion":4.5},{"id":"2ebf97c9-381f-4823-8a08-c9943c1abf80","name":"Posts AI Summarizer","type":"@n8n/n8n-nodes-langchain.openAi","position":[1560,1820],"parameters":{"modelId":{"__rl":true,"mode":"list","value":"gpt-3.5-turbo","cachedResultName":"GPT-3.5-TURBO"},"options":{},"messages":{"values":[{"content":"=Below are the most recent posts and reposts from a LinkedIn user. Summarize them collectively in no more than two short paragraphs. Focus on capturing the main themes, tone, and any recurring interests or professional concerns.\n\nAvoid listing each post separately — instead, synthesize the information into a narrative that gives a clear idea of what this person is currently focused on or passionate about.\n\nPosts: {{ $json.postsString }}\n\nKeep it insightful but brief — no more than 2 concise paragraphs."}]},"simplify":false},"credentials":{"openAiApi":{"id":"X2hq9OSGP3TFsKt6","name":"AIX 1"}},"executeOnce":false,"typeVersion":1.8},{"id":"6dbcfab2-e3fe-46ed-9fa5-9301f0762815","name":"AI Profile Summarizer","type":"@n8n/n8n-nodes-langchain.openAi","position":[420,1280],"parameters":{"modelId":{"__rl":true,"mode":"list","value":"gpt-3.5-turbo","cachedResultName":"GPT-3.5-TURBO"},"options":{},"messages":{"values":[{"content":"=Please summarize the following linkedin profile data {{ $json.profileString }} for a lead I want to cold email. I want to combine this summary with another information about them to send personalied emails, so please make sure you include relevant bits in the summary"}]},"simplify":false},"credentials":{"openAiApi":{"id":"X2hq9OSGP3TFsKt6","name":"AIX 1"}},"executeOnce":false,"typeVersion":1.8},{"id":"a03e2002-840c-4792-a4aa-35b4a1886584","name":"Update Profile Summary","type":"n8n-nodes-base.googleSheets","position":[900,1280],"parameters":{"columns":{"value":{"apollo_id":"={{ $('Get Pending About and Posts Rows').item.json.apollo_id }}","about_linkedin_profile":"={{ $json.choices[0].message.content }}","profile_summary_scrape":"completed"},"schema":[{"id":"apollo_id","type":"string","display":true,"removed":false,"required":false,"displayName":"apollo_id","defaultMatch":false,"canBeUsedToMatch":true},{"id":"name","type":"string","display":true,"removed":true,"required":false,"displayName":"name","defaultMatch":false,"canBeUsedToMatch":true},{"id":"organization","type":"string","display":true,"removed":true,"required":false,"displayName":"organization","defaultMatch":false,"canBeUsedToMatch":true},{"id":"title","type":"string","display":true,"removed":true,"required":false,"displayName":"title","defaultMatch":false,"canBeUsedToMatch":true},{"id":"linkedin_url","type":"string","display":true,"removed":true,"required":false,"displayName":"linkedin_url","defaultMatch":false,"canBeUsedToMatch":true},{"id":"linkedin_username","type":"string","display":true,"removed":true,"required":false,"displayName":"linkedin_username","defaultMatch":false,"canBeUsedToMatch":true},{"id":"extract_username_status","type":"string","display":true,"removed":true,"required":false,"displayName":"extract_username_status","defaultMatch":false,"canBeUsedToMatch":true},{"id":"email_address","type":"string","display":true,"removed":true,"required":false,"displayName":"email_address","defaultMatch":false,"canBeUsedToMatch":true},{"id":"contacts_scrape_status","type":"string","display":true,"removed":true,"required":false,"displayName":"contacts_scrape_status","defaultMatch":false,"canBeUsedToMatch":true},{"id":"about_linkedin_profile","type":"string","display":true,"removed":false,"required":false,"displayName":"about_linkedin_profile","defaultMatch":false,"canBeUsedToMatch":true},{"id":"profile_summary_scrape","type":"string","display":true,"removed":false,"required":false,"displayName":"profile_summary_scrape","defaultMatch":false,"canBeUsedToMatch":true},{"id":"recent_posts_summary","type":"string","display":true,"removed":true,"required":false,"displayName":"recent_posts_summary","defaultMatch":false,"canBeUsedToMatch":true},{"id":"posts_scrape_status","type":"string","display":true,"removed":true,"required":false,"displayName":"posts_scrape_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":["apollo_id"],"attemptToConvertTypes":false,"convertFieldsToString":false},"options":{},"operation":"update","sheetName":{"__rl":true,"mode":"list","value":"gid=0","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE/edit#gid=0","cachedResultName":"Sheet1"},"documentId":{"__rl":true,"mode":"list","value":"1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE/edit?usp=drivesdk","cachedResultName":"Apollo.ai leads and enrichment"}},"credentials":{"googleSheetsOAuth2Api":{"id":"3h4bdiubEN6iygLi","name":"Google Sheets account"}},"typeVersion":4.5},{"id":"a259f9ad-4e43-4d96-8d37-7312e7658fc2","name":"Update Posts Summary","type":"n8n-nodes-base.googleSheets","position":[2020,1820],"parameters":{"columns":{"value":{"apollo_id":"={{ $('Get Pending About and Posts Rows1').item.json.apollo_id }}","posts_scrape_status":"scraped","recent_posts_summary":"={{ $json.choices[0].message.content }}"},"schema":[{"id":"apollo_id","type":"string","display":true,"removed":false,"required":false,"displayName":"apollo_id","defaultMatch":false,"canBeUsedToMatch":true},{"id":"name","type":"string","display":true,"removed":true,"required":false,"displayName":"name","defaultMatch":false,"canBeUsedToMatch":true},{"id":"organization","type":"string","display":true,"removed":true,"required":false,"displayName":"organization","defaultMatch":false,"canBeUsedToMatch":true},{"id":"title","type":"string","display":true,"removed":true,"required":false,"displayName":"title","defaultMatch":false,"canBeUsedToMatch":true},{"id":"linkedin_url","type":"string","display":true,"removed":true,"required":false,"displayName":"linkedin_url","defaultMatch":false,"canBeUsedToMatch":true},{"id":"linkedin_username","type":"string","display":true,"removed":true,"required":false,"displayName":"linkedin_username","defaultMatch":false,"canBeUsedToMatch":true},{"id":"extract_username_status","type":"string","display":true,"removed":true,"required":false,"displayName":"extract_username_status","defaultMatch":false,"canBeUsedToMatch":true},{"id":"email_address","type":"string","display":true,"removed":true,"required":false,"displayName":"email_address","defaultMatch":false,"canBeUsedToMatch":true},{"id":"contacts_scrape_status","type":"string","display":true,"removed":true,"required":false,"displayName":"contacts_scrape_status","defaultMatch":false,"canBeUsedToMatch":true},{"id":"about_linkedin_profile","type":"string","display":true,"removed":true,"required":false,"displayName":"about_linkedin_profile","defaultMatch":false,"canBeUsedToMatch":true},{"id":"profile_summary_scrape","type":"string","display":true,"removed":true,"required":false,"displayName":"profile_summary_scrape","defaultMatch":false,"canBeUsedToMatch":true},{"id":"recent_posts_summary","type":"string","display":true,"required":false,"displayName":"recent_posts_summary","defaultMatch":false,"canBeUsedToMatch":true},{"id":"posts_scrape_status","type":"string","display":true,"required":false,"displayName":"posts_scrape_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":["apollo_id"],"attemptToConvertTypes":false,"convertFieldsToString":false},"options":{},"operation":"update","sheetName":{"__rl":true,"mode":"list","value":"gid=0","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE/edit#gid=0","cachedResultName":"Sheet1"},"documentId":{"__rl":true,"mode":"list","value":"1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE/edit?usp=drivesdk","cachedResultName":"Apollo.ai leads and enrichment"}},"credentials":{"googleSheetsOAuth2Api":{"id":"3h4bdiubEN6iygLi","name":"Google Sheets account"}},"typeVersion":4.5},{"id":"1e27ce31-3f74-458b-bdd1-b8aaa6cc709a","name":"Get Completely Enriched Profiles","type":"n8n-nodes-base.googleSheets","position":[1420,2420],"parameters":{"options":{},"filtersUI":{"values":[{"lookupValue":"finished","lookupColumn":"contacts_scrape_status"},{"lookupValue":"completed","lookupColumn":"profile_summary_scrape"},{"lookupValue":"scraped","lookupColumn":"posts_scrape_status"}]},"sheetName":{"__rl":true,"mode":"list","value":"gid=0","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE/edit#gid=0","cachedResultName":"Sheet1"},"documentId":{"__rl":true,"mode":"list","value":"1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE/edit?usp=drivesdk","cachedResultName":"Apollo.ai leads and enrichment"}},"credentials":{"googleSheetsOAuth2Api":{"id":"3h4bdiubEN6iygLi","name":"Google Sheets account"}},"executeOnce":true,"typeVersion":4.5},{"id":"80ee87ce-8f6b-4dda-a065-888fe5f485fc","name":"update_to_unscraped","type":"n8n-nodes-base.googleSheets","position":[2600,800],"parameters":{"columns":{"value":{"apollo_id":"={{ $json.apollo_id }}","posts_scrape_status":"unscraped"},"schema":[{"id":"apollo_id","type":"string","display":true,"removed":false,"required":false,"displayName":"apollo_id","defaultMatch":false,"canBeUsedToMatch":true},{"id":"name","type":"string","display":true,"removed":true,"required":false,"displayName":"name","defaultMatch":false,"canBeUsedToMatch":true},{"id":"organization","type":"string","display":true,"removed":true,"required":false,"displayName":"organization","defaultMatch":false,"canBeUsedToMatch":true},{"id":"title","type":"string","display":true,"removed":true,"required":false,"displayName":"title","defaultMatch":false,"canBeUsedToMatch":true},{"id":"linkedin_url","type":"string","display":true,"removed":true,"required":false,"displayName":"linkedin_url","defaultMatch":false,"canBeUsedToMatch":true},{"id":"linkedin_username","type":"string","display":true,"removed":true,"required":false,"displayName":"linkedin_username","defaultMatch":false,"canBeUsedToMatch":true},{"id":"extract_username_status","type":"string","display":true,"removed":true,"required":false,"displayName":"extract_username_status","defaultMatch":false,"canBeUsedToMatch":true},{"id":"email_address","type":"string","display":true,"removed":true,"required":false,"displayName":"email_address","defaultMatch":false,"canBeUsedToMatch":true},{"id":"contacts_scrape_status","type":"string","display":true,"removed":true,"required":false,"displayName":"contacts_scrape_status","defaultMatch":false,"canBeUsedToMatch":true},{"id":"about_linkedin_profile","type":"string","display":true,"removed":true,"required":false,"displayName":"about_linkedin_profile","defaultMatch":false,"canBeUsedToMatch":true},{"id":"profile_summary_scrape","type":"string","display":true,"removed":true,"required":false,"displayName":"profile_summary_scrape","defaultMatch":false,"canBeUsedToMatch":true},{"id":"recent_posts_summary","type":"string","display":true,"removed":true,"required":false,"displayName":"recent_posts_summary","defaultMatch":false,"canBeUsedToMatch":true},{"id":"posts_scrape_status","type":"string","display":true,"removed":false,"required":false,"displayName":"posts_scrape_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":["apollo_id"],"attemptToConvertTypes":false,"convertFieldsToString":false},"options":{},"operation":"update","sheetName":{"__rl":true,"mode":"list","value":"gid=0","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1d99PlHkp9RPeSAtmATgQ4OC4Selcp8JSFLNuKx-n1EQ/edit#gid=0","cachedResultName":"Sheet1"},"documentId":{"__rl":true,"mode":"list","value":"1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE/edit?usp=drivesdk","cachedResultName":"Apollo.ai leads and enrichment"}},"credentials":{"googleSheetsOAuth2Api":{"id":"3h4bdiubEN6iygLi","name":"Google Sheets account"}},"typeVersion":4.5},{"id":"5f39b0e9-da20-48d1-b169-57252c514f36","name":"Append to Enriched Leads Database","type":"n8n-nodes-base.googleSheets","position":[1620,2420],"parameters":{"columns":{"value":{"Position":"={{ $json.title }}","Lead Name":"={{ $json.name }}","Email Address":"={{ $json.email_address }}","Company/Organization":"={{ $json.organization }}","Recent Posts Summary":"={{ $json.recent_posts_summary }}","Linkedin Profile Summary":"={{ $json.about_linkedin_profile }}"},"schema":[{"id":"Lead Name","type":"string","display":true,"required":false,"displayName":"Lead Name","defaultMatch":false,"canBeUsedToMatch":true},{"id":"Email Address","type":"string","display":true,"removed":false,"required":false,"displayName":"Email Address","defaultMatch":false,"canBeUsedToMatch":true},{"id":"Company/Organization","type":"string","display":true,"required":false,"displayName":"Company/Organization","defaultMatch":false,"canBeUsedToMatch":true},{"id":"Position","type":"string","display":true,"required":false,"displayName":"Position","defaultMatch":false,"canBeUsedToMatch":true},{"id":"Linkedin Profile Summary","type":"string","display":true,"required":false,"displayName":"Linkedin Profile Summary","defaultMatch":false,"canBeUsedToMatch":true},{"id":"Recent Posts Summary","type":"string","display":true,"required":false,"displayName":"Recent Posts Summary","defaultMatch":false,"canBeUsedToMatch":true}],"mappingMode":"defineBelow","matchingColumns":["Email Address"],"attemptToConvertTypes":false,"convertFieldsToString":false},"options":{},"operation":"appendOrUpdate","sheetName":{"__rl":true,"mode":"list","value":"gid=0","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1npW6ZR6a7hDhxXcKUPPSRfE9em9ZZ2-qiOxmbscYnjc/edit#gid=0","cachedResultName":"Sheet1"},"documentId":{"__rl":true,"mode":"list","value":"1npW6ZR6a7hDhxXcKUPPSRfE9em9ZZ2-qiOxmbscYnjc","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1npW6ZR6a7hDhxXcKUPPSRfE9em9ZZ2-qiOxmbscYnjc/edit?usp=drivesdk","cachedResultName":"Enriched Leads Database"}},"credentials":{"googleSheetsOAuth2Api":{"id":"3h4bdiubEN6iygLi","name":"Google Sheets account"}},"typeVersion":4.5},{"id":"3c2ced03-2b9d-4cae-8ce2-3d280575448e","name":"update status to failed","type":"n8n-nodes-base.googleSheets","position":[200,1440],"parameters":{"columns":{"value":{"apollo_id":"={{ $('Get Pending About and Posts Rows').item.json.apollo_id }}","profile_summary_scrape":"failed"},"schema":[{"id":"apollo_id","type":"string","display":true,"removed":false,"required":false,"displayName":"apollo_id","defaultMatch":false,"canBeUsedToMatch":true},{"id":"name","type":"string","display":true,"removed":true,"required":false,"displayName":"name","defaultMatch":false,"canBeUsedToMatch":true},{"id":"organization","type":"string","display":true,"removed":true,"required":false,"displayName":"organization","defaultMatch":false,"canBeUsedToMatch":true},{"id":"title","type":"string","display":true,"removed":true,"required":false,"displayName":"title","defaultMatch":false,"canBeUsedToMatch":true},{"id":"linkedin_url","type":"string","display":true,"removed":true,"required":false,"displayName":"linkedin_url","defaultMatch":false,"canBeUsedToMatch":true},{"id":"linkedin_username","type":"string","display":true,"removed":true,"required":false,"displayName":"linkedin_username","defaultMatch":false,"canBeUsedToMatch":true},{"id":"extract_username_status","type":"string","display":true,"removed":true,"required":false,"displayName":"extract_username_status","defaultMatch":false,"canBeUsedToMatch":true},{"id":"email_address","type":"string","display":true,"removed":true,"required":false,"displayName":"email_address","defaultMatch":false,"canBeUsedToMatch":true},{"id":"contacts_scrape_status","type":"string","display":true,"removed":true,"required":false,"displayName":"contacts_scrape_status","defaultMatch":false,"canBeUsedToMatch":true},{"id":"about_linkedin_profile","type":"string","display":true,"removed":true,"required":false,"displayName":"about_linkedin_profile","defaultMatch":false,"canBeUsedToMatch":true},{"id":"profile_summary_scrape","type":"string","display":true,"required":false,"displayName":"profile_summary_scrape","defaultMatch":false,"canBeUsedToMatch":true},{"id":"recent_posts_summary","type":"string","display":true,"removed":true,"required":false,"displayName":"recent_posts_summary","defaultMatch":false,"canBeUsedToMatch":true},{"id":"posts_scrape_status","type":"string","display":true,"removed":true,"required":false,"displayName":"posts_scrape_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":["apollo_id"],"attemptToConvertTypes":false,"convertFieldsToString":false},"options":{},"operation":"update","sheetName":{"__rl":true,"mode":"list","value":"gid=0","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1Xv9-U2Em_C-M5qTGCZGpSM9HJcchBQGKU6PQusLJEcM/edit#gid=0","cachedResultName":"Sheet1"},"documentId":{"__rl":true,"mode":"list","value":"1Xv9-U2Em_C-M5qTGCZGpSM9HJcchBQGKU6PQusLJEcM","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1Xv9-U2Em_C-M5qTGCZGpSM9HJcchBQGKU6PQusLJEcM/edit?usp=drivesdk","cachedResultName":"Apollo.ai leads and enrichment"}},"credentials":{"googleSheetsOAuth2Api":{"id":"3h4bdiubEN6iygLi","name":"Google Sheets account"}},"typeVersion":4.5},{"id":"e23649fb-6414-46e1-86ff-040e69896c0b","name":"Google Sheets","type":"n8n-nodes-base.googleSheets","position":[1320,1980],"parameters":{"columns":{"value":{"apollo_id":"={{ $('Get Pending About and Posts Rows1').item.json.apollo_id }}","posts_scrape_status":"failed"},"schema":[{"id":"apollo_id","type":"string","display":true,"removed":false,"required":false,"displayName":"apollo_id","defaultMatch":false,"canBeUsedToMatch":true},{"id":"name","type":"string","display":true,"removed":true,"required":false,"displayName":"name","defaultMatch":false,"canBeUsedToMatch":true},{"id":"organization","type":"string","display":true,"removed":true,"required":false,"displayName":"organization","defaultMatch":false,"canBeUsedToMatch":true},{"id":"title","type":"string","display":true,"removed":true,"required":false,"displayName":"title","defaultMatch":false,"canBeUsedToMatch":true},{"id":"linkedin_url","type":"string","display":true,"removed":true,"required":false,"displayName":"linkedin_url","defaultMatch":false,"canBeUsedToMatch":true},{"id":"linkedin_username","type":"string","display":true,"removed":true,"required":false,"displayName":"linkedin_username","defaultMatch":false,"canBeUsedToMatch":true},{"id":"extract_username_status","type":"string","display":true,"removed":true,"required":false,"displayName":"extract_username_status","defaultMatch":false,"canBeUsedToMatch":true},{"id":"email_address","type":"string","display":true,"removed":true,"required":false,"displayName":"email_address","defaultMatch":false,"canBeUsedToMatch":true},{"id":"contacts_scrape_status","type":"string","display":true,"removed":true,"required":false,"displayName":"contacts_scrape_status","defaultMatch":false,"canBeUsedToMatch":true},{"id":"about_linkedin_profile","type":"string","display":true,"removed":true,"required":false,"displayName":"about_linkedin_profile","defaultMatch":false,"canBeUsedToMatch":true},{"id":"profile_summary_scrape","type":"string","display":true,"removed":true,"required":false,"displayName":"profile_summary_scrape","defaultMatch":false,"canBeUsedToMatch":true},{"id":"recent_posts_summary","type":"string","display":true,"removed":true,"required":false,"displayName":"recent_posts_summary","defaultMatch":false,"canBeUsedToMatch":true},{"id":"posts_scrape_status","type":"string","display":true,"required":false,"displayName":"posts_scrape_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":["apollo_id"],"attemptToConvertTypes":false,"convertFieldsToString":false},"options":{},"operation":"update","sheetName":{"__rl":true,"mode":"list","value":"gid=0","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1d99PlHkp9RPeSAtmATgQ4OC4Selcp8JSFLNuKx-n1EQ/edit#gid=0","cachedResultName":"Sheet1"},"documentId":{"__rl":true,"mode":"list","value":"1Xv9-U2Em_C-M5qTGCZGpSM9HJcchBQGKU6PQusLJEcM","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1Xv9-U2Em_C-M5qTGCZGpSM9HJcchBQGKU6PQusLJEcM/edit?usp=drivesdk","cachedResultName":"Apollo.ai leads and enrichment"}},"credentials":{"googleSheetsOAuth2Api":{"id":"3h4bdiubEN6iygLi","name":"Google Sheets account"}},"typeVersion":4.5},{"id":"7b086a49-f227-4883-9391-25e5acb8780a","name":"Stringify Profile Data1","type":"n8n-nodes-base.code","position":[200,1280],"parameters":{"mode":"runOnceForEachItem","jsCode":"const profile = item.json;\n\nreturn {\n  json: {\n    profileString: JSON.stringify(profile, null, 2) // Pretty print with 2-space indentation\n  }\n};"},"typeVersion":2},{"id":"608eb567-2f5f-4113-acb8-d2ef2a2990e5","name":"Stringify Posts Data","type":"n8n-nodes-base.code","position":[1320,1820],"parameters":{"mode":"runOnceForEachItem","jsCode":"const profile = item.json;\n\nreturn {\n  json: {\n    postsString: JSON.stringify(profile, null, 2) // Pretty print with 2-space indentation\n  }\n};"},"typeVersion":2},{"id":"a873dbe2-c2fd-41ab-bad7-7e058446ffc2","name":"Schedule Trigger1","type":"n8n-nodes-base.scheduleTrigger","position":[2140,1180],"parameters":{"rule":{"interval":[{"field":"weeks","triggerAtDay":[2],"triggerAtHour":8,"weeksInterval":4}]}},"typeVersion":1.2},{"id":"e6a3abf6-bb85-4b7e-9498-5490d1d9a3b4","name":"Generate Leads with Apollo.io1","type":"n8n-nodes-base.httpRequest","position":[460,140],"parameters":{"url":"=https://api.apollo.io/api/v1/mixed_people/search","method":"POST","options":{"response":{"response":{}}},"jsonBody":"={\n  \"person_locations\": [\"{{ $json.Location }}\"],\n  \"person_titles\": [\"{{ $json['Job Title'] }}\"],\n  \"page\": 1,\n  \"per_page\": {{$json['Number of Leads']}},\n  \"projection\": [\"id\", \"name\", \"linkedin_url\", \"title\"]\n}","sendBody":true,"sendHeaders":true,"specifyBody":"json","headerParameters":{"parameters":[{"name":"Cache-Control","value":"no-cache"},{"name":"accept","value":"application/json"},{"name":"x-api-key","value":"\"your-api_key_here\""}]}},"typeVersion":4.2},{"id":"ddc7ed41-4be8-4daf-85ef-0cdb706f3003","name":"Add Leads to Google Sheet","type":"n8n-nodes-base.googleSheets","position":[1080,140],"parameters":{"columns":{"value":{"name":"={{ $json.name }}","title":"={{ $json.title }}","apollo_id":"={{ $json.id }}","linkedin_url":"={{ $json.linkedin_url }}","organization":"={{ $json.organization }}","posts_scrape_status":"pending","contacts_scrape_status":"pending","profile_summary_scrape":"pending","extract_username_status":"pending"},"schema":[{"id":"apollo_id","type":"string","display":true,"required":false,"displayName":"apollo_id","defaultMatch":false,"canBeUsedToMatch":true},{"id":"name","type":"string","display":true,"required":false,"displayName":"name","defaultMatch":false,"canBeUsedToMatch":true},{"id":"organization","type":"string","display":true,"required":false,"displayName":"organization","defaultMatch":false,"canBeUsedToMatch":true},{"id":"title","type":"string","display":true,"required":false,"displayName":"title","defaultMatch":false,"canBeUsedToMatch":true},{"id":"linkedin_url","type":"string","display":true,"required":false,"displayName":"linkedin_url","defaultMatch":false,"canBeUsedToMatch":true},{"id":"linkedin_username","type":"string","display":true,"removed":true,"required":false,"displayName":"linkedin_username","defaultMatch":false,"canBeUsedToMatch":true},{"id":"extract_username_status","type":"string","display":true,"required":false,"displayName":"extract_username_status","defaultMatch":false,"canBeUsedToMatch":true},{"id":"email_address","type":"string","display":true,"removed":true,"required":false,"displayName":"email_address","defaultMatch":false,"canBeUsedToMatch":true},{"id":"contacts_scrape_status","type":"string","display":true,"required":false,"displayName":"contacts_scrape_status","defaultMatch":false,"canBeUsedToMatch":true},{"id":"about_linkedin_profile","type":"string","display":true,"removed":true,"required":false,"displayName":"about_linkedin_profile","defaultMatch":false,"canBeUsedToMatch":true},{"id":"profile_summary_scrape","type":"string","display":true,"removed":false,"required":false,"displayName":"profile_summary_scrape","defaultMatch":false,"canBeUsedToMatch":true},{"id":"recent_posts_summary","type":"string","display":true,"removed":true,"required":false,"displayName":"recent_posts_summary","defaultMatch":false,"canBeUsedToMatch":true},{"id":"posts_scrape_status","type":"string","display":true,"required":false,"displayName":"posts_scrape_status","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/1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE/edit#gid=0","cachedResultName":"Sheet1"},"documentId":{"__rl":true,"mode":"list","value":"1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE/edit?usp=drivesdk","cachedResultName":"Apollo.ai leads and enrichment"}},"credentials":{"googleSheetsOAuth2Api":{"id":"3h4bdiubEN6iygLi","name":"Google Sheets account"}},"typeVersion":4.5},{"id":"836386bd-a5c4-4cb1-8ba6-8ce2310fcc96","name":"HTTP Request","type":"n8n-nodes-base.httpRequest","position":[520,5040],"parameters":{"url":"=https://blessed-gently-stag.ngrok-free.app/contacts","options":{}},"typeVersion":4.2},{"id":"ed3b325d-80a5-491a-9f1d-165df1d5b0ec","name":"Get Email from Apollo11","type":"n8n-nodes-base.httpRequest","position":[480,580],"parameters":{"url":"https://api.apollo.io/api/v1/people/match","method":"POST","options":{},"sendBody":true,"sendQuery":true,"sendHeaders":true,"bodyParameters":{"parameters":[{"name":"id","value":"={{ $json.apollo_id }}"}]},"queryParameters":{"parameters":[{"name":"reveal_personal_emails","value":"true"},{"name":"reveal_phone_number","value":"false"}]},"headerParameters":{"parameters":[{"name":"Cache-Control","value":"no-cache"},{"name":"accept","value":"application/json"},{"name":"x-api-key","value":"\"your_api_key\""}]}},"typeVersion":4.2},{"id":"f9b631b7-d5ad-49be-9a84-c8eceaedb264","name":"Limit","type":"n8n-nodes-base.limit","position":[440,1060],"parameters":{"maxItems":2},"typeVersion":1},{"id":"91810b86-6b72-402a-a11f-fea6c6d79b80","name":"Limit1","type":"n8n-nodes-base.limit","position":[380,1900],"parameters":{"maxItems":8},"typeVersion":1},{"id":"302e4c03-82bc-42f6-bb17-e03db2f50a4a","name":"Sticky Note","type":"n8n-nodes-base.stickyNote","position":[1060,2300],"parameters":{"color":4,"width":960,"height":360,"content":"## Update Completely Enriched Profile to Final Database"},"typeVersion":1},{"id":"630174c3-35a3-424f-aa93-6b679cf21624","name":"Sticky Note10","type":"n8n-nodes-base.stickyNote","position":[2040,660],"parameters":{"color":7,"width":800,"height":360,"content":"## Update posts summary status from failed back to pending"},"typeVersion":1},{"id":"c689c67c-5169-4d7d-a1e8-70b986cd1a47","name":"Sticky Note3","type":"n8n-nodes-base.stickyNote","position":[2040,1100],"parameters":{"color":5,"width":800,"height":360,"content":"## Update Contact Scrape Status from Invalid back to Pending"},"typeVersion":1},{"id":"c27398fd-76d0-470f-b8c8-969e5a1c6a87","name":"Google Sheets Trigger","type":"n8n-nodes-base.googleSheetsTrigger","position":[260,380],"parameters":{"event":"rowAdded","options":{},"pollTimes":{"item":[{"mode":"everyMinute"}]},"sheetName":{"__rl":true,"mode":"list","value":"gid=0","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE/edit#gid=0","cachedResultName":"Sheet1"},"documentId":{"__rl":true,"mode":"list","value":"1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE/edit?usp=drivesdk","cachedResultName":"Apollo.ai leads and enrichment"}},"credentials":{"googleSheetsTriggerOAuth2Api":{"id":"QIzlwC5h5ovG1JQ1","name":"Google Sheets Trigger account 2"}},"typeVersion":1},{"id":"427f85ab-7b49-4b6d-89a2-dbe0bc3e0534","name":"Sticky Note8","type":"n8n-nodes-base.stickyNote","position":[2000,220],"parameters":{"color":6,"width":820,"height":360,"content":"## Update profile summary status from failed back to pending"},"typeVersion":1},{"id":"0dc99522-a422-4321-b51e-676a70936c8b","name":"Sticky Note2","type":"n8n-nodes-base.stickyNote","position":[1720,40],"parameters":{"color":4,"width":1280,"height":1540,"content":"## Scheduled Lead Status Reset Workflow\nThis workflow runs on a schedule every four weeks to identify Google Sheets rows with invalid email addresses or failed post summary scrapes. It updates the status of these rows to \"pending\" for email revalidation and \"unscraped\" for post rescraping, enabling automated retry attempts for lead enrichment."},"typeVersion":1}],"active":false,"pinData":{},"settings":{"executionOrder":"v1"},"versionId":"5436ea49-4d99-4996-a2ff-6feb039aac43","connections":{"If":{"main":[[{"node":"Add Email Address","type":"main","index":0}],[{"node":"Mark Invalid Email","type":"main","index":0}]]},"Limit":{"main":[[{"node":"Get About Profile","type":"main","index":0}]]},"Limit1":{"main":[[{"node":"Get Profile Posts","type":"main","index":0}]]},"OpenAI1":{"main":[[{"node":"Add Linkedin Username","type":"main","index":0}]]},"Split Out":{"main":[[{"node":"Clean Data","type":"main","index":0}]]},"Clean Data":{"main":[[{"node":"Add Leads to Google Sheet","type":"main","index":0}]]},"HTTP Request":{"main":[[]]},"Clean Posts Data":{"main":[[{"node":"Stringify Posts Data","type":"main","index":0}],[{"node":"Google Sheets","type":"main","index":0}]]},"Get About Profile":{"main":[[{"node":"Clean Profile Data","type":"main","index":0}]]},"Get Profile Posts":{"main":[[{"node":"Clean Posts Data","type":"main","index":0}]]},"Schedule Trigger1":{"main":[[{"node":"get invalid email rows","type":"main","index":0}]]},"Schedule Trigger2":{"main":[[{"node":"get_failed_profile_summary_rows","type":"main","index":0}]]},"Schedule Trigger3":{"main":[[{"node":"get_failed_posts_summary_rows1","type":"main","index":0}]]},"Clean Profile Data":{"main":[[{"node":"Stringify Profile Data1","type":"main","index":0}],[{"node":"update status to failed","type":"main","index":0}]]},"On form submission":{"main":[[{"node":"Generate Leads with Apollo.io1","type":"main","index":0}]]},"Posts AI Summarizer":{"main":[[{"node":"Update Posts Summary","type":"main","index":0}]]},"Stringify Posts Data":{"main":[[{"node":"Posts AI Summarizer","type":"main","index":0}]]},"AI Profile Summarizer":{"main":[[{"node":"Update Profile Summary","type":"main","index":0}]]},"Google Sheets Trigger":{"main":[[{"node":"Get Pending Username Row","type":"main","index":0}]]},"Confirm Email Validity":{"main":[[{"node":"If","type":"main","index":0}]]},"Google Sheets Trigger2":{"main":[[{"node":"Get Pending Email Statuses","type":"main","index":0}]]},"Google Sheets Trigger3":{"main":[[{"node":"Get Pending About and Posts Rows","type":"main","index":0}]]},"Google Sheets Trigger4":{"main":[[{"node":"Get Pending About and Posts Rows1","type":"main","index":0}]]},"Google Sheets Trigger5":{"main":[[{"node":"Get Completely Enriched Profiles","type":"main","index":0}]]},"get invalid email rows":{"main":[[{"node":"update_to_pending","type":"main","index":0}]]},"Get Email from Apollo11":{"main":[[{"node":"Confirm Email Validity","type":"main","index":0}]]},"Stringify Profile Data1":{"main":[[{"node":"AI Profile Summarizer","type":"main","index":0}]]},"Get Pending Username Row":{"main":[[{"node":"OpenAI1","type":"main","index":0}]]},"Get Pending Email Statuses":{"main":[[{"node":"Get Email from Apollo11","type":"main","index":0}]]},"Generate Leads with Apollo.io1":{"main":[[{"node":"Split Out","type":"main","index":0}]]},"get_failed_posts_summary_rows1":{"main":[[{"node":"update_to_unscraped","type":"main","index":0}]]},"get_failed_profile_summary_rows":{"main":[[{"node":"update_to_pending1","type":"main","index":0}]]},"Get Completely Enriched Profiles":{"main":[[{"node":"Append to Enriched Leads Database","type":"main","index":0}]]},"Get Pending About and Posts Rows":{"main":[[{"node":"Limit","type":"main","index":0}]]},"Get Pending About and Posts Rows1":{"main":[[{"node":"Limit1","type":"main","index":0}]]}}}


