# Use OCR and vector search to answer questions with WhatsApp: n8n workflow

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

Source: https://millionrounds.com/workflow/use-ocr-and-vector-search-to-answer-questions-with-whatsapp (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)

# Use OCR and vector search to answer questions with WhatsApp

Started by an incoming WhatsApp message, and works across Google Drive, Pinecone and WhatsApp. It puts OpenAI behind a retrieval step, so answers are drawn from documents you supply rather than from the model alone. 35 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%2Fuse-ocr-and-vector-search-to-answer-questions-with-whatsapp)

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

**2** Branches: places the flow splits

**0** Loops or waits

**3** Services it connects to

## The flow

Starts it 1 Model 20 Logic 8 Service 6

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

- 1 **WhatsApp Trigger** Whats App trigger *Starts it*
- 2 **Text Chunker1** Text Splitter Recursive Character Text Splitter *Model*
- 3 **Embeddings OpenAI1** Embeddings Open Ai *Model*
- 4 **OpenAI Chat Model** Lm Chat Open Ai *Model*
- 5 **Window Buffer Memory** Memory Buffer Window *Model*
- 6 **Embeddings OpenAI2** Embeddings Open Ai *Model*
- 7 **OpenAI Chat Model6** Lm Chat Open Ai *Model*
- 8 **Window Buffer Memory6** Memory Buffer Window *Model*
- 9 **Embeddings OpenAI3** Embeddings Open Ai *Model*
- 10 **OpenAI Chat Model5** Lm Chat Open Ai *Model*
- 11 **Window Buffer Memory5** Memory Buffer Window *Model*
- 12 **Set Chunk Config** Set *Logic*
- 13 **Route Incoming Message** Switch *Logic*
- 14 **Document Loader1** Document Default Data Loader *Model*
- 15 **Store in Pinecone Vector DB1** Vector Store Pinecone *Model*
- 16 **Document-Grounded AI Agent V** Agent *Model*
- 17 **Vector Search (Voice)** Vector Store Pinecone *Model*
- 18 **Document-Grounded AI Agent D** Agent *Model*
- 19 **Vector Search (Text)** Vector Store Pinecone *Model*
- 20 **Document-Grounded AI Agent A** Agent *Model*
- 21 **Download Incoming File** Google Drive *Service*
- 22 **Handle text-based questions** If *Logic*
- 23 **Create URL** Http Request *Service*
- 24 **Format Reply (Voice)** Code *Logic*
- 25 **Format Reply (Text)** Code *Logic*
- 26 **Format Reply (Wellness)** Code *Logic*
- 27 **OCR PDF/Image** Mistral Ai *Model*
- 28 **Fetch URL** Http Request *Service*
- 29 **Send Reply (Voice)** Whats App *Service*
- 30 **Send Reply (Text)** Whats App *Service*
- 31 **Send Reply (Default Text)** Whats App *Service*
- 32 **Clean OCR Text1** Code *Logic*
- 33 **Transcribe a recording** Open Ai *Model*
- 34 **Chunk Document** Code *Logic*
- 35 **Query Normalizer** Open Ai *Model*

## How it's built

- **Starts on:** An incoming WhatsApp message
- **Steps:** 35, with 2 branches
- **Size:** Large: read it before trusting it with anything live
- **Connects to:** Google Drive, 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 Google Drive, 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 35 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 35 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%2Fuse-ocr-and-vector-search-to-answer-questions-with-whatsapp)
- **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.

[Google Drive](https://millionrounds.com/workflows?service=Google+Drive#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.

- [**WhatsApp personal AI assistant with PDF** 35 steps · calls a model · Airtable, Gmail](https://millionrounds.com/workflow/whatsapp-personal-ai-assistant-with-pdf)
- [**Autonomous customizable support chatbot** 36 steps · calls a model · Intercom, Pinecone](https://millionrounds.com/workflow/autonomous-customizable-support-chatbot)
- [**AI-powered WhatsApp customer service with OpenAI and Gmail** 37 steps · calls a model · Gmail, Google Sheets](https://millionrounds.com/workflow/ai-powered-whatsapp-customer-service-with-openai-and-gmail)
- [**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)
- [**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)
- [**WhatsApp AI customer service chatbot – handles text, voice** 37 steps · calls a model · Google Drive, Postgres](https://millionrounds.com/workflow/whatsapp-ai-customer-service-chatbot-handles-text-voice)
