lead enrichment with n8n + Apollo.io (part 1 of 4)
How to Build a 500-Lead Enrichment Pipeline That Generates Personalized Icebreakers in Under 15 Minutes
Stop spending 10+ hours a week manually enriching leads. In this guide, I'll show you exactly how to build an automation that pulls 500 qualified agency leads from Apollo.io, enriches them with AI-generated personalized icebreakers, and automatically saves everything to Google Sheets—all in under 15 minutes.
By the end of this tutorial, you'll have a fully functional lead enrichment system that:
✅ Automatically creates a new Google Sheet for each campaign
✅ Pulls 500+ targeted leads from Apollo.io via Apify
✅ Filters for high-quality leads with LinkedIn URLs and verified emails
✅ Generates personalized email icebreakers using AI
✅ Saves everything in an organized, campaign-ready format
Download the complete n8n template: apollo-lead-enrichment.json
Why automation is worth a shot for agencies
Agencies waste 20+ hours per week on manual lead generation tasks:
Copy-pasting from Apollo.io
Manually checking for email validity
Writing personalized first lines
Organizing data in spreadsheets
This automation reduces that to 15 minutes of setup and then runs completely hands-free.
What You'll Need
Before we start, make sure you have:
n8n (self-hosted or cloud version)
Apify account with the Apollo.io scraper actor
Google Sheets API enabled
OpenAI API key for generating icebreakers
Apollo.io search URL with your target criteria
Total setup time: 10-15 minutes
Cost: ~$0.64 per 500 leads (the MINIMUM Apollo requires for each scrape is 500 leads)
Step 1: Create the Workflow Foundation
Start by creating a new workflow in n8n. We'll build this automation in a logical sequence that mirrors the manual process.
Add a Manual Trigger node to start. This lets you run the workflow on-demand whenever you need fresh leads.
💡 Pro tip: Later, you can replace this with a Schedule Trigger
to run automatically every Monday morning.
Step 2: Automatically Create a Google Sheet
The first real magic happens here. Instead of manually creating spreadsheets, our automation creates a new one with a timestamp.
Add a Google Sheets node with these settings:
Resource: Spreadsheet
Operation: Create
Title:
New Run - {{ $now }}
This creates a fresh spreadsheet for each campaign run, keeping your data organized and timestamped.
Step 3: Connect to Apollo.io via Apify
Here's where we tap into Apollo's massive database without clicking through their interface.
Configure the HTTP Request node:
{
"method": "POST",
"url": "https://api.apify.com/v2/acts/code_crafter~apollo-io-scraper/run-sync-get-dataset-items",
"headers": {
"Authorization": "Bearer YOUR_APIFY_TOKEN"
},
"body": {
"cleanOutput": false,
"totalRecords": 500,
"url": "YOUR_APOLLO_SEARCH_URL"
}
}
Setting up your Apollo search URL:
Go to Apollo.io and create your ideal search
Filter by: Company size (11-100), Industry (Marketing/Advertising), Location (USA)
Copy the full URL from your browser
Paste it in the "url" field above
Step 4: Filter for Quality Leads
Not all leads are created equal. We only want leads we can actually reach.
Add a Filter node with these conditions:
LinkedIn URL is not empty (AND)
Email is not empty
This ensures you only process leads with both professional profiles and valid contact information.
Step 5: Apply Smart Limits (Testing Phase)
During testing, limit the results to avoid unnecessary API costs.
Add a Limit node:
Max Items: 5 (increase to 500 when ready for production)
⚡ Quick tip: Always test with 5 leads first to ensure
everything works before processing hundreds.
Step 6: Generate AI-Powered Icebreakers
This is where we transform generic outreach into personalized conversations.
Configure the OpenAI node with this prompt:
Lead Data to Analyze:
First Name - {{ $json.first_name }}
Company Name - {{ $json.organization_name }}
Location - {{ $json.present_raw_address }}
Business Type - {{ $json.organization.industry }}
Create a natural, conversational icebreaker following this structure:
1. Casual greeting with first name + company compliment
2. Mention working with similar businesses in their location
3. Simple transition like "Wanted to run something by you."
Keep it under 25 words, use location/company acronyms when sensible.
Example output:
"Hey Sarah, love what DMA is doing. Also working with agencies in NYC. Wanted to run something by you."
Step 7: Set Up Dynamic Headers
Before saving data, we need to tell Google Sheets what columns to create.
Add a Set node to define headers:
[
"id", "first_name", "last_name", "name",
"linkedin_url", "title", "organization_name",
"headline", "email", "city", "state",
"organization_website_url", "industry",
"icebreaker" // Our new AI-generated field
]
Step 8: Write Headers to Google Sheets
This step creates the column structure in your spreadsheet.
Configure another HTTP Request node:
Method: PUT
URL:
https://sheets.googleapis.com/v4/spreadsheets/{{SPREADSHEET_ID}}/values/A1:AZ1
Query Parameter:
valueInputOption = RAW
Body:
{
"majorDimension": "ROWS",
"values": [{{ $json.headers }}]
}
Step 9: Save All Enriched Data
Finally, we append all our enriched lead data to the spreadsheet.
Add a final Google Sheets node:
Operation: Append
Include the icebreaker field in your column mappings
The workflow automatically maps all Apollo fields plus your AI-generated icebreaker to the appropriate columns.
Testing Your Automation
Follow this testing sequence:
Run with 1 lead first - Verify all nodes execute correctly
Check the Google Sheet - Ensure headers and data appear properly
Test with 5 leads - Confirm the icebreakers make sense
Scale to 500 - Remove the limit and run full production
Advanced Optimizations
Once your core workflow works, try these upgrades:
🌐 Add Website Scraping
Pull recent company news/service details straight from their websites🎯 Industry-Specific Icebreakers
Customize AI prompts for different sectors (e.g., SaaS vs. e-commerce)🔄 Duplicate Detection
Auto-check against your CRM to avoid reprocessing leads🔔 Slack Notifications
Get instant alerts for high-value leads (50+ employees)
Troubleshooting Common Issues
"Invalid value at 'data.values'" error:
Your headers array might be formatted as a string instead of an array
Check that you're using proper JSON syntax
No results from Apollo:
Verify your Apollo search URL is complete (includes all parameters)
Check that your Apify token has sufficient credits
Icebreakers sound generic:
Refine your OpenAI prompt with more specific instructions
Include more lead data points in the prompt
✅ Your Final Deliverable
A ready-to-use Google Sheets file with:
Apollo.io lead data
Verified LinkedIn/email
AI-generated icebreakers
Campaign-ready formatting
Use this to:
Launch cold email campaigns in Instantly/Lemlist
Prioritize leads for sales teams
Enrich further in CRMs (HubSpot, Salesforce)
Feed into lead scoring models
Download the Template
Ready to implement this in your agency? Download the complete n8n workflow template and import it directly into your n8n instance.
Download apollo-lead-enrichment.json
Next Steps
This lead enrichment automation is just the beginning. In the next guide, we'll build on this foundation to create an AI-powered lead scoring system that automatically prioritizes your hottest prospects.
Coming next:
Step 2: AI-Powered Lead Scoring
Step 3: Automated LinkedIn Outreach
Step 4: Multi-Channel Lead Nurture System
Ready to transform your entire agency operations? This lead enrichment system is just one of 5 core automations we implement for agencies. Book a free Agency Ops Audit to see how automation could save your team 20+ hours per week.