Quick overview
This workflow receives property enquiries via a webhook, validates and classifies them as Personal or Business, scores buying intent with Groq (LLM), then saves the lead to the appropriate Google Sheets tracker and alerts agents via Gmail.
How it works
- Receives a POST request from your website contact form with enquiry details.
- Checks whether an email address is present, and if it is missing logs the raw enquiry to Google Sheets and returns an HTTP 400 error.
- Flattens the incoming payload and classifies the lead as Personal or Business based on the email domain.
- Sends the lead details to the Groq Chat Completions API to generate a 1–10 buying-intent score, and falls back to a default score of 5 if the AI request fails.
- Routes the lead to a Personal or Business path and upserts the record into the corresponding Google Sheets tracker using the email as the unique key.
- Sends a formatted lead alert email to the team via Gmail including the lead type and AI score, then returns an HTTP 200 success response to the webhook caller.
Setup
- Configure the webhook URL in your website/contact-form tool to send a POST payload containing at least name, email, and phone.
- Add a Groq API credential in n8n so the workflow can call the Groq Chat Completions endpoint.
- Connect Google Sheets credentials and select the spreadsheets/tabs for Personal leads, Business leads, and the Incomplete Lead log.
- Connect Gmail credentials and set the recipient(s) for the agent notification email in the Gmail node.