Most first workflows are toys. This one is not. Some version of it is the single most requested automation from Nigerian businesses, because every one of them is losing leads in a WhatsApp inbox somebody forgets to open.
We will build it in four moves. You need an n8n instance (hosted or your own), a WhatsApp Business API number, an OpenAI key and a Supabase project.
1. Capture the message
Start with a Webhook node and point your WhatsApp Business webhook at its production URL. Every inbound message arrives as JSON with the sender, the text and a timestamp.
Two things people get wrong here:
- Test URL versus production URL. The test URL only listens while the editor is open. Ship with the production one.
- Duplicate deliveries. WhatsApp retries if you are slow to acknowledge. Respond immediately, then do the work, or you will process the same lead twice.
2. Qualify with AI, not with keywords
Add an AI node and give it one job: turn a free-text message into structured fields. Ask it to return JSON with fields like intent, budget signal, urgency and a one-line summary, and tell it explicitly what to output when the message says nothing useful.
Keep the prompt narrow. A model asked to classify one message does that reliably; a model asked to classify, reply, upsell and book a meeting in one call does none of it reliably. Add a Code node right after to parse the JSON and fail loudly if it is malformed, so a bad response never silently poisons your database.
3. Store every lead
Write the raw message and the structured fields to Supabase. Store the raw text even when parsing fails, because the failures are where you learn what your prompt is missing.
Use the sender's phone number as a natural key and upsert rather than insert, so a returning customer updates their record instead of creating a second one.
4. Reply fast, escalate rarely
Branch with an IF node on the qualification result:
- Hot lead → send an acknowledgement on WhatsApp and alert the sales team with the summary attached.
- Common question → answer it from your FAQ content and log it.
- Anything unclear → hand it to a human, unedited.
That last branch is the one people delete to look clever. Leave it in. A business will forgive a bot that says "let me get someone" far sooner than one that confidently invents a price.
Before you call it done
- Send yourself ten messages, including two deliberately confusing ones.
- Turn off your OpenAI key and check the workflow degrades to "a human will reply" instead of crashing.
- Add an error workflow so failures reach you, not a log nobody reads.
- Time it. If a reply takes more than a few seconds, the business will notice before you do.
What to charge for it
Priced as a project, this shape of build sits comfortably in the range you see on the opportunities board for WhatsApp sales automation. What moves the number is not the node count. It is whether you handle the failure cases, hand over documentation, and stay reachable for the first two weeks after launch.
Now make it yours
Swap WhatsApp for Instagram DMs, or Supabase for Google Sheets, or the FAQ branch for a booking link. The skeleton (capture, structure, store, escalate) is the same in almost every automation a business will ever pay you for.
Build it with us. The community is free and the build track opens with a first-100 discount: see pricing or join the community.