# Email management system with OpenAI and Pinecone DB: n8n workflow

> Started by an arriving email, and works across Gmail, Pinecone and Telegram. It puts OpenAI and OpenRouter behind a retrieval step, so answers are drawn...

Source: https://millionrounds.com/workflow/email-management-system-with-openai-and-pinecone-db (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)

# Email management system with OpenAI and Pinecone DB

Started by an arriving email, and works across Gmail, Pinecone and Telegram. It puts OpenAI and OpenRouter behind a retrieval step, so answers are drawn from documents you supply rather than from the model alone. 34 steps, 2 branches: large, and worth reading before you trust it with anything live.

Large Calls a model: OpenAI, OpenRouter Retrieval

[Download free](https://millionrounds.com/login?next=%2Fapp%2Fworkflow%2Femail-management-system-with-openai-and-pinecone-db)

**34 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 1 Model 17 Logic 3 Service 13

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

- 1 **Gmail Trigger** Gmail trigger *Starts it*
- 2 **Embeddings OpenAI** Embeddings Open Ai *Model*
- 3 **Label as Finance** Gmail Tool *Service*
- 4 **Label as Sales Opportunities** Gmail Tool *Service*
- 5 **Embeddings OpenAI1** Embeddings Open Ai *Model*
- 6 **GPT 4o mini** Lm Chat Open Router *Model*
- 7 **GPT 4o mini1** Lm Chat Open Router *Model*
- 8 **GPT 4o mini2** Lm Chat Open Router *Model*
- 9 **GPT 4o mini3** Lm Chat Open Router *Model*
- 10 **OutputFormat** Output Parser Structured *Model*
- 11 **Label as Internal** Gmail Tool *Service*
- 12 **Output Format** Output Parser Structured *Model*
- 13 **Output Format1** Output Parser Structured *Model*
- 14 **GPT 5 mini** Lm Chat Open Router *Model*
- 15 **Inbox Router** Text Classifier *Model*
- 16 **Database of FAQs and Policies** Vector Store Pinecone *Model*
- 17 **Finance Agent** Agent *Model*
- 18 **Leads Agent** Agent *Model*
- 19 **Database of Business Services** Vector Store Pinecone *Model*
- 20 **Customer Support Agent** Agent *Model*
- 21 **Internal Agent** Agent *Model*
- 22 **No Operation, do nothing** No Op *Logic*
- 23 **Route by Email Type** Switch *Logic*
- 24 **Needs Review?** If *Logic*
- 25 **Reply Email** Gmail *Service*
- 26 **Send a summary of email and from who** Telegram *Service*
- 27 **Send a message to Receivables Team** Gmail *Service*
- 28 **Send a message to Payments Team** Gmail *Service*
- 29 **Send a message to user to review the email directly** Telegram *Service*
- 30 **Email Draft** Gmail *Service*
- 31 **Label as Customer Support** Gmail *Service*
- 32 **Notify Amount Received** Telegram *Service*
- 33 **Notify Amount to Pay** Telegram *Service*
- 34 **Send a message to user to review drafted reply** Telegram *Service*

## How it's built

- **Starts on:** An arriving email
- **Steps:** 34, with 2 branches
- **Size:** Large: read it before trusting it with anything live
- **Connects to:** Gmail, Pinecone, Telegram
- **Model:** OpenAI, OpenRouter
- **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, Pinecone and Telegram accounts, and a key for OpenAI and OpenRouter. 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 and OpenRouter. 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 34 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 34 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%2Femail-management-system-with-openai-and-pinecone-db)
- **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)[Pinecone](https://millionrounds.com/workflows?service=Pinecone#library)[Telegram](https://millionrounds.com/workflows?service=Telegram#library)

## Workflows like it

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

- [**Assist hospital doctors with Telegram and OpenAI** 34 steps · calls a model · Gmail, Google Sheets](https://millionrounds.com/workflow/assist-hospital-doctors-with-telegram-and-openai)
- [**Classify and auto-reply to Gmail with OpenAI** 34 steps · calls a model · Gmail, Google Sheets](https://millionrounds.com/workflow/classify-and-auto-reply-to-gmail-with-openai)
- [**Evaluate job fit and generate application assets** 34 steps · calls a model · Apify, Gmail](https://millionrounds.com/workflow/evaluate-job-fit-and-generate-application-assets)
- [**Manage rent, maintenance and tenant messages with OpenAI** 34 steps · calls a model · Google Sheets, Slack](https://millionrounds.com/workflow/manage-rent-maintenance-and-tenant-messages-with-openai)
- [**AI powered RAG chatbot for your docs + Google Drive + Gemini** 35 steps · calls a model · Google Docs, Google Drive](https://millionrounds.com/workflow/ai-powered-rag-chatbot-for-your-docs-google-drive-gemini)
- [**Build a comprehensive multimodal assistant on Telegram** 33 steps · calls a model · Telegram, in-memory vectors](https://millionrounds.com/workflow/build-a-comprehensive-multimodal-assistant-on-telegram)
