# Generate qualified leads from LinkedIn with Apify and OpenAI: n8n workflow

> Started by an event in a connected app, and works across Airtable. It hands the judgement calls to OpenAI.

Source: https://millionrounds.com/workflow/generate-qualified-leads-from-linkedin-with-apify-and-openai (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)

# Generate qualified leads from LinkedIn with Apify and OpenAI

Started by an event in a connected app, and works across Airtable. It hands the judgement calls to OpenAI. 16 steps, 1 branch, 1 loop or waits: a working afternoon to understand properly.

Medium Calls a model: OpenAI

[Download free](https://millionrounds.com/login?next=%2Fapp%2Fworkflow%2Fgenerate-qualified-leads-from-linkedin-with-apify-and-openai)

**16 steps** Medium: a working afternoon

**1** Branch: places the flow splits

**1** Loop or waits

**1** Service it connects to

## The flow

Starts it 1 Model 3 Logic 9 Service 3

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

- 1 **Start** Manual trigger *Starts it*
- 2 **OpenAI GPT-4 Mini** Lm Chat Open Ai *Model*
- 3 **Structure AI Output** Output Parser Structured *Model*
- 4 **Edit Variables** Set *Logic*
- 5 **AI Lead Analyzer** Agent *Model*
- 6 **Scrape LinkedIn Jobs** Http Request *Service*
- 7 **Save to Airtable** Airtable *Service*
- 8 **Split Job Data** Split Out *Logic*
- 9 **Process in Batches** Split In Batches *Logic*
- 10 **Remove Duplicates** Remove Duplicates *Logic*
- 11 **Clean Data Format** Set *Logic*
- 12 **Get Existing Leads** Airtable *Service*
- 13 **Categorize Leads** Code *Logic*
- 14 **Route Leads** Switch *Logic*
- 15 **Filter by Company Size** Filter *Logic*
- 16 **Workflow Complete** No Op *Logic*

## How it's built

- **Starts on:** An event in a connected app
- **Steps:** 16, with 1 branch, 1 loop or waits
- **Size:** Medium: a working afternoon
- **Connects to:** Airtable
- **Model:** OpenAI

## Questions

What does it need to run?

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

What starts it?

It starts on an event in a connected app.

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?

Plan an afternoon. 16 steps is enough that you should read each one before running it.

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 16 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%2Fgenerate-qualified-leads-from-linkedin-with-apify-and-openai)
- **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.

[Airtable](https://millionrounds.com/workflows?service=Airtable#library)

## Workflows like it

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

- [**AI lead qualification & multi-channel sales pipeline automation** 16 steps · calls a model · Airtable, Asana](https://millionrounds.com/workflow/ai-lead-qualification-and-multi-channel-sales-pipeline-autom)
- [**Qualify & route leads with OpenAI and Clearbit** 16 steps · calls a model · Airtable, HubSpot](https://millionrounds.com/workflow/qualify-and-route-leads-with-openai-and-clearbit)
- [**Automated AI cold calling system with VAPI.AI and Airtable** 16 steps · Airtable](https://millionrounds.com/workflow/automated-ai-cold-calling-system-with-vapi-ai-and-airtable)
- [**LinkedIn lead scraper CRM pipeline with Airtable** 16 steps · Airtable](https://millionrounds.com/workflow/linkedin-lead-scraper-crm-pipeline-with-airtable)
- [**Analyze sales calls & route leads with OpenAI and Airtable** 17 steps · calls a model · Airtable, Gmail](https://millionrounds.com/workflow/analyze-sales-calls-and-route-leads-with-openai-and-airtable)
- [**Automate lead enrichment with OpenAI and Airtable** 15 steps · calls a model · Airtable, Slack](https://millionrounds.com/workflow/automate-lead-enrichment-with-openai-and-airtable)
