How I Built an AI Agent That Generates Leads from a LinkedIn URL?
— And Why It Might Be the End of Manual Prospecting
We used to spend hours writing cold emails.
→ Looking up LinkedIn profiles.
→ Copy-pasting job titles.
→ Crafting intros.
→ Rewriting each line so it “felt personal.”
→ Testing tools. Paying for plugins.
→ Hiring VAs. Managing inboxes.
And for what?
2% reply rates — if you're lucky.
So we built an AI agent to do the whole thing for us.
Not just the email writing.
The entire pipeline:
→ Scraping
→ Enriching
→ Writing
→ Delivering
All you do is drop in a LinkedIn URL.
Everything else happens automatically.
Here’s how it works — and how you can build it too.
🔧 The Stack
n8n for automation (free, open-source, no-code)
Apify or a local scraper for LinkedIn data
Slack, Google Sheets, Email, Notion for delivery
No browser extensions.
No form fills.
No fluff.
🧠 The Full Workflow Breakdown
Let’s walk through it step-by-step:
1. Trigger
It starts with a Webhook (or a scheduler).
You input a LinkedIn profile URL — manually or through another automation.
2. Input Parser
The workflow checks the URL.
It makes sure it's valid, extracts the right pieces, and ensures it’s clean for scraping.
3. LinkedIn Scraper
This is where the magic begins.
Using Apify or a headless browser, it scrapes key details:
Name
Title
Company
Industry
Bio/About section
Location
Skills
Education
No login. No API. Fully local and safe.
4. Data Cleaning & Transformation
Now the messy part.
The scraped data is cleaned using Set, If, and Function nodes in n8n.
It removes empty fields, trims whitespace, and normalizes the output.
Think of it as making your AI’s job easier.
5. Prompt Engineering Layer
This is the core.
We build a dynamic prompt that feeds into Claude or GPT.
It reads like this:
“Based on this person’s LinkedIn profile, write a cold email introducing our product. Focus on their job title, industry, and likely pain points. Keep it casual, concise, and human.”
Prompt includes:
Profile data
Email goal (e.g., intro, demo request, referral ask)
Writing style and tone
Optional personalization logic
This is where most agents fall flat — ours doesn’t.
6. Claude or GPT API Call
The prompt is sent to Claude or GPT via API.
We’ve tested both — Claude tends to be more structured; GPT a bit more creative.
In under 2 seconds, we get a personalized email back.
7. Response Handling
Once the AI responds, we parse the output:
→ Strip out unnecessary line breaks
→ Remove hallucinated data
→ Format it for delivery
8. Delivery Options
You can choose how and where to send the final message:
Slack DM
Email (via SMTP or Gmail)
Append to a Google Sheet
Push to Notion or CRM
Return as a webhook response
You can even combine outputs — send the email to yourself, your SDR, and store it in Sheets at the same time.
🎯 What It Actually Does for Us
This one workflow books 20–30 qualified calls/month on autopilot.
But more than that — it changed how we think about lead gen.
Instead of:
Spending time finding leads
Manually researching them
Carefully crafting the message
We’ve turned it into a system.
An always-on, no-fatigue, AI-powered prospector.
And the emails?
They don’t feel like AI.
They feel like you read the person’s mind.
Because technically… you did.
💡 Why This Matters (More Than Just Email)
This isn’t just about cold outreach.
This is about autonomous workflows.
Systems that:
→ Reason
→ Write
→ Act
→ Repeat
This same architecture can be used for:
Warm intro requests
Candidate screening
Customer onboarding
Referral automation
Event follow-ups
Partner outreach
Internal summaries
Anywhere a human used to “read + write + send,”
AI agents can now do it — better and faster.
🧪 Bonus: What We’re Experimenting With
Auto-tagging ICP fit based on role/title
Looping through 50+ profiles at once
A/B testing Claude vs GPT outputs
Dynamic tone-shifting based on industry
Delivering outputs as voice notes via WhatsApp
Final Thought: Build Once, Scale Forever
Most people are still building lead gen like it's 2015.
Tools duct-taped together.
Hustle over system design.
Manual steps everywhere.
But if you're in B2B and you're not automating intelligence — you're behind.
This AI agent isn’t just a cold email writer.
It’s a lens into what’s next:
A world where software doesn’t just follow instructions…
It makes decisions.
And we’re only getting started.
If you enjoyed this breakdown, follow along — I’ll be sharing more AI agent systems, prompt breakdowns, and automation builds over the next few weeks.
Welcome to the age of intelligent workflows. 🧠
Want to build this for your own business?
We go deep on these exact systems inside AcquisitionX — our private community where founders and marketers build AI-powered growth engines together.
✅ Access all 7+ ready-to-use AI agents
✅ Group live strategy calls
✅ Step-by-step workflow clones (Claude, GPT, LinkedIn, Cold Email, Reddit, and more)
✅ Battle-tested playbooks that generate 20–30 qualified leads/month — without paid ads or sales reps
Join us here 👇
https://www.skool.com/acquisitionx/aboutref=38f6b839e9cd400ea1272f6c5329c948
The prompt isn’t well optimised tbh, if you’re using claude you need to add a bit more specific context for better accuracy.
@Suprava Sabat, is it safe to add linkedin cookies to this tools like n8n or make.com, because as per linkedin security policy, you can't use session cookie. I am not sure how well we can handle data security by giving this tools our session cookies