Automate LinkedIn Profile Collection with n8n and SerpAPI

This workflow automates collecting LinkedIn profiles by performing Google searches via SerpAPI, extracting relevant data, and saving it to Excel and NocoDB. It solves the tedious manual task of gathering targeted LinkedIn leads based on keywords and locations efficiently.
manualTrigger
httpRequest
openAi
+6
Learn how to Build this Workflow with AI:
Workflow Identifier: 1943
NODES in Use: Manual Trigger, HTTP Request, Set, SplitOut, OpenAI, Merge, ConvertToFile, NocoDB, Sticky Note

Press CTRL+F5 if the workflow didn't load.

Visit through Desktop for Best experience

Opening Problem Statement

Meet Daniel, a sales development representative tasked with sourcing qualified LinkedIn leads in Germany for his new SaaS product focused on no-code tools. Every week, Daniel spends countless hours manually searching Google and LinkedIn for profiles matching specific job keywords, locations, and follower counts. This manual process results in errors, missed leads, and repetitive tedious work. Daniel’s frustration mounts as he realizes this wasted time could be better spent engaging prospects instead of hunting them down.

Specifically, Daniel needs a method to efficiently fetch LinkedIn profiles based on defined keywords like “nocode” and locations such as “Germany,” which automatically extracts and organizes vital data like profile names, company affiliations, follower counts, and profile URLs. Without automation, it’s easy for him to overlook details or repeat the same searches multiple times, costing him hours per week and potentially losing promising leads.

What This Automation Does

This n8n workflow automates the entire sourcing of LinkedIn profiles by leveraging SerpAPI to conduct Google searches constrained to LinkedIn URLs, extracting structured profile data, and enriching it using OpenAI. When you run this workflow, you get:

  • Targeted LinkedIn profiles returned from keyword and location-based Google searches.
  • Cleaned data with follower counts converted into numeric values for better analysis.
  • Company names extracted from profile snippets using AI for added context.
  • Results neatly stored in an Excel file ready for download.
  • Automatic insertion of captured profiles into a NocoDB database for easy access and future retrieval.
  • Elimination of manual errors and hours of time wasted on repetitive searching.

Prerequisites ⚙️

  • n8n Automation Platform Account (cloud or self-hosted) 🔌
  • SerpAPI account with API key to perform Google search queries (free tier available) 🔑
  • OpenAI account with API key for company name extraction and follower count processing 🔑
  • NocoDB account (cloud or self-hosted) with API credentials to store leads in a database 📁

Step-by-Step Guide

Step 1: Import the Workflow into n8n

Start by copying the workflow JSON file provided. In your n8n dashboard, go to Workflows > Import from File or Import from URL to load this LinkedIn profile collector.

Once imported, you should see nodes representing search parameters, HTTP requests, OpenAI processing, and final data storage.

Common Mistake: Forgetting to activate the workflow after import.

Step 2: Set Your Search Parameters

Locate the Search parameter node (a Set node). Update the default values with your desired:

  • Keyword (e.g., “nocode”)
  • Location (e.g., “Germany”)
  • Number of search results (e.g., 20)
  • Host language (e.g., “en”)
  • Geolocation code (e.g., “de”)
  • Search engine (usually “google”)
  • Site (predefined as linkedin.com/in to limit search results)

These parameters dynamically tailor Google searches via SerpAPI.

Expected Outcome: When triggered manually, the parameters feed into the search for LinkedIn profiles specifically matching your criteria.

Step 3: Configure SerpAPI Credentials

Click on the Google search w/ SerpAPI HTTP Request node. Ensure your SerpAPI credentials are properly linked under credential. SerpAPI handles sending your Google search query and receiving structured JSON with search results.

Common Mistake: Not having a SerpAPI account or misconfiguring credentials leading to no search results.

Step 4: Split Search Results into Individual Profiles

The next node, Turn search results into individual items (SplitOut node), takes the large JSON response from SerpAPI and breaks the “organic_results” array into individual LinkedIn profile listings you can process separately.

At this point, you see a list of JSON objects representing each LinkedIn profile’s metadata.

Step 5: Clean and Extract Relevant Fields

The Edit Fields node (a Set node) reshapes each profile JSON item to only keep necessary fields: profile name, LinkedIn URL, snippet, follower count string, search keyword, and location. It discards unnecessary metadata to simplify downstream processing.

Step 6: Enrich Data with OpenAI

The Company name & followers node taps into OpenAI’s GPT-4o model. Here’s the prompt it uses:

=Transform  {{ $json.Followers }} into a number and extract where possible the name of the company in {{ $json.NameInLinkedinProfile }} or in {{ $json.Snippet }} Do not output things like location or name, only followers and company_name

This intelligent step extracts company names from profile snippets and standardizes follower counts (e.g., “3.3k+” to 3300), which is highly valuable for sorting and targeting leads.

Step 7: Discard Additional Metadata

The Discard meta data Set node keeps only the essential fields OpenAI produces: “NameOfCompany” and numeric “followers_number”.

Step 8: Merge Final Data Sets

The Generate final data via merge node combines the enriched data from OpenAI with the edited LinkedIn profile fields into a single JSON object per profile entry.

Step 9: Output Data as Excel File

The LinkedIn profiles in Excel for download node converts the combined JSON data into an Excel (.xlsx) file, which you can download directly from the node interface after the workflow runs.

Step 10: Store Data in NocoDB

The final Store data in a NocoDB table node sends the merged profile data into a configured NocoDB database table for persistence, later queries, or integrations.

Setup Notes: Create the NocoDB table with fields like NameInLinkedinProfile (text), NameOfCompany (text), linkedinUrl (url), Followers (text), followers_number (number), Keyword (text), Location (text), Rich snippet (long text), and snippet_highlighted_words (long text).

Customizations ✏️

  • Change Search Keywords or Locations: In the Search parameter node, update the “Keyword” or “Location” fields to target different markets or job titles.
  • Switch OpenAI Model: In the Company name & followers node, you can change from GPT-4o to another OpenAI model depending on your subscription or desired result quality.
  • Export as CSV Instead of Excel: Modify the LinkedIn profiles in Excel for download node’s operation from “xlsx” to “csv” if preferred.
  • Remove NocoDB Storage: If you do not want to store data in a database, simply delete or disable the Store data in a NocoDB table node.
  • Increase Number of Search Results: Adjust the “Number of search results to be returned” in the Search parameter node to fetch more profiles per execution.

Troubleshooting 🔧

  • Problem: “No search results returned from SerpAPI.”

    Cause: Incorrect SerpAPI credentials or exceeded API limits.

    Solution: Verify your SerpAPI API key under Credential settings and ensure your account has sufficient quota. Test the SerpAPI request independently to confirm connectivity.
  • Problem: “OpenAI API errors or no data enrichment happening.”

    Cause: Invalid OpenAI API key or quota exhaustion.

    Solution: Double-check the OpenAI credentials in n8n and confirm your usage limits. Confirm the prompt is correctly set in the node.
  • Problem: “Excel file download button not visible or fails.”

    Cause: Node not executed or workflow stopped prematurely.

    Solution: Confirm the workflow runs completely, then open the Excel node and click the download button manually.

Pre-Production Checklist ✅

  • Ensure SerpAPI credentials are valid and tested.
  • Verify OpenAI API key is set and the model is correctly selected.
  • Confirm NocoDB credentials and table fields align with workflow data structure.
  • Test manual trigger runs and check partial outputs step-by-step.
  • Backup your NocoDB data before first runs to avoid accidental overwrites.

Deployment Guide

After completing setup and testing, activate the workflow by toggling the activation switch in n8n. You can run it manually to fetch LinkedIn profiles anytime. For automated periodic runs, set up a Cron Trigger (not included in this workflow) triggering based on your lead generation frequency.

Monitor workflow executions via the n8n dashboard to catch and resolve errors. Download your accumulated Excel reports as needed and access your NocoDB database for ongoing pipeline management.

FAQs

  • Can I use another search API instead of SerpAPI?
    Yes, but SerpAPI is recommended due to its ease of use and Google search reliability. If changing, adjust the HTTP request node accordingly.
  • Does this workflow consume many OpenAI tokens?
    It uses OpenAI moderation reasonably since mainly extracting company names and follower counts, keeping token usage moderate.
  • Is my LinkedIn lead data secure?
    Data is processed within your n8n environment; ensure your API keys and servers are secure. Avoid sharing credentials.
  • Can I scale this to hundreds of searches?
    Yes, but watch SerpAPI and OpenAI rate limits and costs. Consider spreading executions over time.

Conclusion

By following this guide, you’ve automated Daniel’s lead sourcing nightmare. You now have a workflow that efficiently finds LinkedIn profiles by keyword and location, enriches data using AI, and saves everything neatly for analysis or sales prospecting.

This automation saves hours per week previously spent on manual searches, reduces errors, and builds a scalable lead generation pipeline with Excel and NocoDB integration.

Next steps could include automating outreach based on these leads or integrating with CRM tools for seamless workflow extension. With your newfound automation power, Daniel—and you—can focus on closing deals, not digging through profiles.

Related Workflows

Automate Viral UGC Video Creation Using n8n + Degaus (Beginner-Friendly Guide)

Learn how to automate viral UGC video creation using n8n, AI prompts, and Degaus. This beginner-friendly guide shows how to import, configure, and run the workflow without technical complexity.
Form Trigger
Google Sheets
Gmail
+37
Free

AI SEO Blog Writer Automation in n8n (Beginner Guide)

A complete beginner guide to building an AI-powered SEO blog writer automation using n8n.
AI Agent
Google Sheets
httpRequest
+5
Free

Automate CrowdStrike Alerts with VirusTotal, Jira & Slack

This workflow automates processing of CrowdStrike detections by enriching threat data via VirusTotal, creating Jira tickets for incident tracking, and notifying teams on Slack for quick response. Save hours daily by transforming complex threat data into actionable alerts effortlessly.
scheduleTrigger
httpRequest
jira
+5
Free

Automate Telegram Invoices to Notion with AI Summaries & Reports

Save hours on financial tracking by automating invoice extraction from Telegram photos to Notion using Google Gemini AI. This workflow extracts data, records transactions, and generates detailed spending reports with charts sent on schedule via Telegram.
lmChatGoogleGemini
telegramTrigger
notion
+9
Free

Automate Email Replies with n8n and AI-Powered Summarization

Save hours managing your inbox with this n8n workflow that uses IMAP email triggers, AI summarization, and vector search to draft concise replies requiring minimal review. Automate business email processing efficiently with AI guidance and Gmail integration.
emailReadImap
vectorStoreQdrant
emailSend
+12
Free

Automate Email Campaigns Using n8n with Gmail & Google Sheets

This n8n workflow automates personalized email outreach campaigns by integrating Gmail and Google Sheets, saving hours of manual follow-up work and reducing errors in email sequences. It ensures timely follow-ups based on previous email interactions, optimizing communication efficiency.
googleSheets
gmail
code
+5
Free