Stepthrough Start free

How do I automatically sort and label my Gmail with AI?

Use two layers: Gmail filters for mail you can describe with a rule (a sender, a subject line), and an AI step for mail you can only describe in words, such as "a new customer asking about prices". The AI layer is a small n8n workflow where a Text Classifier reads each new email, decides if it is a Lead, a Client or an Invoice, and adds the matching Gmail label, which you build in the free lesson Gmail AI Triage.

Filters are free, instant and never wrong about what they match, so use them wherever a rule works. AI earns its place when two emails look alike to a rule but mean different things, like a new prospect and an existing client who both write "quick question about pricing".

How do I set up the filter layer?

  1. Pick an example email, tick its checkbox, click More (the three dots) and choose Filter messages like these.
  2. Tighten the match, for example add the subject words every request shares.
  3. Click Create filter, tick Apply the label, and choose or create the label.
  4. Tick "Also apply filter to matching conversations" so the ones already in your inbox get labeled too.
  5. Click Create filter. New matching mail is labeled the moment it arrives.

How do I set up the AI layer in n8n?

  1. Create the labels in Gmail first, for example Lead, Client and Invoice.
  2. Add a Gmail Trigger and connect Gmail with Sign in with Google. It checks the inbox every minute.
  3. Add a Text Classifier. In Text to Classify, switch to Expression and pass in the sender, subject and snippet.
  4. Add categories with descriptions. The description is what the AI goes by, so make the difference clear: Lead is "someone new asking about our services, prices or availability", Client is "an existing client writing about their own project or account".
  5. Give it a model, such as an OpenAI Chat Model with your API key.
  6. Connect each output to a Gmail step that adds that label.
  7. Test on a pinned email, check the label in Gmail, then publish.

The AI triage rules post helps you write category descriptions that sort cleanly. For the bigger picture, see the email triage use case.

What does this look like in a real lesson?

In Gmail AI Triage, Sam at a made-up marketing agency has a new lead, a client question, a hosting bill and a newsletter in the inbox, none sorted, with three labels already made. You connect Gmail, add a Text Classifier with Lead, Client and Invoice, describe Lead and Client so the AI can tell them apart, and wire each output to its label step. Client emails also go to a Basic LLM Chain that writes a short reply, saved with Create a draft. You run it on the pinned client email from Fernhill Bakery: it gets the Client label and a draft reply waits in Drafts, unsent. The newsletter fits no category, so it stays as it is.

The filter side is in Gmail Filters, Labels and AI Drafts: a filter labels every "New quote request" email, including three already waiting, and Gemini's Help me write drafts the reply. The draft invents a price, and you remove it before you send.

Which tools can do this without building anything?

  • Fyxer AI works inside Gmail and Outlook, sorts email into categories such as To respond and FYI, and drafts replies for you to review.
  • Gmail with Gemini summarizes threads and drafts replies. Pair it with filters and labels for the sorting.
  • n8n is the build-it-yourself route, when you want your own categories and rules.

What mistakes should I avoid?

  • Using AI where a filter would do. A known sender or subject needs a rule, not a model.
  • Vague category descriptions. "Client" and "Lead" with no description get mixed up.
  • Forgetting the "none of these" case. Newsletters and spam should be able to stay unlabeled.
  • Letting it send replies. Have it save drafts. A person reads and sends anything that goes to a client.
  • Not checking the first week. Look at what got which label and adjust the descriptions.

Key takeaways

  • Filters for mail a rule can describe, AI for mail only words can describe.
  • In n8n, a Text Classifier picks the category and a Gmail step adds the label.
  • Clear category descriptions are what make the AI sort correctly.
  • Save AI replies as drafts. A person sends them.
  • Ready-made assistants like Fyxer AI do this without building.

Frequently asked questions

Can Gemini label my Gmail automatically?

Gemini in Gmail helps you read and write email. Automatic labeling still runs through Gmail filters, or through an assistant or automation built for it.

Is it safe to give n8n access to my Gmail?

Google shows what n8n asks for before you allow it, such as reading mail and adding labels and drafts. Use an account your company allows and keep the workflow to labels and drafts.

How much does the AI part cost to run?

It uses a small amount of model credit for each email. Your model provider's pricing page has the current rates, and using filters for predictable mail keeps the AI calls down.

Learn it hands-on

Free, interactive lessons: you do every step yourself in a practice copy of the real tool, it checks your work as you go, and nothing touches your real accounts.

Start the free lesson

AI tools in this answer

Each one in the Stepthrough AI tools directory: what it does, who it is for and the free lesson where there is one.

The full AI tools directory

Plain-English definitions, each with an example from a free lesson.

The full AI glossary

More questions: How do I... · All AI questions · All free tutorials