# Local Business Lead Discovery and Enrichment Agent with OpenAI: n8n workflow

> Started by a clock, and works across Gmail and Postgres. It hands the judgement calls to OpenAI. 20 steps: a working afternoon to understand properly.

Source: https://millionrounds.com/workflow/local-business-lead-discovery-and-enrichment-agent-with-open (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)

# Local Business Lead Discovery and Enrichment Agent with OpenAI

Started by a clock, and works across Gmail and Postgres. It hands the judgement calls to OpenAI. 20 steps: a working afternoon to understand properly.

Medium Calls a model: OpenAI

[Download free](https://millionrounds.com/login?next=%2Fapp%2Fworkflow%2Flocal-business-lead-discovery-and-enrichment-agent-with-open)

**20 steps** Medium: a working afternoon

**0** Branches: places the flow splits

**0** Loops or waits

**2** Services it connects to

## The flow

Starts it 1 Model 4 Logic 8 Service 7

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

- 1 **GPT-5.** Lm Chat Open Ai *Model*
- 2 **Enrich Selected 10, Scrape Website** Firecrawl Tool *Service*
- 3 **Enrich Selected 10, Scrape Listing** Firecrawl Tool *Service*
- 4 **/search in Firecrawl** Firecrawl Tool *Service*
- 5 **GPT-5.1** Lm Chat Open Ai *Model*
- 6 **/scrape in Firecrawl** Firecrawl Tool *Service*
- 7 **Schedule Trigger** Schedule trigger *Starts it*
- 8 **AI Agent, enrichment** Agent *Model*
- 9 **AI Agent, Discover Fresh** Agent *Model*
- 10 **Rotation Seed** Code *Logic*
- 11 **Enrich Selected 10, Parse** Code *Logic*
- 12 **Parse Refill Output** Code *Logic*
- 13 **Postgres, Insert Lead** Postgres *Service*
- 14 **Compute Fingerprint** Code *Logic*
- 15 **Aggregate New Leads** Aggregate *Logic*
- 16 **Fetch Seen Fingerprints** Postgres *Service*
- 17 **Build Email HTML** Code *Logic*
- 18 **Filter Unseen (Top 10)** Code *Logic*
- 19 **Gmail, Send Weekly Summary** Gmail *Service*
- 20 **Enrich Selected 10, Prep** Code *Logic*

## How it's built

- **Starts on:** A clock
- **Steps:** 20
- **Size:** Medium: a working afternoon
- **Connects to:** Gmail, Postgres
- **Model:** OpenAI

## Questions

What does it need to run?

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

What starts it?

It starts on a clock.

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. 20 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 20 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%2Flocal-business-lead-discovery-and-enrichment-agent-with-open)
- **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)[Postgres](https://millionrounds.com/workflows?service=Postgres#library)

## Workflows like it

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

- [**AI-powered cold email outreach with OpenAI and Gmail** 20 steps · calls a model · Gmail, Google Sheets](https://millionrounds.com/workflow/ai-powered-cold-email-outreach-with-openai-and-gmail)
- [**Automate event follow-ups with OpenAI and LinkedIn** 20 steps · calls a model · Email, HubSpot](https://millionrounds.com/workflow/automate-event-follow-ups-with-openai-and-linkedin)
- [**Automate lead qualification & follow-up with Gemini** 20 steps · calls a model · Gmail, Google Calendar](https://millionrounds.com/workflow/automate-lead-qualification-and-follow-up-with-gemini)
- [**Intelligent Lead Response and Engagement Automation** 20 steps · calls a model · Gmail, Google Calendar](https://millionrounds.com/workflow/intelligent-lead-response-and-engagement-automation)
- [**Qualify LinkedIn AI automation leads with Unipile and OpenAI** 20 steps · calls a model · Postgres](https://millionrounds.com/workflow/qualify-linkedin-ai-automation-leads-with-unipile-and-openai)
- [**This AI-powered workflow finds HOT LinkedIn leads in SECONDS** 20 steps · calls a model · Airtable, Gmail](https://millionrounds.com/workflow/this-ai-powered-workflow-finds-hot-linkedin-leads-in-seconds)
