# Score and route real estate leads with OpenAI and MLS: n8n workflow

> Started by a clock, and works across Email, Postgres, Slack and in-memory vectors. It puts OpenAI behind a retrieval step, so answers are drawn from...

Source: https://millionrounds.com/workflow/score-and-route-real-estate-leads-with-openai-and-mls (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)

# Score and route real estate leads with OpenAI and MLS

Started by a clock, and works across Email, Postgres, Slack and in-memory vectors. It puts OpenAI behind a retrieval step, so answers are drawn from documents you supply rather than from the model alone. 35 steps, 2 branches, 1 loop or waits: large, and worth reading before you trust it with anything live.

Large Calls a model: OpenAI Retrieval

[Download free](https://millionrounds.com/login?next=%2Fapp%2Fworkflow%2Fscore-and-route-real-estate-leads-with-openai-and-mls)

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

**2** Branches: places the flow splits

**1** Loop or waits

**4** Services it connects to

## The flow

Starts it 1 Model 17 Logic 10 Service 7

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

- 1 **Schedule Trigger** Schedule trigger *Starts it*
- 2 **OpenAI Model - Enrichment** Lm Chat Open Ai *Model*
- 3 **Structured Output - Enriched Lead Data** Output Parser Structured *Model*
- 4 **OpenAI Model - Routing** Lm Chat Open Ai *Model*
- 5 **Structured Output - Routing Decision** Output Parser Structured *Model*
- 6 **OpenAI Model - Scoring** Lm Chat Open Ai *Model*
- 7 **Structured Output - Lead Score** Output Parser Structured *Model*
- 8 **OpenAI Model - Sentiment** Lm Chat Open Ai *Model*
- 9 **Embeddings OpenAI - Insert** Embeddings Open Ai *Model*
- 10 **Text Splitter - Recursive** Text Splitter Recursive Character Text Splitter *Model*
- 11 **Embeddings OpenAI - Retrieve** Embeddings Open Ai *Model*
- 12 **HTTP Request Tool - Property Data** Http Request Tool *Service*
- 13 **Workflow Configuration** Set *Logic*
- 14 **Lead Enrichment Agent** Agent *Model*
- 15 **Agent Routing Agent** Agent *Model*
- 16 **Lead Scoring Agent** Agent *Model*
- 17 **Lead Sentiment Analysis** Sentiment Analysis *Model*
- 18 **Lead Knowledge Base - Insert** Vector Store In Memory *Model*
- 19 **Document Loader - Lead Data** Document Default Data Loader *Model*
- 20 **Lead Knowledge Base - Retrieve** Vector Store In Memory *Model*
- 21 **Fetch Leads from MLS/Portals** Http Request *Service*
- 22 **Fetch Leads from CRM/Email/Social** Http Request *Service*
- 23 **High-Priority Lead Filter** If *Logic*
- 24 **Fetch Agent Performance Data** Http Request *Service*
- 25 **Check Sentiment Score** If *Logic*
- 26 **Store Lead in Database** Postgres *Service*
- 27 **Merge All Lead Sources** Merge *Logic*
- 28 **Prepare High-Priority Lead Data** Set *Logic*
- 29 **Prepare Standard Lead Data** Set *Logic*
- 30 **Merge Lead with Agent Data** Set *Logic*
- 31 **Loop Over Leads** Split In Batches *Logic*
- 32 **Track Engagement Metrics** Set *Logic*
- 33 **Notify Slack - High Priority** Slack *Service*
- 34 **Send Email - Agent Assignment** Email Send *Service*
- 35 **Aggregate Daily Lead Stats** Aggregate *Logic*

## How it's built

- **Starts on:** A clock
- **Steps:** 35, with 2 branches, 1 loop or waits
- **Size:** Large: read it before trusting it with anything live
- **Connects to:** Email, Postgres, Slack, in-memory vectors
- **Model:** OpenAI
- **Retrieval:** Answers are drawn from documents you supply, not from the model alone

## Questions

What does it need to run?

An n8n account, plus your own Email, Postgres, Slack and in-memory vectors 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. Its answers draw on documents you give it, not on the model alone. Model calls are billed by the provider, not by n8n.

How long does it take to set up?

Take your time. At 35 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 35 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%2Fscore-and-route-real-estate-leads-with-openai-and-mls)
- **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.

[Email](https://millionrounds.com/workflows?service=Email#library)[Postgres](https://millionrounds.com/workflows?service=Postgres#library)[Slack](https://millionrounds.com/workflows?service=Slack#library)[in-memory vectors](https://millionrounds.com/workflows?service=in-memory+vectors#library)

## Workflows like it

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

- [**Manage hotel guest requests and post-stay outreach** 35 steps · calls a model · Google Sheets, Slack](https://millionrounds.com/workflow/manage-hotel-guest-requests-and-post-stay-outreach)
- [**Capture, qualify, and route real estate leads with WhatsApp** 37 steps · calls a model · Airtable, Gmail](https://millionrounds.com/workflow/capture-qualify-and-route-real-estate-leads-with-whatsapp)
- [**Monitor Reddit communities lead generation with Slack** 33 steps · Slack](https://millionrounds.com/workflow/monitor-reddit-communities-lead-generation-with-slack)
- [**Speed-to-Lead AI Response Engine for WhatsApp, Web Forms** 37 steps · Email, Google Sheets](https://millionrounds.com/workflow/speed-to-lead-ai-response-engine-for-whatsapp-web-forms)
- [**Speed-to-Lead AI Response Engine for WhatsApp, Web Forms, Chat** 37 steps · Email, Google Sheets](https://millionrounds.com/workflow/speed-to-lead-ai-response-engine-for-whatsapp-web-forms-chat)
- [**Find high-mismatch local business leads with Firecrawl** 38 steps · calls a model · Slack, n8n data table](https://millionrounds.com/workflow/find-high-mismatch-local-business-leads-with-firecrawl)
