Lead Generation automation using n8n and AI
AI-Powered Lead Generation & Personalized Outreach Automation Using n8n
Project Type: Business Process Automation
Technology: n8n, Apify, Google Maps, Google Sheets, Google PageSpeed Insights API, OpenAI
Category: AI Automation | Lead Generation | Workflow Automation
1. Project Overview
Finding potential customers, collecting their contact information, analyzing their websites, and creating personalized outreach messages can be a time-consuming process when performed manually.
To streamline this process, I developed an end-to-end lead generation and personalized outreach automation system using n8n, Apify, and AI.
The system automates the entire process, starting with discovering businesses through Google Maps and ending with generating personalized outreach messages based on their website performance.
The solution consists of three interconnected automation workflows:
- Automated Business Lead Generation
- Automated Email Extraction
- AI-Powered Personalized Message Generation
2. The Challenge
Traditional lead generation involves several repetitive activities:
- Searching Google Maps for businesses within a specific industry or location.
- Collecting business information such as names, websites, addresses, and phone numbers.
- Visiting individual websites to locate contact email addresses.
- Analyzing websites to identify performance and optimization opportunities.
- Writing personalized outreach messages for individual businesses.
- Organizing collected leads and outreach messages for further processing.
Performing these activities manually becomes inefficient when working with hundreds or thousands of potential leads.
The objective was to automate this entire process while maintaining relevant business information and personalized communication.
3. Solution Architecture
I designed three independent but interconnected n8n workflows, each responsible for a specific stage of the lead generation process.
Workflow 1: Automated Business Lead Generation
Objective: Discover and collect business leads based on a selected business category and location.
How it works:
- A business category and location are provided as search inputs.
- Apify is used to scrape relevant business listings from Google Maps.
- Multiple Apify executions are configured to handle different search batches.
- The collected business information is processed and structured.
- The generated leads are stored in Google Sheets for subsequent processing.
Information collected includes:
- Business name
- Business website
- Business address
- Phone number
- Google Maps business information
Result: An organized database of potential business leads without manually searching and copying individual listings.
Workflow 2: Automated Email Extraction
Objective: Extract publicly available business contact emails from the websites collected in the first workflow.
How it works:
- The workflow retrieves business leads from Google Sheets.
- It filters and processes records in batches.
- HTTP requests are sent to the corresponding business websites.
- The workflow identifies relevant website pages, including contact pages.
- HTML content is processed using JavaScript to extract email addresses.
- Additional extraction logic checks contact information and email patterns.
- Extracted emails are validated and stored against their corresponding leads.
The workflow also handles businesses where email addresses are not immediately available, using additional extraction steps.
Result: Business leads are enriched with publicly available contact information, reducing the need to manually visit individual websites.
Workflow 3: AI-Powered Personalized Message Generation
Objective: Generate personalized outreach messages using actual website performance insights rather than sending generic marketing emails.
How it works:
- The workflow retrieves business information and email addresses from Google Sheets.
- Google PageSpeed Insights API is used to analyze the business website.
- The website audit results are processed using JavaScript.
- Relevant website performance and SEO improvement opportunities are extracted.
- The structured findings are passed to an AI model.
- The AI generates a personalized outreach message based on the business information and identified website opportunities.
- The generated message is saved back to Google Sheets for review and further outreach.
Personalization includes:
- Business-specific information.
- Website performance observations.
- Identified SEO and optimization opportunities.
- Relevant recommendations based on the website analysis.
Instead of generating the same message for every business, the AI uses website-specific findings to create more relevant outreach communication.
4. Technology Stack
TechnologyPurpose
n8n
Workflow orchestration and automation
Apify
Google Maps business data extraction
Google Maps
Business discovery
HTTP Request
Website data retrieval and API communication
JavaScript
Data processing and email extraction
Google PageSpeed Insights
Website performance analysis
OpenAI
Personalized message generation
Google Sheets
Lead storage and workflow coordination
5. End-to-End Workflow
The complete automation follows this pipeline:
Business Discovery → Lead Collection → Email Extraction → Website Analysis → AI Personalization → Message Storage
Each workflow performs a dedicated task, making the overall system easier to maintain, extend, and optimize.
6. Key Benefits
- Reduced Manual Work: Automates repetitive lead discovery, email extraction, and message preparation.
- Scalable Lead Collection: Supports processing multiple business categories and locations.
- Enriched Business Data: Combines business information with publicly available contact details.
- Personalized Outreach: Uses actual website analysis to generate relevant business-specific messages.
- Centralized Data Management: Keeps leads, extracted emails, and generated messages organized in Google Sheets.
- Modular Architecture: Separates lead generation, email extraction, and personalization into independent workflows.
7. Conclusion
This project demonstrates how workflow automation and AI can be combined to build a practical lead generation system.
By integrating Google Maps data extraction, website scraping, performance analysis, and AI-powered content generation, I created an automated pipeline that transforms business discovery into personalized outreach preparation.
The system reduces repetitive manual tasks and provides a structured foundation for building scalable B2B lead generation and outreach processes.
The key takeaway: AI is not just useful for generating content; when combined with workflow automation, it can connect multiple business processes into a single intelligent system.

SajidStrategy & Digital Marketing Consultant
Vertel ons over uw project
Of u nu een redesign plant of helemaal opnieuw begint, wij helpen u strategie, design en prestaties op elkaar af te stemmen. Neem contact op voor een gratis kennismakingsgesprek. Geen druk, gewoon een gericht gesprek.
Voor meer informatie kunt u ons mailen via [email protected]