n8n

How to Automate Gmail Inbox Triage and Draft Replies?

Busy inboxes slow teams down. This build reads each new Gmail message, sorts it into a clear label, and writes a polite draft reply you can review. Ideal for office staff, sales assistants, and school admin teams that need fast triage without missing urgent notes. You get a clean queue and a ready to edit answer for each thread.

New emails are pulled from Gmail every minute. The text goes to an AI classifier powered by Google Gemini, which picks a category like High Priority, Work Related, or Promotion. Based on that choice, the flow adds the matching Gmail label automatically. At the same time, an AI Agent using a Groq model creates a first draft reply and saves it as a Gmail draft, so a human can edit and send. It uses separate models for classification and drafting to improve accuracy and tone, and you can add more categories as your workload grows.

Setup only needs Gmail labels and API access for Google Gemini and Groq. Expect faster first responses, clearer priorities, and less inbox stress, often saving 30 to 60 minutes each day. No code changes are needed beyond choosing labels and pasting API keys. Great for sorting inquiries, vendor emails, and parent or client messages while keeping control over final sends.

What are the key features?

  • Gmail Trigger checks for new emails every minute
  • Google Gemini classifies each message into custom categories
  • Routes messages to matching Gmail labels based on the chosen category
  • Groq powered AI Agent writes a polite, context aware draft reply
  • Saves replies as Gmail drafts so a human can review and send
  • Easily add more categories and labels as needs change

What are the benefits?

  • Reduce manual sorting from 60 minutes to 5 minutes per day
  • Automate about 70% of first draft replies while keeping human review
  • Improve priority accuracy with clear labels for each category
  • Handle up to 5 times more email volume without extra staff
  • Connect Gmail with two AI models in one place

How do you set it up?

  1. Import the template into n8n: Create a new workflow in n8n > Click the three dots menu > Select 'Import from File' > Choose the downloaded JSON file.
  2. You'll need accounts with Gmail, Google Gemini and Groq. See the Tools Required section above for links to create accounts with these services.
  3. In the n8n credentials manager, create a Gmail OAuth2 credential. Sign in to your Google account and grant Gmail access. Name the credential clearly, for example Gmail Main.
  4. Open the Gmail Trigger node and select your Gmail credential. Confirm the polling setting is every minute or choose a rate that fits your volume.
  5. In your Gmail inbox, create labels for each category you want, such as High Priority, Work Related, and Promotion. Use colors if helpful.
  6. Open the Classification Agent node. Enter your category names and short rules or keywords in the description field. Make sure category names match your Gmail label names.
  7. Double click the Google Gemini Chat Model node. In the credential dropdown, click Create new credential, then paste your Gemini API key from the Google AI Studio API page and test the connection.
  8. Double click the Groq Chat Model node. In the credential dropdown, click Create new credential, add your Groq API key from your Groq account, choose the model, and test the connection.
  9. Open each Add Label node and select your Gmail credential. Choose the exact Gmail label by name or ID that matches the classification output connected to that node.
  10. Open the AI Agent node and adjust the system message to match your tone. Open the Gmail Draft node and confirm Resource is Draft, Subject maps to the original subject, and Message maps to the AI output.
  11. Run a test: send sample emails that fit each category. Check n8n executions, confirm the right label is applied in Gmail, and verify a draft reply is created in your Drafts folder.
  12. Troubleshoot: if labels are missing, ensure category names and output paths match. Reconnect Gmail if auth errors appear. If drafts do not show, confirm the message field maps to the AI output and review the n8n logs.

Tools Required

$24 / mo or $20 / mo billed annually to use n8n in the cloud. However, the local or self-hosted n8n Community Edition is free.

Gmail

Sign up

No cost: Personal Gmail (Gmail API has no usage-based pricing; quotas apply)

Google Gemini

Sign up

Free tier: $0 via Gemini API; e.g., Gemini 2.5 Flash-Lite free limits 1,000 requests/day (15 RPM, 250k TPM). Paid from $0.10/1M input tokens and $0.40/1M output tokens.

Free tier: $0, API key usable via API (rate‑limited)

Similar Templates

Join Futurise to access 1,200+ automation templates

Get instant access to ready-made automation workflows for n8n, Make.com, AI agents, and more. Download, customise, and deploy in minutes.