LinkedIn to Google Sheets, leads and first lines ready
You find a promising LinkedIn profile, copy the name, paste the URL, grab a detail for personalization… then do it again. And again. After 30 profiles, your brain is fried and your sheet is a mess.
Agency owners feel it when outreach volume spikes. A marketing consultant feels it when they’re juggling delivery and prospecting. Even a founder doing their own outbound runs into the same wall. This LinkedIn leads automation gives you a clean Google Sheet of prospects plus a tailored first line draft, ready for outreach.
Below, you’ll see how the workflow finds LinkedIn prospects through Google Search, enriches context with AI research, and writes a one-line opener you can actually use.
How This Automation Works
The full n8n workflow, from trigger to final output:
n8n Workflow Template: LinkedIn to Google Sheets, leads and first lines ready
flowchart LR
subgraph sg0["Schedule Flow"]
direction LR
n0@{ icon: "mdi:swap-vertical", form: "rounded", label: "Set Fields", pos: "b", h: 48 }
n1@{ icon: "mdi:database", form: "rounded", label: "Add to Google", pos: "b", h: 48 }
n2@{ icon: "mdi:brain", form: "rounded", label: "OpenRouter Chat Model", pos: "b", h: 48 }
n3@{ icon: "mdi:robot", form: "rounded", label: "Research Agent", pos: "b", h: 48 }
n4["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/httprequest.dark.svg' width='40' height='40' /></div><br/>Google Search"]
n5["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/code.svg' width='40' height='40' /></div><br/>Results "]
n6["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/code.svg' width='40' height='40' /></div><br/>Pages"]
n7@{ icon: "mdi:swap-horizontal", form: "rounded", label: "Pages Check", pos: "b", h: 48 }
n8@{ icon: "mdi:database", form: "rounded", label: "Google Sheets", pos: "b", h: 48 }
n9@{ icon: "mdi:robot", form: "rounded", label: "Outreach Agent", pos: "b", h: 48 }
n10@{ icon: "mdi:play-circle", form: "rounded", label: "Schedule Trigger", pos: "b", h: 48 }
n6 --> n7
n5 --> n1
n5 --> n6
n0 --> n4
n7 --> n4
n1 --> n3
n4 --> n5
n9 --> n8
n3 --> n9
n10 --> n0
n2 -.-> n3
end
%% Styling
classDef trigger fill:#e8f5e9,stroke:#388e3c,stroke-width:2px
classDef ai fill:#e3f2fd,stroke:#1976d2,stroke-width:2px
classDef aiModel fill:#e8eaf6,stroke:#3f51b5,stroke-width:2px
classDef decision fill:#fff8e1,stroke:#f9a825,stroke-width:2px
classDef database fill:#fce4ec,stroke:#c2185b,stroke-width:2px
classDef api fill:#fff3e0,stroke:#e65100,stroke-width:2px
classDef code fill:#f3e5f5,stroke:#7b1fa2,stroke-width:2px
classDef disabled stroke-dasharray: 5 5,opacity: 0.5
class n10 trigger
class n3,n9 ai
class n2 aiModel
class n7 decision
class n1,n8 database
class n4 api
class n5,n6 code
classDef customIcon fill:none,stroke:none
class n4,n5,n6 customIcon
The Problem: LinkedIn lead sourcing and personalization doesn’t scale
Manual prospecting is slow in a way that’s hard to explain until you’ve done it for a week straight. You’re not just collecting names and links. You’re switching tabs, scanning snippets, trying to find one “human” detail, then writing a first line that doesn’t sound copied. It gets worse when you need volume, because quality drops first. And if you’re in a niche like legal, most scraping tools are either expensive, unreliable, or frankly not worth the risk.
The friction compounds. Here’s where it breaks down in real life.
- You waste about 5 minutes per lead just moving data into the right columns.
- Personalization turns into “Hi {FirstName}” because research takes too long.
- Paid tools push you into Sales Navigator or questionable scraping workflows.
- Your pipeline looks “busy,” but you can’t tell which leads are actually outreach-ready.
The Solution: Google Search to Sheets, enriched and drafted automatically
This workflow starts with a scheduled run in n8n, then uses Google Programmable Search to find LinkedIn profiles that match your query (for example, solo lawyers or small firm founders). It parses the search results into usable lead fields like name, title, profile URL, and the Google snippet, then appends that raw data into Google Sheets so nothing gets lost. Next, it enriches each lead using OpenRouter’s Sonar Pro model, pulling in extra context from the web that helps your message feel real. Finally, it generates a personalized, one-line outreach opener using GPT-4o (either via OpenAI or routed through OpenRouter) and writes that back into the same sheet. You end with an organized list that’s ready to message, not a half-finished research project.
The workflow kicks off on a schedule, runs a Google search, and paginates through results in batches so you can process a lot of leads without chaos. Each lead gets logged first, enriched second, and only then turned into a first-line draft. When it’s done, your Google Sheet contains both the lead data and the outreach line you’ll send.
What You Get: Automation vs. Results
| What This Workflow Automates | Results You’ll Get |
|---|---|
|
|
Example: What This Looks Like
Say you want 200 new solo-lawyer leads each week. Manually, if you spend about 5 minutes to find a profile, copy details, and write a usable first line, that’s roughly 1,000 minutes (about 16 hours). With this workflow, you schedule the run, let it collect and log leads automatically, then review the finished Sheet. Even if you spend about 1 hour skimming and tweaking the best lines, you’ve still turned a full-day task into a quick weekly review.
What You’ll Need
- n8n instance (try n8n Cloud free)
- Self-hosting option if you prefer (Hostinger works well)
- Google Programmable Search for finding LinkedIn profiles via Google.
- Google Sheets to store leads and outreach lines.
- OpenRouter API key (get it from your OpenRouter dashboard after funding the account).
Skill level: Beginner. You’ll mostly paste API keys, connect Google Sheets, and edit a search query and prompt.
Don’t want to set this up yourself? Talk to an automation expert (free 15-minute consultation).
How It Works
A scheduled run kicks things off. n8n starts the workflow automatically on the timing you choose, so lead generation doesn’t depend on motivation (or a spare Friday afternoon).
Google Search finds the right LinkedIn profiles. The workflow sends a request to Google Programmable Search using your query and settings, then paginates through results so it can collect a large list without manual clicking.
Results get cleaned and logged immediately. Code nodes parse the response into fields that actually matter for outreach, and the workflow appends each lead into Google Sheets before any AI work happens. If something fails later, you still keep the raw leads.
AI enrichment and first-line drafting happens per lead. The workflow loops through your newly added rows, uses OpenRouter’s research model to pull in extra context, then uses GPT-4o to write a single personalized opener and updates the corresponding row in the sheet.
You can easily modify the Google search query to target a different niche based on your needs. See the full implementation guide below for customization options.
Step-by-Step Implementation Guide
Step 1: Configure the Scheduled Trigger
Start the workflow on a scheduled interval so the lead search runs automatically.
- Select Scheduled Start and set the Rule interval to your preferred schedule.
- Confirm the trigger connects to Initialize Index as the first action.
Step 2: Connect Google Sheets and Initialize the Search Index
Set the initial pagination index and prepare your spreadsheet for incoming leads.
- In Initialize Index, set currentStartIndex to
1. - Open Append to Spreadsheet and set Operation to
append. - Map the columns in Append to Spreadsheet: Name to
{{ $json.name }}, title to{{ $json.position }}, and profile_url to{{ $json.link }}. - Select the target spreadsheet in Document (e.g.,
[YOUR_ID]) and Sheet (e.g.,Sheet1).
Credential Required: Connect your Google Sheets credentials in Append to Spreadsheet.
Credential Required: Connect your Google Sheets credentials in Update Lead Sheet (configured later).
Step 3: Configure Web Search and Pagination Loop
Build the search request, parse the results, and loop through pagination.
- In Web Search Request, set URL to
https://www.googleapis.com/customsearch/v1and enable Send Query. - Set query parameters in Web Search Request: key to
[CONFIGURE_YOUR_API_KEY], cx to[CONFIGURE_YOUR_API_KEY], q to("solo practitioner" OR "founder" OR "managing partner") lawyer "law firm" site:linkedin.com/in -government -gov -biglaw, and start to{{ $json.startIndex || 1 }}. - Confirm Parse Search Results uses the provided JavaScript to extract name, position, link, and pagination fields (startIndex, hasMoreResults).
- Verify Parse Search Results outputs to both Append to Spreadsheet and Pagination Control in parallel.
- In Pagination Control, keep the JavaScript that returns
continueLoopandstartIndex. - In Pagination Gate, set the condition to true when
{{ $('Pagination Control').item.json.continueLoop }}is true. - Connect Pagination Gate back to Web Search Request to continue pagination.
⚠️ Common Pitfall: If your Google Custom Search API key or CX is missing, Web Search Request will return empty results and pagination may loop without data.
Step 4: Set Up AI Research and Outreach Generation
Use the research agent and AI model to generate personalized outreach lines.
- In Research Insight Agent, keep Text as
Name: {{ $json.name }} Title: {{ $json.title }} About: {{ $json.about }}. - Review the System Message inside Research Insight Agent to ensure it aligns with your outreach goals.
- Confirm OpenRouter Chat Engine is connected as the language model for Research Insight Agent and set Model to
perplexity/sonar-pro. - In Generate Outreach Line, use the system message and ensure the user content references:
{{ $('Parse Search Results').all()[ $itemIndex ].json.name }},{{ $('Parse Search Results').all()[ $itemIndex ].json.position }}, and{{ $('Parse Search Results').all()[ $itemIndex ].json.about }}.
Credential Required: Connect your OpenRouter credentials in OpenRouter Chat Engine (credentials are applied at the parent node level, not the agent).
Credential Required: Connect your OpenAI credentials in Generate Outreach Line.
Step 5: Configure Lead Sheet Updates
Write the generated outreach line back to the spreadsheet and match on the lead’s name.
- Open Update Lead Sheet and set Operation to
appendOrUpdate. - Map name to
{{ $('Parse Search Results').all()[ $itemIndex ].json.name }}and outreach message 1 to{{ $json.message.content }}. - Set Matching Columns to
nameto update the correct lead row. - Select the same Document and Sheet used in Append to Spreadsheet (e.g.,
[YOUR_ID]andSheet1).
⚠️ Common Pitfall: If the name column is empty or inconsistent, Update Lead Sheet may append duplicates instead of updating existing rows.
Step 6: Test and Activate Your Workflow
Run a test to ensure the search, AI generation, and sheet updates complete successfully.
- Click Execute Workflow to run Scheduled Start manually.
- Verify that Append to Spreadsheet adds new rows with Name, title, and profile_url.
- Confirm Generate Outreach Line returns a short personalized line and Update Lead Sheet writes it to outreach message 1.
- Turn on the workflow by toggling Active to enable scheduled production runs.
Common Gotchas
- Google Programmable Search credentials can expire or be restricted by project settings. If things break, check your Google Cloud API key restrictions and Custom Search API enablement first.
- If you’re using Wait nodes or external rendering, processing times vary. Bump up the wait duration if downstream nodes fail on empty responses.
- Default prompts in AI nodes are generic. Add your brand voice early or you’ll be editing outputs forever.
Frequently Asked Questions
About 20 minutes if your accounts are ready.
No. You’ll connect accounts, paste API keys, and edit a search query and prompt.
Yes. n8n has a free self-hosted option and a free trial on n8n Cloud. Cloud plans start at $20/month for higher volume. You’ll also need to factor in OpenRouter/OpenAI usage (most teams land around a few dollars while testing, then scale with volume).
Two options: n8n Cloud (managed, easiest setup) or self-hosting on a VPS. For self-hosting, Hostinger VPS is affordable and handles n8n well. Self-hosting gives you unlimited executions but requires basic server management.
Yes, and it’s the main way you’ll get the best results. Change the Google search query in the Web Search Request step (for example, swap “solo lawyer” for “therapist founder” and keep the site:linkedin.com/in pattern). Then tweak the outreach prompt in the Generate Outreach Line step so it matches your tone and offer. If you want deeper personalization, adjust the Research Insight Agent instructions to prioritize signals you care about (location, practice area, recent content, and so on).
Usually it’s an OAuth issue: the wrong Google account, revoked permissions, or the sheet wasn’t shared with the connected account. Also check that your column names match what the workflow expects (Name, Title, Profile URL, Outreach Message). If the workflow can append rows but can’t update them later, the row mapping or sheet/tab selection is often the culprit.
The template is designed to handle up to about 1,000 leads per day, but the practical limit depends on your Google Search quota and how much AI enrichment you run per lead. On n8n Cloud Starter you can run a healthy amount of daily executions, and higher plans handle more. If you self-host, there’s no execution cap from n8n, so your server resources and API limits become the bottleneck. In practice, most teams start with a small daily batch, validate quality, then scale up.
Often, yes, because this flow uses batching, branching, and AI steps that get awkward (or pricey) in simpler tools. You also have the option to self-host n8n, which is a big deal when volume grows. Zapier or Make can still be fine for lightweight “log this lead” zaps, but they’re not as comfortable when you want pagination, enrichment, and row-by-row updates in one workflow. If you’re unsure, Talk to an automation expert and describe your volume and niche.
Once this is running, your “lead list” becomes a living system, not a recurring chore. You review, tweak, send, and move on.
Need Help Setting This Up?
Our automation experts can build and customize this workflow for your specific needs. Free 15-minute consultation—no commitment required.