# Domain outbound : automate lead extraction, and targeted outreach: n8n workflow

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

Source: https://millionrounds.com/workflow/domain-outbound-automate-lead-extraction-and-targeted-outrea (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)

# Domain outbound: automate lead extraction, and targeted outreach

Started by an event in a connected app, and works across Gmail and Google Sheets. It hands the judgement calls to OpenAI. 27 steps, 2 branches, 6 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%2Fdomain-outbound-automate-lead-extraction-and-targeted-outrea)

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

**2** Branches: places the flow splits

**6** Loops or waits

**2** Services it connects to

## The flow

Starts it 1 Model 2 Logic 19 Service 5

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

- 1 **When clicking ‘Test workflow’** Manual trigger *Starts it*
- 2 **Generate queries** Open Ai *Model*
- 3 **fomate queries** Code *Logic*
- 4 **Loop Over queries** Split In Batches *Logic*
- 5 **Wait1** Wait *Logic*
- 6 **Gmail search** Http Request *Service*
- 7 **Extract Urls** Code *Logic*
- 8 **Filter urls** Filter *Logic*
- 9 **If url is not empty** If *Logic*
- 10 **Remove Duplicates** Remove Duplicates *Logic*
- 11 **Loop Over Items** Split In Batches *Logic*
- 12 **Loop Over Items1** Split In Batches *Logic*
- 13 **HTTP Request1** Http Request *Service*
- 14 **Aggregate** Aggregate *Logic*
- 15 **Extract Emails** Code *Logic*
- 16 **Split Out** Split Out *Logic*
- 17 **Remove Duplicates2** Remove Duplicates *Logic*
- 18 **Loop Over Items4** Split In Batches *Logic*
- 19 **Extract Domain Name** Code *Logic*
- 20 **get website with Jina.ai** Http Request *Service*
- 21 **If1** If *Logic*
- 22 **Limit Markdown** Code *Logic*
- 23 **Generate Email content** Open Ai *Model*
- 24 **Gmail1** Gmail *Service*
- 25 **Google Sheets** Google Sheets *Service*
- 26 **Code6** Code *Logic*
- 27 **Wait2** Wait *Logic*

## How it's built

- **Starts on:** An event in a connected app
- **Steps:** 27, with 2 branches, 6 loops or waits
- **Size:** Large: read it before trusting it with anything live
- **Connects to:** Gmail, Google Sheets
- **Model:** OpenAI

## Questions

What does it need to run?

An n8n account, plus your own Gmail and Google Sheets accounts, 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?

Take your time. At 27 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 27 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%2Fdomain-outbound-automate-lead-extraction-and-targeted-outrea)
- **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)

## Workflows like it

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

- [**AI prospect researcher +ISCP only need company name and domain** 27 steps · calls a model · Google Docs, Google Sheets](https://millionrounds.com/workflow/ai-prospect-researcher-iscp-only-need-company-name-and-domai)
- [**Agentic B2B lead enrichment from Google Search to Google Sheets** 27 steps · calls a model · Gmail, Google Sheets](https://millionrounds.com/workflow/agentic-b2b-lead-enrichment-from-google-search-to-google-she)
- [**Generate and enrich local business leads with Decodo** 27 steps · calls a model · Gmail, Google Sheets](https://millionrounds.com/workflow/generate-and-enrich-local-business-leads-with-decodo)
- [**Generate and qualify B2B leads from Telegram with Google Maps** 27 steps · calls a model · Gmail, Google Sheets](https://millionrounds.com/workflow/generate-and-qualify-b2b-leads-from-telegram-with-google-map)
- [**Send AI-personalized outreach emails from HubSpot** 27 steps · calls a model · Gmail, Google Sheets](https://millionrounds.com/workflow/send-ai-personalized-outreach-emails-from-hubspot)
- [**Audit CRM lead data quality with Google Sheets and NeverBounce** 27 steps · Google Sheets](https://millionrounds.com/workflow/audit-crm-lead-data-quality-with-google-sheets-and-neverboun)
