Automation library · Lead generation

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.

LargeCalls a model: OpenAIRetrieval

35 stepsLarge: read it before trusting it with anything live
2Branches: places the flow splits
1Loop or waits
4Services it connects to

The flow

Starts it 1Model 17Logic 10Service 7

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

  1. 1Schedule TriggerSchedule triggerStarts it
  2. 2OpenAI Model - EnrichmentLm Chat Open AiModel
  3. 3Structured Output - Enriched Lead DataOutput Parser StructuredModel
  4. 4OpenAI Model - RoutingLm Chat Open AiModel
  5. 5Structured Output - Routing DecisionOutput Parser StructuredModel
  6. 6OpenAI Model - ScoringLm Chat Open AiModel
  7. 7Structured Output - Lead ScoreOutput Parser StructuredModel
  8. 8OpenAI Model - SentimentLm Chat Open AiModel
  9. 9Embeddings OpenAI - InsertEmbeddings Open AiModel
  10. 10Text Splitter - RecursiveText Splitter Recursive Character Text SplitterModel
  11. 11Embeddings OpenAI - RetrieveEmbeddings Open AiModel
  12. 12HTTP Request Tool - Property DataHttp Request ToolService
  13. 13Workflow ConfigurationSetLogic
  14. 14Lead Enrichment AgentAgentModel
  15. 15Agent Routing AgentAgentModel
  16. 16Lead Scoring AgentAgentModel
  17. 17Lead Sentiment AnalysisSentiment AnalysisModel
  18. 18Lead Knowledge Base - InsertVector Store In MemoryModel
  19. 19Document Loader - Lead DataDocument Default Data LoaderModel
  20. 20Lead Knowledge Base - RetrieveVector Store In MemoryModel
  21. 21Fetch Leads from MLS/PortalsHttp RequestService
  22. 22Fetch Leads from CRM/Email/SocialHttp RequestService
  23. 23High-Priority Lead FilterIfLogic
  24. 24Fetch Agent Performance DataHttp RequestService
  25. 25Check Sentiment ScoreIfLogic
  26. 26Store Lead in DatabasePostgresService
  27. 27Merge All Lead SourcesMergeLogic
  28. 28Prepare High-Priority Lead DataSetLogic
  29. 29Prepare Standard Lead DataSetLogic
  30. 30Merge Lead with Agent DataSetLogic
  31. 31Loop Over LeadsSplit In BatchesLogic
  32. 32Track Engagement MetricsSetLogic
  33. 33Notify Slack - High PrioritySlackService
  34. 34Send Email - Agent AssignmentEmail SendService
  35. 35Aggregate Daily Lead StatsAggregateLogic

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.