Day 24Growth & DemandLinkedInOutreachSales

LinkedIn DM Outreach Bot — AI Agent for personalized LinkedIn outreach

Scales networking with human-like icebreaker generation.

Impact

Scales networking with human-like icebreaker generation.

Mechanism

Lead Discovery + Personalisation

DAY 24
Full README · Case Study

🚀 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)
95%5%Time Spent on OutreachManual Outreach (45 Hours)AI Agent Setup (10 Mins)

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.

Describe Audience

Generate Precision URL

Extract Profiles

Profile Data

Personalized Message

Batch Data

Execute LinkedIn Actions

🏁 User Trigger

🧠 AI Search Architect

🕵️ Apify Scraper

🛑 Safety Limit

✍️ GPT-4 Icebreaker Agent

📝 Google Sheets CRM

🚀 PhantomBuster Launcher

🎉 Outreach Sent


🔍 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%2C20 based 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_name
    • linkedin_url
    • title
    • email_status
    • icebreaker (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:

  1. n8n (Self-hosted or Cloud).
  2. OpenAI API Account (Credit loaded).
  3. Apify Account (For the Apollo scraper).
  4. PhantomBuster Account (For LinkedIn automation).
  5. Google Account (For Sheets).

⚙️ Step 1: Environment Configuration

You will need to set up your credentials in n8n.

OpenAI Credentials

  1. Go to n8n -> Credentials -> Add Credential.
  2. Search OpenAI API.
  3. Paste your API Key starting with sk-....
  4. Test connection.

Apify Credentials

  1. Go to Apify Console -> Settings -> Integrations.
  2. Copy your Personal API Token.
  3. In n8n, the extraction node uses a Header Auth or direct parameter injection.
    • Note: In this workflow, the key is hardcoded in the header parameter Authorization: Bearer . You should replace apify_api_... with your own key inside the HTTP Request Node.

PhantomBuster Credentials

  1. Go to PhantomBuster -> User Settings.
  2. Copy your API Key.
  3. In n8n, locate the Trigger PhantomBuster Agent node.
  4. Update the X-Phantombuster-Key header with your key.
  5. Important: You also need the Agent ID (found in the URL of your PhantomBuster dashboard, e.g., .../agents/4108795702201397).

📥 Step 2: Import the Workflow

  1. Download the LinkedIn DM Outreach System.json file included in this repo.
  2. Open your n8n Editor.
  3. Click Workflow (top right) -> Import from File.
  4. Select the JSON file.
  5. Save the workflow immediately.

📊 Step 3: Google Sheets Setup

  1. Create a new Google Sheet.
  2. Create a header row (Row 1) with exactly these columns:
    • id
    • first_name
    • last_name
    • name
    • linkedin_url
    • title
    • email_status
    • photo_url
    • icebreaker
  3. In n8n, open the Add to Google Sheet node.
  4. Connect your Google Drive credentials.
  5. Select your new Sheet using the file picker.

🏃 Step 4: Running the Beast

  1. Click "Execute Workflow".
  2. The Form Input window will appear.
  3. Type your prompt:

    "Find me E-commerce founders in London with 10-50 employees."

  4. 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):

text
You 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:

  1. Parophrasing Constraint: Forces the AI to "think" about the content, not just regex copy-paste.
  2. Length Constraint: "Laconic and spartan" prevents the AI from writing 3-paragraph essays that no one reads.
  3. 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.

  1. In the Run Apify Actor node output, inspect the JSON.
  2. Find fields like organization.short_description or headlines.
  3. Map these in the Personalize Outreach node using {{ $json.organization.short_description }}.

Email Fallback Mode

If you want to send emails instead of DMs:

  1. Add a Filter node after Run Apify Actor.
  2. Condition: email_status equal to Verified.
  3. Connect to a Gmail or Outlook node instead of PhantomBuster.

💰 Cost Analysis

Is this expensive? Let's break it down per 1,000 leads.

ServiceCost per 1,000 LeadsNotes
n8nFree / $20/moSelf-hosted vs Cloud
OpenAI~$0.15GPT-4o Mini is dirt cheap
Apify~$5.00Data scraping costs
PhantomBuster~$30.00Monthly 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 Clay or Prospeo node 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:

  1. id
  2. first_name
  3. last_name
  4. name
  5. linkedin_url
  6. title
  7. email_status
  8. photo_url
  9. icebreaker

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
}

  • 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:

"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

Explore more agents

30 open-source systems · full registry

Browse All 30 Agents