# AI inbox assistant with OpenAI and Gmail: n8n workflow template

> Started by a clock, and works across Gmail and Google Drive. It hands the judgement calls to OpenAI.

Source: https://millionrounds.com/workflow/ai-inbox-assistant-with-openai-and-gmail (Millionrounds; every figure on the page links to its filing or article)

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

# AI inbox assistant with OpenAI and Gmail

Started by a clock, and works across Gmail and Google Drive. It hands the judgement calls to OpenAI. 25 steps, 1 branch: large, and worth reading before you trust it with anything live.

Large Calls a model: OpenAI

[Download free](https://millionrounds.com/login?next=%2Fapp%2Fworkflow%2Fai-inbox-assistant-with-openai-and-gmail)

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

**1** Branch: places the flow splits

**0** Loops or waits

**2** Services it connects to

## The flow

Starts it 1 Model 6 Logic 2 Service 16

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

- 1 **Check inbox every 30 minutes** Schedule trigger *Starts it*
- 2 **OpenAI GPT-4o-mini** Lm Chat Open Ai *Model*
- 3 **Fetch unread emails** Gmail *Service*
- 4 **Classify email category** Text Classifier *Model*
- 5 **Label as Promotions** Gmail *Service*
- 6 **Label as Social** Gmail *Service*
- 7 **Label as Personal** Gmail *Service*
- 8 **Label as Sales** Gmail *Service*
- 9 **Label as Business** Gmail *Service*
- 10 **Label as Receipts** Gmail *Service*
- 11 **Label as Misc** Gmail *Service*
- 12 **Label as Legal** Gmail *Service*
- 13 **Mark as read** Gmail *Service*
- 14 **Draft personal reply** Open Ai *Model*
- 15 **Draft sales reply** Open Ai *Model*
- 16 **Draft business reply** Open Ai *Model*
- 17 **Draft legal reply** Open Ai *Model*
- 18 **Save personal draft** Gmail *Service*
- 19 **Save sales draft** Gmail *Service*
- 20 **Save business draft** Gmail *Service*
- 21 **Save legal draft** Gmail *Service*
- 22 **Get email attachments** Gmail *Service*
- 23 **Has attachments?** If *Logic*
- 24 **Prepare attachment files** Code *Logic*
- 25 **Save to Google Drive** Google Drive *Service*

## How it's built

- **Starts on:** A clock
- **Steps:** 25, with 1 branch
- **Size:** Large: read it before trusting it with anything live
- **Connects to:** Gmail, Google Drive
- **Model:** OpenAI

## Questions

What does it need to run?

An n8n account, plus your own Gmail and Google Drive accounts, and a key for OpenAI. You connect your own accounts after importing it; none are included.

What starts it?

It starts on a clock.

Does it use AI?

Yes. It calls OpenAI. Model calls are billed by the provider, not by n8n.

How long does it take to set up?

Take your time. At 25 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 25 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%2Fai-inbox-assistant-with-openai-and-gmail)
- **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)

## Workflows like it

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

- [**Automate Job applications with Gemini and OpenAI** 25 steps · calls a model · Gmail](https://millionrounds.com/workflow/automate-job-applications-with-gemini-and-openai)
- [**Automating WhatsApp replies with Go High Level and Redis** 25 steps · calls a model · Google Drive, Redis](https://millionrounds.com/workflow/automating-whatsapp-replies-with-go-high-level-and-redis)
- [**Build a self-updating RAG system with OpenAI and Qdrant** 25 steps · calls a model · Google Drive, Qdrant](https://millionrounds.com/workflow/build-a-self-updating-rag-system-with-openai-and-qdrant)
- [**Turn your portfolio into an AI assistant with OpenAI** 25 steps · calls a model · Gmail, Google Drive](https://millionrounds.com/workflow/turn-your-portfolio-into-an-ai-assistant-with-openai)
- [**AI-powered multi-channel customer journey with SMS and OpenAI** 24 steps · calls a model · Gmail, Twilio](https://millionrounds.com/workflow/ai-powered-multi-channel-customer-journey-with-sms-and-opena)
- [**Build a RAG system with Qdrant and Gemini** 24 steps · calls a model · Google Drive, Qdrant](https://millionrounds.com/workflow/build-a-rag-system-with-qdrant-and-gemini)
