# Answer multi-channel support queries with OpenAI RAG: n8n workflow

> Started by an incoming WhatsApp message, and works across Discord, Email, Google Sheets, Postgres and five others.

Source: https://millionrounds.com/workflow/answer-multi-channel-support-queries-with-openai-rag (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)

# Answer multi-channel support queries with OpenAI RAG

Started by an incoming WhatsApp message, and works across Discord, Email, Google Sheets, Postgres and five others. It puts OpenAI behind a retrieval step, so answers are drawn from documents you supply rather than from the model alone. 77 steps, 12 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%2Fanswer-multi-channel-support-queries-with-openai-rag)

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

**12** Branches: places the flow splits

**0** Loops or waits

**9** Services it connects to

## The flow

Starts it 8 Model 13 Logic 29 Service 10

The steps in the order they run, from what starts it. The first 60 of 77.

- 1 **Email Trigger (IMAP)** Email Read Imap *Service*
- 2 **Webhook Trigger (Live Chat)** Webhook *Starts it*
- 3 **WhatsApp Trigger** Whats App trigger *Starts it*
- 4 **Slack Trigger (Mentions)** Slack trigger *Starts it*
- 5 **Discord Webhook Trigger** Webhook *Starts it*
- 6 **OpenAI Chat Model (RAG)** Lm Chat Open Ai *Model*
- 7 **OpenAI Chat Model (Sentiment)** Lm Chat Open Ai *Model*
- 8 **OpenAI Chat Model (Escalation)** Lm Chat Open Ai *Model*
- 9 **Weekly Maintenance Schedule** Schedule trigger *Starts it*
- 10 **OpenAI Embeddings (Retrieve)** Embeddings Open Ai *Model*
- 11 **Chat Memory** Memory Postgres Chat *Model*
- 12 **Error Trigger** Error trigger *Starts it*
- 13 **Ingest Knowledge Base (Manual)** Manual trigger *Starts it*
- 14 **Docs Text Splitter** Text Splitter Recursive Character Text Splitter *Model*
- 15 **OpenAI Embeddings (Docs)** Embeddings Open Ai *Model*
- 16 **Workflow Configuration** Set *Logic*
- 17 **RAG Support Agent** Agent *Model*
- 18 **Sentiment Analysis** Chain Llm *Model*
- 19 **Escalation Reasoning** Chain Llm *Model*
- 20 **Weekly Configuration** Set *Logic*
- 21 **Knowledge Base Search** Vector Store Supabase *Model*
- 22 **Alert Workflow Failure** Slack *Service*
- 23 **Ingestion Configuration** Set *Logic*
- 24 **Docs Loader** Document Default Data Loader *Model*
- 25 **Supabase Docs Insert** Vector Store Supabase *Model*
- 26 **Normalize Payload** Code *Logic*
- 27 **Restore Context (Answer)** Code *Logic*
- 28 **Restore Context (Sentiment)** Code *Logic*
- 29 **Restore Context (Escalation)** Code *Logic*
- 30 **Fetch Weekly Metrics** Google Sheets *Service*
- 31 **Load Source Documents** Code *Logic*
- 32 **Automated Email?** If *Logic*
- 33 **Confidence Scoring** Code *Logic*
- 34 **Prepare Ticket Object** Set *Logic*
- 35 **Aggregate Weekly Metrics** Code *Logic*
- 36 **Purge Existing Docs** Supabase *Service*
- 37 **Ignored (Automated Email)** No Op *Logic*
- 38 **Has Valid Message?** If *Logic*
- 39 **Check Confidence Threshold** If *Logic*
- 40 **Create Zendesk Ticket** Zendesk *Service*
- 41 **Send Weekly Summary** Slack *Service*
- 42 **Purge Old Chat Memory** Postgres *Service*
- 43 **Archive Weekly Metrics** Postgres *Service*
- 44 **Reload Documents After Purge** Code *Logic*
- 45 **Remove Duplicate Messages** Remove Duplicates *Logic*
- 46 **Ignored (Empty Message)** No Op *Logic*
- 47 **Check Sentiment** If *Logic*
- 48 **Escalation Reason** Code *Logic*
- 49 **Escalation Alert to Support Team** Slack *Service*
- 50 **New Message?** If *Logic*
- 51 **Is Live Chat? (Empty)** If *Logic*
- 52 **Channel Router** Switch *Logic*
- 53 **Log Escalation to Sheets** Google Sheets *Service*
- 54 **Message Within Limit?** If *Logic*
- 55 **Is Live Chat? (Duplicate)** If *Logic*
- 56 **Respond to Live Chat (Ignored)** Respond To Webhook *Starts it*
- 57 **Format Email Response** Set *Logic*
- 58 **Format Webhook Response** Set *Logic*
- 59 **Format WhatsApp Response** Set *Logic*
- 60 **Format Discord Response** Set *Logic*

## How it's built

- **Starts on:** An incoming WhatsApp message
- **Steps:** 77, with 12 branches
- **Size:** Large: read it before trusting it with anything live
- **Connects to:** Discord, Email, Google Sheets, Postgres, Slack, Supabase, Supabase vectors, WhatsApp, Zendesk
- **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 Discord, Email, Google Sheets, Postgres, Slack, Supabase, Supabase vectors, WhatsApp and Zendesk 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 77 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 77 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%2Fanswer-multi-channel-support-queries-with-openai-rag)
- **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.

[Discord](https://millionrounds.com/workflows?service=Discord#library)[Email](https://millionrounds.com/workflows?service=Email#library)[Google Sheets](https://millionrounds.com/workflows?service=Google+Sheets#library)[Postgres](https://millionrounds.com/workflows?service=Postgres#library)[Slack](https://millionrounds.com/workflows?service=Slack#library)[Supabase](https://millionrounds.com/workflows?service=Supabase#library)[Supabase vectors](https://millionrounds.com/workflows?service=Supabase+vectors#library)[WhatsApp](https://millionrounds.com/workflows?service=WhatsApp#library)[Zendesk](https://millionrounds.com/workflows?service=Zendesk#library)

## Workflows like it

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

- [**Route multichannel support tickets with OpenAI and HubSpot** 59 steps · calls a model · Gmail, Slack](https://millionrounds.com/workflow/route-multichannel-support-tickets-with-openai-and-hubspot)
- [**Create a multi-modal Telegram support bot with OpenAI** 48 steps · calls a model · Google Drive, Supabase vectors](https://millionrounds.com/workflow/create-a-multi-modal-telegram-support-bot-with-openai)
- [**Route WhatsApp customer support with OpenAI** 48 steps · calls a model · Gmail, Google Drive](https://millionrounds.com/workflow/route-whatsapp-customer-support-with-openai)
- [**Multi-department support bot with Pinecone and Telegram** 46 steps · calls a model · Google Drive, Pinecone](https://millionrounds.com/workflow/multi-department-support-bot-with-pinecone-and-telegram)
- [**Handle WhatsApp support chats with OpenRouter and Pinecone** 44 steps · calls a model · Pinecone, WhatsApp](https://millionrounds.com/workflow/handle-whatsapp-support-chats-with-openrouter-and-pinecone)
- [**Route RAG customer support across WhatsApp and Outlook** 41 steps · calls a model · Google Sheets, Outlook](https://millionrounds.com/workflow/route-rag-customer-support-across-whatsapp-and-outlook)
