Skip to main content

Triage emails and draft Gmail replies using Gemini and Google Calendar

Workflow preview

Workflow preview
100%
Triage emails and draft Gmail replies using Gemini and Google Calendar preview
Open on n8n.io

1. Workflow Overview

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 ...

Best for

  • Ticket Management automation workflows
  • AI Summarization automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.stickynote, n8n-nodes-base.gmail, n8n-nodes-base.gmailtrigger, n8n-nodes-base.filter, @n8n/n8n-nodes-langchain.agent, n8n-nodes-base.switch, n8n-nodes-base.code, n8n-nodes-base.googlecalendartool

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Allan Vaccarizi.

Original n8n.io source

1.1 Workflow description

Title
Triage emails and draft Gmail replies using Gemini and Google Calendar
Workflow name
Triage emails and draft Gmail replies using Gemini and Google Calendar

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

  • Connect a Gmail OAuth2 credential to all Gmail nodes (trigger, fetch, remove label, draft, label, mark unread)
  • Connect a Google Gemini (PaLM) API credential to the Gemini Chat Model node
  • Connect a Google Calendar OAuth2 credential to the Google Calendar Tool node
  • Configure the Gmail Trigger label/filter to match your inbox setup
  • Update the label IDs in Remove Label from Thread, Get label for response, and Labelliser to match your Gmail labels
  • Customize the HTML signature in the Build HTML Signature code node

Requirements

  • Gmail account with OAuth2 access
  • Google Gemini (PaLM) API key
  • Google Calendar account

How to customize

  • Adjust the AI Agent's system prompt to change tone, add new label categories, or modify the reply structure.
  • Extend the Switch node with additional branches (e.g., forward to a team member, archive automatically, create a CRM task).
  • Replace the Gmail draft step with a direct send for fully automated responses on low-risk categories like Notifications.

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Sticky Note13

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 2 - Sticky Note16

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 3 - Sticky Note1

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 4 - Sticky Note2

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 5 - Sticky Note5

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 6 - Sticky Note6

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 7 - Fetch Email Details

Type / Role
n8n-nodes-base.gmail - gmail
Config choices
Version 2.1

Block 8 - Add Label to Email

Type / Role
n8n-nodes-base.gmail - gmail
Config choices
Version 2

Block 9 - When New Email Arrives

Type / Role
n8n-nodes-base.gmailTrigger - gmailTrigger
Config choices
Version 1

Block 10 - Send Response Email

Type / Role
n8n-nodes-base.gmail - gmail
Config choices
Version 2.1

Block 11 - Filter Valid Label

Type / Role
n8n-nodes-base.filter - filter
Config choices
Version 2.2

Block 12 - Draft and Label Agent

Type / Role
@n8n/n8n-nodes-langchain.agent - agent
Config choices
Version 2.2

Block 13 - Send Draft Email

Type / Role
n8n-nodes-base.gmail - gmail
Config choices
Version 2.1

Block 14 - Route by Draft Type

Type / Role
n8n-nodes-base.switch - switch
Config choices
Version 3.3

Block 15 - Build HTML Signature

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 16 - Get Current Date

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 17 - Remove Label from Thread

Type / Role
n8n-nodes-base.gmail - gmail
Config choices
Version 2.1

Block 18 - Google Calendar Tool

Type / Role
n8n-nodes-base.googleCalendarTool - googleCalendarTool
Config choices
Version 1.3

Block 19 - Gemini Chat Model

Type / Role
@n8n/n8n-nodes-langchain.lmChatGoogleGemini - lmChatGoogleGemini
Config choices
Version 1

Block 20 - Gmail Thread Tool

Type / Role
n8n-nodes-base.gmailTool - gmailTool
Config choices
Version 2.1

Block 21 - Structured Output Parser

Type / Role
@n8n/n8n-nodes-langchain.outputParserStructured - outputParserStructured
Config choices
Version 1.3

Block 22 - Mark Email as Unread

Type / Role
n8n-nodes-base.gmail - gmail
Config choices
Version 2.2

Block 23 - Sticky Note7

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 24 - Sticky Note8

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Showing the first 24 of 25 workflow blocks. Download the JSON for the full node graph.

3. Summary Table

Workflow Triage emails and draft Gmail replies using Gemini and Google Calendar
Complexity advanced
Nodes 25
Categories Ticket Management, AI Summarization
Author Allan Vaccarizi
Published 28 Apr 2026

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/15369/15369.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Triage emails and draft Gmail replies using Gemini and Google Calendar do?

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 ...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Ticket Management, AI Summarization use case.