# Run a customer support RAG chatbot with OpenAI: n8n workflow

> Started by someone opening a chat with it, and works across Google Drive, Telegram and in-memory vectors.

Source: https://millionrounds.com/workflow/run-a-customer-support-rag-chatbot-with-openai (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)

# Run a customer support RAG chatbot with OpenAI

Started by someone opening a chat with it, and works across Google Drive, Telegram and in-memory vectors. It puts OpenAI behind a retrieval step, so answers are drawn from documents you supply rather than from the model alone. 21 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%2Frun-a-customer-support-rag-chatbot-with-openai)

**21 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 3 Model 8 Logic 8 Service 2

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

- 1 **When a Customer Asks a Question** Chat trigger *Starts it*
- 2 **Embed the Question** Embeddings Open Ai *Model*
- 3 **Answering Model** Lm Chat Open Ai *Model*
- 4 **When a Document Is Added** Google Drive trigger *Starts it*
- 5 **When a Document Is Updated** Google Drive trigger *Starts it*
- 6 **Split It Into Passages** Text Splitter Recursive Character Text Splitter *Model*
- 7 **Embed the Documents** Embeddings Open Ai *Model*
- 8 **Search the Documentation** Vector Store In Memory *Model*
- 9 **Answer With Citations Only** Chain Llm *Model*
- 10 **Download the Document** Google Drive *Service*
- 11 **Read the Document Contents** Document Default Data Loader *Model*
- 12 **Index the Document** Vector Store In Memory *Model*
- 13 **Score the Matches and Build the Sources** Code *Logic*
- 14 **Verify Every Claim Is Cited** Code *Logic*
- 15 **Do the Docs Cover the Question?** If *Logic*
- 16 **Is the Answer Grounded?** If *Logic*
- 17 **Mark It as Not Covered** Set *Logic*
- 18 **Send the Cited Answer** Set *Logic*
- 19 **Mark It as Ungrounded** Set *Logic*
- 20 **Alert a Human** Telegram *Service*
- 21 **Tell the Customer a Human Will Follow Up** Set *Logic*

## How it's built

- **Starts on:** Someone opening a chat with it
- **Steps:** 21, with 2 branches
- **Size:** Large: read it before trusting it with anything live
- **Connects to:** Google Drive, Telegram, in-memory vectors
- **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, Telegram and in-memory vectors accounts, and a key for OpenAI. You connect your own accounts after importing it; none are included.

What starts it?

It starts on someone opening a chat with 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 21 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 21 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%2Frun-a-customer-support-rag-chatbot-with-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 Drive](https://millionrounds.com/workflows?service=Google+Drive#library)[Telegram](https://millionrounds.com/workflows?service=Telegram#library)[in-memory vectors](https://millionrounds.com/workflows?service=in-memory+vectors#library)

## Workflows like it

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

- [**Answer HR and IT policy questions on Telegram with OpenAI** 21 steps · calls a model · Telegram](https://millionrounds.com/workflow/answer-hr-and-it-policy-questions-on-telegram-with-openai)
- [**Automate multi-channel customer support with Gmail** 21 steps · calls a model · Gmail, Google Sheets](https://millionrounds.com/workflow/automate-multi-channel-customer-support-with-gmail)
- [**Build a Telegram AI assistant with MemMachine and OpenAI** 21 steps · calls a model · Gmail, Google Calendar](https://millionrounds.com/workflow/build-a-telegram-ai-assistant-with-memmachine-and-openai)
- [**HR & IT helpdesk chatbot with OpenAI and Telegram** 21 steps · calls a model · Telegram](https://millionrounds.com/workflow/hr-and-it-helpdesk-chatbot-with-openai-and-telegram)
- [**WhatsApp support bot with Google Drive RAG and OpenAI** 21 steps · calls a model · Google Drive, Supabase vectors](https://millionrounds.com/workflow/whatsapp-support-bot-with-google-drive-rag-and-openai)
- [**AI WhatsApp support with Gemini and Twilio** 22 steps · calls a model · Airtable, Google Drive](https://millionrounds.com/workflow/ai-whatsapp-support-with-gemini-and-twilio)
