Skip to main content

Beginner lead finder using SerpAPI search

Workflow preview

Workflow preview
100%
Beginner lead finder using SerpAPI search preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

This n8n workflow finds experts on any topic , scrapes their websites, and pulls out contact emails automatically. Core services used: SerpAPI (google search) · Apify (website crawler) · OpenAI (GP...

Best for

  • Lead Generation automation workflows
  • Multimodal AI automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

@n8n/n8n-nodes-langchain.lmchatopenai, @n8n/n8n-nodes-langchain.outputparserstructured, n8n-nodes-base.splitinbatches, n8n-nodes-base.manualtrigger, n8n-nodes-base.stickynote, n8n-nodes-base.set, n8n-nodes-serpapi.serpapi, n8n-nodes-base.code

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Robert Breen.

Original n8n.io source

1.1 Workflow description

Title
Beginner lead finder using SerpAPI search
Workflow name
Beginner lead finder using SerpAPI search

This n8n workflow finds experts on any topic, scrapes their websites, and pulls out contact emails automatically.
Core services used: SerpAPI (google search) · Apify (website crawler) · OpenAI (GPT-4o email extraction).


🛠️ Step-by-Step Setup & Execution

1️⃣ Run Workflow (Manual Trigger)

Node Type Purpose
Run Workflow Manual Trigger Start the workflow on demand while you test.

2️⃣ Set Your Topic

Node Type How to configure
Set Topic Set Add a string field Topic – e.g. "n8n". This keyword drives every subsequent step.

3️⃣ Search Google (Results 1-10)

Node Type API Credential
Search Google (top 10) SerpAPI Create SerpAPI credential
1. Sign up → copy API key → n8n → Credentials → New → SerpAPI → paste.
2. Select the credential in this node.
Key Params
q ={{ $json.Topic }} Expert
location Region code (ex 585069efee19ad271e9c9b36)
additionalFields.start "10" (Google position 1-10)

4️⃣ Search Google (Results 11-20)

Node Type Notes
Search Google (11-20) SerpAPI (same credential) Remove start or set to 20+ to fetch next page.

5️⃣ Extract URL Lists

Node Type Script Purpose
Extract Url & Extract Url 2 Code Loop data.organic_results → output { title, link, displayed_link } for each result.

6️⃣ Combine Both Result Sets

Node Type Details
Append Results Merge (combineAll) Merges arrays from steps 3 & 4 into a single list for processing.

7️⃣ Loop Over Every URL

Node Type Configuration
Loop Over Items1 Split In Batches Default batch = 1 (process one page at a time).
onError = continueRegularOutput keeps loop alive on failures.

8️⃣ Scrape Webpage Content (Apify)

Node Type API Credential
Scrape URL with apify HTTP Request Create Apify credential
1. Sign up at https://console.apify.com
2. Account → API tokens → copy.
3. n8n → Credentials → New → HTTP Query Auth → set query param token=YOUR_TOKEN.
Request Details
Method POST
URL https://api.apify.com/v2/acts/6sigmag~fast-website-content-crawler/run-sync-get-dataset-items
JSON Body json { "startUrls": ["{{ $json.link }}"] }

9️⃣ Extract Email with OpenAI

Node Type API Credential
Extract Email from webpage LangChain Agent Create OpenAI credential
1. Generate key at https://platform.openai.com/account/api-keys
2. n8n → Credentials → New → OpenAI API → paste key.
Prompt (system) extract the email address from the text. if there is no email address, output null.
Output Parser Structured Output Parser2 expects → { "email": "address OR null" }

🔟 Loop Continues & Final Data

  • The extracted result returns to Loop Over Items1 until every URL is processed.
  • Typical final item JSON:
    {
      "title": "How to Build n8n Workflows",
      "link": "https://example.com",
      "email": "[email protected]"
    }
    

💡 Optional Enhancements Idea How Save Leads Add a Google Sheets or Airtable node after the loop. Validate Emails Chain a ZeroBounce / Hunter.io verification API before saving. Parallel Crawling Increase SplitInBatches size (watch Apify rate limits).

🙋‍♂️ Need More Help? Robert Breen – Automation Consultant & n8n Expert 📧 [email protected] 🔗 https://www.linkedin.com/in/robert-breen-29429625/ 🌐 https://ynteractive.com

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - OpenAI Chat Model3

Type / Role
@n8n/n8n-nodes-langchain.lmChatOpenAi - lmChatOpenAi
Config choices
Version 1.2

Block 2 - Structured Output Parser2

Type / Role
@n8n/n8n-nodes-langchain.outputParserStructured - outputParserStructured
Config choices
Version 1.2

Block 3 - Loop Over Items1

Type / Role
n8n-nodes-base.splitInBatches - splitInBatches
Config choices
Version 3

Block 4 - Run Workflow

Type / Role
n8n-nodes-base.manualTrigger - manualTrigger
Config choices
Version 1

Block 5 - Sticky Note6

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 6 - Sticky Note9

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 7 - Sticky Note11

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 8 - Set Topic

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 9 - Search Google (top 10)

Type / Role
n8n-nodes-serpapi.serpApi - serpApi
Config choices
Version 1

Block 10 - Search Google (11-20)

Type / Role
n8n-nodes-serpapi.serpApi - serpApi
Config choices
Version 1

Block 11 - Extract Url

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 12 - Extract Url 2

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 13 - Append Results

Type / Role
n8n-nodes-base.merge - merge
Config choices
Version 3.2

Block 14 - Scrape URL with apify

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 15 - Extract Email from webpage

Type / Role
@n8n/n8n-nodes-langchain.agent - agent
Config choices
Version 2

Block 16 - Sticky Note12

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

3. Summary Table

Workflow Beginner lead finder using SerpAPI search
Complexity advanced
Nodes 16
Categories Lead Generation, Multimodal AI
Author Robert Breen
Published 08 Aug 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/7155/7155.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Beginner lead finder using SerpAPI search do?

This n8n workflow finds experts on any topic , scrapes their websites, and pulls out contact emails automatically. Core services used: SerpAPI (google search) · Apify (website crawler) · OpenAI (GP...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Lead Generation, Multimodal AI use case.