🎫 Triage emails and draft Gmail replies using Gemini and Google Calendar

⚑ 6,417 views · 🎫 Ticket Management & Triage

Description

Who it’s for

This workflow is for professionals and small business owners who receive a high volume of emails and want to automate triage, labeling, and draft reply generation β€” without losing the human touch before sending.

How it works

  1. A Gmail trigger polls the inbox every minute for new unread emails and retrieves the current date.
  2. The full email message is fetched, and any existing processing labels are stripped from the thread.
  3. A Gemini 2.5 Pro AI Agent reads the email (and the full thread via a Gmail Thread tool), checks Google Calendar for availability, then classifies the email into one of six categories (Urgent, Reply, Read, Notification, Newsletter, Invoice) and drafts an HTML reply when needed.
  4. A Switch node routes the output: emails requiring a reply (Urgent or Reply) pass through a JavaScript node that appends an HTML signature before saving the message as a Gmail draft.
  5. All paths converge to fetch the matching Gmail label, filter for validity, apply it to the thread, and mark the message as unread so it surfaces for human review.

How to set up

Requirements

How to customize

πŸ”— Nodes Used

Gmail, Gmail Trigger, Filter, AI Agent, Structured Output Parser, Google Gemini Chat Model

πŸ“₯ Import

Download workflow.json and import into n8n: Workflow menu β†’ Import from File

πŸ“– Importing guide Β· πŸ”‘ Credential setup