Qualify, log, and route inbound WhatsApp leads with OpenAI and Google Sheets
Ready for 3.0What this workflow does
This AI workflow has 13 nodes and runs when an HTTP POST request hits its webhook URL. Along the way it connects OpenAI Chat Model and Google Sheets.
How it runs
Trigger: When an HTTP POST request hits its webhook URL.
- Extract Message (Edit Fields (Set)): sets 3 fields: message, phone, name
- Classify Lead (AI Agent): runs an AI agent, with model: OpenAI Chat Model; output parser: Segment Schema
- Flatten Result (Edit Fields (Set)): sets 9 fields: Phone, Name, Message…
- Log Lead to Google Sheet (Google Sheets): append or update (sheet)
- Is Buyer? (If): checks a condition and branches into true / false
- Reply to Buyer (WAHA) (HTTP Request): calls an HTTP API (POST)
- Is Spam? (If): checks a condition and branches into true / false
- Notify Owner of Hot Lead (WAHA) (HTTP Request): calls an HTTP API (POST)
- Respond (Respond to Webhook): sends the response back to the webhook caller
- Polite Reply (Non-Buyer) (HTTP Request): calls an HTTP API (POST)
Services it uses
Before you upgrade to n8n 3.0
Nothing in this workflow is removed in n8n 3.0, so it should import and run after the upgrade.
Nodes used (9)
- Webhook
n8n-nodes-base.webhook - Edit Fields (Set)
n8n-nodes-base.set - AI Agent
@n8n/n8n-nodes-langchain.agent - OpenAI Chat Model
@n8n/n8n-nodes-langchain.lmChatOpenAi - Structured Output Parser
@n8n/n8n-nodes-langchain.outputParserStructured - Google Sheets
n8n-nodes-base.googleSheets - Respond to Webhook
n8n-nodes-base.respondToWebhook - If
n8n-nodes-base.if - HTTP Request
n8n-nodes-base.httpRequest
From the author
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…