Build an n8n Gmail agent that labels mail and drafts replies

A creator built a Gemini-powered n8n agent that labels incoming Gmail and drafts replies, never sending, after fixing a first-test bug.

Used for
Everyday life
Skill needed
No code
Shown in video
Partial demo
Summary based on
Transcript
PromptProof LabWatch on YouTube

I Built an AI Assistant That Sorts My Emails and Writes the Replies (Free, No Code)

Published Nov 4, 20265:21209 views14 likes

Key moments

  • 3:23Live test labels interview invite and drafts reply
  • 3:53First-test bug: simultaneous tool calls
  • 4:39Automatic run on three new emails

What they made

Agent labeled and drafted replies for test emails, then ran automatically on three new emails (newsletter, personal, exam deadline) without manual action.

4:39

How they did it

  1. Human1:17

    Set up a demo Gmail account with test emails and connected Gmail to n8n via Google sign-in.

    Stated in video · n8n
  2. Human1:34

    Configured a Gmail trigger to check the inbox every minute for new email.

    Stated in video · n8n
  3. Human2:04

    Wired the AI agent to receive sender, subject, text, and two IDs, using Google Gemini 2.5 Flash as the model.

    Stated in video · Google Gemini 2.5 Flash
  4. Human2:36

    Defined two tools (add label, create reply draft) and a system prompt with label definitions and safety rules.

    Stated in video · n8n
  5. AI3:23

    On a test interview invite, the agent applied the Job-Uni label and created a short reply draft saying it would confirm a time slot.

    Stated in video · Google Gemini 2.5 Flash
  6. AI + human3:53

    First run failed because Gemini called both tools at once; the creator added a one-sentence rule to use one tool per step, after which it worked.

    Stated in video · n8n
  7. AI4:39

    After publishing, the agent automatically labeled three new emails (newsletter, personal, exam deadline) without manual action.

    Stated in video · Google Gemini 2.5 Flash

What you can reuse

  • Define each label explicitly in the system prompt, or the agent over-applies labels like Urgent.
  • Constrain the agent to one tool per step to avoid simultaneous tool-call failures.
  • Keep the agent on drafts only and review its work daily at first.

Trade-offs

  • First test failed with a red error because Gemini tried to use both tools at once; fixed with a one-line rule.
  • Tested on a demo Gmail account with test emails, not the creator's real 2,400-email inbox.
  • Agent never sends; all replies remain drafts requiring human review.
  • n8n free trial and Gemini credits are time-limited.

AI-generated case summaries can contain mistakes. Report an error

Related cases