🔓 Unlock all 10,000+ workflows & prompts free Join Newsletter →
✅ Full access unlocked — explore all 10,000 AI workflow and prompt templates Browse Templates →
Home n8n Workflow
January 22, 2026

Apify to Google Sheets, clean LinkedIn lead lists

Lisa Granqvist Partner Workflow Automation Expert

You find a perfect LinkedIn post. The comments are full of potential buyers. Then you spend the next hour copying names, opening profiles, and pasting half-broken rows into a spreadsheet.

This is the kind of grind that drains growth marketers first, but agency owners and busy sales teams feel it too. With Apify Sheets leads automation, you turn LinkedIn commenters into a clean, enriched lead list without the messy manual work.

Below you’ll see how the workflow runs, what you get out of it, and the practical setup details that matter when you want leads you can actually contact.

How This Automation Works

The full n8n workflow, from trigger to final output:

n8n Workflow Template: Apify to Google Sheets, clean LinkedIn lead lists

The Problem: LinkedIn comments don’t turn into usable leads

LinkedIn makes it easy to find intent. It does not make it easy to capture it. You start with a post URL, then it’s tabs on tabs: commenter profiles, company pages, headlines, locations, and the “wait, did we already add this person?” spiral. Even if you export something, it’s usually messy. Duplicates sneak in, names don’t match profiles, and half the rows are missing the context that would make outreach feel human. By the time the list is “clean,” the moment is gone and your follow-up is late.

The friction compounds. Here’s where it breaks down most often.

  • You waste about 1–2 hours per campaign just collecting commenter names and URLs across multiple posts.
  • Manual copy-paste creates small errors that become big problems when you run outreach at scale.
  • Your list is usually “basic” data only, so you still have to open profiles to find role, company, and location.
  • Duplicates pile up fast, especially when the same people comment across related posts.

The Solution: Apify pulls commenters, n8n enriches, Sheets stays clean

This workflow turns a LinkedIn post (or a small set of posts) into an outreach-ready spreadsheet. You start it manually or via a simple form, paste the post URLs, and n8n sends the job to Apify’s LinkedIn scrapers. First, it collects all comments and engagement details from the post. Then it deduplicates people so you don’t get the same lead twice. After that, it batches profile URLs and enriches each profile with deeper details (headline, location, role, company, industry, and more depending on what’s available). Finally, it formats everything into neat rows and appends them to a Google Sheet (or exports a CSV if you prefer).

The workflow starts with your LinkedIn post URLs. Apify gathers the comment data, then n8n loops through pages in batches so you can pull large threads without babysitting it. Once profiles are enriched, the workflow prepares clean export rows and pushes them into Google Sheets, ready for filtering and outreach.

What You Get: Automation vs. Results

Example: What This Looks Like

Say you run one lead-gen sprint from 3 LinkedIn posts per week, and each post has roughly 150 commenters. Manually, even at “only” 1 minute per person to grab a name, profile link, and a quick note, that’s about 7–8 hours of tab-hopping (and you still don’t have enrichment). With this workflow, you spend about 10 minutes pasting URLs into the form, then you wait while Apify scrapes and enriches in the background. The output lands in Google Sheets already deduped and formatted, so you can start outreach the same afternoon.

What You’ll Need

  • n8n instance (try n8n Cloud free)
  • Self-hosting option if you prefer (Hostinger works well)
  • Apify to scrape comments and enrich profiles
  • Google Sheets to store and work your lead list
  • Apify Token (get it from the Apify Console)

Skill level: Intermediate. You’ll connect credentials, choose Sheets vs. CSV mode, and do light tweaking (like sheet name and which fields you want exported).

Don’t want to set this up yourself? Talk to an automation expert (free 15-minute consultation).

How It Works

You launch it from a form or manual run. In “default mode,” a form collects LinkedIn post URLs so a non-technical teammate can run it without touching the canvas. If you prefer, you can switch to manual fields and hardcode post IDs for a repeatable campaign.

Apify scrapes the comment threads. n8n sends an HTTP request to Apify’s LinkedIn Post Comments scraper, then calculates pagination and loops through pages in batches until it has everything you asked for.

The workflow cleans and enriches leads. It merges all comments, derives a unique lead list, then batches profile URLs into groups and calls Apify’s profile batch scraper. This is where the list becomes useful, because you get more than a name and a comment.

Results are exported to Google Sheets (or CSV). n8n prepares export-ready rows, creates or loads a sheet payload, then appends the lead rows so your spreadsheet becomes the source of truth for outreach and tracking.

You can easily modify which LinkedIn posts you pull and where the final file goes based on your needs. See the full implementation guide below for customization options.

Step-by-Step Implementation Guide

Step 1: Configure the Form Trigger

Set up the form entry point that collects LinkedIn post URLs and comment limits before processing.

  1. Add and configure Form Submit Trigger with Form Title set to Linkedin Posts Comments Leads Scraper.
  2. In Form Submit Trigger, keep Response Mode as lastNode and the redirect URL as =https://docs.google.com/spreadsheets/u/0/.
  3. Optionally keep Manual Launch Start and Manual Input Setup disabled for manual testing; if enabled, set postIds to a list and limit to 100.
  4. Connect Form Submit Trigger to Map Form Inputs as shown in the workflow.
Tip: Keep the form description HTML intact so users see the required LinkedIn URL formats.

Step 2: Connect Google Sheets

Configure the Google Sheets creation and append operations used to store enriched leads.

  1. Open Generate Sheet File and set Title to =LinkedIn-Posts-Comments-Leads-{{ $now.format('yyyy-MM-dd+T') }}.
  2. Credential Required: Connect your googleSheetsOAuth2Api credentials in Generate Sheet File.
  3. Open Append Lead Rows and keep Operation set to append with Document ID ={{ $('Generate Sheet File').first().json.spreadsheetId }} and Sheet Name ={{ $('Generate Sheet File').first().json.sheets[0].properties.sheetId }}.
  4. Credential Required: Connect your googleSheetsOAuth2Api credentials in Append Lead Rows.
⚠️ Common Pitfall: If the spreadsheet is not created, Append Lead Rows will fail because it references IDs from Generate Sheet File.

Step 3: Set Up Comment Scraping and Pagination

Map form inputs, inject the Apify token, scrape the first comment batch, and loop through additional pages when required.

  1. In Map Form Inputs, set postIds to {{ $json['Post IDs/URLs'].replaceAll('\n','').replaceAll('\r', '').split(',').filter(item => $ifEmpty(item, false)) }} and limit to {{ $json['How many comments you want to scrape?'] || 100 }}.
  2. In Assign Apify Token, set APIFY_TOKEN to your Apify token, and map limit to {{ $json.limit }} and postIds to {{ $json.postIds }}.
  3. Configure Execute Comment Scrape with URL {{ 'https://api.apify.com/v2/acts/apimaestro~linkedin-post-comments-replies-engagements-scraper-no-cookies/run-sync-get-dataset-items?token=' +$json.APIFY_TOKEN}} and ensure the body parameters use {{ $json.postIds }}, {{ 1 }}, and {{ $json.limit }}.
  4. Keep the pagination logic chain: Combine First BatchCheck Extra RunsCompute PaginationSplit RecordsIterate Comment PagesRepeat Comment ScrapeAggregate Loop CommentsMerge All Comments.
⚠️ Common Pitfall: Leaving APIFY_TOKEN blank in Assign Apify Token will cause the Apify requests to return authorization errors.

Step 4: Set Up Lead Deduplication and Profile Enrichment

Transform comment items into unique profile URLs, batch them, and fetch profile details.

  1. After Merge All Comments, use Collect Comment Items to combine first and looped results with {{ $json.items.concat($('Combine First Batch').item.json.items) }}.
  2. Keep Derive Unique Leads and Batch Profile URLs as-is to deduplicate and chunk profile URLs (500 per batch).
  3. Ensure the batching loop uses Expand Profile BatchesIterate Profile PagesEnrich Profile BatchAggregate Loop ProfilesMerge All Profiles.
  4. In Enrich Profile Batch, keep the URL as {{ 'https://api.apify.com/v2/acts/apimaestro~linkedin-profile-batch-scraper-no-cookies-required/run-sync-get-dataset-items?token=' + $('Assign Apify Token').first().json.APIFY_TOKEN}} and map usernames to {{ $json.batches }}.
Tip: The workflow uses multiple aggregate and code nodes to combine lists and normalize data; keep these grouped steps intact to avoid missing items.

Step 5: Configure Export and Parallel Outputs

Flatten profile data, generate a new Google Sheet, and append rows. This step also triggers an optional file conversion branch in parallel.

  1. Use Prepare Export Rows to flatten profile objects into row-ready JSON (keep the provided JavaScript).
  2. Prepare Export Rows outputs to both Generate Sheet File and Convert Results File in parallel.
  3. In Load Sheet Payload, return the prepared rows using {{ $('Prepare Export Rows').all() }} before writing to Sheets.
  4. Confirm Append Lead Rows uses Cell Format USER_ENTERED and Use Append enabled to add rows after each run.
Tip: Convert Results File is disabled by default; enable it only if you want a downloadable file output.

Step 6: Test and Activate Your Workflow

Run a manual test, verify sheet creation, and activate the workflow for production.

  1. Click Execute Workflow and submit the form in Form Submit Trigger with a small set of LinkedIn URLs.
  2. Confirm that Generate Sheet File creates a spreadsheet titled LinkedIn-Posts-Comments-Leads-YYYY-MM-DD+T and that Append Lead Rows writes rows into the Leads sheet.
  3. Check Workflow Complete receives data, indicating the workflow finished successfully.
  4. When ready, toggle the workflow to Active for production use.
🔒

Unlock Full Step-by-Step Guide

Get the complete implementation guide + downloadable template

Common Gotchas

  • Apify credentials can expire or need specific permissions. If things break, check your token in the Apify Console and then update the APIFY_TOKEN in n8n credentials 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

How long does it take to set up this Apify Sheets leads automation?

About 30 minutes if your Apify token and Google Sheets access are ready.

Do I need coding skills to automate Apify Sheets leads?

No. You’ll mostly paste in credentials and choose where the output should go. The only “technical” part is deciding if you want Sheets export or CSV mode.

Is n8n free to use for this Apify Sheets leads workflow?

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 Apify usage (the first 1,000 scraped comments are free, then pricing is about $5 per 1,000 results for the scrapers used here).

Where can I host n8n to run this automation?

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.

Can I customize this Apify Sheets leads workflow for CSV instead of Google Sheets?

Yes, but you’ll toggle a few nodes. Disable the Google Sheets export nodes and enable the CSV download path (the workflow includes a “Convert results to file” step for this). You’ll also switch from the form trigger to the manual input setup so you can paste post IDs/URLs in one place. Common tweaks include exporting fewer columns, adding a “source post URL” column, and writing into a new sheet tab per campaign.

Why is my Apify connection failing in this workflow?

Most of the time it’s a token issue or a quota/cost limit you hit unexpectedly. Regenerate your Apify token in the Apify Console and update the APIFY_TOKEN value in n8n. Also confirm the actor you’re calling is the right one (comments scraper vs. profile batch scraper), because a wrong endpoint can look like “empty data.” If your inputs are private or the post URL is malformed, Apify may return a successful run with no usable results, which feels like the workflow “did nothing.”

How many leads can this Apify Sheets leads automation handle?

A lot, as long as you batch it. Practically, teams run this comfortably on a few hundred to a few thousand commenters per pull because enrichment is the heavier part and Apify charges per results. On n8n Cloud, your limit is mostly your monthly executions; if you self-host, there’s no execution cap and the bottleneck becomes server resources plus Apify rate/usage limits. If you’re doing large threads, keep the split-in-batches behavior and avoid trying to enrich everything in a single massive request.

Is this Apify Sheets leads automation better than using Zapier or Make?

Often, yes, because the workflow relies on batching, looping, and merging data across multiple Apify runs, and those patterns get expensive or awkward in simpler tools. n8n also makes it easier to dedupe and reshape data before export, so your sheet stays usable. Another practical win is flexibility: you can run form mode for teammates, then switch to manual mode for repeatable campaigns without rebuilding everything. Zapier or Make can still be fine for a tiny two-step flow, but this one has more moving parts. Talk to an automation expert if you want help choosing the simplest option for your exact volume.

Once this is running, you stop treating LinkedIn comment threads like “research” and start treating them like a repeatable lead source. Set it up, pull clean lists when you need them, and move on to the part that actually grows revenue.

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.

Lisa Granqvist

Workflow Automation Expert

Expert in workflow automation and no-code tools.

×

Use template

Get instant access to this n8n workflow Json file

💬
Get a free quote today!
Get a free quote today!

Tell us what you need and we'll get back to you within one working day.

Get a free quote today!
Get a free quote today!

Tell us what you need and we'll get back to you within one working day.

Launch login modal Launch register modal