# Handle WhatsApp sales queries with OpenAI and Supabase: n8n workflow

> Started by an incoming WhatsApp message, and works across Supabase vectors and WhatsApp. It puts OpenAI behind a retrieval step, so answers are drawn from...

Source: https://millionrounds.com/workflow/handle-whatsapp-sales-queries-with-openai-and-supabase (Millionrounds; every figure on the page links to its filing or article)

[Automation library](https://millionrounds.com/workflows) · [CRM](https://millionrounds.com/workflows?category=CRM#library)

# Handle WhatsApp sales queries with OpenAI and Supabase

Started by an incoming WhatsApp message, and works across Supabase vectors and WhatsApp. It puts OpenAI behind a retrieval step, so answers are drawn from documents you supply rather than from the model alone. 26 steps, 2 branches: large, and worth reading before you trust it with anything live.

Large Calls a model: OpenAI Retrieval

[Download free](https://millionrounds.com/login?next=%2Fapp%2Fworkflow%2Fhandle-whatsapp-sales-queries-with-openai-and-supabase)

**26 steps** Large: read it before trusting it with anything live

**2** Branches: places the flow splits

**0** Loops or waits

**2** Services it connects to

## The flow

Starts it 2 Model 11 Logic 5 Service 8

The steps in the order they run, from what starts it.

- 1 **Embeddings OpenAI1** Embeddings Open Ai *Model*
- 2 **Recursive Character Text Splitter** Text Splitter Recursive Character Text Splitter *Model*
- 3 **WhatsApp Trigger** Whats App trigger *Starts it*
- 4 **Web Search** Tool Serp Api *Model*
- 5 **search_products_inventory** Data Table Tool *Service*
- 6 **On form submission1** Form trigger *Starts it*
- 7 **the brain** Lm Chat Open Ai *Model*
- 8 **System Memory** Memory Buffer Window *Model*
- 9 **Knowledgebase** Vector Store Supabase *Model*
- 10 **Supabase Vector Store** Vector Store Supabase *Model*
- 11 **Default Data Loader** Document Default Data Loader *Model*
- 12 **Route Types** Switch *Logic*
- 13 **Sales AI agent** Agent *Model*
- 14 **Map text prompt** Set *Logic*
- 15 **Gets WhatsApp Voicemail Source URL** Whats App *Service*
- 16 **Gets WhatsApp Image Source URL** Whats App *Service*
- 17 **Send message1** Whats App *Service*
- 18 **Response_validation** Code *Logic*
- 19 **Download Voicemail** Http Request *Service*
- 20 **Download Image** Http Request *Service*
- 21 **If** If *Logic*
- 22 **OpenAI** Open Ai *Model*
- 23 **OpenAI1** Open Ai *Model*
- 24 **Send text message** Whats App *Service*
- 25 **Send media&caption message** Whats App *Service*
- 26 **Map image prompt** Set *Logic*

## How it's built

- **Starts on:** An incoming WhatsApp message
- **Steps:** 26, with 2 branches
- **Size:** Large: read it before trusting it with anything live
- **Connects to:** Supabase vectors, WhatsApp
- **Model:** OpenAI
- **Retrieval:** Answers are drawn from documents you supply, not from the model alone

## Questions

What does it need to run?

An n8n account, plus your own Supabase vectors and WhatsApp accounts, and a key for OpenAI. You connect your own accounts after importing it; none are included.

What starts it?

It starts on an incoming WhatsApp message.

Does it use AI?

Yes. It calls OpenAI. Its answers draw on documents you give it, not on the model alone. Model calls are billed by the provider, not by n8n.

How long does it take to set up?

Take your time. At 26 steps it is large: read it before trusting it with anything live.

How do I import it?

Copy the workflow, open a new workflow in n8n and paste. The steps appear on the canvas, ready for your own accounts.

**Before you run it**

Nothing here has been tested by us. It is somebody's working automation, read and described from its own steps. Treat the connections it wants as a list of accounts it will touch, and read the 26 steps before you point it at anything that matters.

## Run it in n8n

- **Create your n8n account** Free to start. n8n is where the workflow runs. [Create an n8n account ↗](https://millionrounds.com/n8n)
- **Download the workflow** Free with a Millionrounds account. [Download free](https://millionrounds.com/login?next=%2Fapp%2Fworkflow%2Fhandle-whatsapp-sales-queries-with-openai-and-supabase)
- **Paste it into n8n** Open a new workflow in n8n and paste. Then connect your own accounts.

Stored with the author's traces removed: canvas notes, instance identifiers, saved credential names and any live document they had left behind.

## Connects to

Each opens the other workflows that use it.

[Supabase vectors](https://millionrounds.com/workflows?service=Supabase+vectors#library)[WhatsApp](https://millionrounds.com/workflows?service=WhatsApp#library)

## Workflows like it

Also crm, with the same services where possible, closest in size first.

- [**Answer WhatsApp sales queries from text, voice, photos, and video** 29 steps · calls a model · WhatsApp, in-memory vectors](https://millionrounds.com/workflow/answer-whatsapp-sales-queries-from-text-voice-photos-and-vid)
- [**Manage Streak CRM with WhatsApp and OpenAI** 29 steps · calls a model · WhatsApp](https://millionrounds.com/workflow/manage-streak-crm-with-whatsapp-and-openai)
- [**Send sales forecast charts and answer Q&A on WhatsApp** 23 steps · calls a model · Google Sheets, WhatsApp](https://millionrounds.com/workflow/send-sales-forecast-charts-and-answer-q-and-a-on-whatsapp)
- [**Send AI-personalized deal follow-ups from Zoho CRM with Slack** 15 steps · calls a model · Gmail, Slack](https://millionrounds.com/workflow/send-ai-personalized-deal-follow-ups-from-zoho-crm-with-slac)
- [**Analyze sales calls with Supabase RAG and Slack** 13 steps · calls a model · Email, Slack](https://millionrounds.com/workflow/analyze-sales-calls-with-supabase-rag-and-slack)
- [**Run a WhatsApp sales chatbot with Gemini and HubSpot** 11 steps · calls a model · Google Sheets, WhatsApp](https://millionrounds.com/workflow/run-a-whatsapp-sales-chatbot-with-gemini-and-hubspot)
