# AI-powered WhatsApp customer service with OpenAI and Gmail: n8n workflow

> Started by an incoming WhatsApp message, and works across Gmail, Google Sheets, Supabase and WhatsApp.

Source: https://millionrounds.com/workflow/ai-powered-whatsapp-customer-service-with-openai-and-gmail (Millionrounds; every figure on the page links to its filing or article)

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

# AI-powered WhatsApp customer service with OpenAI and Gmail

Started by an incoming WhatsApp message, and works across Gmail, Google Sheets, Supabase and WhatsApp. It puts OpenAI behind a retrieval step, so answers are drawn from documents you supply rather than from the model alone. 37 steps, 1 branch: 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%2Fai-powered-whatsapp-customer-service-with-openai-and-gmail)

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

**1** Branch: places the flow splits

**0** Loops or waits

**4** Services it connects to

## The flow

Starts it 1 Model 18 Logic 8 Service 10

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

- 1 **OpenAI Chat Model8** Lm Chat Open Ai *Model*
- 2 **OpenAI Chat Model10** Lm Chat Open Ai *Model*
- 3 **OpenAI Chat Model11** Lm Chat Open Ai *Model*
- 4 **Think1** Tool Think *Model*
- 5 **Structured Output Parser** Output Parser Structured *Model*
- 6 **Structured Output Parser1** Output Parser Structured *Model*
- 7 **Postgres Chat Memory** Memory Postgres Chat *Model*
- 8 **Structured Output Parser2** Output Parser Structured *Model*
- 9 **Knowledge base** Google Docs Tool *Service*
- 10 **orders database** Google Sheets Tool *Service*
- 11 **OpenAI Chat Model** Lm Chat Open Ai *Model*
- 12 **OpenAI Chat Model1** Lm Chat Open Ai *Model*
- 13 **OpenAI Chat Model2** Lm Chat Open Ai *Model*
- 14 **Supabase1** Supabase Tool *Service*
- 15 **WhatsApp Trigger** Whats App trigger *Starts it*
- 16 **privacy classifier** Chain Llm *Model*
- 17 **intent classifier** Chain Llm *Model*
- 18 **sentiment classifier** Chain Llm *Model*
- 19 **Customer service AGENT** Agent *Model*
- 20 **Human intervention** Text Classifier *Model*
- 21 **Generate conv context** Agent *Model*
- 22 **Voice or Text** Switch *Logic*
- 23 **Merge3** Merge *Logic*
- 24 **Merge4** Merge *Logic*
- 25 **Historial Chat and feedback** Google Sheets *Service*
- 26 **Aliment context for next messages** Supabase *Service*
- 27 **Send message** Whats App *Service*
- 28 **Owner escalation** Gmail *Service*
- 29 **Human request.** Gmail *Service*
- 30 **Critical complaint.** Gmail *Service*
- 31 **Normal path / success** No Op *Logic*
- 32 **Download media** Whats App *Service*
- 33 **Text** Set *Logic*
- 34 **Aggregate3** Aggregate *Logic*
- 35 **Aggregate** Aggregate *Logic*
- 36 **Transcribe1** Open Ai *Model*
- 37 **Merge** Merge *Logic*

## How it's built

- **Starts on:** An incoming WhatsApp message
- **Steps:** 37, with 1 branch
- **Size:** Large: read it before trusting it with anything live
- **Connects to:** Gmail, Google Sheets, Supabase, 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 Gmail, Google Sheets, Supabase 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 37 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 37 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%2Fai-powered-whatsapp-customer-service-with-openai-and-gmail)
- **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.

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

## Workflows like it

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

- [**Route WhatsApp support requests with Claude and Supabase** 37 steps · calls a model · Gmail, Google Calendar](https://millionrounds.com/workflow/route-whatsapp-support-requests-with-claude-and-supabase)
- [**Use OCR and vector search to answer questions with WhatsApp** 35 steps · calls a model · Google Drive, Pinecone](https://millionrounds.com/workflow/use-ocr-and-vector-search-to-answer-questions-with-whatsapp)
- [**WhatsApp personal AI assistant with PDF** 35 steps · calls a model · Airtable, Gmail](https://millionrounds.com/workflow/whatsapp-personal-ai-assistant-with-pdf)
- [**Build an AI-powered SMS support system with Twilio and OpenAI** 40 steps · calls a model · Gmail, Postgres](https://millionrounds.com/workflow/build-an-ai-powered-sms-support-system-with-twilio-and-opena)
- [**Answer onboarding questions in Slack with Anthropic** 33 steps · calls a model · Google Sheets, Pinecone](https://millionrounds.com/workflow/answer-onboarding-questions-in-slack-with-anthropic)
- [**Crawl websites & answer questions with OpenAI** 33 steps · calls a model · Google Sheets](https://millionrounds.com/workflow/crawl-websites-and-answer-questions-with-openai)
