Automated AI LinkedIn DM system in 1 hour (n8n)
72 min build: natural-language form makes an Apollo URL, Apify scrape, AI personalization, Sheets tracking, PhantomBuster sends LinkedIn connection requests and follow-ups.
Tools featured in this playbook
This article was originally posted on YouTube
Here is how to build your own LinkedIn outreach system in n8n. It creates a targeted lead list in Apollo from plain English, enriches the leads, uses AI to write a personalized icebreaker, sends connection requests safely and tracks everything in a Google Sheet. I'm Nick, and I've made over a million dollars with AI and automation.
The stack
Apollo: a big database you search with filters, like "dentists in the United States with 1 to 50 staff". Exporting from Apollo is expensive.
Apify: a library of scrapers. One of them takes an Apollo search URL and scrapes the leads. It costs about $1.20 per 1,000 leads.
OpenAI: writes the personalized icebreaker.
Google Sheets: the lead database.
PhantomBuster: sends the connection requests on LinkedIn, simulating real human activity.
Rule number one: do it manually first
Before automating anything, I run every step by hand once. There is the use case, and then there is the automation of the use case. If you skip this, you put the car before the horse.
Manual proof of concept
1. Search in Apollo
Search with a keyword ("creative agency"), job titles (owner, CEO, founder, partner) and a location (United States). I got 844 creative agencies.
2. Scrape with Apify
Paste the Apollo search URL into the Apollo scraper actor, set the number of records, tick work emails and personal emails, and run. I exported 100 results to a Google Sheet to check the data: about 66% had a LinkedIn URL and 77% had an email. Always check the source data.
LinkedIn only allows about 100 to 150 cold connection requests per week per account. So 1,000 leads covers about a month.
3. Write the icebreaker prompt
A LinkedIn connection request is limited to about 300 characters, roughly 50 words. So the icebreaker has to be very short. My prompt, in short:
"Your task is to take as input a bunch of LinkedIn profile information of a user, and generate a very short, very punchy icebreaker that I can use as a variable in my connection request."
Return the result as JSON:
{"icebreaker": "..."}.Follow this template: "Hey {name}, love seeing {thing about them}. I'm also into {plausible tie-in}, thought I'd connect."
Never use the exact information from a LinkedIn field. Always paraphrase, so it reads as human-written.
Make it extremely short. Be laconic and Spartan.
Feed it the name, city, current title and company, and some past experience. After those tweaks, about four out of five results were good, like "Hey Danielle, spotting your creative agency journey. I'm also into entrepreneurial ventures, thought I'd connect."
4. Send with PhantomBuster
Add an "Icebreaker" column to the sheet.
Set up the LinkedIn Auto Connect phantom. Connect your LinkedIn account with the PhantomBuster Chrome extension.
Use the sheet as input, use the Icebreaker column as the whole message, and set a maximum of 10 invitations per launch.
Launch it. It takes a minute or two per profile, because it simulates real activity.
Once one invitation went out, I knew every step worked.
Building it in n8n
Step 1: form trigger
An n8n form with one required text area: "Describe your audience in plain English" (company type, location, etc.).
Step 2: generate the Apollo search URL
An OpenAI "Message a model" node. System prompt: you are a sales assistant. Turn a natural language description of a prospect audience into an Apollo search URL. Give it an example URL and explain what it describes.
The key part: list the only fields it may change: organization locations, keywords, person titles and organization number of employees ranges. "Do not add or change any other fields." Output JSON with search_url. Paste the result into Apollo to check that it is a valid search.
Step 3: run the Apify actor
Use an HTTP Request node. From the Apify API reference, copy the cURL for "Run actor synchronously with input and get dataset items". I first used "run actor synchronously and return output", which returns nothing useful. Import the cURL into n8n.
Put the actor ID in the URL (it sits between
actors/and/inputin the Apify URL).Add your Apify API token as a Bearer token (Settings → API & Integrations).
In the JSON body, pass the search URL and the total records.
Pin the output, so you don't rerun the scrape on every test. Pinning data saves a lot of time when you test a flow 20 times.
Step 4: limit node
Add a Limit node while testing. I once ran the AI step on all 500 leads by mistake.
Step 5: personalize with OpenAI
Reuse the prompt from the manual test. Put the example profile and the example icebreaker in as a user message and an assistant message, then add a user message with the live fields mapped from Apify: first name, city, title, company, previous experience. Output as JSON.
Step 6: add to Google Sheets
Create a sheet with the headers you need (ID, first name, last name, full name, LinkedIn URL, title, email status, photo URL, icebreaker). Use "Append row" and map each column manually. Map from the earlier node, not from the OpenAI node, or you'll lose the lead fields.
Step 7: aggregate
Add an Aggregate node that puts all items into one list. Without it, PhantomBuster gets triggered once per lead.
Step 8: trigger PhantomBuster
In the phantom settings, set the input to your sheet URL (shared so it can be read), the profile URL column to the LinkedIn URL column, and the message to the Icebreaker column. For custom messages beyond second connections, you may need Sales Navigator.
In the PhantomBuster API docs (v2), copy the cURL for "agent launch" and import it into an HTTP Request node.
Create an API key in PhantomBuster and pass it as the
X-Phantombuster-Keyheader. Add the agent ID.
PhantomBuster only returns a container ID. I tried getting the results back through a webhook and the "fetch output" endpoint, but the output came back as a text string that wasn't worth parsing. You don't need it: PhantomBuster deduplicates automatically, so anyone in the sheet eventually gets processed, and its results tab shows who was contacted. Just run the phantom whenever you add people, or once a day.
Tips before you scale
Start with 5 to 10 requests per day and increase slowly. LinkedIn allows about 100 connection requests per week.
Check LinkedIn often and reply fast. Replying within about a minute raises conversions a lot.
Refresh your message template every couple of weeks.
Watch your metrics. Your first campaign will probably be your worst.
Comments
Login to leave a comment