# Automated email responses with OpenAI and Supabase: n8n workflow

> Started by an event in a connected app, and works across Outlook, Postgres, Supabase and Supabase vectors.

Source: https://millionrounds.com/workflow/automated-email-responses-with-openai-and-supabase (Millionrounds; every figure on the page links to its filing or article)

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

# Automated email responses with OpenAI and Supabase

Started by an event in a connected app, and works across Outlook, Postgres, 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. 27 steps, 2 branches, 1 loop or waits: 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%2Fautomated-email-responses-with-openai-and-supabase)

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

**2** Branches: places the flow splits

**1** Loop or waits

**4** Services it connects to

## The flow

Starts it 2 Model 12 Logic 7 Service 6

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

- 1 **Embeddings OpenAI1** Embeddings Open Ai *Model*
- 2 **Embeddings OpenAI2** Embeddings Open Ai *Model*
- 3 **Microsoft Outlook Trigger** Microsoft Outlook trigger *Starts it*
- 4 **JSON** Output Parser Structured *Model*
- 5 **4o** Lm Chat Open Ai *Model*
- 6 **When Executed by Another Workflow** Execute Workflow trigger *Starts it*
- 7 **Embeddings OpenAI6** Embeddings Open Ai *Model*
- 8 **Recursive Character Text Splitter3** Text Splitter Recursive Character Text Splitter *Model*
- 9 **Email Template DB** Vector Store Supabase *Model*
- 10 **FAQ DB** Vector Store Supabase *Model*
- 11 **Loop Over Items1** Split In Batches *Logic*
- 12 **Email Manager** Agent *Model*
- 13 **Supabase Vector Store4** Vector Store Supabase *Model*
- 14 **Default Data Loader3** Document Default Data Loader *Model*
- 15 **Clean HTML** Code *Logic*
- 16 **Forward?** If *Logic*
- 17 **Update a row2** Supabase *Service*
- 18 **Retrieve Categories** Postgres *Service*
- 19 **Reply1** Microsoft Outlook *Service*
- 20 **Reply** Microsoft Outlook *Service*
- 21 **Aggregate1** Aggregate *Logic*
- 22 **Outlook Forward** Http Request *Service*
- 23 **Execute Workflow** Execute Workflow *Logic*
- 24 **Categorize** Open Ai *Model*
- 25 **Spam Filter** If *Logic*
- 26 **Conversation Retrieval** Postgres *Service*
- 27 **Format** Code *Logic*

## How it's built

- **Starts on:** An event in a connected app
- **Steps:** 27, with 2 branches, 1 loop or waits
- **Size:** Large: read it before trusting it with anything live
- **Connects to:** Outlook, Postgres, 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 Outlook, Postgres, 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 event in a connected app.

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 27 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 27 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%2Fautomated-email-responses-with-openai-and-supabase)
- **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.

[Outlook](https://millionrounds.com/workflows?service=Outlook#library)[Postgres](https://millionrounds.com/workflows?service=Postgres#library)[Supabase](https://millionrounds.com/workflows?service=Supabase#library)[Supabase vectors](https://millionrounds.com/workflows?service=Supabase+vectors#library)

## Workflows like it

Also data collection, with the same services where possible, closest in size first.

- [**Build a RAG knowledge base from PDFs with Gemini and Supabase** 27 steps · calls a model · Google Drive, Google Sheets](https://millionrounds.com/workflow/build-a-rag-knowledge-base-from-pdfs-with-gemini-and-supabas)
- [**Autonomous AI crawler with OpenAI and Supabase** 28 steps · calls a model · Supabase](https://millionrounds.com/workflow/autonomous-ai-crawler-with-openai-and-supabase)
- [**Adaptive email auto-responder with OpenAI and Gmail** 29 steps · calls a model · Gmail, Google Sheets](https://millionrounds.com/workflow/adaptive-email-auto-responder-with-openai-and-gmail)
- [**Build AI-ready knowledge base from Outlook & Notion** 25 steps · calls a model · Notion, Outlook](https://millionrounds.com/workflow/build-ai-ready-knowledge-base-from-outlook-and-notion)
- [**Conversing with OpenAI and Postgres** 25 steps · calls a model · Postgres](https://millionrounds.com/workflow/conversing-with-openai-and-postgres)
- [**Sync a Telegram RAG chatbot with Google Drive and OpenAI** 25 steps · calls a model · Google Drive, Supabase](https://millionrounds.com/workflow/sync-a-telegram-rag-chatbot-with-google-drive-and-openai)
