AutomationFlowsSocial Media › Extract Linkedin Sales Navigator Contacts to Google Sheets with Auto Pagination

Extract Linkedin Sales Navigator Contacts to Google Sheets with Auto Pagination

ByNaveen Choudhary @n8nstein on n8n.io

This workflow scrapes LinkedIn Sales Navigator search results and automatically saves contact details to Google Sheets with pagination support and rate limiting protection.

Event trigger★★★★☆ complexity15 nodesHTTP RequestGoogle Sheets
Social Media Trigger: Event Nodes: 15 Complexity: ★★★★☆ Added:

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

This workflow follows the Google Sheets → HTTP Request 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": {
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "120b55a2-ed29-4a35-9265-18940cee8b21",
      "name": "Scrape LinkedIn Contacts API",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -768,
        -32
      ],
      "parameters": {
        "url": "https://api.nickautomations.com/linkedin/scrape",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "authentication": "genericCredentialType",
        "bodyParameters": {
          "parameters": [
            {
              "name": "cookies",
              "value": "={{ $json.cookies }}"
            },
            {
              "name": "url",
              "value": "={{ $json.url }}"
            },
            {
              "name": "scraper_type",
              "value": "={{ $json.scraper_type }}"
            },
            {
              "name": "start",
              "value": "={{ $json.start }}"
            }
          ]
        },
        "genericAuthType": "httpHeaderAuth"
      },
      "credentials": {
        "httpHeaderAuth": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "93f2cf65-a67c-4f8d-9512-6ab51bdfb973",
      "name": "Extract Contact Data Array",
      "type": "n8n-nodes-base.code",
      "position": [
        -544,
        -32
      ],
      "parameters": {
        "jsCode": "// Get all items from the previous node\nconst items = $input.all();\n\n// Assuming the payload is in the first item\nconst payload = items[0].json;\n\n// Return the nested 'data' array for the next node\nreturn payload.data;"
      },
      "typeVersion": 2
    },
    {
      "id": "3f8a9eb7-0df9-4464-a3cd-ae2ca5db2d55",
      "name": "Save Contacts to Google Sheets",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -320,
        -32
      ],
      "parameters": {
        "columns": {
          "value": {
            "id": "={{ $json.id }}",
            "title": "={{ $json.title }}",
            "fullName": "={{ $json.fullName }}",
            "industry": "={{ $json.industry }}",
            "lastName": "={{ $json.lastName }}",
            "location": "={{ $json.location }}",
            "firstName": "={{ $json.firstName }}",
            "profileUrl": "={{ 'https://www.linkedin.com/in/' + $json.entityUrn.split('(')[1].split(',')[0] }}",
            "companyName": "={{ $json.companyName }}",
            "companyLocation": "={{ $json.companyLocation }}"
          },
          "schema": [
            {
              "id": "id",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "id",
              "defaultMatch": true,
              "canBeUsedToMatch": true
            },
            {
              "id": "firstName",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "firstName",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "lastName",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "lastName",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "fullName",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "fullName",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "location",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "location",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "title",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "title",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "companyName",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "companyName",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "companyLocation",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "companyLocation",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "industry",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "industry",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "profileUrl",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "profileUrl",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "id"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "append",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1IZUmM6cTe4Fmona9tWcfX6A0F4G0Di4VyZUhxKAbp0M/edit#gid=0",
          "cachedResultName": "LinkedIn Contacts"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1IZUmM6cTe4Fmona9tWcfX6A0F4G0Di4VyZUhxKAbp0M",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1IZUmM6cTe4Fmona9tWcfX6A0F4G0Di4VyZUhxKAbp0M/edit?usp=drivesdk",
          "cachedResultName": "LinkedIn Contacts"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "a8d46ea2-2543-4f9d-ab03-07f3b0347a87",
      "name": "Check If More Pages Available",
      "type": "n8n-nodes-base.if",
      "position": [
        -96,
        -32
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "81c52d64-e7d8-4d23-aaba-6befa2f6e46a",
              "operator": {
                "type": "number",
                "operation": "lt"
              },
              "leftValue": "={{ $('Scrape LinkedIn Contacts API').item.json.paging.start - $('Set Search Parameters').item.json.start/25 }}",
              "rightValue": "={{ $('Set Search Parameters').item.json.total_pages }}"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "e18e663a-f637-4df9-a4fb-c5c9b4b6fcf0",
      "name": "Increment Page Start Parameter",
      "type": "n8n-nodes-base.set",
      "position": [
        128,
        -48
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "9b805fcd-3929-464c-8338-d8c365873c0b",
              "name": "start",
              "type": "number",
              "value": "={{ $('Scrape LinkedIn Contacts API').item.json.paging.start + 25 }}"
            }
          ]
        }
      },
      "executeOnce": true,
      "typeVersion": 3.4
    },
    {
      "id": "ddf0bf2a-6395-4afe-8e50-dc954a0889af",
      "name": "Rate Limit Delay Between Requests",
      "type": "n8n-nodes-base.wait",
      "position": [
        352,
        48
      ],
      "parameters": {
        "amount": "={{ Math.floor(Math.random() * (60 - 30 + 1)) + 30 }}"
      },
      "typeVersion": 1.1
    },
    {
      "id": "b6f3aefc-aae0-48a3-b812-5c628f8d9a98",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1232,
        -224
      ],
      "parameters": {
        "width": 416,
        "height": 224,
        "content": "### Configuration Settings\n\n**cookies**: LinkedIn session cookies (required)\n**url**: LinkedIn Sales Navigator search URL\n**scraper_type**: contacts\n**total_pages**: Number of pages to scrape (default: 2)\n\nEach page contains ~25 contacts\nModify these values before running"
      },
      "typeVersion": 1
    },
    {
      "id": "1110cbb4-a93c-4aa4-b5f9-7229487dda40",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -704,
        -240
      ],
      "parameters": {
        "color": 5,
        "width": 496,
        "height": 192,
        "content": "### Scraping Process\n\n1. API fetches contact data from LinkedIn\n2. Extract nested contact array from response\n3. Save contact details to Google Sheets\n\nData includes: name, title, company, location, profile URL, etc."
      },
      "typeVersion": 1
    },
    {
      "id": "15dabc04-686b-4273-b7e7-3d7efe326681",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -128,
        -240
      ],
      "parameters": {
        "color": 4,
        "width": 416,
        "height": 192,
        "content": "### Pagination Logic\n\nChecks if more pages exist\nIf YES \u2192 Increment start parameter (+25)\nIf NO \u2192 Workflow completes\n\nLoop continues until all pages are scraped"
      },
      "typeVersion": 1
    },
    {
      "id": "fd5eafc2-36c6-4e86-87d5-3d74f2b9396e",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        112,
        240
      ],
      "parameters": {
        "color": 3,
        "width": 416,
        "content": "### Rate Limiting Protection **(DON'T LOWER THIS)**\n\nRandom delay: 30-60 seconds between requests\n\nPrevents LinkedIn API blocks\nMimics human browsing behavior"
      },
      "typeVersion": 1
    },
    {
      "id": "9a22691a-daa3-4fba-bc83-ad90f86134e5",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1680,
        -48
      ],
      "parameters": {
        "color": 6,
        "width": 400,
        "height": 400,
        "content": "## Get 1 Month Free API Access\n\nNeed API credentials?\n\n[Email Naveen to request access](mailto:nchoudhary110792@gmail.com?subject=LinkedIn%20Scraper%20API%20-%20Free%201%20Month%20Access%20Request&body=Hi%20Naveen%2C%0A%0AI%20would%20like%20to%20request%201%20month%20of%20free%20access%20to%20the%20LinkedIn%20Scraper%20API.%0A%0AName%3A%20%0AEmail%3A%20%0AUse%20Case%3A%20%0A%0AThank%20you!)\n\nYou'll receive your API keys within 24 hours\n\n**How to add your API key:**\n1. Click on \"Fetch LinkedIn Contacts\" node\n2. Scroll to \"Authentication\" section\n3. Select \"Header Auth\" credential\n4. Click \"Create New Credential\"\n5. Set Name: \"x-api-key\"\n6. Set Value: [Your API key from email]\n7. Save and test the workflow\n"
      },
      "typeVersion": 1
    },
    {
      "id": "d8ec7f32-3a28-45c3-b4ff-1419016af252",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -944,
        256
      ],
      "parameters": {
        "color": 2,
        "width": 720,
        "height": 352,
        "content": "### How to Get LinkedIn Cookies\n\n**Required Extension:**\n[Install EditThisCookie](https://chromewebstore.google.com/detail/editthiscookie-v3/ojfebgpkimhlhcblbalbfjblapadhbol)\n\n**Steps to Extract Cookies:**\n1. Go to LinkedIn Sales Navigator\n2. Click the cookie icon in your browser toolbar\n3. Click \"Export\" button\n4. Copy the exported cookie data\n5. Paste into the \"cookies\" field in this node\n\nSee reference image for [visual guide](https://drive.google.com/file/d/1yY4xdXjrChAeKGWz3H6lqyp1lJ1ElKWU/view?usp=sharing)\n\n**Cookies authenticate your LinkedIn session (and nothing is saved - not even the data scraping)**"
      },
      "typeVersion": 1
    },
    {
      "id": "d78e5f9b-2047-4994-83dc-d35d1bd7585e",
      "name": "Start Workflow",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -1216,
        48
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "5bdef910-db46-47f9-8e2a-dd2ac16b563f",
      "name": "Set Search Parameters",
      "type": "n8n-nodes-base.set",
      "position": [
        -992,
        48
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "ef3bbffa-8a91-4477-b930-b2089fdb5d04",
              "name": "cookies",
              "type": "array",
              "value": "[YOUR_COOKIES_HERE]"
            },
            {
              "id": "26025d17-4e8c-48df-aaa2-60b5bfa0d021",
              "name": "url",
              "type": "string",
              "value": "[YOUR_SALES_NAVIGATOR_SEARCH_URL_HERE]"
            },
            {
              "id": "3fb93134-cc12-4e83-ae2e-387de3c01f74",
              "name": "scraper_type",
              "type": "string",
              "value": "contacts"
            },
            {
              "id": "5bd33944-beb4-4aa0-a617-b25d9759d690",
              "name": "start",
              "type": "number",
              "value": "={{ $input.first()?.json?.start ?? 0 }}"
            },
            {
              "id": "1cfc15c1-6bfb-4ded-bdb8-6076cdd008ef",
              "name": "total_pages",
              "type": "number",
              "value": 2
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "ce0fa21f-039e-43dd-9c56-20f3a69b4cae",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2528,
        -208
      ],
      "parameters": {
        "width": 752,
        "height": 816,
        "content": "## LinkedIn Sales Navigator to Google Sheets Scraper\n\nThis workflow automatically extracts contact data from LinkedIn Sales Navigator and saves it to Google Sheets.\n\n### What it does:\n- Fetches contacts from Sales Navigator search results via API\n- Handles pagination automatically (25 contacts per page)\n- Extracts: name, title, company, location, profile URL, industry\n- Saves all data to Google Sheets\n- Built-in rate limiting (30-60s delays) prevents API blocks\n\n### Requirements:\n- Self-hosted n8n (won't work on Cloud)\n- LinkedIn Sales Navigator account\n- API access (email creator for 1 month free)\n- EditThisCookie browser extension\n- Google Sheets account\n\n### Quick Setup:\n1. Get API key from creator (see purple sticky note)\n2. Extract LinkedIn cookies (see green sticky note)\n3. Configure \"Set Search Parameters\" node\n4. Make a copy of the Google Sheet template\n5. Connect your Google Sheets in the final node\n6. Run workflow\n\n### Important Notes:\n- Keep cookies private (they're your login session)\n- Don't lower the rate limit delay\n- Each page = ~25 contacts\n- Data is NOT stored anywhere except your Google Sheet\n\nFor detailed setup instructions, see the sticky notes throughout the workflow."
      },
      "typeVersion": 1
    }
  ],
  "connections": {
    "Start Workflow": {
      "main": [
        [
          {
            "node": "Set Search Parameters",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set Search Parameters": {
      "main": [
        [
          {
            "node": "Scrape LinkedIn Contacts API",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract Contact Data Array": {
      "main": [
        [
          {
            "node": "Save Contacts to Google Sheets",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Scrape LinkedIn Contacts API": {
      "main": [
        [
          {
            "node": "Extract Contact Data Array",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check If More Pages Available": {
      "main": [
        [
          {
            "node": "Increment Page Start Parameter",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Increment Page Start Parameter": {
      "main": [
        [
          {
            "node": "Rate Limit Delay Between Requests",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Save Contacts to Google Sheets": {
      "main": [
        [
          {
            "node": "Check If More Pages Available",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Rate Limit Delay Between Requests": {
      "main": [
        [
          {
            "node": "Set Search Parameters",
            "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

This workflow scrapes LinkedIn Sales Navigator search results and automatically saves contact details to Google Sheets with pagination support and rate limiting protection.

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

More Social Media workflows → · Browse all categories →

Related workflows

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

Social Media

Disclaimer: this workflow only works on self-hosted instances due to the file system usage.

Execute Workflow Trigger, HTTP Request, Form Trigger +3
Social Media

More workflow: https://aitool.wiki/

Google Sheets, Google Drive, Read Write File +3
Social Media

&gt; ⚠️ Disclaimer: This workflow uses Community Nodes and requires a self-hosted n8n instance.

HTTP Request, Telegram Trigger, Google Sheets +1
Social Media

This n8n workflow automates the process of scraping job listings from both LinkedIn and Indeed platforms simultaneously, combining results, and exporting data to Google Sheets for comprehensive job ma

Form Trigger, HTTP Request, Google Sheets
Social Media

Generate traffic and grow your audience effortlessly with this plug-and-play n8n automation template. Automatically fetch TikTok videos, upload them to YouTube Shorts, save logs to Google Sheets, and

HTTP Request, Google Sheets, Telegram +1