LinkedIn automation: ICP prospecting with AI scoring and messages (n8n)
At a glance
- Setup estimate
- 3–5 h (ESTIMATE)
- Tools
- Industries
- General (any small business)
Problem
Manual LinkedIn prospecting and personalization doesn't scale
Who it's for
A self-hosted n8n LinkedIn automation for B2B founders, consultants and small sales teams who sell to a defined ideal customer profile (ICP). The trigger: finding the right people on LinkedIn, researching each company and writing to them one by one doesn't scale, and you want the research and prioritising done for you.
Skip it if you're on n8n Cloud (the template says its AnySite community node only runs self-hosted), if you can't accept risk to your LinkedIn account, or if you expected AI-written outreach: as shipped, the message step sends the word 'Hello'.
Tools and what each does
- n8n Chat Trigger + ICP Agent (gpt-4o, with memory)
- Interviews you about your ideal customer in plain language until it has the ICP details.
- AI Agent with gpt-4.1 + structured output parser
- Turns the ICP into Sales Navigator search filters (titles, companies, location, industry, company size, keywords).
- AnySite LinkedIn community node (package n8n-nodes-hdw)
- Runs the search; fetches company websites, the lead's and company's posts, and Google news; sends connection requests and messages; lists your connections.
- AnySite web parser tools + OpenAI gpt-4o
- Map and scrape company websites and summarise the site, posts and news.
- OpenAI gpt-4o (Company Score Analysis)
- Scores each lead 1–10 from those summaries.
- Google Sheets
- One sheet holds every lead, the research summaries, the score and connection/message flags.
Browse by tool: n8n, AnySite, LinkedIn, OpenAI, Google Sheets
Steps
- Describe your ideal customer to the chat agent.
- The agent converts it to search filters and AnySite returns matching people, saved to the sheet.
- For each lead, n8n finds the company website and summarises it, plus recent lead posts, company posts and company news.
- A daily 7:00 run scores unscored leads, sorts by score and sends connection requests to up to 50 leads not yet contacted.
- Another 7:00 run fetches your 40 newest connections and marks matching leads as connected.
- A third 7:00 run messages connected leads not yet messaged, 5 seconds apart.
Known problems in the source template
Found by reading the template's JSON, not by running it. Likely fails as shipped.
Problem: The LinkedIn message node sends the fixed text 'Hello'. Nothing in the workflow writes a personalised message, despite the title.
Fix: Add an OpenAI step that drafts a message from the lead's summaries, and put it in a sheet column for you to review before sending.
Problem: After messaging, the sheet update refers to a node called 'Google Sheets16', which doesn't exist in the JSON. That step likely errors, 'Message Sent' is never set, and the same people could be messaged again the next day.
Fix: Point it at the node that feeds the loop (the sheet read in that branch).
Problem: The scoring prompt rates interest in 'Hotels suppliers' and 'Hotel Services', the author's market.
Fix: Rewrite the criteria for your product before the first scoring run.
Before you start
- Self-hosted n8n with the AnySite community node installed (npm package n8n-nodes-hdw).
- An AnySite API key (cost UNKNOWN) connected to your LinkedIn account, plus whatever LinkedIn plan the Sales Navigator search needs (UNKNOWN).
- An OpenAI API key with billing set up.
- A Google Sheet with the template's columns (Name, URN, URL, Headline, Website, summaries, Lead Score, Contact Request, Connected, Message Sent…).
- Setup estimate: 3–5 h (ESTIMATE).
What can go wrong
Requires self-hosted n8n: it uses the AnySite LinkedIn community node, which does not run on n8n Cloud. Also needs an AnySite API key (cost UNKNOWN) and an OpenAI API key. Risk: LinkedIn's User Agreement prohibits using "bots or other unauthorized automated methods" to send messages or add contacts, so automating your account could put it at risk. Read https://www.linkedin.com/legal/user-agreement before using this.
- LegalLinkedIn's User Agreement prohibits using "bots or other unauthorized automated methods" to send messages or add contacts. Sending up to 50 automated connection requests a day can put your account at risk. Read the agreement before switching on the outreach branches, or run only the research and scoring part.
- Silent failureThe score is stored as text from the model's reply. The template asks for 'ONLY a single number', but anything else (a sentence, '8/10') will likely sort unpredictably and may change who gets contacted first.
- Rate limitAll three daily jobs fire at 7:00, and each lead triggers several AnySite and OpenAI calls plus many Sheets reads and writes. Google's Sheets API allows 60 reads per minute per user per project, so a big first search can hit that limit.
- Data privacyPersonal LinkedIn profile data and post content are stored in Google Sheets and sent to OpenAI and AnySite. In the EU and UK that's personal data under GDPR, so you need a lawful basis for processing it.
- ModelThe template uses gpt-4.1 and gpt-4o, both listed on OpenAI's deprecations page for removal from the API on Jan 14, 2027 (recommended replacement gpt-6-luna).
How to adapt it
- Keep the ICP chat, search, research and scoring, and do the outreach by hand from the sorted sheet. That's the lower-risk version.
- Lower the connection limit from 50 and stagger the schedule triggers.
- Add a score threshold so only leads scoring, say, 7 or more get a connection request.
- Swap Google Sheets for Airtable or a CRM once the column set settles.
Sources we checked
- Source template: n8n.io workflow 3490 checked
- Template JSON via n8n templates API checked
- npm: n8n-nodes-hdw (AnySite community node) checked
- LinkedIn User Agreement checked
- Google Sheets API usage limits checked
- OpenAI API deprecations checked
- Status
- Researched: Sourced and summarized, not yet run end-to-end by us
- Last checked
- Details checked
Setup estimates are rough guesses for someone comfortable with the tools who already has the accounts and API keys. Real time is unknown until tested.