# Automate email & calendar management with Gmail: n8n workflow

> Started by someone opening a chat with it, and works across Gmail, Google Calendar and in-memory vectors.

Source: https://millionrounds.com/workflow/automate-email-and-calendar-management-with-gmail (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)

# Automate email & calendar management with Gmail

Started by someone opening a chat with it, and works across Gmail, Google Calendar and in-memory vectors. It puts OpenAI behind a retrieval step, so answers are drawn from documents you supply rather than from the model alone. 32 steps: 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%2Fautomate-email-and-calendar-management-with-gmail)

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

**0** Branches: places the flow splits

**0** Loops or waits

**3** Services it connects to

## The flow

Starts it 4 Model 14 Logic 2 Service 12

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

- 1 **When chat message received** Chat trigger *Starts it*
- 2 **OpenAI Chat Model** Lm Chat Open Ai *Model*
- 3 **Window Buffer Memory** Memory Buffer Window *Model*
- 4 **When Executed by Another Workflow** Execute Workflow trigger *Starts it*
- 5 **Get last emails** Gmail Tool *Service*
- 6 **Get calendar events** Google Calendar Tool *Service*
- 7 **When clicking ‘Test workflow’** Manual trigger *Starts it*
- 8 **Embeddings OpenAI** Embeddings Open Ai *Model*
- 9 **Token Splitter** Text Splitter Token Splitter *Model*
- 10 **Embeddings OpenAI1** Embeddings Open Ai *Model*
- 11 **OpenAI Chat Model1** Lm Chat Open Ai *Model*
- 12 **Delete an email** Gmail Tool *Service*
- 13 **Create an Email Draft as response to a thread** Gmail Tool *Service*
- 14 **Create an New Email Draft** Gmail Tool *Service*
- 15 **Add an calender entry** Google Calendar Tool *Service*
- 16 **Gmail Trigger** Gmail trigger *Starts it*
- 17 **OpenAI Chat Model2** Lm Chat Open Ai *Model*
- 18 **Get an email by MessageID** Gmail Tool *Service*
- 19 **Determine the name of the day of the week** Date Time Tool *Service*
- 20 **sessionId-master** No Op *Logic*
- 21 **EMail Agent** Agent *Model*
- 22 **Gmail - get recent Threads** Gmail *Service*
- 23 **Read- Threads History Vector Store** Vector Store In Memory *Model*
- 24 **Write - Threads History Vector Store** Vector Store In Memory *Model*
- 25 **Default Data Loader** Document Default Data Loader *Model*
- 26 **Threads History Vector Store** Vector Store In Memory *Model*
- 27 **Research context and infos in previous conversations** Tool Vector Store *Model*
- 28 **Classify Emails** Text Classifier *Model*
- 29 **Gmail1** Gmail *Service*
- 30 **Gmail - Label as Colleges** Gmail *Service*
- 31 **Gmail label as kunde** Gmail *Service*
- 32 **Code - Summarize Email Thread as Text** Code *Logic*

## How it's built

- **Starts on:** Someone opening a chat with it
- **Steps:** 32
- **Size:** Large: read it before trusting it with anything live
- **Connects to:** Gmail, Google Calendar, in-memory 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 Calendar and in-memory vectors accounts, and a key for 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 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 32 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 32 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%2Fautomate-email-and-calendar-management-with-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 Calendar](https://millionrounds.com/workflows?service=Google+Calendar#library)[in-memory vectors](https://millionrounds.com/workflows?service=in-memory+vectors#library)

## Workflows like it

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

- [**Automate pet grooming posts & bookings with Facebook** 32 steps · calls a model · Google Calendar, Google Sheets](https://millionrounds.com/workflow/automate-pet-grooming-posts-and-bookings-with-facebook)
- [**Turn Telegram voice messages into Gmail emails** 32 steps · calls a model · Gmail, Google Calendar](https://millionrounds.com/workflow/turn-telegram-voice-messages-into-gmail-emails)
- [**WhatsApp appointment scheduling with Google Calendar** 32 steps · Google Calendar, Postgres](https://millionrounds.com/workflow/whatsapp-appointment-scheduling-with-google-calendar)
- [**AI secretary for scheduling with WhatsApp and Telegram** 31 steps · calls a model · Google Calendar, Redis](https://millionrounds.com/workflow/ai-secretary-for-scheduling-with-whatsapp-and-telegram)
- [**Calendar Management & RAG Agent with OpenAI and OpenRouter** 31 steps · calls a model · Google Calendar, n8n data table](https://millionrounds.com/workflow/calendar-management-and-rag-agent-with-openai-and-openrouter)
- [**Send AI-powered Slack briefings with Google Workspace** 33 steps · calls a model · Gmail, Google Calendar](https://millionrounds.com/workflow/send-ai-powered-slack-briefings-with-google-workspace)
