🚀 AI-Powered LinkedIn DM Outreach System
"Nobody hates LinkedIn outreach. They hate BAD outreach."
🌟 The Outreach Revolution: Day 24
Welcome to the LinkedIn DM Outreach System, a cutting-edge automation agent built for Day 24 of the "30 Days, 30 AI Agents" Challenge.
This isn't just another spam bot. This is a hyper-personalized, intelligent signal-generating machine designed to turn cold leads into warm conversations without you lifting a finger.
🛑 The Problem with Traditional Outreach
You know the drill. You open LinkedIn, search for "Founder", and start the grind:
- ❌ Generic Cold DMs: "Hi, I saw your profile..." (Delete)
- ❌ Zero Replies: Sending hundreds of messages into the void with a 0.5% reply rate.
- ❌ Hours Wasted: Manually filtering profiles, copy-pasting names, checking if you've messaged them before.
- ❌ Inefficient Filters: Guessing job titles and industries, missing hidden gems.
- ❌ Burnout: After 3 days, you stop doing it. Pipeline dries up.
✅ The Solution: Precision & Personalization
This agent solves the quality vs. quantity dilemma by using AI at every step of the funnel:
- 🎯 Natural Language Targeting: Describe your audience in plain English. No more complex Boolean strings.
- 🧠 AI-Driven Search: Converts "SaaS Founders in Miami who like tennis" into precise Apollo/LinkedIn search queries.
- 🤖 Automated Scraping: Pulls verified data from Apollo/LinkedIn via Apify.
- ✍️ Hyper-Personalized Icebreakers: AI reads their profile (bio, history, location) and writes a unique, 1-on-1 message.
- 📊 CRM Integration: Auto-syncs every lead to Google Sheets for tracking.
- 🚀 Silent Execution: Runs in the background, filling your pipeline while you sleep.
📈 Why This Agent Changes Everything
Time Saved vs. Manual Outreach
Imagine manually researching 500 prospects.
- Search & Filter: 5 hours (Finding the right people)
- Profile Review: 12 hours (Reading "About" sections)
- Writing Messages: 25 hours (Crafting "personal" notes)
- Tracking: 3 hours (Updating Excel)
- TOTAL: 45 Hours/Week (A full-time job!)
With AI Agent:
- Setup: 15 Minutes
- Execution: 0 Minutes (Fully Automated)
Revenue Potential
Consistency is the #1 driver of sales. This agent ensures you hit your outreach volume targets every single day without burnout.
- Daily Volume: 50 High-Quality DMs
- Monthly Volume: 1,500 DMs
- Reply Rate: 15-20% (Conservative Estimate w/ Personalization)
- Leads Generated: 200-300 Warm Leads / Month
If your Lifetime Value (LTV) is $1,000, and you close 5% of leads: $10,000 - $15,000 / Month in New Pipeline
🧠 Workflow Architecture
This system uses a sophisticated chain of "Thinking" and "Doing" nodes to mimic a human BDR (Business Development Representative). It follows a Linear Execution Pipeline.
🔍 Deep Dive: Node-by-Node Analysis
This workflow is not a simple "if this, then that". It is a cognitive pipeline. Let's break down exactly what happens at each stage.
1. The Brain: User Input Trigger
- Node Type:
n8n-nodes-base.formTrigger - Function: Acts as the command center.
- Input: You provide a simple text description.
Example: "I want to reach out to Marketing Managers in Austin, Texas who work at Seed to Series A startups."
- Role: Eliminates the need for you to manually fiddle with complex filter settings. The AI understands "Seed to Series A" better than a simple filter.
2. AI Search Architect (OpenAI)
- Node:
Generate Search URL - Model:
gpt-4.5-preview(The heavy hitter). - The Magic:
- Takes your plain English description.
- Uses a customized System Prompt to map your intent to Apollo.io's URL parameters.
- Understands concepts like
organizationNumEmployeesRanges[]=1%2C20based on your description.
- Why It Matters: Apollo has better filters than basic LinkedIn. The AI leverages this to create a "Golden List" of prospects.
3. The Hunter: Apify Scraper
- Node:
Run Apify Actor & Get Results - Actor:
jljBwyyQakqrL1wae(Apollo Scraper). - Action:
- Receives the AI-generated URL.
- Navigates to the search results page via headless browser.
- Extracts: Name, Title, Company, LinkedIn URL, Location, and meaningful "About" sections.
- Output: A clean JSON array of high-intent prospects.
4. Safety Valve: Limit Node
- Node:
Limit - Setting: Max 3 items (Default).
- Purpose: Prevents API burn during testing.
- Scaling: Once you are confident, change this to 50 or 100 to run full daily batches.
5. The Copywriter: AI Icebreaker Agent
- Node:
Personalize Outreach - Model:
gpt-4o(Optimized for speed and creativity). - The Prompt Engineering:
- The system is instructed to be "Laconic and Spartan".
- It is explicitly forbidden from using clichés like "passionate about..." or "visionary leader".
- Template: "Hey {{name}}, loved seeing {{thingAboutThem}}. I'm also into {{plausibleTieIn}}, thought I'd connect."
- Magic Moment: The AI reads their specific job history or bio ("Former Regional Sales Director at Out East Eyewear") and references it naturally ("loved seeing your transition from eyeware sales...").
6. The CRM: Google Sheets Integration
- Node:
Add to Google Sheet - Function: Serves as your database of record.
- Data Points Stored:
id(Unique Identifier)first_name/last_namelinkedin_urltitleemail_statusicebreaker(The generated message)
- Benefit: You have full visibility before any message is sent. You can manually review the sheet to Quality Check (QC) the AI's drafts.
7. The Launcher: PhantomBuster
- Node:
Trigger PhantomBuster Agent - Function: The final mile delivery.
- Action:
- Takes the aggregated list from the Google Sheet.
- Feeds it into a PhantomBuster LinkedIn Network Booster or Message Sender.
- Executes the actual DM/Connection Request on LinkedIn.
🛠️ Detailed Setup Guide
Follow these steps to deploy your agent in under 15 minutes.
📋 Prerequisites
Before you begin, ensure you have the following accounts:
- n8n (Self-hosted or Cloud).
- OpenAI API Account (Credit loaded).
- Apify Account (For the Apollo scraper).
- PhantomBuster Account (For LinkedIn automation).
- Google Account (For Sheets).
⚙️ Step 1: Environment Configuration
You will need to set up your credentials in n8n.
OpenAI Credentials
- Go to
n8n->Credentials->Add Credential. - Search
OpenAI API. - Paste your API Key starting with
sk-.... - Test connection.
Apify Credentials
- Go to Apify Console -> Settings -> Integrations.
- Copy your Personal API Token.
- In n8n, the extraction node uses a
Header Author direct parameter injection.- Note: In this workflow, the key is hardcoded in the header parameter
Authorization: Bearer. You should replaceapify_api_...with your own key inside the HTTP Request Node.
- Note: In this workflow, the key is hardcoded in the header parameter
PhantomBuster Credentials
- Go to PhantomBuster -> User Settings.
- Copy your API Key.
- In n8n, locate the
Trigger PhantomBuster Agentnode. - Update the
X-Phantombuster-Keyheader with your key. - Important: You also need the
Agent ID(found in the URL of your PhantomBuster dashboard, e.g.,.../agents/4108795702201397).
📥 Step 2: Import the Workflow
- Download the
LinkedIn DM Outreach System.jsonfile included in this repo. - Open your n8n Editor.
- Click
Workflow(top right) ->Import from File. - Select the JSON file.
- Save the workflow immediately.
📊 Step 3: Google Sheets Setup
- Create a new Google Sheet.
- Create a header row (Row 1) with exactly these columns:
idfirst_namelast_namenamelinkedin_urltitleemail_statusphoto_urlicebreaker
- In n8n, open the
Add to Google Sheetnode. - Connect your Google Drive credentials.
- Select your new Sheet using the file picker.
🏃 Step 4: Running the Beast
- Click "Execute Workflow".
- The Form Input window will appear.
- Type your prompt:
"Find me E-commerce founders in London with 10-50 employees."
- Watch the nodes light up green as the agent works.
- 🟢 Search URL Generating...
- 🟢 Scraping Data...
- 🟢 Writing Icebreakers...
- 🟢 Saving to Sheets...
- 🟢 Triggering Outreach...
🎓 Prompt Engineering Masterclass
The secret sauce of this agent is not the scraping. It's the Writing. Here is the exact specific prompt that ensures the AI doesn't sound like a bot.
System Prompt (The "Anti-Cringe" Directive):
textYou are a helpful, intelligent writing assistant. Your task is to take as input a bunch of LinkedIn profile information... and then generate a very short, very punchy icebreaker. In order to ensure icebreakers are punchy and high-quality, make them follow this template: Hey {{name}}, loved seeing {{thingAboutThem}}. I'm also into {{plausibleTieIn}}, thought I'd connect. For {{thingAboutThem}} and {{plausibleTieIn}}, never use the exact information provided in a LinkedIn field. Instead, always paraphrase. This makes it seem human written. Also, make it super short. Don't say stuff like "passionate about turning vision into reality". Be extremely laconic and spartan.
Why This Works:
- Parophrasing Constraint: Forces the AI to "think" about the content, not just regex copy-paste.
- Length Constraint: "Laconic and spartan" prevents the AI from writing 3-paragraph essays that no one reads.
- Template Structure: Ensures consistent, scalable output that fits into the LinkedIn connection note character limit (300 chars).
🎭 Advanced Customization
Once you have mastered the basics, you can customize the agent to fit your specific persona.
Changing the Tone
To make the outreach more casual or formal, edit the Personalize Outreach node.
- Formal: Change "laconic and spartan" to "professional and respectful".
- Gen Z: Change "loved seeing" to "obsessed with".
Adding Variables
You can inject more data from Apollo into the prompt.
- In the
Run Apify Actornode output, inspect the JSON. - Find fields like
organization.short_descriptionorheadlines. - Map these in the
Personalize Outreachnode using{{ $json.organization.short_description }}.
Email Fallback Mode
If you want to send emails instead of DMs:
- Add a
Filternode afterRun Apify Actor. - Condition:
email_statusequal toVerified. - Connect to a
GmailorOutlooknode instead of PhantomBuster.
💰 Cost Analysis
Is this expensive? Let's break it down per 1,000 leads.
| Service | Cost per 1,000 Leads | Notes |
|---|---|---|
| n8n | Free / $20/mo | Self-hosted vs Cloud |
| OpenAI | ~$0.15 | GPT-4o Mini is dirt cheap |
| Apify | ~$5.00 | Data scraping costs |
| PhantomBuster | ~$30.00 | Monthly sub covers volume |
| TOTAL | ~$35.15 | $0.03 per Lead |
Compared to a Lead Gen Agency charging $2,000/month, this is a 98% cost reduction.
🔮 Future Roadmap (Day 25+)
This agent is just the beginning. Possibilities for extension:
- Email Enrichment: Add a
ClayorProspeonode to find verified emails for multichannel outreach. - Content Commenting: Use AI to comment on their recent posts before sending a DM.
- Voice Notes: Generate minimal AI voice notes to send as DM attachments (High conversion!).
- CRM Sync: Push successful leads to HubSpot or Salesforce.
❓ FAQ & Troubleshooting
Q: usage limit exceeded (HTTP 429)
A: This usually happens with the Apify or PhantomBuster API if you run too many concurrent executions. Add a Wait node in n8n or decrease the concurrency in the PhantomBuster settings.
Q: The AI connects me with irrelevant people.
A: Refine your initial "Audience Description". Be specific. Instead of "Founders", try "Founders of B2B SaaS companies in the Healthcare space". The gpt-4.5-preview model is smart, but it needs context.
Q: Is this compliant with LinkedIn Terms?
A: Disclaimer: Automated scraping and outreach can violate LinkedIn's ToS.
- Safety: Use PhantomBuster's recommended limits (e.g., 80 connections/day).
- Proxies: Ensure PhantomBuster and Apify are using residential proxies (they usually do by default/add-on).
- Human in the Loop: Use the Google Sheet as a review stage. Don't auto-send without a glance until you trust the system.
🧬 Workflow Definitions (Technical Reference)
For developers and power users, here is the technical schema for the key nodes in this workflow.
User Input Schema
The formTrigger node expects a single text field.
json{ "formTitle": "LinkedIn Lead Outreach Trigger", "fields": [ { "fieldLabel": "Describe your audience in plain English.", "fieldType": "textarea", "required": true } ] }
Apify Payload
The Run Apify Actor node sends the following JSON body to the actor jljBwyyQakqrL1wae.
json{ "getPersonalEmails": true, "getWorkEmails": true, "totalRecords": 500, "url": "{{ $json.message.content.searchUrl }}" }
Note: The searchUrl is dynamically injected from the OpenAI node.
Google Sheet Columns
Ensure your sheet has these exact headers to match the Add to Google Sheet node mapping:
idfirst_namelast_namenamelinkedin_urltitleemail_statusphoto_urlicebreaker
PhantomBuster Trigger
The trigger uses the standard PhantomBuster API v2 launch endpoint.
- Endpoint:
https://api.phantombuster.com/api/v2/agents/launch - Method:
POST - Headers:
X-Phantombuster-Key:[YOUR_KEY]
- Body:
json{ "id": "4108795702201397" // Replace with your Agent ID }
📚 Recommended Resources
- n8n Academy: Learn the basics of workflows.
- Apify Store: Browse other scrapers (Instagram, Twitter, TikTok).
- OpenAI Cookbook: Advanced prompting techniques.
- PhantomBuster Blog: Growth hacking strategies.
📜 License & Credits
Creator: Day 24 of the 30 Days 30 AI Agents Challenge. Tech Stack:
- n8n - The Workflow Engine
- OpenAI - The Intelligence
- Apify - The Data Source
- PhantomBuster - The Outreach Driver
"We’re not automating LinkedIn. We’re fixing it."
Verified Agent Architecture v1.0.0 - 2025 Release Made with ❤️ by the AI Agent bros team