# Categorize emails, chat with PDFs and OpenAI: n8n workflow

> Started by someone opening a chat with it, and works across Gmail, Pinecone and Slack. It puts Claude and OpenAI behind a retrieval step, so answers are...

Source: https://millionrounds.com/workflow/categorize-emails-chat-with-pdfs-and-openai (Millionrounds; every figure on the page links to its filing or article)

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

# Categorize emails, chat with PDFs and OpenAI

Started by someone opening a chat with it, and works across Gmail, Pinecone and Slack. It puts Claude and OpenAI behind a retrieval step, so answers are drawn from documents you supply rather than from the model alone. 26 steps, 1 branch: 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%2Fcategorize-emails-chat-with-pdfs-and-openai)

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

**1** Branch: places the flow splits

**0** Loops or waits

**3** Services it connects to

## The flow

Starts it 3 Model 16 Logic 3 Service 4

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

- 1 **Recursive Character Text Splitter** Text Splitter Recursive Character Text Splitter *Model*
- 2 **Embeddings OpenAI** Embeddings Open Ai *Model*
- 3 **OpenAI Chat Model** Lm Chat Open Ai *Model*
- 4 **Embeddings OpenAI2** Embeddings Open Ai *Model*
- 5 **PDFs to download** No Op *Logic*
- 6 **Anthropic Chat Model** Lm Chat Anthropic *Model*
- 7 **Get calendar availability** Tool Http Request *Model*
- 8 **Window Buffer Memory** Memory Buffer Window *Model*
- 9 **Book appointment** Tool Http Request *Model*
- 10 **When chat message received** Chat trigger *Starts it*
- 11 **OpenAI Chat Model1** Lm Chat Open Ai *Model*
- 12 **On new email to nathan's inbox** Gmail trigger *Starts it*
- 13 **Webhook** Webhook *Starts it*
- 14 **Default Data Loader** Document Default Data Loader *Model*
- 15 **Insert into Pinecone vector store** Vector Store Pinecone *Model*
- 16 **Question and Answer Chain** Chain Retrieval Qa *Model*
- 17 **Read Pinecone Vector Store** Vector Store Pinecone *Model*
- 18 **Download PDF** Http Request *Service*
- 19 **Appointment booking agent** Agent *Model*
- 20 **Assign label with AI** Text Classifier *Model*
- 21 **Whether email contains n8n** If *Logic*
- 22 **Vector Store Retriever** Retriever Vector Store *Model*
- 23 **Add automation label** Gmail *Service*
- 24 **Add music label** Gmail *Service*
- 25 **Execute JavaScript** Code *Logic*
- 26 **Send message** Slack *Service*

## How it's built

- **Starts on:** Someone opening a chat with it
- **Steps:** 26, with 1 branch
- **Size:** Large: read it before trusting it with anything live
- **Connects to:** Gmail, Pinecone, Slack
- **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 Gmail, Pinecone and Slack 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 someone opening a chat with it.

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 26 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 26 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%2Fcategorize-emails-chat-with-pdfs-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.

[Gmail](https://millionrounds.com/workflows?service=Gmail#library)[Pinecone](https://millionrounds.com/workflows?service=Pinecone#library)[Slack](https://millionrounds.com/workflows?service=Slack#library)

## Workflows like it

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

- [**Create ClickUp meeting action items from transcripts** 26 steps · calls a model · Airtable, ClickUp](https://millionrounds.com/workflow/create-clickup-meeting-action-items-from-transcripts)
- [**Manage dental patient chat, bookings, and reminders** 26 steps · calls a model · Google Sheets, Slack](https://millionrounds.com/workflow/manage-dental-patient-chat-bookings-and-reminders)
- [**Prep meeting agendas from Google Calendar with Gmail** 26 steps · calls a model · Airtable, Gmail](https://millionrounds.com/workflow/prep-meeting-agendas-from-google-calendar-with-gmail)
- [**Manage online bookings with Gmail and Google Calendar** 26 steps · Gmail, Google Calendar](https://millionrounds.com/workflow/manage-online-bookings-with-gmail-and-google-calendar)
- [**Orchestrate Full-Lifecycle Event Operations** 26 steps · Gmail, Google Calendar](https://millionrounds.com/workflow/orchestrate-full-lifecycle-event-operations)
- [**AI token tracker for WhatsApp & Telegram – Save AI usage** 25 steps · calls a model · Airtable, Gmail](https://millionrounds.com/workflow/ai-token-tracker-for-whatsapp-and-telegram-save-ai-usage)
