Qualify, log, and route inbound WhatsApp leads with OpenAI and Google Sheets

Quick overview This workflow receives inbound WhatsApp lead messages via a webhook, uses OpenAI to classify each sender's intent (buyer, job seeker, or spam), logs the enriched lead to Google Sheets — and then acts on the classification: buyers get an instant Hebrew reply while a hot-lead alert lands on your own WhatsApp, spam is silently logged, and everyone else receives a polite neutral answer. Low-confidence classifications are flagged for human review.

How it works A webhook receives the WhatsApp message payload (WAHA, Cloud API or any provider — field mapping is one Set node). OpenAI classifies the message into buyer / job_seeker / spam with an intent summary, confidence score and one-line reasoning, enforced by a structured output schema. The lead is appended or updated in a Google Sheets "Leads" tab, matched on the phone number; classifications with confidence below 0.6 are flagged NeedsReview. A routing layer then branches by segment: buyer → instant Hebrew auto-reply + hot-lead alert to the owner's WhatsApp; spam → no reply; anything else → polite neutral reply. Every branch returns a JSON response with the detected segment, so the calling platform can chain further logic.

Setup Point your WhatsApp provider's inbound webhook at the Webhook node (POST) and adjust the three field expressions in Extract Message if your payload differs. Add an OpenAI credential on the OpenAI Chat Model node. Add a Google Sheets OAuth credential and pick your spreadsheet — columns: Phone, Name, Message, Segment, Intent, Confidence, Reasoning, ReceivedAt, NeedsReview. In the three WAHA send nodes: replace YOUR-WAHA-SERVER with your WAHA base URL, attach a Header Auth credential (X-Api-Key), and put your own number in Notify Owner (replace OWNER-PHONE). Edit the two Hebrew reply texts to match your business tone, then activate.

0
Downloads
1
Views
8.06
Quality Score
beginner
Complexity
Author:achiya(View Original →)
Created:8/15/2026
Updated:8/15/2026

🔒 Please log in to import templates to n8n and favorite templates

Workflow Visualization

Loading...

Preparing workflow renderer

Comments (0)

Login to post comments