Email & Admin

Auto-Label Incoming Gmail Messages

Let AI read each new Gmail message and apply the labels that fit, such as Partnership, Inquiry or Notification.

The Problem

Inboxes mix partnership offers, customer questions and automated notifications. Filters based on sender or keywords miss most of them.

How This Template Solves It

An agency owner wants partnership requests kept apart from notifications. The workflow reads each new email, the AI picks from the labels you define, and those labels are applied in Gmail so the inbox is sorted before you open it.

How It Works

  1. 1A Gmail trigger polls for new messages.
  2. 2Fetches the full message content.
  3. 3An AI chain assigns labels using a JSON schema of allowed label names.
  4. 4Matches the AI labels to the label IDs in your Gmail account and adds them to the message.

What You Need

  • A Gmail account with the labels already created
  • An OpenAI API key

What Stays Under Your Control

  • You define the labels and the instructions for each one.

Watch Out For

  • Label names must match exactly in Gmail, the system prompt and the JSON schema.
  • Set the polling interval to how quickly you need emails sorted.

Adapted from a community workflow template. Before publishing we removed credentials, account and file IDs, email addresses and sample data. The original author's setup notes are kept inside the workflow file.

More Email & Admin Templates

Email & Admin

Draft Gmail Replies to Incoming Emails

Check each incoming Gmail message, decide whether it needs a reply, and save an AI-written draft in the thread.

Starts on: New Gmail email

GmailOpenAI
Email & Admin

Human-in-the-Loop Email Replies with AI

Summarize incoming emails, draft a reply with your business information, and send it only after a person approves.

Starts on: New email (IMAP)

Email (IMAP)Email (SMTP)OpenAI