AutomationFlowsWeb Scraping › Extract & Enrich Linkedin Comments to Leads with Apify → Google Sheets/csv

Extract & Enrich Linkedin Comments to Leads with Apify → Google Sheets/csv

BySaverflow AI @saverflowai on n8n.io

Automate LinkedIn lead generation by scraping comments from targeted posts and enriching profiles with detailed data

Event trigger★★★★★ complexity39 nodesForm TriggerHTTP RequestGoogle Sheets
Web Scraping Trigger: Event Nodes: 39 Complexity: ★★★★★ Added:

This workflow corresponds to n8n.io template #4635 — we link there as the canonical source.

This workflow follows the Form Trigger → Google Sheets recipe pattern — see all workflows that pair these two integrations.

The workflow JSON

Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →

Download .json
{
  "meta": {
    "templateId": "4635"
  },
  "nodes": [
    {
      "id": "66c32da3-373c-42a9-bf51-5bec1fd6c4cd",
      "name": "Trigger manually",
      "type": "n8n-nodes-base.manualTrigger",
      "disabled": true,
      "position": [
        1240,
        1360
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "6a0decfe-9539-4c10-9474-0031fa91dfc5",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        380,
        240
      ],
      "parameters": {
        "color": 5,
        "width": 1620,
        "height": 1000,
        "content": "# \ud83d\ude80 LinkedIn Comments to Leads Extractor & Enricher (Apify) \u2192 Google Sheets / CSV\n\n## Overview\n\n**Automate LinkedIn lead generation by scraping comments from targeted posts and enriching profiles with detailed data**\n\nThis n8n workflow automatically extracts leads from LinkedIn post comments using Apify's powerful scrapers (no LinkedIn login required), enriches the data with additional profile information, and exports everything to Google Sheets or CSV format.\n\n---\n\n## \u2728 Key Features\n\n- \ud83d\udd0d **No Login Required**: Scrape LinkedIn data without sharing credentials\n- \ud83d\udcb0 **Cost-Effective**: First 1,000 comments are free with Apify\n- \ud83d\udcca **Data Enrichment**: Enhance basic comment data with full profile details\n- \ud83d\udcc8 **Export Options**: Choose between Google Sheets or CSV output\n- \ud83c\udfaf **Targeted Scraping**: Focus on specific posts for quality leads\n\n---\n\n## \ud83d\udee0\ufe0f Apify Scrapers Used\n\n### 1. LinkedIn Post Comments Scraper\n- **Tool**: [LinkedIn Post Comments, Replies, Engagements Scraper | No Cookies](https://apify.com/apimaestro/linkedin-post-comments-replies-engagements-scraper-no-cookies/api/python)\n- **Pricing**: $5.00 per 1,000 results\n- **Function**: Extracts all comments and engagement data from specified LinkedIn posts\n\n### 2. LinkedIn Profile Batch Scraper\n- **Tool**: [LinkedIn Profile Details Batch Scraper (No Cookies Required)](https://apify.com/apimaestro/linkedin-profile-batch-scraper-no-cookies-required)\n- **Pricing**: $5.00 per 1,000 results\n- **Function**: Enriches scraped profiles with detailed information\n\n> \ud83d\udca1 **Free Tier**: Apify provides 1,000 free scraped comments to get you started!\n\n---\n"
      },
      "typeVersion": 1
    },
    {
      "id": "e206b173-eb8a-4721-8251-8b0ebb2aa38f",
      "name": "On form submission",
      "type": "n8n-nodes-base.formTrigger",
      "position": [
        1300,
        1760
      ],
      "parameters": {
        "options": {
          "ignoreBots": true,
          "buttonLabel": "Submit",
          "appendAttribution": false,
          "respondWithOptions": {
            "values": {
              "redirectUrl": "=https://docs.google.com/spreadsheets/u/0/",
              "respondWith": "redirect"
            }
          }
        },
        "formTitle": "Linkedin Posts Comments Leads Scraper",
        "formFields": {
          "values": [
            {
              "fieldType": "textarea",
              "fieldLabel": "Post IDs/URLs",
              "placeholder": "e.g. 7334385757769416704, https://www.linkedin.com/feed/update/urn:li:activity:7334385757769416704/",
              "requiredField": true
            },
            {
              "fieldType": "number",
              "fieldLabel": "How many comments you want to scrape?",
              "placeholder": "Default: 100"
            }
          ]
        },
        "responseMode": "lastNode",
        "formDescription": "=<div style=\"font-family: Arial, sans-serif; line-height: 1.8; color: #333; word-wrap: break-word; overflow-wrap: break-word;\">\n\n<p style=\"margin-bottom: 20px;\"><strong style=\"color: #0077b5;\">\ud83d\udd38 Step 1: Add Posts URLs</strong></p>\n<p style=\"margin-bottom: 20px;\">The workflow accepts various LinkedIn post identifier formats:</p>\n\n<p style=\"margin-bottom: 18px;\"><strong>\ud83d\udcca Numeric post IDs:</strong><br>\n<span style=\"font-family: monospace; background: #f5f5f5; padding: 4px 6px; word-break: break-all; margin-top: 8px; display: inline-block;\">7334385757769416704</span></p>\n\n<p style=\"margin-bottom: 18px;\"><strong>\ud83d\udd17 Activity URLs:</strong><br>\n<span style=\"font-family: monospace; background: #f5f5f5; padding: 4px 6px; word-break: break-all; display: block; margin-top: 8px;\">https://www.linkedin.com/feed/update/urn:li:activity:273437/</span></p>\n\n<p style=\"margin-bottom: 25px;\"><strong>\ud83c\udf10 Full post URLs:</strong><br>\n<span style=\"font-family: monospace; background: #f5f5f5; padding: 4px 6px; word-break: break-all; display: block; margin-top: 8px;\">https://www.linkedin.com/posts/username_title-activity-7334385757769416704-dMnz</span></p>\n\n<hr style=\"margin: 30px 0; border: 1px solid #ddd;\">-------------------\n\n<p style=\"margin-bottom: 20px;\"><strong style=\"color: #28a745;\">\u2705 Step 2: Results</strong></p>\n<p style=\"margin-bottom: 20px;\">Once finished, you'll be redirected to Google Sheets where you can find your result with the name:</p>\n<p style=\"background: #f0f8ff; padding: 15px; border-left: 4px solid #0077b5; margin: 20px 0;\">\n<strong>\"LinkedIn-Posts-Comments-Leads-{{ $now.format('yyyy-MM-dd') }}\"</strong>\n</p>\n\n<hr style=\"margin: 30px 0; border: 1px solid #ddd;\">-------------------\n\n\n<p style=\"color: #666; font-size: 14px; margin-top: 25px;\"><em>\ud83d\udca1 Tip: Make sure your LinkedIn URLs are publicly accessible for the best results.</em></p>\n\n</div>"
      },
      "typeVersion": 2.2
    },
    {
      "id": "d90f3510-b326-4352-90f4-772eca3d5b9b",
      "name": "Set APIFY Token",
      "type": "n8n-nodes-base.set",
      "position": [
        1820,
        1460
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "20febbcc-0a59-4a89-8932-9bbb34b0e9f9",
              "name": "APIFY_TOKEN",
              "type": "string",
              "value": ""
            },
            {
              "id": "291758a3-c73f-4db5-a2b3-5f88664a8b53",
              "name": "limit",
              "type": "number",
              "value": "={{ $json.limit }}"
            },
            {
              "id": "921b72d5-3688-4324-9d36-50668548344e",
              "name": "postIds",
              "type": "array",
              "value": "={{ $json.postIds }}"
            }
          ]
        },
        "includeOtherFields": true
      },
      "notesInFlow": true,
      "typeVersion": 3.4
    },
    {
      "id": "36eb3f1f-e0db-4175-964e-9200bf503918",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1740,
        1360
      ],
      "parameters": {
        "color": 3,
        "width": 260,
        "height": 300,
        "content": "## 1. Set APIFY TOKEN\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n### _(CLICK ME)_"
      },
      "typeVersion": 1
    },
    {
      "id": "5237c7a8-e2b4-49ae-a070-9cd885e1bc18",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1420,
        1280
      ],
      "parameters": {
        "color": 2,
        "height": 300,
        "content": "_(or if run manually ENABLE this)_  \n### 4. Set Post ID/URL\n\n\n\n\n\n\n\n\n\n\n\n\n\n### _(CLICK ME)_ and Connect\n"
      },
      "typeVersion": 1
    },
    {
      "id": "9637dc03-c409-477d-a596-c84f4df12d63",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1160,
        1620
      ],
      "parameters": {
        "color": 3,
        "width": 400,
        "height": 380,
        "content": "## 3. You can run through the form (check Form URL)\n\n\n\n\n\n\n\n\n\n\n\n\n\n### _(CLICK ME)_ \nIf run manually DISABLE this node"
      },
      "typeVersion": 1
    },
    {
      "id": "efe492e1-78f7-4f55-89d7-caea70767044",
      "name": "Set fields from the form",
      "type": "n8n-nodes-base.set",
      "position": [
        1620,
        1760
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "916bb8f7-34c5-4f2f-b13d-f60d228abc1f",
              "name": "postIds",
              "type": "array",
              "value": "={{ $json['Post IDs/URLs'].replaceAll('\\n','').replaceAll('\\r', '').split(',').filter(item => $ifEmpty(item, false))  }}"
            },
            {
              "id": "7ff3d2f4-ab8a-444f-9747-f95166a950bd",
              "name": "limit",
              "type": "number",
              "value": "={{ $json['How many comments you want to scrape?'] || 100 }}"
            }
          ]
        }
      },
      "notesInFlow": true,
      "typeVersion": 3.4
    },
    {
      "id": "aea3954b-94cf-4785-a692-a46d45b9add5",
      "name": "Set manual fields",
      "type": "n8n-nodes-base.set",
      "disabled": true,
      "position": [
        1480,
        1360
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "af09ad86-b3dd-45b7-b17d-cb810e4b48d6",
              "name": "postIds",
              "type": "array",
              "value": "['https://www.linkedin.com/feed/update/urn:li:activity:7334385757769416704/', 'https://www.linkedin.com/feed/update/urn:li:activity:7318557377971023872/']"
            },
            {
              "id": "b2f9412e-4c81-454f-ad84-a1d5f6547a26",
              "name": "limit",
              "type": "number",
              "value": 100
            }
          ]
        }
      },
      "notesInFlow": true,
      "typeVersion": 3.4
    },
    {
      "id": "c9d2e385-9c38-43ea-88bd-e7363f215cc7",
      "name": "More runs needed?",
      "type": "n8n-nodes-base.if",
      "notes": "Per run it's only 100 comments",
      "position": [
        2620,
        1460
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "19224073-c84d-456f-b694-318df4223d2a",
              "operator": {
                "type": "number",
                "operation": "gt"
              },
              "leftValue": "={{ $json.summary.totalComments }}",
              "rightValue": 100
            },
            {
              "id": "8156447e-75dd-4cad-8fc8-17366667d165",
              "operator": {
                "type": "number",
                "operation": "gt"
              },
              "leftValue": "={{ $('Set APIFY Token').first().json.limit }}",
              "rightValue": 100
            }
          ]
        }
      },
      "notesInFlow": true,
      "typeVersion": 2.2
    },
    {
      "id": "021e8ae2-6773-4154-ab59-61dab49b16e9",
      "name": "Set pagination",
      "type": "n8n-nodes-base.code",
      "position": [
        2840,
        1320
      ],
      "parameters": {
        "jsCode": "const limitPages = Math.ceil($('Set APIFY Token').first().json.limit / 100)\nconst totalComments = $('Run Apify Comments Scraper').last().json.summary.totalComments \nconst availablePages = Math.ceil(totalComments / 100)\n\nconst totalRuns = availablePages <= limitPages ? availablePages : limitPages\n\nlet currentPage = 2\n\n\nreturn {\n  json: {\n    items:\n      Array.from({ length: totalRuns }, (_, i) => {\n        return { currentPage: currentPage + i }\n      })\n  }\n};"
      },
      "typeVersion": 2
    },
    {
      "id": "5371649d-d032-452d-8af6-13a679b254fd",
      "name": "Split Out",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        3060,
        1320
      ],
      "parameters": {
        "options": {},
        "fieldToSplitOut": "items"
      },
      "typeVersion": 1
    },
    {
      "id": "4003ce75-3e13-4d2a-9199-bac9f5bda6de",
      "name": "Aggregate",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        2400,
        1460
      ],
      "parameters": {
        "options": {},
        "aggregate": "aggregateAllItemData",
        "destinationFieldName": "items"
      },
      "typeVersion": 1
    },
    {
      "id": "c25710e8-c47c-4fb9-91e1-d9fe37ad53fa",
      "name": "Gather All Comments",
      "type": "n8n-nodes-base.set",
      "position": [
        3720,
        1120
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "b4280f11-a50b-4065-8742-9f994c6ee84d",
              "name": "items",
              "type": "array",
              "value": "={{ $json.items.concat($('Aggregate').item.json.items) }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "2876c38b-ed23-4d6b-9a65-97c1b70d245a",
      "name": "Create Unique List of Leads",
      "type": "n8n-nodes-base.code",
      "position": [
        4180,
        1480
      ],
      "parameters": {
        "jsCode": "// Get all input items\nconst items = $input.first().json.items;\n\n// Use reduce to filter unique profile_url values\nconst uniqueProfiles = items.reduce((acc, item) => {\n  // Check if this profile_url is already in the accumulator\n  console.log(item)\n  if (item.author && !acc.some(i => i.profile_url === item.author.profile_url)) {\n    acc.push(item.author);\n  }\n  return acc;\n}, []);\n\nreturn uniqueProfiles"
      },
      "typeVersion": 2
    },
    {
      "id": "80336fb8-a783-4907-89eb-82b9877a7b36",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2000,
        1040
      ],
      "parameters": {
        "color": 7,
        "width": 2040,
        "height": 840,
        "content": "## \ud83d\udee0 Running Apify LinkedIn Comments Scrapers and processing data\nWe want to run an Apify scraper once to validate the number of available comments and then run it multiple times if necessary."
      },
      "typeVersion": 1
    },
    {
      "id": "3877d666-27e5-4bf7-8a1c-3c1e4dce32d8",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        4040,
        1040
      ],
      "parameters": {
        "width": 1700,
        "height": 840,
        "content": "## Create a unique list of Leads, \u2728 enrich \u2728 it with more data\nOnce we have all of the comment authors, we need to enrich them with more information from LinkedIn\n"
      },
      "typeVersion": 1
    },
    {
      "id": "fdbf8690-b517-4773-819a-e8bd92ddcd25",
      "name": "Run Apify Comments Scraper",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        2180,
        1460
      ],
      "parameters": {
        "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}}",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "bodyParameters": {
          "parameters": [
            {
              "name": "postIds",
              "value": "={{ $json.postIds }}"
            },
            {
              "name": "page_number",
              "value": "={{ 1 }}"
            },
            {
              "name": "sortOrder",
              "value": "most recent"
            },
            {
              "name": "limit",
              "value": "={{ $json.limit }}"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "5b426074-2649-48cf-9a55-cedfe1cb0bf7",
      "name": "Run Apify Comments Scraper Loop",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        3500,
        1340
      ],
      "parameters": {
        "url": "={{ 'https://api.apify.com/v2/acts/apimaestro~linkedin-post-comments-replies-engagements-scraper-no-cookies/run-sync-get-dataset-items?token=' + $('Set APIFY Token').first().json.APIFY_TOKEN}}",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "bodyParameters": {
          "parameters": [
            {
              "name": "postIds",
              "value": "={{ $('Set APIFY Token').first().json.postIds }}"
            },
            {
              "name": "page_number",
              "value": "={{ $json.currentPage }}"
            },
            {
              "name": "sortOrder",
              "value": "most recent"
            },
            {
              "name": "limit",
              "value": "={{ $('Set APIFY Token').first().json.limit }}"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "b3038b0f-d025-4843-8204-1bb498b193ce",
      "name": "Run Apify Profile Enrichment",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        5220,
        1500
      ],
      "parameters": {
        "url": "={{ 'https://api.apify.com/v2/acts/apimaestro~linkedin-profile-batch-scraper-no-cookies-required/run-sync-get-dataset-items?token=' + $('Set APIFY Token').first().json.APIFY_TOKEN}}",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "bodyParameters": {
          "parameters": [
            {
              "name": "usernames",
              "value": "={{ $json.batches }}"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "87194dbf-8d63-438a-8081-8ed7a4e93169",
      "name": "Split Out Batches",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        4640,
        1480
      ],
      "parameters": {
        "include": "allOtherFields",
        "options": {},
        "fieldToSplitOut": "batches"
      },
      "typeVersion": 1
    },
    {
      "id": "4fe12998-abdd-4659-aaa7-1aeef2ad241a",
      "name": "Loop Over Comments",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        3280,
        1320
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 3
    },
    {
      "id": "e1a29bde-cfe6-4c89-a601-3ae0b582e052",
      "name": "Loop Over Profiles",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        4940,
        1480
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 3
    },
    {
      "id": "1eb148c9-17a9-4d02-99a0-e647b3398ea4",
      "name": "Split in batches",
      "type": "n8n-nodes-base.code",
      "position": [
        4400,
        1480
      ],
      "parameters": {
        "jsCode": "const uniqueProfiles = $input.all().map(item => item.json.profile_url)\n\n// Split the uniqueProfiles in batches of 500 for the Apify\nconst chunkSize = 500;\nconst batches = [];\n\nfor (let i = 0; i < uniqueProfiles.length; i += chunkSize) {\n  batches.push(uniqueProfiles.slice(i, i + chunkSize));\n}\n\n\nreturn { batches };"
      },
      "typeVersion": 2
    },
    {
      "id": "596572a6-7ffe-4cfa-b662-8cd083dbaccc",
      "name": "Aggregate Comments",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        3780,
        1340
      ],
      "parameters": {
        "options": {},
        "aggregate": "aggregateAllItemData",
        "destinationFieldName": "items"
      },
      "typeVersion": 1
    },
    {
      "id": "1dc0b52f-3c86-40ea-8c4b-399872e22259",
      "name": "Aggregate Profiles",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        5440,
        1500
      ],
      "parameters": {
        "options": {},
        "aggregate": "aggregateAllItemData",
        "destinationFieldName": "items"
      },
      "typeVersion": 1
    },
    {
      "id": "21cc6cc8-d4dc-40d9-9cfb-0069786af878",
      "name": "Aggregate All Profiles",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        5220,
        1320
      ],
      "parameters": {
        "options": {
          "mergeLists": true
        },
        "fieldsToAggregate": {
          "fieldToAggregate": [
            {
              "fieldToAggregate": "items"
            }
          ]
        }
      },
      "typeVersion": 1
    },
    {
      "id": "84708fbf-bed4-4ce3-85c9-3ea16a9358c5",
      "name": "Aggregate All Comments",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        3500,
        1120
      ],
      "parameters": {
        "options": {
          "mergeLists": true
        },
        "fieldsToAggregate": {
          "fieldToAggregate": [
            {
              "fieldToAggregate": "items"
            }
          ]
        }
      },
      "typeVersion": 1
    },
    {
      "id": "ecab78f3-dcf3-4ddc-afdd-e0d49df4eaca",
      "name": "Convert to File",
      "type": "n8n-nodes-base.convertToFile",
      "disabled": true,
      "position": [
        6100,
        1140
      ],
      "parameters": {
        "options": {
          "headerRow": true
        }
      },
      "executeOnce": false,
      "typeVersion": 1.1
    },
    {
      "id": "36b226d0-a07b-48f1-9a28-85aebf794fd9",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        5840,
        1040
      ],
      "parameters": {
        "color": 2,
        "width": 660,
        "height": 380,
        "content": "## You can either run it manually (not through form) and download the CSV\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nYou need to activate \"Trigger manual\" nodes first\n\n### _(CLICK ME) and Connect_"
      },
      "typeVersion": 1
    },
    {
      "id": "f278ede4-329d-4248-9f6c-b9bb14fa13aa",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        5840,
        1500
      ],
      "parameters": {
        "color": 3,
        "width": 660,
        "height": 380,
        "content": "## 2. Add credentials to Google Sheets\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n### _(CLICK ME)_"
      },
      "typeVersion": 1
    },
    {
      "id": "49cf9532-0e2f-487e-b6d4-eeb15fec3885",
      "name": "Prepare the list for export",
      "type": "n8n-nodes-base.code",
      "position": [
        5440,
        1320
      ],
      "parameters": {
        "jsCode": "function flatten(obj, prefix = '', res = {}) {\n  for (const key in obj) {\n    const value = obj[key];\n    const prefixedKey = prefix ? `${prefix}_${key}` : key;\n    if (typeof value === 'object' && value !== null && !Array.isArray(value)) {\n      flatten(value, prefixedKey, res);\n    } else {\n      res[prefixedKey] = value;\n    }\n  }\n  return res;\n}\n\nreturn $input.first().json.items.map(item => ({\n  json: flatten(item)\n}));"
      },
      "typeVersion": 2
    },
    {
      "id": "33928b41-e209-4240-a636-41874b87b2f8",
      "name": "Create Google Sheet",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        5920,
        1640
      ],
      "parameters": {
        "title": "=LinkedIn-Posts-Comments-Leads-{{ $now.format('yyyy-MM-dd+T') }}",
        "options": {},
        "resource": "spreadsheet",
        "sheetsUi": {
          "sheetValues": [
            {
              "title": "Leads"
            }
          ]
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "executeOnce": true,
      "typeVersion": 4.5
    },
    {
      "id": "d6e02f6e-0031-4dd8-922b-7981def48097",
      "name": "Add Leads",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        6340,
        1640
      ],
      "parameters": {
        "columns": {
          "value": {},
          "schema": [
            {
              "id": "profileUrl",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "profileUrl",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "basic_info_fullname",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "basic_info_fullname",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "basic_info_first_name",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "basic_info_first_name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "basic_info_last_name",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "basic_info_last_name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "basic_info_headline",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "basic_info_headline",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "basic_info_public_identifier",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "basic_info_public_identifier",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "basic_info_profile_picture_url",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "basic_info_profile_picture_url",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "basic_info_about",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "basic_info_about",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "basic_info_location_country",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "basic_info_location_country",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "basic_info_location_city",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "basic_info_location_city",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "basic_info_location_full",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "basic_info_location_full",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "basic_info_location_country_code",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "basic_info_location_country_code",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "basic_info_creator_hashtags",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "basic_info_creator_hashtags",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "basic_info_is_creator",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "basic_info_is_creator",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "basic_info_is_influencer",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "basic_info_is_influencer",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "basic_info_is_premium",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "basic_info_is_premium",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "basic_info_created_timestamp",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "basic_info_created_timestamp",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "basic_info_show_follower_count",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "basic_info_show_follower_count",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "basic_info_background_picture_url",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "basic_info_background_picture_url",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "basic_info_urn",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "basic_info_urn",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "basic_info_follower_count",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "basic_info_follower_count",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "basic_info_connection_count",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "basic_info_connection_count",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "basic_info_current_company",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "basic_info_current_company",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "basic_info_current_company_urn",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "basic_info_current_company_urn",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "basic_info_current_company_url",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "basic_info_current_company_url",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "experience",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "experience",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "education",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "education",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "certifications",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "certifications",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "autoMapInputData",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {
          "useAppend": true,
          "cellFormat": "USER_ENTERED"
        },
        "operation": "append",
        "sheetName": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $('Create Google Sheet').first().json.sheets[0].properties.sheetId }}"
        },
        "documentId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $('Create Google Sheet').first().json.spreadsheetId }}"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "executeOnce": false,
      "typeVersion": 4.5
    },
    {
      "id": "fdb1fb37-bc5a-435d-97b4-aef5fbb8175f",
      "name": "Set the list for sheets",
      "type": "n8n-nodes-base.code",
      "position": [
        6140,
        1640
      ],
      "parameters": {
        "jsCode": "\nreturn $('Prepare the list for export').all();"
      },
      "typeVersion": 2
    },
    {
      "id": "fe6d63a8-dadd-4187-814a-7a421bbb6d3f",
      "name": "Sticky Note8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        380,
        2200
      ],
      "parameters": {
        "color": 5,
        "width": 1180,
        "height": 280,
        "content": "\n---\n\n## \ud83d\udcca Output Data Structure\n\nYour exported data will include:\n\n- **Basic Info**: Name, headline, location\n- **Profile Details**: Company, position, industry\n- **Engagement Data**: Comment content, engagement metrics\n- **Contact Info**: Available profile links and connections\n- **Enriched Data**: Additional profile insights from Apify\n\n"
      },
      "typeVersion": 1
    },
    {
      "id": "cc6512e8-8b8b-42b6-ba41-02a647bf6f5d",
      "name": "Sticky Note9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1560,
        2200
      ],
      "parameters": {
        "width": 760,
        "height": 540,
        "content": "---\n\n## \ud83d\udca1 Pro Tips\n\n- **Quality over Quantity**: Target posts with high-quality, relevant engagement\n- **Monitor Costs**: Track your Apify usage to stay within budget\n- **Data Hygiene**: Regularly clean and deduplicate your lead lists\n- **Compliance**: Ensure your scraping activities comply with LinkedIn's terms of service\n\n---\n\n## \ud83c\udd98 Troubleshooting\n\n**Common Issues:**\n- **Authentication Errors**: Verify your Apify token is correctly configured\n- **Empty Results**: Check that your LinkedIn post URLs are valid and public\n- **Export Failures**: Ensure Google Sheets credentials are properly set up\n\n**Need Help?** Contact [Saverflow.ai](https://saverflow.ai) for support and custom workflow development.\n\n---\n\n*Powered by Saverflow.ai | Streamline your lead generation with intelligent automation*"
      },
      "typeVersion": 1
    },
    {
      "id": "ad786f97-cc63-4259-a469-5c5d271b17f8",
      "name": "Sticky Note10",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        380,
        1240
      ],
      "parameters": {
        "color": 6,
        "width": 1620,
        "height": 960,
        "content": "\n## \ud83d\udccb Prerequisites\n\n### Required API Credentials\n\n1. **Apify Token**\n   - Add your `APIFY_TOKEN` to the workflow credentials\n   - [Get your token from Apify Console](https://apify.com/account#/integrations)\n\n2. **Google Sheets Credentials** *(if using Sheets export)*\n   - Configure OAuth credentials for Google Sheets integration\n   - [Follow n8n's Google Sheets setup guide](https://docs.n8n.io/integrations/builtin/credentials/google/oauth-single-service/?utm_source=n8n_app&utm_medium=credential_settings&utm_campaign=create_new_credentials_modal)\n\n---\n\n## \ud83d\udd04 Workflow Process\n\n### Default Mode: Form-Based Execution\n\n1. **Manual Trigger** \u2192 Launches the workflow\n2. **Form Submission** \u2192 User-friendly form for inputting LinkedIn post URLs\n3. **Comment Scraping** \u2192 Apify extracts all comments from specified posts\n4. **Profile Enrichment** \u2192 Additional profile data gathered for each commenter\n5. **Data Processing** \u2192 Creates unique, enriched lead list\n6. **Google Sheets Export** \u2192 Automatically populates your spreadsheet\n\n**Result**: You'll be redirected to a Google Sheets document containing all enriched leads\n\n### Alternative Mode: CSV Export\n\nFor users preferring CSV output:\n\n1. **Disable**: Form trigger nodes\n2. **Enable**: Manual trigger node\n3. **Disable**: Google Sheets export nodes\n4. **Enable**: CSV download nodes\n5. **Configure**: Add post IDs/URLs in \"Set manual fields\" node\n6. **Execute**: Run workflow and download CSV from the CSV node\n"
      },
      "typeVersion": 1
    },
    {
      "id": "66685e68-953e-41b7-bc24-3de11ec8798a",
      "name": "Done",
      "type": "n8n-nodes-base.noOp",
      "position": [
        7060,
        1360
      ],
      "parameters": {},
      "typeVersion": 1
    }
  ],
  "connections": {
    "Add Leads": {
      "main": [
        [
          {
            "node": "Done",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Aggregate": {
      "main": [
        [
          {
            "node": "More runs needed?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split Out": {
      "main": [
        [
          {
            "node": "Loop Over Comments",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set pagination": {
      "main": [
        [
          {
            "node": "Split Out",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Convert to File": {
      "main": [
        []
      ]
    },
    "Set APIFY Token": {
      "main": [
        [
          {
            "node": "Run Apify Comments Scraper",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split in batches": {
      "main": [
        [
          {
            "node": "Split Out Batches",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Trigger manually": {
      "main": [
        [
          {
            "node": "Set manual fields",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "More runs needed?": {
      "main": [
        [
          {
            "node": "Set pagination",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Create Unique List of Leads",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set manual fields": {
      "main": [
        []
      ]
    },
    "Split Out Batches": {
      "main": [
        [
          {
            "node": "Loop Over Profiles",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Aggregate Comments": {
      "main": [
        [
          {
            "node": "Loop Over Comments",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Aggregate Profiles": {
      "main": [
        [
          {
            "node": "Loop Over Profiles",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Comments": {
      "main": [
        [
          {
            "node": "Aggregate All Comments",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Run Apify Comments Scraper Loop",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Profiles": {
      "main": [
        [
          {
            "node": "Aggregate All Profiles",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Run Apify Profile Enrichment",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "On form submission": {
      "main": [
        [
          {
            "node": "Set fields from the form",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create Google Sheet": {
      "main": [
        [
          {
            "node": "Set the list for sheets",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Gather All Comments": {
      "main": [
        [
          {
            "node": "Create Unique List of Leads",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Aggregate All Comments": {
      "main": [
        [
          {
            "node": "Gather All Comments",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Aggregate All Profiles": {
      "main": [
        [
          {
            "node": "Prepare the list for export",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set the list for sheets": {
      "main": [
        [
          {
            "node": "Add Leads",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set fields from the form": {
      "main": [
        [
          {
            "node": "Set APIFY Token",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Run Apify Comments Scraper": {
      "main": [
        [
          {
            "node": "Aggregate",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create Unique List of Leads": {
      "main": [
        [
          {
            "node": "Split in batches",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prepare the list for export": {
      "main": [
        [
          {
            "node": "Create Google Sheet",
            "type": "main",
            "index": 0
          },
          {
            "node": "Convert to File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Run Apify Profile Enrichment": {
      "main": [
        [
          {
            "node": "Aggregate Profiles",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Run Apify Comments Scraper Loop": {
      "main": [
        [
          {
            "node": "Aggregate Comments",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}

Credentials you'll need

Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.

Pro

For the full experience including quality scoring and batch install features for each workflow upgrade to Pro

About this workflow

Automate LinkedIn lead generation by scraping comments from targeted posts and enriching profiles with detailed data

Source: https://n8n.io/workflows/4635/ — original creator credit. Request a take-down →

More Web Scraping workflows → · Browse all categories →

Related workflows

Workflows that share integrations, category, or trigger type with this one. All free to copy and import.

Web Scraping

Automatically scrapes Google My Business listings using Apify's Google Maps Scraper, filters results to businesses with 1-star reviews, and exports structured lead data into a dedicated Google Sheet t

Form Trigger, HTTP Request, Google Sheets +1
Web Scraping

Users who want to automatically fetch and organize property listings from 99Acres and MagicBricks into Google Sheets without manual copying. Users submit search URLs via a form. The workflow uses Apif

Google Sheets, HTTP Request, Form Trigger
Web Scraping

This workflow is perfect for content strategists, SEO specialists, marketing agencies, and virtual assistants who need to quickly audit and collect blog content from client websites into a structured

Form Trigger, Google Sheets, HTTP Request
Web Scraping

This workflow is for marketers, growth hackers, and social media managers who want to collect and analyze comments from LinkedIn posts without manual copy-pasting. It is especially useful for communit

Form Trigger, Google Sheets, HTTP Request
Web Scraping

Product - SERP Analysis (Serper + Firecrawl). Uses formTrigger, httpRequest, googleSheets, openAi. Event-driven trigger; 40 nodes.

Form Trigger, HTTP Request, Google Sheets +1