Use this powerful n8n workflow to process scraped leads using a Gemini AI agent. Validate, deduplicate, format data, and log results to Google Sheets, providing robust automation.
Download this n8n workflow template and start using it instantly.
This automation template is ideal for:
Growth Marketers needing automated lead processing pipelines.
Sales Operations teams requiring clean, deduplicated CRM input data.
Users looking for advanced examples of AI Agents within an n8n workflow.
Developers seeking robust n8n templates for handling large datasets and external API calls.
This sophisticated n8n workflow solves the common challenge of integrating messy scraped lead data (from sources like Apify or Apollo) into a structured format like Google Sheets. Instead of relying on rigid conditional logic, this n8n automation utilizes the power of a Google Gemini AI Agent, which is configured within a specialized n8n node.
The core functionality of this n8n template is its ability to handle large batches (up to 1000 leads), perform complex validation (checking for required fields like Name, Email, and Company), handle deduplication checks against existing sheets, and generate unique Lead IDs (e.g., AP-DDMMYY-xxxx). This specific n8n node configuration ensures data quality and provides transparent, consolidated reporting via Telegram, making this a highly valuable and reliable business automation tool. Implementing this n8n workflow significantly reduces manual data cleaning efforts.
This comprehensive n8n workflow operates in a controlled loop to manage large datasets efficiently:
APIFY Post Request n8n node calls the scraping API (Apify/Apollo) to initiate or fetch the lead data. This is followed by an Apify Get Request n8n node used in the loop for pagination/fetching the next data chunk.Loop Over Items n8n node splits the retrieved leads into manageable batches (configured to 1000 items) to prevent memory or API timeouts, ensuring the n8n automation runs efficiently.Knowledge Base Agent n8n node, which leverages the Google Gemini Chat Model. The agent follows strict, detailed instructions: validate required fields, perform real-time deduplication via the Google Sheets Get Row(s) n8n tool, and use the Google Sheets Append n8n tool to insert clean data. Memory is maintained for context across processing steps.Send a text message n8n node via Telegram.Wait n8n node (30 seconds) before proceeding to fetch the next 1000 records, completing the powerful n8n workflow cycle until all leads are processed.To set up this advanced n8n workflow template, follow these steps:
APIFY Post Request n8n node with the correct API endpoint URL, headers, and necessary authentication details for your scraping source.Lead ID, Name, Email, Phone Number, Company Name, Job Title, Website/LinkedIn, Address, Company Summary, Relevant Partner. When Executed by Another Workflow (n8n trigger): The designated starting point for this automation, allowing it to function as a modular sub-workflow.
APIFY Post Request / Apify Get Request (n8n node): HTTP Request n8n nodes used to manage data retrieval from the Apify/Apollo scraping API.
Loop Over Items (n8n node): Splits incoming data into batches of 1000 items (batchSize: 1000), a critical component for handling large lead volumes within the n8n workflow.
Knowledge Base Agent (n8n node): The central AI processing core. It is configured with strict instructions for data validation, ID generation, and orchestrating downstream actions via connected n8n tools.
Google Gemini Chat Model (n8n node): Provides the necessary large language model capability for the AI Agent's reasoning and transformation tasks.
Simple Memory (n8n node): Ensures context persistence for up to 20 messages within the agent's processing cycle, improving performance when handling sequential tasks.
Append row in sheet in Google Sheets / Get row(s) in sheet in Google Sheets (n8n tool): These Google Sheets n8n tools are connected directly to the AI Agent, allowing it to dynamically perform deduplication lookups and insert validated rows.
Send a text message (n8n node): Sends the final, detailed batch summary generated by the AI agent to a designated Telegram chat ID, ensuring timely reporting of the n8n workflow execution status.
Automate personalized cold outreach using this n8n workflow. It pulls leads from Google Sheets, uses GPT-4 for professional email copywriting, sends via Gmail, and integrates a third-party tracking sequence.

Automate lead generation using this advanced n8n workflow to scrape prospect data from Apollo and LinkedIn, analyze profiles with OpenAI, and generate hyper-personalized 4-step email sequences.

Automate B2B lead generation using a powerful n8n workflow. Trigger scraping via a Telegram message, use GPT-4 to structure the query, scrape verified leads via Apollo/Apify, and save de-duplicated data to Supabase. This n8n workflow maximizes efficiency.

Use this powerful n8n workflow to automate lead qualification using Relevance AI, scoring prospects as hot, warm, or cold, and triggering hyper-personalized outreach via Gmail.

Use this powerful n8n workflow to automatically qualify, score, and route incoming leads using OpenAI, saving hot leads to Airtable and notifying your sales team via Slack. Explore more n8n templates today.








































