PICKED FROM N8N.IO · EMAIL & INBOX

Each new Gmail message is read by OpenAI and given a label that fits its content. The default labels are Partnership, Inquiry and Notification, and you can change the names and descriptions. The labels are then added to the message in Gmail.

Template by Oskar · 30.7k views on n8n.io · listed there as “Auto-label incoming Gmail messages with AI nodes”

THE WORKFLOW11 NODES
@Gmail trigger@Get messagecontent✦Assign labels formessage◆OpenAI Chat{}JSON Parser≡Set label values@Get all labels⊟Split outassigned labels⋈Mergecorresponding la…⊞Aggregate labelIDs@Add labels tomessage
DIFFICULTY
Beginner
NODES
11
USES AI
Yes
PUBLISHED
March 2024

001 / WHAT HAPPENS

  1. 01

    A Gmail trigger checks for new messages every minute.

  2. 02

    The workflow downloads the content of the message.

  3. 03

    OpenAI picks the matching label or labels from your list and returns them in a set format.

  4. 04

    The workflow looks up the label IDs that exist in your Gmail account.

  5. 05

    The matching labels are added to the message.

WHO IT SUITS

Suits any business with a busy shared inbox that wants enquiries, partnership pitches and notifications sorted before staff open them.

CONNECTS

  • Gmail
  • OpenAI

002 / BEFORE YOU USE IT HERE

  • !Customer or staff details sent to an overseas AI provider such as OpenAI is a cross-border disclosure under APP 8 of the Privacy Act, so say so in your privacy policy.
  • !The labels must already exist in Gmail with the same names the AI uses, or they will not be applied.
  • !Polling every minute makes a lot of calls, so lengthen the trigger interval if volume is low.

LOCAL SWAP

Swap the Gmail nodes for Microsoft Outlook nodes if you use Microsoft 365, and recreate the labels as categories.

Need n8n and the AI hosted in Australia? →

004 / QUESTIONS

Anything else is quicker to answer on a call. Thirty minutes, free, with the people who would build it.

Yes. Every template on this list is free on n8n.io. You need an n8n account (n8n Cloud or self-hosted) and accounts for the apps it connects to, some of which charge for API use.

We adapt templates to your systems, add approval steps where customers are involved, host n8n in Australia when the data calls for it and hand it over documented.

Book a free call→