# Automate Gmail labeling with Gemini and Telegram: n8n workflow

> Started by an arriving email, and works across Gmail and Telegram. It hands the judgement calls to Gemini and OpenAI.

Source: https://millionrounds.com/workflow/automate-gmail-labeling-with-gemini-and-telegram (Millionrounds; every figure on the page links to its filing or article)

[Automation library](https://millionrounds.com/workflows) · [Alerts and monitoring](https://millionrounds.com/workflows?category=Alerts+and+monitoring#library)

# Automate Gmail labeling with Gemini and Telegram

Started by an arriving email, and works across Gmail and Telegram. It hands the judgement calls to Gemini and OpenAI. 18 steps, 1 loop or waits: a working afternoon to understand properly.

Medium Calls a model: Gemini, OpenAI

[Download free](https://millionrounds.com/login?next=%2Fapp%2Fworkflow%2Fautomate-gmail-labeling-with-gemini-and-telegram)

**18 steps** Medium: a working afternoon

**0** Branches: places the flow splits

**1** Loop or waits

**2** Services it connects to

## The flow

Starts it 1 Model 3 Logic 3 Service 11

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

- 1 **Gmail Trigger** Gmail trigger *Starts it*
- 2 **OpenAI Chat Model** Lm Chat Open Ai *Model*
- 3 **Google Gemini Chat Model** Lm Chat Google Gemini *Model*
- 4 **Text Classifier** Text Classifier *Model*
- 5 **Label as Business** Gmail *Service*
- 6 **Label as Personal** Gmail *Service*
- 7 **Label as Appointments** Gmail *Service*
- 8 **Label as Urgent** Gmail *Service*
- 9 **Label as Invoices** Gmail *Service*
- 10 **Clean html and organize into statements** Code *Logic*
- 11 **Aggregate** Aggregate *Logic*
- 12 **InfraNodus Save to Graph** Http Request *Service*
- 13 **Get Label's Name in Gmail** Gmail *Service*
- 14 **Wait** Wait *Logic*
- 15 **Get Email's snippet** Gmail *Service*
- 16 **InfraNodus Question Generator** Http Request *Service*
- 17 **Send Notification via Telegram** Telegram *Service*
- 18 **Send Insight to Telegram** Telegram *Service*

## How it's built

- **Starts on:** An arriving email
- **Steps:** 18, 1 loop or waits
- **Size:** Medium: a working afternoon
- **Connects to:** Gmail, Telegram
- **Model:** Gemini, OpenAI

## Questions

What does it need to run?

An n8n account, plus your own Gmail and Telegram accounts, and a key for Gemini and OpenAI. 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 Gemini and OpenAI. Model calls are billed by the provider, not by n8n.

How long does it take to set up?

Plan an afternoon. 18 steps is enough that you should read each one before running it.

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 18 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-gmail-labeling-with-gemini-and-telegram)
- **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)[Telegram](https://millionrounds.com/workflows?service=Telegram#library)

## Workflows like it

Also alerts and monitoring, with the same services where possible, closest in size first.

- [**Automated 24/7 crypto news alerts to X, Telegram & Discord** 18 steps · calls a model · Discord, RSS](https://millionrounds.com/workflow/automated-24-7-crypto-news-alerts-to-x-telegram-and-discord)
- [**Crypto alpha scanner with OpenAI** 18 steps · calls a model · Reddit, Telegram](https://millionrounds.com/workflow/crypto-alpha-scanner-with-openai)
- [**Monitor Reddit for sales opportunities with OpenAI** 18 steps · calls a model · Asana, Gmail](https://millionrounds.com/workflow/monitor-reddit-for-sales-opportunities-with-openai)
- [**Monitor brand news and send AI-prioritized digests with Gemini** 18 steps · calls a model · Gmail, Google Sheets](https://millionrounds.com/workflow/monitor-brand-news-and-send-ai-prioritized-digests-with-gemi)
- [**Monitor negative news for watchlist companies** 18 steps · calls a model · Gmail, Google Sheets](https://millionrounds.com/workflow/monitor-negative-news-for-watchlist-companies)
- [**Reconcile trade mismatches in Google Sheets with Groq** 18 steps · calls a model · Gmail, Google Sheets](https://millionrounds.com/workflow/reconcile-trade-mismatches-in-google-sheets-with-groq)
