Automated LinkedIn Profile Collector using Search API and Google Sheets - n8n Workflow

A robust n8n workflow designed to scrape targeted LinkedIn profiles using SerpAPI Google Search and store the resulting data instantly in Google Sheets. Use these n8n templates for efficient lead generation.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?


  • Lead Generation Specialists and Sales Teams needing targeted contact data.

  • Marketing Analysts performing market research using public data.

  • n8n users looking for advanced web scraping n8n templates.

  • Professionals requiring an automated, scalable solution for collecting LinkedIn URLs.

Overview

This comprehensive n8n workflow solves the tedious problem of manually searching and logging LinkedIn profiles based on specific keywords. It transforms a simple form submission into a powerful, multi-page Google search operation targeting LinkedIn. By leveraging the SerpAPI n8n node, the automation performs structured searches, handles pagination automatically, extracts key profile details (like the full name from the title), and immediately logs all findings into a structured Google Sheet. This particular n8n workflow saves significant time, ensures data consistency, and provides immediate, actionable leads, demonstrating the power of custom n8n automation for data collection.

How it Works

This n8n workflow initiates upon a user submitting the custom form defined in the 'On form submission' n8n trigger.


  1. Trigger and Formatting: The 'On form submission' n8n trigger collects keywords and the number of pages to fetch. The subsequent 'Format Keywords' n8n node sanitizes and converts the comma-separated input into the precise bracketed format required for advanced Google search syntax, which is vital for effective scraping within this n8n workflow.

  2. Pagination Setup: The 'Build Page List' Code n8n node calculates the necessary API offsets (start parameter) required by SerpAPI to fetch results across the requested number of search pages.

  3. Looping and Searching: The 'Loop Over Items' node iterates through each page offset generated. For every iteration, the 'SerpAPI Search' n8n node executes the targeted Google search query (site:pl.linkedin.com/in/) using the formatted keywords and the current page offset.

  4. Result Checking: The 'Check how many results are returned' n8n node (Switch type) evaluates the search results. If zero results are found, the n8n workflow terminates and notifies the user via the 'No profiles found' Form node.

  5. Extraction and Cleaning: If results exist, the 'Split Out' n8n node separates the organic_results array into individual items (one item per profile). The 'Get Full Name to property of object' Code n8n node then cleans the data, extracting the full name from the profile title.

  6. Data Storage: Finally, the 'Append profile in sheet' Google Sheets n8n node writes the structured data (Date, Profile URL, Full Name, Keywords) into the designated Google Sheet, completing the goal of this n8n template.

Installation Guide

To install and utilize this n8n workflow template effectively, follow these steps:


  1. Import the n8n Workflow: Copy the provided JSON code and paste it into your n8n instance via the 'New' menu > 'Import from JSON'.

  2. Configure Credentials: You must provide credentials for the following services:

SerpAPI: Set up a SerpAPI credential for the 'SerpAPI Search' n8n node. This API key enables the Google search queries.
Google Sheets: Authenticate a Google Sheets credential for the 'Append profile in sheet' n8n node. Ensure this account has write access to the target spreadsheet.

  1. Google Sheet Setup: Create a new Google Sheet (or use an existing one) and ensure the first row contains the exact column headers expected by the n8n node: Date, Profile, Keywords, and Full name.

  2. Update Node Parameters: In the 'Append profile in sheet' n8n node, update the Document ID and Sheet Name to point to your specific Google Sheet destination.

  3. Activate: Save the n8n workflow and activate it using the toggle switch.

Node Details

On form submission (n8n trigger): Acts as the entry point for this n8n workflow. It collects user input including Keywords (comma separated) and Pages to fetch.
Format Keywords (Set n8n node): Essential for search query accuracy. It wraps each comma-separated keyword in quotes and parentheses, e.g., word1, word2 becomes ("word1") ("word2").
Build Page List (Code n8n node): Programmatically generates input items representing each page needed for pagination (using 10 items per page offset calculation).
Loop Over Items (Split In Batches n8n node): Controls the flow, ensuring the SerpAPI search runs sequentially for every requested page offset, which is crucial for handling large search volumes within the n8n workflow.
SerpAPI Search (SerpAPI n8n node): Performs the actual extraction via a localized Google search (site:pl.linkedin.com/in/) using the dynamically built query and page offset.
Check how many results are returned (Switch n8n node): A core logic n8n node that routes the workflow based on the count of results (0 vs. > 0 total results).
Split Out (Split Out n8n node): Transforms the list of results into individual data items, preparing them for mapping.
Get Full Name to property of object (Code n8n node): Cleans the scraped data by using JavaScript to extract the profile owner's full name from the search result title.


  • Append profile in sheet (Google Sheets n8n node): The final action n8n node, configured to append the structured Date, Profile, Keywords, and Full name data to the designated Google Sheet.

Related n8n Workflows

Free

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

Featured*