# Basic RAG system with Claude and OpenAI: n8n workflow template

> Started by an incoming Telegram message, and works across Google Drive, Supabase, Supabase vectors, Telegram and one other.

Source: https://millionrounds.com/workflow/basic-rag-system-with-claude-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)

# Basic RAG system with Claude and OpenAI

Started by an incoming Telegram message, and works across Google Drive, Supabase, Supabase vectors, Telegram and one other. It puts Claude and OpenAI behind a retrieval step, so answers are drawn from documents you supply rather than from the model alone. 29 steps: large, and worth reading before you trust it with anything live.

Large Calls a model: Claude, OpenAI Retrieval

[Download free](https://millionrounds.com/login?next=%2Fapp%2Fworkflow%2Fbasic-rag-system-with-claude-and-openai)

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

**0** Branches: places the flow splits

**0** Loops or waits

**5** Services it connects to

## The flow

Starts it 6 Model 13 Service 10

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

- 1 **When chat message received** Chat trigger *Starts it*
- 2 **Embeddings OpenAI1** Embeddings Open Ai *Model*
- 3 **Default Data Loader1** Document Default Data Loader *Model*
- 4 **Embeddings OpenAI2** Embeddings Open Ai *Model*
- 5 **Default Data Loader2** Document Default Data Loader *Model*
- 6 **Embeddings OpenAI3** Embeddings Open Ai *Model*
- 7 **OpenAI Chat Model** Lm Chat Open Ai *Model*
- 8 **Twilio Trigger** Twilio trigger *Starts it*
- 9 **Anthropic Chat Model** Lm Chat Anthropic *Model*
- 10 **Telegram Trigger** Telegram trigger *Starts it*
- 11 **GD1** Google Drive trigger *Starts it*
- 12 **GD2** Google Drive trigger *Starts it*
- 13 **GD3** Google Drive trigger *Starts it*
- 14 **Local RAG Agent** Agent *Model*
- 15 **Supabase Vector Store1** Vector Store Supabase *Model*
- 16 **Supabase Vector Store3** Vector Store Supabase *Model*
- 17 **Supabase Vector Store** Vector Store Supabase *Model*
- 18 **Text RAG Agent** Agent *Model*
- 19 **Telegram RAG Agent** Agent *Model*
- 20 **Download file** Google Drive *Service*
- 21 **Get many rows** Supabase *Service*
- 22 **Delete a row** Supabase *Service*
- 23 **Get many rows1** Supabase *Service*
- 24 **Update a row** Supabase *Service*
- 25 **Send an SMS/MMS/WhatsApp message** Twilio *Service*
- 26 **Send a text message** Telegram *Service*
- 27 **Delete a row3** Supabase *Service*
- 28 **Update a row1** Supabase *Service*
- 29 **Download file1** Google Drive *Service*

## How it's built

- **Starts on:** An incoming Telegram message
- **Steps:** 29
- **Size:** Large: read it before trusting it with anything live
- **Connects to:** Google Drive, Supabase, Supabase vectors, Telegram, Twilio
- **Model:** Claude, 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, Supabase, Supabase vectors, Telegram and Twilio accounts, and a key for Claude and OpenAI. You connect your own accounts after importing it; none are included.

What starts it?

It starts on an incoming Telegram message.

Does it use AI?

Yes. It calls Claude and 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 29 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 29 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%2Fbasic-rag-system-with-claude-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 Drive](https://millionrounds.com/workflows?service=Google+Drive#library)[Supabase](https://millionrounds.com/workflows?service=Supabase#library)[Supabase vectors](https://millionrounds.com/workflows?service=Supabase+vectors#library)[Telegram](https://millionrounds.com/workflows?service=Telegram#library)[Twilio](https://millionrounds.com/workflows?service=Twilio#library)

## Workflows like it

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

- [**Build a Telegram AI chatbot with Trilox and OpenAI** 29 steps · calls a model · Telegram](https://millionrounds.com/workflow/build-a-telegram-ai-chatbot-with-trilox-and-openai)
- [**Find and rank job listings from Adzuna and Remotive** 29 steps · calls a model · Google Sheets, Telegram](https://millionrounds.com/workflow/find-and-rank-job-listings-from-adzuna-and-remotive)
- [**Get Colombian peso to USD exchange rate with Telegram** 29 steps · calls a model · Telegram](https://millionrounds.com/workflow/get-colombian-peso-to-usd-exchange-rate-with-telegram)
- [**Score GeM tender compliance and draft bid responses** 29 steps · calls a model · Gmail, Google Sheets](https://millionrounds.com/workflow/score-gem-tender-compliance-and-draft-bid-responses)
- [**Telegram bot starter template setup & AI agent chatbot** 29 steps · calls a model · Google Sheets, Telegram](https://millionrounds.com/workflow/telegram-bot-starter-template-setup-and-ai-agent-chatbot)
- [**AI warehouse inventory cycle count bot with OpenAI** 28 steps · calls a model · Google Sheets, Telegram](https://millionrounds.com/workflow/ai-warehouse-inventory-cycle-count-bot-with-openai)
