# Multi-agent healthcare assistant with WhatsApp and OpenAI: n8n workflow

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

Source: https://millionrounds.com/workflow/multi-agent-healthcare-assistant-with-whatsapp-and-openai (Millionrounds; every figure on the page links to its filing or article)

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

# Multi-agent healthcare assistant with WhatsApp and OpenAI

Started by an incoming WhatsApp message, and works across Google Sheets and WhatsApp. It puts OpenAI behind a retrieval step, so answers are drawn from documents you supply rather than from the model alone. 49 steps, 4 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%2Fmulti-agent-healthcare-assistant-with-whatsapp-and-openai)

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

**4** Branches: places the flow splits

**0** Loops or waits

**2** Services it connects to

## The flow

Starts it 1 Model 20 Logic 10 Service 18

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

- 1 **Memory** Memory Postgres Chat *Model*
- 2 **OpenAI** Lm Chat Open Ai *Model*
- 3 **WATrigger** Whats App trigger *Starts it*
- 4 **create_patient** Google Sheets Tool *Service*
- 5 **Calculator** Tool Calculator *Model*
- 6 **get_last_patient_id** Google Sheets Tool *Service*
- 7 **Memory1** Memory Postgres Chat *Model*
- 8 **OpenAI1** Lm Chat Open Ai *Model*
- 9 **get_clinics** Google Sheets Tool *Service*
- 10 **get_doctors** Google Sheets Tool *Service*
- 11 **find_patient** Google Sheets Tool *Service*
- 12 **create_appointment** Google Sheets Tool *Service*
- 13 **get_availability** Google Sheets Tool *Service*
- 14 **find_last_entry_id** Google Sheets Tool *Service*
- 15 **Calculator1** Tool Calculator *Model*
- 16 **Memory2** Memory Postgres Chat *Model*
- 17 **OpenAI2** Lm Chat Open Ai *Model*
- 18 **OpenAI3** Lm Chat Open Ai *Model*
- 19 **Memory3** Memory Postgres Chat *Model*
- 20 **OpenAI4** Lm Chat Open Ai *Model*
- 21 **Memory4** Memory Postgres Chat *Model*
- 22 **Appointment System** Agent *Model*
- 23 **Switch** Switch *Logic*
- 24 **Register Patient Tool** Agent Tool *Model*
- 25 **Appointment Scheduler Tool** Agent Tool *Model*
- 26 **Report Analyzer Tool** Agent Tool *Model*
- 27 **Prescription Medicine Analyzer Tool** Agent Tool *Model*
- 28 **response** If *Logic*
- 29 **Analyzing Image Text** Whats App *Service*
- 30 **Get Document** Whats App *Service*
- 31 **Get Audio URL** Whats App *Service*
- 32 **PrepareInput** Code *Logic*
- 33 **Generate Audio** Open Ai *Model*
- 34 **Text Message** Whats App *Service*
- 35 **Get Image URL** Whats App *Service*
- 36 **Download Document** Http Request *Service*
- 37 **Download Audio** Http Request *Service*
- 38 **Text Prompt** Set *Logic*
- 39 **Code** Code *Logic*
- 40 **Download Image** Http Request *Service*
- 41 **If PDF File** If *Logic*
- 42 **Transcribe Audio** Open Ai *Model*
- 43 **If** If *Logic*
- 44 **Audio Response** Whats App *Service*
- 45 **Analyze Image** Open Ai *Model*
- 46 **Extract from PDF File** Extract From File *Service*
- 47 **Audio Prompt** Set *Logic*
- 48 **Image Prompt** Set *Logic*
- 49 **Document Prompt** Set *Logic*

## How it's built

- **Starts on:** An incoming WhatsApp message
- **Steps:** 49, with 4 branches
- **Size:** Large: read it before trusting it with anything live
- **Connects to:** Google Sheets, 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 Sheets 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 49 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 49 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%2Fmulti-agent-healthcare-assistant-with-whatsapp-and-openai)
- **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 Sheets](https://millionrounds.com/workflows?service=Google+Sheets#library)[WhatsApp](https://millionrounds.com/workflows?service=WhatsApp#library)

## Workflows like it

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

- [**Smart kitchen & inventory assistant with OpenAI** 43 steps · calls a model · Google Sheets, Telegram](https://millionrounds.com/workflow/smart-kitchen-and-inventory-assistant-with-openai)
- [**Attendance system with OpenAI and Google Sheets** 41 steps · calls a model · Google Sheets, Telegram](https://millionrounds.com/workflow/attendance-system-with-openai-and-google-sheets)
- [**Generate consensus-based answers with Claude and OpenAI** 41 steps · calls a model · Gmail, Slack](https://millionrounds.com/workflow/generate-consensus-based-answers-with-claude-and-openai)
- [**Run AI employee onboarding with Groq and Google Workspace** 62 steps · calls a model · Gmail, Google Drive](https://millionrounds.com/workflow/run-ai-employee-onboarding-with-groq-and-google-workspace)
- [**Assist hospital doctors with Telegram and OpenAI** 34 steps · calls a model · Gmail, Google Sheets](https://millionrounds.com/workflow/assist-hospital-doctors-with-telegram-and-openai)
- [**Classify and auto-reply to Gmail with OpenAI** 34 steps · calls a model · Gmail, Google Sheets](https://millionrounds.com/workflow/classify-and-auto-reply-to-gmail-with-openai)
