Automated LinkedIn Profile Search and Google Sheet Data Entry - n8n Workflow

Use this powerful n8n workflow to scrape LinkedIn profiles based on position, industry, and region using Google Custom Search, automatically saving all structured data directly to Google Sheets. Find the best n8n templates for lead generation.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?


  • Sales teams needing automated lead generation from LinkedIn.

  • Market researchers compiling lists of professionals in specific regions and industries.

  • Data analysts looking for a robust n8n automation solution for external data acquisition.

  • Users searching for practical n8n templates that manage complex API pagination.

Overview

Manually searching and compiling LinkedIn profile data is time-consuming and error-prone. This specialized n8n workflow addresses this challenge by automating the entire process. Utilizing the Google Custom Search API with specific search parameters (position, industry, region), this n8n automation template efficiently extracts public profile links, names, titles, and descriptions.

The key value of this n8n workflow lies in its robust pagination handling and data cleaning capabilities. It ensures that up to the maximum limit allowed by the Google API (100 results) are collected and securely saved to a dedicated Google Sheet, providing a clean, organized, and scalable solution for competitive analysis or lead list building. This is an essential n8n node combination for data-intensive operations.

How it Works

This automation begins with the On form submission n8n trigger. The user defines the position, industry, and region criteria required for the search.


  1. Initialization: The workflow first uses the Edit Fields n8n node to set initial pagination parameters, specifically currentStartIndex to 1.

  2. API Search Loop: The core process uses the HTTP Request n8n node to query the Google Custom Search API. The search query is dynamically constructed using the input criteria, limited to site:linkedin.com/in. The start parameter ensures the n8n workflow fetches the correct page of results during each iteration of the loop.

  3. Data Extraction & Cleaning: The subsequent Code in JavaScript n8n node is critical. It processes the raw JSON response from the Google API, extracts structured fields (Name, Title, Link), performs necessary title cleanup (removing trailing ' | LinkedIn' text), and calculates the nextStartIndex and a hasMoreResults boolean.

  4. Rate Limiting & Storage: A Wait n8n node pauses the execution for 3 seconds to prevent hitting Google API rate limits. The Append or update row in sheet Google Sheets n8n node then writes the cleaned profile data, along with the original search parameters, to the target Google Sheet.

  5. Loop Control: The profile data is stripped down to just the pagination variables (startIndex and hasMoreResults) in the Edit Fields1 node and refined in Code in JavaScript1. This information feeds into the Pagination Check n8n node, an If statement. If continueLoop is true, the n8n workflow automatically returns to the HTTP Request node to fetch the next set of results; otherwise, the automation completes.

Installation Guide

To deploy this n8n template successfully, follow these steps:


  1. Import the Workflow: Copy the provided JSON data and paste it into your n8n instance to create a new n8n workflow.

  2. Google Sheets Credential Setup: In the Append or update row in sheet n8n node, set up or select your Google Sheets OAuth2 API credential. Ensure the service account has write access to your desired spreadsheet.

  3. Google Search API Setup: The HTTP Request n8n node requires credentials for the Google Custom Search API.

Set up a Generic HTTP Basic Auth credential. Use your Google API Key and your Search Engine ID (CX).
Ensure the CX ID is correctly entered in the cx query parameter within the HTTP Request n8n node.

  1. Google Sheet Preparation: Create a Google Sheet with corresponding columns expected by the workflow: Name, Position, Profile Links, Description, Image Link, Searched Position, Searched Industry, and Searched Region.

  2. Trigger Activation: Navigate to the On form submission n8n trigger node and copy the webhook URL to use in your application or fill out the test form manually to start the n8n workflow.

Node Details

On form submission (n8n trigger): The starting point of this n8n workflow. Collects initial user inputs: postion, industry, and region to formulate the search query.
HTTP Request (n8n node): Connects to the googleapis.com/customsearch/v1. It executes the specialized search query targeting LinkedIn and manages pagination by adjusting the start parameter based on previous loop results.
Code in JavaScript (n8n node): Functions as the primary data processor. It parses the complex JSON structure from the Google API, cleans up metadata (like profile titles), and calculates the necessary parameters (startIndex, hasMoreResults) for the subsequent pagination logic in the n8n workflow.
Append or update row in sheet (Google Sheets n8n node): Handles data persistence. It takes the cleaned profile data and maps it precisely to the structured columns in the connected Google Sheet document.
Code in JavaScript1 (n8n node): A utility node used specifically to bundle the pagination control variables (continueLoop and startIndex) into a format suitable for the Pagination Check n8n node.
Pagination Check (n8n node): An If condition that controls the workflow's loop. If the hasMoreResults flag (aliased as continueLoop) is true, the n8n workflow iterates back to the HTTP Request n8n node to fetch the next 10 results.

Related n8n Workflows

Free

Nodes: 8 Nodes
Updated: December 26 2025
View all
Created by

Pixcels Themes is a modern AI Automation Agency helping businesses streamline time-consuming tasks through intelligent automation. We build practical AI solutions—from automated workflows and Shopify integrations to custom chatbots and tailored AI agents—that replace manual work with smart, self-running systems. Our focus is simple: make businesses faster, more efficient, and ready for the AI-powered future

Featured*