# Scrape LinkedIn B2B leads with Apify: n8n workflow template

> Started by someone submitting a form, and works across Gmail, Google Sheets and HubSpot. It hands the judgement calls to OpenAI.

Source: https://millionrounds.com/workflow/scrape-linkedin-b2b-leads-with-apify (Millionrounds; every figure on the page links to its filing or article)

[Automation library](https://millionrounds.com/workflows) · [Lead generation](https://millionrounds.com/workflows?category=Lead+generation#library)

# Scrape LinkedIn B2B leads with Apify

Started by someone submitting a form, and works across Gmail, Google Sheets and HubSpot. It hands the judgement calls to OpenAI. 23 steps, 1 branch, 2 loops or waits: large, and worth reading before you trust it with anything live.

Large Calls a model: OpenAI

[Download free](https://millionrounds.com/login?next=%2Fapp%2Fworkflow%2Fscrape-linkedin-b2b-leads-with-apify)

**23 steps** Large: read it before trusting it with anything live

**1** Branch: places the flow splits

**2** Loops or waits

**3** Services it connects to

## The flow

Starts it 3 Model 4 Logic 9 Service 7

The steps in the order they run, from what starts it.

- 1 **📥 Approved Leads Webhook** Webhook *Starts it*
- 2 **Lead Campaign Setup** Form trigger *Starts it*
- 3 **Rejection Webhook** Webhook *Starts it*
- 4 **LLM** Lm Chat Open Ai *Model*
- 5 **OpenAI Chat Model** Lm Chat Open Ai *Model*
- 6 **🔧 Normalize Lead Data** Code *Logic*
- 7 **make separate json of each keyword** Code *Logic*
- 8 **Webhook Data Normalizer** Code *Logic*
- 9 **generate Ai email** Agent *Model*
- 10 **Rejection Email Rewriter** Agent *Model*
- 11 **✂️ Split Email Content** Code *Logic*
- 12 **Data Batcher** Split In Batches *Logic*
- 13 **Rejection Data Stringifier** Code *Logic*
- 14 **Leads Log** Google Sheets *Service*
- 15 **Update: Improved Email** Google Sheets *Service*
- 16 **📤 Send Approved Email** Gmail *Service*
- 17 **post Apify data scrap** Http Request *Service*
- 18 **Lead Data Batcher** Split In Batches *Logic*
- 19 **Get Apify recent run data** Http Request *Service*
- 20 **If email exist** If *Logic*
- 21 **JSON Stringifier** Code *Logic*
- 22 **HubSpot Company Creator** Hubspot *Service*
- 23 **HubSpot Contact Sync** Hubspot *Service*

## How it's built

- **Starts on:** Someone submitting a form
- **Steps:** 23, with 1 branch, 2 loops or waits
- **Size:** Large: read it before trusting it with anything live
- **Connects to:** Gmail, Google Sheets, HubSpot
- **Model:** OpenAI

## Questions

What does it need to run?

An n8n account, plus your own Gmail, Google Sheets and HubSpot accounts, and a key for OpenAI. You connect your own accounts after importing it; none are included.

What starts it?

It starts on someone submitting a form.

Does it use AI?

Yes. It calls OpenAI. Model calls are billed by the provider, not by n8n.

How long does it take to set up?

Take your time. At 23 steps it is large: read it before trusting it with anything live.

How do I import it?

Copy the workflow, open a new workflow in n8n and paste. The steps appear on the canvas, ready for your own accounts.

**Before you run it**

Nothing here has been tested by us. It is somebody's working automation, read and described from its own steps. Treat the connections it wants as a list of accounts it will touch, and read the 23 steps before you point it at anything that matters.

## Run it in n8n

- **Create your n8n account** Free to start. n8n is where the workflow runs. [Create an n8n account ↗](https://millionrounds.com/n8n)
- **Download the workflow** Free with a Millionrounds account. [Download free](https://millionrounds.com/login?next=%2Fapp%2Fworkflow%2Fscrape-linkedin-b2b-leads-with-apify)
- **Paste it into n8n** Open a new workflow in n8n and paste. Then connect your own accounts.

Stored with the author's traces removed: canvas notes, instance identifiers, saved credential names and any live document they had left behind.

## Connects to

Each opens the other workflows that use it.

[Gmail](https://millionrounds.com/workflows?service=Gmail#library)[Google Sheets](https://millionrounds.com/workflows?service=Google+Sheets#library)[HubSpot](https://millionrounds.com/workflows?service=HubSpot#library)

## Workflows like it

Also lead generation, with the same services where possible, closest in size first.

- [**Enrich and score leads with Claude and PDL** 23 steps · calls a model · Apify, Gmail](https://millionrounds.com/workflow/enrich-and-score-leads-with-claude-and-pdl)
- [**Personalized sales outreach from LinkedIn job signals** 23 steps · calls a model · Apify, Google Sheets](https://millionrounds.com/workflow/personalized-sales-outreach-from-linkedin-job-signals)
- [**Qualify real estate WhatsApp leads with Gemini and Airtable** 23 steps · calls a model · Airtable, Google Calendar](https://millionrounds.com/workflow/qualify-real-estate-whatsapp-leads-with-gemini-and-airtable)
- [**Reddit lead finder: prospecting with OpenAI and Supabase** 23 steps · calls a model · Gmail, Google Sheets](https://millionrounds.com/workflow/reddit-lead-finder-prospecting-with-openai-and-supabase)
- [**Send validated outreach emails with Gmail and Google Sheets** 23 steps · Gmail, Google Drive](https://millionrounds.com/workflow/send-validated-outreach-emails-with-gmail-and-google-sheets)
- [**AI-powered Google Maps business scraper with OpenRouter** 24 steps · calls a model · Google Sheets](https://millionrounds.com/workflow/ai-powered-google-maps-business-scraper-with-openrouter)
