Back to Catalog

YouTube lead generation: Turn comments into enriched prospects with Apify and Gemini AI

Msaid Mohamed el hadiMsaid Mohamed el hadi
1393 views
2/3/2026
Official Page

Automated YouTube Leads: Turn Comments into Enriched Prospects

Workflow Overview

This cutting-edge n8n workflow is a powerful automation tool designed to revolutionize how businesses and marketers identify and qualify leads directly from YouTube video comments. By leveraging specialized Apify Actors and an intelligent AI agent, this workflow seamlessly transforms raw comment data into comprehensive lead profiles, saving valuable time and resources.

This workflow automatically:

  • Discovers & Scrapes Comments:

    • Monitors a Google Sheet for new YouTube video URLs.
    • Automatically extracts all comments from specified YouTube videos using a dedicated Apify Actor.
    • Marks videos as "scrapped" to avoid reprocessing.
  • Intelligent Lead Enrichment:

    • Retrieves unprocessed comments from Google Sheets.
    • Activates an advanced AI agent (powered by OpenRouter's cutting-edge models) to research comment authors.
    • Utilizes Google Search (via Serper API) and specialized Apify scrapers (for website content and Instagram profiles) to find publicly available information like social media links, bios, and potential contact details.
    • Generates concise descriptions for each lead based on gathered data.
  • Organized Data Storage:

    • Creates new entries in a dedicated Google Sheet for each new lead.
    • Updates lead profiles with all discovered enriched data (email, social media, short bio, etc.).
    • Marks comments as "processed" once their authors have been researched and enriched.

Key Benefits

🤖 Full Automation: Eliminates manual data collection and research, freeing up your team for strategic tasks. 💡 Smart Lead Enrichment: AI intelligently sifts through information to build rich, actionable lead profiles. ⏱️ Time-Saving: Instant, scalable lead generation without human intervention. 📈 Enhanced Lead Quality: Go beyond basic contact info with comprehensive social and professional context. 📊 Centralized Data: All leads are neatly organized in Google Sheets for easy access and integration.

Setup Requirements

  • n8n Installation:
    • Install n8n (cloud or self-hosted).
    • Import the workflow configuration.
    • Configure API credentials.
    • Set up scheduling preferences for continuous operation.
  • Google Sheets Credentials:
    • A Google Cloud API key with access to Google Sheets.
    • Set up OAuth2 authentication in n8n for read/write access to your "youtube leads" spreadsheet (containing "videos", "comments", and "leads" sheets).
  • OpenRouter API Access:
    • Create an OpenRouter account.
    • Generate an API key to access their chat models (e.g., google/gemini-2.5-flash-preview-05-20) for AI agent operations.
  • Apify API Access:
  • Serper API Key:
    • Sign up for an account on Serper.dev.
    • Obtain an API key for performing Google searches to find social media profiles and other information.

Potential Use Cases

  • Content Creators: Identify highly engaged audience members for community building or direct outreach.
  • Marketing Teams: Discover potential customers or influencers interacting with competitor content.
  • Sales Professionals: Build targeted lead lists based on specific interests expressed in comments.
  • Market Researchers: Analyze audience demographics and interests by enriching profiles of commenters on relevant videos.
  • Recruiters: Find potential candidates based on their expertise or engagement in industry-specific discussions.

Future Enhancement Roadmap

  • CRM Integration: Directly push enriched leads into popular CRM systems (e.g., HubSpot, Salesforce).
  • Automated Outreach: Implement automated email or social media messaging for qualified leads.
  • Sentiment Analysis: Analyze comment sentiment before enrichment to prioritize positive interactions.
  • Multi-Platform Support: Expand comment extraction and lead enrichment to other platforms (e.g., TikTok, Facebook).
  • Advanced Lead Scoring: Develop a scoring model based on engagement, profile completeness, and relevance.

Ethical Considerations

  • Data Privacy: Ensure all collected data is publicly available and used in compliance with relevant privacy regulations (e.g., GDPR, CCPA).
  • Platform Guidelines: Adhere strictly to YouTube's Terms of Service and Apify's usage policies.
  • Transparency: If engaging with leads, be transparent about how their information was obtained (if applicable).
  • No Spam: This tool is designed for lead identification, not for unsolicited mass messaging.

Technical Requirements

  • n8n v1.0.0 or higher (recommended for latest features and stability)
  • Google Sheets API access
  • OpenRouter API access
  • Apify API access
  • Serper API access
  • Stable internet connection

Workflow Architecture

[YouTube Video URLs (Google Sheet)]
    ⬇️
[Schedule/Manual Trigger]
    ⬇️
[Extract Comments (Apify YouTube Scraper)]
    ⬇️
[Save Raw Comments (Google Sheet)]
    ⬇️
[AI Agent (OpenRouter) for Lead Research]
    ⬇️
[Google Search (Serper) & Web Scraping (Apify FireScraper/Instagram Scraper)]
    ⬇️
[Save Enriched Leads (Google Sheet)]
    ⬇️
[Mark Comments Processed (Google Sheet)]

Connect With Me

Exploring AI-Powered Lead Generation? 📧 Email: mohamedgb00714@gmail.com 💼 LinkedIn: Mohamed el Hadi Msaid

Transform your YouTube engagement into a powerful lead generation engine with intelligent, automated insights!

n8n YouTube Lead Generation Workflow

This n8n workflow is designed to extract, enrich, and manage potential leads from YouTube comments using AI. It leverages Apify for data extraction and Gemini AI (via OpenRouter) for comment analysis and lead qualification, storing the enriched data in Google Sheets.

What it does

This workflow automates the following steps:

  1. Trigger: The workflow can be manually executed or scheduled to run at predefined intervals.
  2. Initial Data: A Sticky Note node provides initial context or data, likely for Apify's YouTube Comment Scraper.
  3. YouTube Comment Scraping (via HTTP Request): It makes an HTTP request to Apify to initiate a YouTube comment scraping task. This step is configured to use an Apify API key and a specific Apify actor ID.
  4. Wait for Apify Task (via HTTP Request): The workflow then polls Apify's API to check the status of the scraping task until it completes.
  5. Fetch Apify Results (via HTTP Request): Once the scraping task is done, it fetches the results (the scraped YouTube comments) from Apify.
  6. Prepare Comments for AI (Code): A Code node processes the raw comments, likely formatting them into a structured input suitable for the AI agent.
  7. AI Agent for Lead Qualification: An AI Agent node (powered by LangChain) uses a conversational model (OpenRouter Chat Model, likely Gemini AI) and a simple memory to analyze the comments. It's designed to identify potential leads based on the content of the comments.
  8. Store Enriched Leads (Google Sheets): Finally, the qualified leads and their enriched data are written to a Google Sheet.

Prerequisites/Requirements

To use this workflow, you will need:

  • n8n Instance: A running n8n instance.
  • Apify Account: An Apify account with an API key and access to a YouTube Comment Scraper actor.
  • OpenRouter Account: An OpenRouter account with an API key to access AI models like Gemini.
  • Google Account: A Google account for Google Sheets integration.
  • YouTube Video ID(s): The ID(s) of the YouTube video(s) from which you want to scrape comments.

Setup/Usage

  1. Import the workflow: Download the JSON provided and import it into your n8n instance.
  2. Configure Credentials:
    • Apify: Set up an HTTP Request credential for Apify with your API key.
    • OpenRouter: Set up an OpenRouter Chat Model credential with your API key.
    • Google Sheets: Set up a Google Sheets credential (OAuth2 recommended) to grant n8n access to your Google Sheets.
  3. Configure Apify HTTP Requests:
    • Update the "HTTP Request" nodes related to Apify (scraping, checking status, fetching results) with your Apify API key and the correct Apify actor ID.
    • Ensure the YouTube video ID(s) are passed correctly to the Apify scraping request, possibly via the "Sticky Note" or a preceding node.
  4. Configure AI Agent:
    • Ensure the "OpenRouter Chat Model" node is correctly configured with the desired AI model (e.g., Gemini) and any specific parameters.
    • Review the prompt or instructions within the "AI Agent" node to ensure it aligns with your lead qualification criteria.
  5. Configure Google Sheets:
    • Specify the Spreadsheet ID and Sheet Name where you want to store the enriched lead data.
    • Adjust the column mapping in the "Google Sheets" node to match the data output from the AI Agent.
  6. Activate the Workflow:
    • You can run the workflow manually using the "When clicking ‘Execute workflow’" trigger.
    • Alternatively, configure the "Schedule Trigger" node to run the workflow at your desired intervals (e.g., daily, weekly).

Related Templates

Generate song lyrics and music from text prompts using OpenAI and Fal.ai Minimax

Spark your creativity instantly in any chat—turn a simple prompt like "heartbreak ballad" into original, full-length lyrics and a professional AI-generated music track, all without leaving your conversation. 📋 What This Template Does This chat-triggered workflow harnesses AI to generate detailed, genre-matched song lyrics (at least 600 characters) from user messages, then queues them for music synthesis via Fal.ai's minimax-music model. It polls asynchronously until the track is ready, delivering lyrics and audio URL back in chat. Crafts original, structured lyrics with verses, choruses, and bridges using OpenAI Submits to Fal.ai for melody, instrumentation, and vocals aligned to the style Handles long-running generations with smart looping and status checks Returns complete song package (lyrics + audio link) for seamless sharing 🔧 Prerequisites n8n account (self-hosted or cloud with chat integration enabled) OpenAI account with API access for GPT models Fal.ai account for AI music generation 🔑 Required Credentials OpenAI API Setup Go to platform.openai.com → API keys (sidebar) Click "Create new secret key" → Name it (e.g., "n8n Songwriter") Copy the key and add to n8n as "OpenAI API" credential type Test by sending a simple chat completion request Fal.ai HTTP Header Auth Setup Sign up at fal.ai → Dashboard → API Keys Generate a new API key → Copy it In n8n, create "HTTP Header Auth" credential: Name="Fal.ai", Header Name="Authorization", Header Value="Key [Your API Key]" Test with a simple GET to their queue endpoint (e.g., /status) ⚙️ Configuration Steps Import the workflow JSON into your n8n instance Assign OpenAI API credentials to the "OpenAI Chat Model" node Assign Fal.ai HTTP Header Auth to the "Generate Music Track", "Check Generation Status", and "Fetch Final Result" nodes Activate the workflow—chat trigger will appear in your n8n chat interface Test by messaging: "Create an upbeat pop song about road trips" 🎯 Use Cases Content Creators: YouTubers generating custom jingles for videos on the fly, streamlining production from idea to audio export Educators: Music teachers using chat prompts to create era-specific folk tunes for classroom discussions, fostering interactive learning Gift Personalization: Friends crafting anniversary R&B tracks from shared memories via quick chats, delivering emotional audio surprises Artist Brainstorming: Songwriters prototyping hip-hop beats in real-time during sessions, accelerating collaboration and iteration ⚠️ Troubleshooting Invalid JSON from AI Agent: Ensure the system prompt stresses valid JSON; test the agent standalone with a sample query Music Generation Fails (401/403): Verify Fal.ai API key has minimax-music access; check usage quotas in dashboard Status Polling Loops Indefinitely: Bump wait time to 45-60s for complex tracks; inspect fal.ai queue logs for bottlenecks Lyrics Under 600 Characters: Tweak agent prompt to enforce fuller structures like [V1][C][V2][B][C]; verify output length in executions

Daniel NkenchoBy Daniel Nkencho
601

Automate Dutch Public Procurement Data Collection with TenderNed

TenderNed Public Procurement What This Workflow Does This workflow automates the collection of public procurement data from TenderNed (the official Dutch tender platform). It: Fetches the latest tender publications from the TenderNed API Retrieves detailed information in both XML and JSON formats for each tender Parses and extracts key information like organization names, titles, descriptions, and reference numbers Filters results based on your custom criteria Stores the data in a database for easy querying and analysis Setup Instructions This template comes with sticky notes providing step-by-step instructions in Dutch and various query options you can customize. Prerequisites TenderNed API Access - Register at TenderNed for API credentials Configuration Steps Set up TenderNed credentials: Add HTTP Basic Auth credentials with your TenderNed API username and password Apply these credentials to the three HTTP Request nodes: "Tenderned Publicaties" "Haal XML Details" "Haal JSON Details" Customize filters: Modify the "Filter op ..." node to match your specific requirements Examples: specific organizations, contract values, regions, etc. How It Works Step 1: Trigger The workflow can be triggered either manually for testing or automatically on a daily schedule. Step 2: Fetch Publications Makes an API call to TenderNed to retrieve a list of recent publications (up to 100 per request). Step 3: Process & Split Extracts the tender array from the response and splits it into individual items for processing. Step 4: Fetch Details For each tender, the workflow makes two parallel API calls: XML endpoint - Retrieves the complete tender documentation in XML format JSON endpoint - Fetches metadata including reference numbers and keywords Step 5: Parse & Merge Parses the XML data and merges it with the JSON metadata and batch information into a single data structure. Step 6: Extract Fields Maps the raw API data to clean, structured fields including: Publication ID and date Organization name Tender title and description Reference numbers (kenmerk, TED number) Step 7: Filter Applies your custom filter criteria to focus on relevant tenders only. Step 8: Store Inserts the processed data into your database for storage and future analysis. Customization Tips Modify API Parameters In the "Tenderned Publicaties" node, you can adjust: offset: Starting position for pagination size: Number of results per request (max 100) Add query parameters for date ranges, status filters, etc. Add More Fields Extend the "Splits Alle Velden" node to extract additional fields from the XML/JSON data, such as: Contract value estimates Deadline dates CPV codes (procurement classification) Contact information Integrate Notifications Add a Slack, Email, or Discord node after the filter to get notified about new matching tenders. Incremental Updates Modify the workflow to only fetch new tenders by: Storing the last execution timestamp Adding date filters to the API query Only processing publications newer than the last run Troubleshooting No data returned? Verify your TenderNed API credentials are correct Check that you have setup youre filter proper Need help setting this up or interested in a complete tender analysis solution? Get in touch 🔗 LinkedIn – Wessel Bulte

Wessel BulteBy Wessel Bulte
247

Auto-reply & create Linear tickets from Gmail with GPT-5, gotoHuman & human review

This workflow automatically classifies every new email from your linked mailbox, drafts a personalized reply, and creates Linear tickets for bugs or feature requests. It uses a human-in-the-loop with gotoHuman and continuously improves itself by learning from approved examples. How it works The workflow triggers on every new email from your linked mailbox. Self-learning Email Classifier: an AI model categorizes the email into defined categories (e.g., Bug Report, Feature Request, Sales Opportunity, etc.). It fetches previously approved classification examples from gotoHuman to refine decisions. Self-learning Email Writer: the AI drafts a reply to the email. It learns over time by using previously approved replies from gotoHuman, with per-classification context to tailor tone and style (e.g., different style for sales vs. bug reports). Human Review in gotoHuman: review the classification and the drafted reply. Drafts can be edited or retried. Approved values are used to train the self-learning agents. Send approved Reply: the approved response is sent as a reply to the email thread. Create ticket: if the classification is Bug or Feature Request, a ticket is created by another AI agent in Linear. Human Review in gotoHuman: How to set up Most importantly, install the gotoHuman node before importing this template! (Just add the node to a blank canvas before importing) Set up credentials for gotoHuman, OpenAI, your email provider (e.g. Gmail), and Linear. In gotoHuman, select and create the pre-built review template "Support email agent" or import the ID: 6fzuCJlFYJtlu9mGYcVT. Select this template in the gotoHuman node. In the "gotoHuman: Fetch approved examples" http nodes you need to add your formId. It is the ID of the review template that you just created/imported in gotoHuman. Requirements gotoHuman (human supervision, memory for self-learning) OpenAI (classification, drafting) Gmail or your preferred email provider (for email trigger+replies) Linear (ticketing) How to customize Expand or refine the categories used by the classifier. Update the prompt to reflect your own taxonomy. Filter fetched training data from gotoHuman by reviewer so the writer adapts to their personalized tone and preferences. Add more context to the AI email writer (calendar events, FAQs, product docs) to improve reply quality.

gotoHumanBy gotoHuman
353