Downloads
Download the n8n workflow (JSON)
real-estate-lead-qualifier-n8n-claude.json · n8n workflow · 22 steps · starts with New portal lead email · uses Gmail, Anthropic, Google Sheets, Slack, Google Calendar, WhatsApp · 38 KB
Import into n8n: Create Workflow, then the menu, then Import from File.
How to import it into n8n
- In n8n, create a new workflow.
- Open the ⋯ menu at the top right and choose Import from File, then pick the downloaded .json. (Or open the file, copy everything and paste it on the canvas.)
- Open each node with a warning and connect your own account: the file carries no passwords or keys.
- Run it once with Test workflow, check the result, then switch it to Active.
What this workflow does
When a buyer or tenant enquires on 99acres, MagicBricks or Housing.com, the portal emails you. This workflow reads that email within a minute. Claude pulls out the name, mobile, buy or rent, BHK, areas, budget and how soon they want to move. n8n then matches the lead to your own listings sheet, picks the top 3, finds 3 free site visit slots in your Google Calendar and sends you everything on Slack. When you tap Approve, the lead gets a WhatsApp with the matching homes and the slots, and the first slot is pencilled into your calendar.
Who it is for
Real estate brokers, channel partners and small builders' sales teams who get portal leads by email and lose them to whoever replies first, especially over weekends.
What you need
- n8n (Cloud or self-hosted)
- The Gmail inbox where portal leads arrive
- An Anthropic API key for Claude
- A Google Sheet with your listings (and a tab for leads)
- Google Calendar for site visits
- Slack for approvals
- A WhatsApp Business Cloud API number with one approved template
The workflow, step by step
Step 1 · Catch every portal lead
n8n watches Gmail for lead emails from 99acres, MagicBricks and Housing.com. It notes which portal sent it, keeps the email text and skips any email it has already handled.
- New portal lead email (Gmail Trigger): polls every minute with a search for the portal senders.
- Clean up email (Set): keeps the message id, portal name, subject, text (trimmed to 4,000 characters) and date.
- Already processed? (Remove Duplicates): never reads the same email twice.
Step 2 · Claude reads the requirement
Claude pulls out name, mobile, buy or rent, BHK, areas, budget in rupees and how soon they want to move. Newsletters and listing reports are marked as not a lead and stop here.
- Read lead with Claude (Basic LLM Chain) with Claude (temperature 0.1) and Lead fields (Structured Output Parser). "95 Lac" becomes 9500000 and "1.2 Cr" becomes 12000000.
- Lead details (Set): joins Claude's fields with the email details and formats the mobile as 91XXXXXXXXXX.
- Real lead with a phone? (Filter): stops newsletters, reports and leads where the portal masked the number.
Step 3 · Match it to your listings
Your listings sheet is the source of truth. A small code step scores each available flat on area, BHK and budget and keeps the top 3. Every lead is logged by phone, so repeat enquiries update one row.
- Get active listings (Google Sheets): reads the
Listingstab once per run, only rows with Status = Available. - Match listings (Code): area match +3, same BHK +2, same buy or rent +1, within budget +2. Anything more than 5% over budget is dropped. Keeps the top 3.
- Log lead (Google Sheets, append or update on Phone): one row per buyer.
- Has a match? (IF): no match goes to No match: alert broker on Slack, so you can call them about something new.
Step 4 · Pick visit slots, you approve
n8n reads your Google Calendar and finds the next 3 free visit slots. The lead, the matches and the slots land in Slack. You tap Approve, or Call first if you want to speak to them.
- Get site visit calendar (Google Calendar): reads the next 5 days of events once per run.
- Pick 3 free visit slots (Code): tries 11 AM, 4 PM and 6 PM IST from tomorrow, skipping anything already booked.
- Approve on Slack (Slack, Send and Wait) and Broker approved? (IF). Call first goes to Mark for a call.
Step 5 · WhatsApp offer, slot pencilled in
Sneha gets a WhatsApp with the matching homes and the 3 slots. The first slot is held in your calendar. If WhatsApp fails you get an alert, and the sheet says Offer sent.
- Send visit offer on WhatsApp (WhatsApp template
site_visit_offer, 3 retries, error output wired). - Hold the first slot (Google Calendar): creates a "HOLD · Site visit" event so you do not offer it to someone else.
- Mark offer sent (Google Sheets) and Alert: WhatsApp failed (Slack).
Setup
- Import the JSON into n8n and connect Gmail, Anthropic, Google Sheets, Google Calendar, Slack and WhatsApp in each red node.
- Create the
Listingstab: Project, Locality, Type, Purpose, Price (plain rupees), Status. - Create the
Leadstab: Phone, Name, Portal, Purpose, Type, Areas, Budget max, Timeline, Matches, Last enquiry, Status, Slots offered, Updated. - Replace
YOUR_SHEET_IDandYOUR_PHONE_NUMBER_ID, and pick your Slack channel. - In Meta Business Manager, create the utility template
site_visit_offer: "Hi {{1}}, thanks for your enquiry for {{2}}. Homes that match: {{3}}. Visit slots: {{4}}. Reply 1, 2 or 3 to book." Wait for approval. - Forward an old portal lead email to the inbox (with your own number in it) and run the workflow once. Check Slack, approve, and see the WhatsApp arrive.
How to customise
- Other portals or your website form: add their sender to the Gmail search. For a website form, add a Webhook trigger that feeds Lead details.
- Visit hours: change
[11, 16, 18]in Pick 3 free visit slots. Add Sunday rules there too. - Several agents: add a column
Agentto Listings and post the Slack approval to that agent's channel. - Booking the reply: connect your WhatsApp lead agent so "1", "2" or "3" from the buyer confirms the slot and updates the HOLD event.
Guardrails
- No WhatsApp goes to a lead until you tap Approve. Prices come only from your listings sheet.
- Claude only extracts what the email says. Masked or missing numbers are never guessed.
- Listings far over budget are never shown.
- WhatsApp templates are used because the buyer has not messaged you first. Keep the template factual and include your firm name.
Troubleshooting
- No leads come in: check the portal sender addresses in your inbox and adjust the Gmail search.
- Every lead says no match: Price must be plain numbers in the sheet (9200000, not "92 L"), and Locality spelling should match what buyers type.
- Slots clash with real visits: make sure site visits are on the calendar the node reads (primary by default).
- Template error 132000: the number of variables in the template must be exactly 4.
- Approval never resumes: Send and Wait only works when the workflow is active.
Want the members-only resources too?
A free account unlocks them all, including the ones shared in DMs.

