Reads unread inbox mail every hour and applies your own labels to each message using AI.

UsesClaudeGmail

Auto-label new Gmail messages with AI

Every hour, the workflow reads the unread mail sitting in your Gmail inbox and sorts it using labels you describe in plain English, such as one for invoices, one for candidate outreach and one for newsletters. The AI reads each message's sender, subject and preview against your rules and picks exactly one label, which is then applied to the message.

You end up with an inbox where new mail already carries the right label, and labels are created in Gmail the first time they are used. A message that matches none of your rules is left untouched rather than pushed into the nearest category, so the labels you do see stay trustworthy. A message that cannot be processed is noted in the run log and skipped, and the rest of the batch still goes through. Nothing is archived, moved or replied to: labels are added and that is all.

ScheduleRun every hour.Run every hour.
ValuesSet labelRules to blank.Set labelRules to blank.
ValuesSet maxEmails to 25.Set maxEmails to 25.
GmailGmailList emails. Save it as inbox.List emails. Save it as inbox.
ValuesSet messages to inbox.emails.Set messages to inbox.emails.
Decisions & LoopsFor each email in messages:For each email in messages:
Decisions & LoopsIf a step below fails, save the error as labelErrorIf a step below fails, save the error as labelError
Try
ValuesSet subject to email.subject.Set subject to email.subject.
ValuesSet sender to email.from.Set sender to email.from.
ValuesSet snippet to email.snippet.Set snippet to email.snippet.
ValuesSet prompt to You are labelling one email. Reply with EXACTLY one label name from the rules below, and nothing else. If none of them fit, reply with the single word none.Set prompt to You are labelling one email. Reply with EXACTLY one label name from the rules below, and nothing else. If none of them fit, reply with the single word none. Rules: labelRules From: sender Subject: subject Preview: snippet.
ClaudeClaudeAsk Claude: prompt. Save it as verdict.Ask Claude: prompt. Save it as verdict. Maximum response length: 16
TextTrim verdict.response_text and save it as label.Trim verdict.response_text and save it as label.
Decisions & LoopsIf label isn't empty and label is not noneIf label isn't empty and label is not none
Yes
GmailGmailAdd label label to email email.Add label label to email email.
No
No steps
On error
ValuesShow in the output: Could not label message email.id as text: labelError as text.Show in the output: Could not label message email.id as text: labelError as text.