Step-by-step guide Your First AI Agent in a Weekend: inbox triage + lead follow-up →
To label Gmail automatically with AI in Zapier, you need one Zap with four working parts: a Gmail trigger that picks up each new email, an AI by Zapier step that chooses one category from a list you define, a lookup table that turns that category into a Gmail label ID, and Gmail's Add Label to Email action. We built exactly that on 9 November 2026 and scored it on 50 test emails. It put 49 in the right category. This walkthrough covers the whole build, six steps in all, with the settings we used and the places where it went wrong first.
What you need before you start
- Your labels, made in Gmail first. Google's help page on labels gives the route: next to "Labels", click "Create new label", and tick "Nest label under" to group them. We nested ours under one parent called AI (AI/Lead, AI/Client, AI/Supplier, AI/Admin, AI/Later and AI/Urgent). That shows which labels the automation sets, and makes them easy to remove later.
- A Zapier plan that can run it. Zapier's help article on AI by Zapier, updated on 28 October 2026, says the Free plan lets you preview an AI step but not publish a Zap that contains one. We built on a Professional trial.
- A test address. Google documents a handy trick: add a plus sign and any word before the @ in your address, and the mail still arrives in your inbox. Send your test emails to yourname+test and the Zap can be told to read only those.
- Your categories, written down. One sentence per category on what belongs there, including the cases you hesitate over yourself. Ours were Lead, Client, Supplier, Admin and Later, with a separate urgent flag.
The Zap at a glance
| Step | What it does | Tasks used |
|---|---|---|
| 1. Gmail: New Email Matching Search | Picks up each new email that matches a Gmail search | 0 |
| 2. AI by Zapier | Chooses one category, flags urgency and gives a reason | 1 on the Standard tier |
| 3. Formatter: Utilities, Lookup Table | Turns the category into a Gmail label ID | 0 |
| 4. Gmail: Add Label to Email | Applies the category label | 1 |
| 5. Filter by Zapier | Continues only if the email is urgent | 0 |
| 6. Gmail: Add Label to Email | Adds the urgent label | 1, only when it runs |
The task counts follow Zapier's article on task usage, updated on 5 November 2026: a task is a successful action, and triggers, filters and Formatter steps do not count. So this Zap uses 2 tasks per email, plus 1 when the email is urgent: 210 tasks for a day of 100 emails with 10 urgent ones. The same article announces different counting for Zapier's newer Next Gen Zaps from 1 December 2026, so read the current version before you size a plan. Nothing in this Zap can send an email.
Step 1: decide which emails it may read
Create a new Zap and choose the Gmail trigger New Email Matching Search. Zapier's Gmail page describes it as firing when you receive a new email that matches a search you provide. The search box takes the same words as Gmail's own search bar, and that is how you control what the AI step sees.
- While you build: a search that matches only your test emails, such as
to:yourname+test@gmail.com. - When you switch on: a search for inbox mail you didn't send. In the guide we use
in:inbox -from:me, plus-category:promotions -category:socialif you use Gmail's tabs. Google's list of search operators documentsfrom:me,category:and the minus sign for exclusion.
Try the search in Gmail first, so you can see exactly which emails it returns. Every newsletter you exclude here is an email that costs no tasks. Then test the trigger, and Zapier loads a few recent matching emails as samples to build with. On our plan the trigger checked Gmail every 2 minutes, which is plenty for sorting.
Step 2: the AI step that picks one category
Add an action and choose AI by Zapier. The step has a Prompt box, a model menu at the bottom right of that box, and a Settings area with a section called Output Fields.
Write the prompt. Say who the business is, list the categories with one line each on what belongs there, define urgent, and ask for a one-sentence reason. End with the email itself: type a label such as "Subject:", a space, then /, and pick the matching field from the Gmail step. We mapped From Name, From Email, Subject and Body Plain, one per line. The editor is fiddly: the / menu opened only after a space, and clicking an inserted field and then typing replaced it.
Check the model tier. Zapier's model tier article, updated on 2 November 2026, lists three tiers: Standard at 1 task per run, Advanced at 3 and Premium at 5. It also says a new AI step on a paid plan defaults to Premium. Sorting email is a simple job, so open the menu and pick a Standard model. We used Claude 5.5 Haiku.
Fix the output fields. Output fields make the result usable by later steps. Zapier can generate them from your prompt, and in our build it got them wrong in three of four AI steps. Here it added required fields called Email From and Email Subject that only echoed the input. Delete the extras and keep four:
| Field | Type | Why |
|---|---|---|
| Category | Single choice, with your exact category names as options | Step 3 looks this up |
| Urgent | True or false, required | Step 5 filters on it |
| Needs Reply | True or false, required | Useful later for drafting |
| Reason | Text, not required | You read it when a label looks wrong |
Click Preview to run the step on a sample. Our phishing-style test email, a "your mailbox is full, verify your account" message, came back as Later, not urgent, no reply needed, with a reason that mentioned a likely phishing attempt.
Step 3: turn the category into a label ID
Gmail knows a label by an ID, not by its name. To see the IDs, add the Gmail action Add Label to Email, open its Label menu and type the start of your label names. In our account each one showed its ID underneath, such as "AI/Lead · ID: Label_2". Write them down.
You could build five branches, one per category. One lookup table is simpler, and Formatter steps use no tasks:
- Add a Formatter step between the AI step and the Gmail step. Choose the event Utilities, then the transform Lookup Table.
- Lookup Key: the Category field from the AI step.
- Key and value pairs: one row per category, with the category name on the left and its label ID on the right. Zapier's lookup table article notes that the key column is case-sensitive, so the names must match the AI step's options exactly.
- In the Gmail step: open the three-dot menu next to Label, choose Custom, and insert the lookup's Output. Set Message to Custom as well, and insert Message Id from the trigger.
The same article describes an optional Fallback Value, used when no key matches. We didn't set one: in both scoring runs the Category field only ever returned one of its five options.
Step 4: a second label for urgent mail
Add Filter by Zapier with one rule: only continue if Urgent is true. After it, add a second Add Label to Email action with your urgent label and the same Message Id. When the email isn't urgent, the filter stops the run and Zapier marks it as Filtered, which is a normal result, not an error. That is why the urgent label comes last.
In our end-to-end runs, the phishing-style email got its Later label and stopped at the filter, as intended. A complaint about a sofa got a category label and the urgent label. Three of our five seeded emails went out with senders and subjects mixed up, our mistake, so those runs show only that the steps connect.
Test it before it reads real mail
The editor's test run executes the whole Zap for real on one sample email. Zapier's task article says testing uses no tasks, "even though testing an action step performs the action in your app". For a label that is harmless. For a step that sends, it is not.
One run on one email proves the plumbing, not accuracy. For that, write test emails that look like your real mail, decide the right answer for each before you run them, and count. On our 50, the category was right 49 times in both runs. Urgency was the weak spot: a vague rule caught 4 of 10 urgent emails, and rewriting that one sentence as concrete triggers caught all 10, with 3 false alarms. The full results and the urgency lesson are in our launch article.
Four things that tripped us up
- Generated output fields. Check them every time. A required field that shouldn't exist pushes the model to fill it with something.
- Label names where IDs belong. If the Zap runs and no label appears, compare the IDs in the label picker with your lookup table, then the spelling of every category.
- Few samples in the editor. The sample list showed only the three or four most recent matching emails, so send test emails one kind at a time.
- Wrong labels are mostly your rules, not the AI. Our one miss was a supplier's promotion filed under Later, and our own category list put promotions under Later. Fix the wording, one line at a time, and test again.
Before you point it at a real inbox: every email the Zap reads is sent to an AI model. Zapier's security page states that it does not train on the data that runs through your workflows, on any plan, and that it acts as your processor under the GDPR. Health or client data still needs a legal basis and a processing agreement before it goes through any AI tool. Because we build to healthcare standards, our default is a separate inbox for sensitive mail that the Zap never reads.
Where to go from a label
A labelled inbox is useful on day one, and it is the trigger for everything else. A second Zap can start when an email gets the Lead label, log the inquiry in a sheet and leave a reply in Drafts. A third can draft a follow-up when a lead goes quiet. Before you build those, read why an AI assistant should draft and never send, and what the studies really say about lead response time.
The complete system is in Your First AI Agent in a Weekend, inbox triage and lead follow-up edition: the rules card that feeds the prompt, the exact prompts for all three Zaps, the lead sheet, the test log and a switch-on checklist. It sits with our other titles in the guides catalogue.
The short version: make the labels in Gmail, let the AI choose from a fixed list, translate that choice into a label ID, and score a test set before the Zap sees real mail. If you'd rather have it designed around your own systems, that is the work we do as custom AI applications and integrations.
Frequently asked questions
Can Zapier label Gmail emails automatically with AI? Yes. A Zap with a Gmail trigger, an AI by Zapier step and Gmail's Add Label to Email action reads each new email, picks one category from your list and applies the matching label. In our build, tested on 9 November 2026, 49 of 50 test emails got the right category.
Do I need a paid Zapier plan to label Gmail with AI? To run it, yes. Zapier's help centre says the Free plan lets you preview an AI by Zapier step on the Standard tier but not publish a Zap that contains one. We built ours on a Professional trial.
How many Zapier tasks does AI email labelling use? Ours used 2 tasks per email: one for the AI step on the Standard model tier and one for the Gmail label, plus 1 more when the urgent label was added. Triggers, filters and Formatter steps do not count. Check the model tier, because Zapier says new AI steps on paid plans default to Premium, at 5 tasks per run.
Why does my Zap run but add no Gmail label? The usual cause is the lookup table. Gmail's label field needs a label ID, not the label's name, and Zapier's lookup keys are case-sensitive. Compare the IDs shown in the Gmail label picker with your table, and make the AI step's category options match the keys exactly.
Is it safe to let an AI step read my inbox? Treat it as sending each email's text to another company. Zapier states that it does not train on the data in your workflows, but health or client data still needs a legal basis and a processing agreement before it goes through any AI tool. Keep sensitive mail in a separate inbox the Zap never reads.
