# Build a WhatsApp assistant for text, audio & images: n8n workflow

> Started by another system calling it, and works across Redis. It puts OpenAI behind a retrieval step, so answers are drawn from documents you supply rather...

Source: https://millionrounds.com/workflow/build-a-whatsapp-assistant-for-text-audio-and-images (Millionrounds; every figure on the page links to its filing or article)

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

# Build a WhatsApp assistant for text, audio & images

Started by another system calling it, and works across Redis. It puts OpenAI behind a retrieval step, so answers are drawn from documents you supply rather than from the model alone. 43 steps, 3 branches, 4 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%2Fbuild-a-whatsapp-assistant-for-text-audio-and-images)

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

**3** Branches: places the flow splits

**4** Loops or waits

**1** Service it connects to

## The flow

Starts it 1 Model 9 Logic 23 Service 10

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

- 1 **Receive WhatsApp** Webhook *Starts it*
- 2 **OpenAI Chat Model** Lm Chat Open Ai *Model*
- 3 **Postgres Chat Memory** Memory Postgres Chat *Model*
- 4 **OpenAI Chat Model1** Lm Chat Open Ai *Model*
- 5 **Structured Output Parser** Output Parser Structured *Model*
- 6 **Parse Message Data** Set *Logic*
- 7 **AI Agent** Agent *Model*
- 8 **Format Response** Chain Llm *Model*
- 9 **Filter Allowed Numbers** Filter *Logic*
- 10 **Split Messages** Split Out *Logic*
- 11 **Wait 2s** Wait *Logic*
- 12 **Loop Messages** Split In Batches *Logic*
- 13 **Mark as Read** Evolution Api *Service*
- 14 **Aggregate** Aggregate *Logic*
- 15 **Is Image URL?** If *Logic*
- 16 **Route by Message Type** Switch *Logic*
- 17 **Clear Queue** Redis *Service*
- 18 **Send Image** Evolution Api *Service*
- 19 **Send Text** Evolution Api *Service*
- 20 **Extract Text** Set *Logic*
- 21 **Extract Audio Base64** Set *Logic*
- 22 **Extract Image Base64** Set *Logic*
- 23 **Extract Document Base64** Set *Logic*
- 24 **Send Unsupported Message** Evolution Api *Service*
- 25 **Done** No Op *Logic*
- 26 **Wait Between Messages** Wait *Logic*
- 27 **Unify Input** Set *Logic*
- 28 **Convert to Audio** Convert To File *Service*
- 29 **Convert to Image** Convert To File *Service*
- 30 **Convert to Document** Convert To File *Service*
- 31 **End Unsupported** No Op *Logic*
- 32 **Queue Message** Redis *Service*
- 33 **Transcribe Audio** Open Ai *Model*
- 34 **Analyze Image** Open Ai *Model*
- 35 **Transcribe Document** Open Ai *Model*
- 36 **Wait for More Messages** Wait *Logic*
- 37 **Format Audio Input** Set *Logic*
- 38 **Format Image Input** Set *Logic*
- 39 **Format Document Input** Set *Logic*
- 40 **Get Queued Messages** Redis *Service*
- 41 **Is Last Message?** If *Logic*
- 42 **Concatenate Messages** Set *Logic*
- 43 **Not Last - Stop** No Op *Logic*

## How it's built

- **Starts on:** Another system calling it
- **Steps:** 43, with 3 branches, 4 loops or waits
- **Size:** Large: read it before trusting it with anything live
- **Connects to:** Redis
- **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 Redis account, and a key for OpenAI. You connect your own accounts after importing it; none are included.

What starts it?

It starts on another system calling it.

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 43 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 43 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%2Fbuild-a-whatsapp-assistant-for-text-audio-and-images)
- **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.

[Redis](https://millionrounds.com/workflows?service=Redis#library)

## Workflows like it

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

- [**Host a Telegram AI bot with a local model and Redis** 41 steps · calls a model · Redis, Telegram](https://millionrounds.com/workflow/host-a-telegram-ai-bot-with-a-local-model-and-redis)
- [**Async Video Polling Engine - Background Job Handler** 27 steps · Redis, S3](https://millionrounds.com/workflow/async-video-polling-engine-background-job-handler)
- [**Create YouTube video RSS feed with Redis** 21 steps · RSS, Redis](https://millionrounds.com/workflow/create-youtube-video-rss-feed-with-redis)
