# Smart email assistant: automate customer support with Supabase: n8n workflow

> Started by an arriving email, and works across Gmail, Google Drive, Supabase and Supabase vectors.

Source: https://millionrounds.com/workflow/smart-email-assistant-automate-customer-support-with-supabas (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)

# Smart email assistant: automate customer support with Supabase

Started by an arriving email, and works across Gmail, Google Drive, Supabase and Supabase vectors. It puts OpenAI behind a retrieval step, so answers are drawn from documents you supply rather than from the model alone. 20 steps, 1 branch: a working afternoon to understand properly.

Medium Calls a model: OpenAI Retrieval

[Download free](https://millionrounds.com/login?next=%2Fapp%2Fworkflow%2Fsmart-email-assistant-automate-customer-support-with-supabas)

**20 steps** Medium: a working afternoon

**1** Branch: places the flow splits

**0** Loops or waits

**4** Services it connects to

## The flow

Starts it 3 Model 11 Logic 2 Service 4

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

- 1 **Email Monitor** Gmail trigger *Starts it*
- 2 **OpenAI Chat Model2** Lm Chat Open Ai *Model*
- 3 **OpenAI Chat Model3** Lm Chat Open Ai *Model*
- 4 **Embeddings OpenAI1** Embeddings Open Ai *Model*
- 5 **File Created** Google Drive trigger *Starts it*
- 6 **File Updated** Google Drive trigger *Starts it*
- 7 **Recursive Character Text Splitter** Text Splitter Recursive Character Text Splitter *Model*
- 8 **Embeddings OpenAI** Embeddings Open Ai *Model*
- 9 **Create Draft** Gmail Tool *Service*
- 10 **AI Email Classifier** Open Ai *Model*
- 11 **AI Response Generator** Agent *Model*
- 12 **Vector Store Tool1** Tool Vector Store *Model*
- 13 **Supabase Vector Store** Vector Store Supabase *Model*
- 14 **Set File ID** Set *Logic*
- 15 **Default Data Loader** Document Default Data Loader *Model*
- 16 **Insert into Supabase Vectorstore** Vector Store Supabase *Model*
- 17 **Route Email** Switch *Logic*
- 18 **Delete Old Doc Rows** Supabase *Service*
- 19 **Download File** Google Drive *Service*
- 20 **Extract Document Text** Extract From File *Service*

## How it's built

- **Starts on:** An arriving email
- **Steps:** 20, with 1 branch
- **Size:** Medium: a working afternoon
- **Connects to:** Gmail, Google Drive, Supabase, Supabase 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 Gmail, Google Drive, Supabase and Supabase vectors accounts, and a key for OpenAI. You connect your own accounts after importing it; none are included.

What starts it?

It starts on an arriving email.

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?

Plan an afternoon. 20 steps is enough that you should read each one before running it.

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 20 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%2Fsmart-email-assistant-automate-customer-support-with-supabas)
- **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.

[Gmail](https://millionrounds.com/workflows?service=Gmail#library)[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)

## Workflows like it

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

- [**Route multilingual support requests with DeepL and OpenAI** 20 steps · calls a model · Gmail](https://millionrounds.com/workflow/route-multilingual-support-requests-with-deepl-and-openai)
- [**Run an AI student helpdesk with OpenAI and Google Sheets** 20 steps · calls a model · Gmail, Google Sheets](https://millionrounds.com/workflow/run-an-ai-student-helpdesk-with-openai-and-google-sheets)
- [**Triage support tickets with OpenAI and HubSpot** 20 steps · Gmail, Google Sheets](https://millionrounds.com/workflow/triage-support-tickets-with-openai-and-hubspot)
- [**Answer questions from documents with RAG and Supabase** 19 steps · calls a model · Google Drive, Supabase vectors](https://millionrounds.com/workflow/answer-questions-from-documents-with-rag-and-supabase)
- [**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)
- [**Automated Slack IT helpdesk with OpenAI and Supabase** 21 steps · calls a model · Slack, Supabase vectors](https://millionrounds.com/workflow/automated-slack-it-helpdesk-with-openai-and-supabase)
