# AI-powered WhatsApp support bot with OpenAI and Gmail: n8n workflow

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

Source: https://millionrounds.com/workflow/ai-powered-whatsapp-support-bot-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 support bot with OpenAI and Gmail

Started by an incoming WhatsApp message, and works across Gmail, Google Sheets, Pinecone and WhatsApp. It puts OpenAI behind a retrieval step, so answers are drawn from documents you supply rather than from the model alone. 32 steps, 2 branches, 3 loops or waits: 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-support-bot-with-openai-and-gmail)

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

**2** Branches: places the flow splits

**3** Loops or waits

**4** Services it connects to

## The flow

Starts it 3 Model 8 Logic 14 Service 7

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

- 1 **When chat message received** Chat trigger *Starts it*
- 2 **On form submission** Form trigger *Starts it*
- 3 **Default Data Loader** Document Default Data Loader *Model*
- 4 **Simple Memory** Memory Buffer Window *Model*
- 5 **Get tickets** Google Sheets Tool *Service*
- 6 **Create support tickets** Google Sheets Tool *Service*
- 7 **Send a message in Gmail** Gmail Tool *Service*
- 8 **OpenAI Chat Model** Lm Chat Open Ai *Model*
- 9 **Embeddings OpenAI** Embeddings Open Ai *Model*
- 10 **Embeddings OpenAI1** Embeddings Open Ai *Model*
- 11 **WhatsApp Trigger** Whats App trigger *Starts it*
- 12 **Company Info** Set *Logic*
- 13 **Switch1** Switch *Logic*
- 14 **Pinecone Vector Store** Vector Store Pinecone *Model*
- 15 **AI Agent** Agent *Model*
- 16 **Pinecone (Retrieve Info)** Vector Store Pinecone *Model*
- 17 **Split Pages URLs** Code *Logic*
- 18 **HTTP Request** Http Request *Service*
- 19 **Split_Binary** Code *Logic*
- 20 **Merge** Merge *Logic*
- 21 **XML** Xml *Logic*
- 22 **Loop Over Files** Split In Batches *Logic*
- 23 **Remove Duplicates** Remove Duplicates *Logic*
- 24 **Code** Code *Logic*
- 25 **PDF or TXT** Switch *Logic*
- 26 **Loop Over Pages** Split In Batches *Logic*
- 27 **Extract PDF** Extract From File *Service*
- 28 **Extract Text** Extract From File *Service*
- 29 **HTML** Html *Logic*
- 30 **Fetch Page HTML** Http Request *Service*
- 31 **Select Text** Set *Logic*
- 32 **Wait** Wait *Logic*

## How it's built

- **Starts on:** An incoming WhatsApp message
- **Steps:** 32, with 2 branches, 3 loops or waits
- **Size:** Large: read it before trusting it with anything live
- **Connects to:** Gmail, Google Sheets, Pinecone, 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, Pinecone 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 32 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 32 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-support-bot-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)[Pinecone](https://millionrounds.com/workflows?service=Pinecone#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.

- [**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)
- [**Automated customer support system with Gmail** 31 steps · calls a model · Gmail, Google Sheets](https://millionrounds.com/workflow/automated-customer-support-system-with-gmail)
- [**Crawl websites & answer questions with OpenAI** 33 steps · calls a model · Google Sheets](https://millionrounds.com/workflow/crawl-websites-and-answer-questions-with-openai)
- [**Triage and draft support replies with Anthropic** 31 steps · calls a model · Google Sheets](https://millionrounds.com/workflow/triage-and-draft-support-replies-with-anthropic)
- [**Escalate overdue and blocked Jira tickets with Gmail** 33 steps · Gmail, Jira](https://millionrounds.com/workflow/escalate-overdue-and-blocked-jira-tickets-with-gmail)
- [**Automate B2B SaaS renewal risk management with CRM** 30 steps · Gmail, HubSpot](https://millionrounds.com/workflow/automate-b2b-saas-renewal-risk-management-with-crm)
