Automation library · Lead generation

Qualify and score real estate leads with WhatsApp and Gemini

Started by an incoming WhatsApp message, and works across Postgres and WhatsApp. It puts Gemini behind a retrieval step, so answers are drawn from documents you supply rather than from the model alone. 24 steps, 3 branches: large, and worth reading before you trust it with anything live.

LargeCalls a model: GeminiRetrieval

24 stepsLarge: read it before trusting it with anything live
3Branches: places the flow splits
0Loops or waits
2Services it connects to

The flow

Starts it 2Model 7Logic 5Service 10

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

  1. 1WebhookWebhookStarts it
  2. 2WhatsApp TriggerWhats App triggerStarts it
  3. 3Google Gemini Chat ModelLm Chat Google GeminiModel
  4. 4Postgres Chat MemoryMemory Postgres ChatModel
  5. 5Google Gemini Chat Model1Lm Chat Google GeminiModel
  6. 6Structured Output ParserOutput Parser StructuredModel
  7. 7JSON Output ParserOutput Parser StructuredModel
  8. 8Validate & Normalise DataCodeLogic
  9. 9Handle Message UpdatesIfLogic
  10. 10AI AgentAgentModel
  11. 11Basic LLM ChainChain LlmModel
  12. 12Create or Update the Lead herePostgresService
  13. 13IfIfLogic
  14. 14Send the typing status to the userHttp RequestService
  15. 15Store the Score for the Lead in the DBPostgresService
  16. 16Send templateWhats AppService
  17. 17Send messageWhats AppService
  18. 18Check if the lead has been qualifiedPostgresService
  19. 19Send Information to the Sales TeamWhats AppService
  20. 20Route LeadIfLogic
  21. 21Send message after qualificationWhats AppService
  22. 22Mark the lead qualifiedPostgresService
  23. 23Fetch the TranscriptPostgresService
  24. 24Prepare the TranscriptCodeLogic

How it's built

Starts on
An incoming WhatsApp message
Steps
24, with 3 branches
Size
Large: read it before trusting it with anything live
Connects to
Postgres, WhatsApp
Model
Gemini
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 Postgres and WhatsApp accounts, and a key for Gemini. You connect your own accounts after importing it; none are included.

What starts it?

It starts on an incoming WhatsApp message.

Does it use AI?

Yes. It calls Gemini. 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 24 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 24 steps before you point it at anything that matters.