Skip to main content

Classify and auto-reply to Gmail with OpenAI, Google Sheets RAG and Telegram

Workflow preview

Workflow preview
100%
Classify and auto-reply to Gmail with OpenAI, Google Sheets RAG and Telegram preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

Gmail Classifier —Classify emails using AI and automate responses This workflow delivers a complete, enterprise grade Gmail automation system designed for high volume teams. It classifies incomi...

Best for

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

Tools used

n8n-nodes-base.gmail, @n8n/n8n-nodes-langchain.openai, n8n-nodes-base.telegram, n8n-nodes-base.gmailtrigger, n8n-nodes-base.googlesheets, n8n-nodes-base.manualtrigger, n8n-nodes-base.stickynote, n8n-nodes-base.switch

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Sandeep Patharkar | www.FastTrackAiMastery.com.

Original n8n.io source

1.1 Workflow description

Title
Classify and auto-reply to Gmail with OpenAI, Google Sheets RAG and Telegram
Workflow name
Classify and auto-reply to Gmail with OpenAI, Google Sheets RAG and Telegram

📨 Gmail Classifier —Classify emails using AI and automate responses

This workflow delivers a complete, enterprise-grade Gmail automation system designed for high-volume teams. It classifies incoming emails, applies labels, generates AI-powered responses, and routes messages to the right department. It also includes optional demo email generation and an inbox cleanup utility so teams can test the workflow instantly.

🚀 What This Workflow Does

  • Classifies Gmail messages into High Priority, Customer Support, Promotions, or Finance/Billing
  • Generates AI-written replies or drafts based on category
  • Applies Gmail labels automatically
  • Uses RAG from Google Sheets for Support queries
  • Sends real-time internal notifications (Telegram)
  • Includes tools to generate & delete test emails for repeatable QA

🏢 Who This Is For

Teams that want reliable, automated inbox management:

  • Customer Support
  • Sales
  • Billing & Finance
  • Operations
  • Solo founders who need executive inbox automation
  • AI-powered enterprise workflows using Gmail

🧩 Internal Workflow Overview

  1. Gmail Trigger pulls unread emails from the inbox
  2. Email Classifier Agent (OpenAI) cleans + classifies the email
  3. Switch Node routes to the correct workflow lane
  4. Labels are added → AI responders generate the message → internal teams get notified
  5. Optional: Demo email generator + inbox cleanup for testing

🛠️ How to Set Up

  1. Add credentials:
    • Gmail OAuth2
    • OpenAI / Gemini
    • Google Sheets OAuth2
  2. Copy the demo sheet:
    https://docs.google.com/spreadsheets/d/1A959skQt0a7RbdsD0IGaCbPxMv4a-HjmQL4hwB9TcXc/edit?usp=sharing
  3. Update the Google Sheets nodes with your Document ID + Sheet Name
  4. Enable Gmail Trigger (UNREAD filter recommended)
  5. Use “Send Demo Emails” → test end-to-end behavior
  6. Run the Gmail Classifier workflow live

📦 Requirements

  • Gmail API access
  • OpenAI/Gemini API key
  • Google Sheets OAuth (for RAG/lookup)
  • n8n (latest recommended version)

🎯 Ideal Enterprise Use Cases

  • Automated customer support with AI-written replies
  • High-priority routing for executives
  • Finance & billing summarization for operations
  • Filtering promotions/marketing noise from shared inboxes
  • AI-augmented helpdesk workflows

🧪 Test Data Included

Use the Demo Sheet tabs:

  • Sample_Emails → pre-written emails for every category
  • Demo_Emails → rows sent as live test emails

Copy → paste → run.

🔖 Tags

Gmail, AI, Inbox Automation, Support Automation, Enterprise, Email Classification, OpenAI, RAG, Google Sheets


Template Author: Sandeep Patharkar
LinkedIn: https://www.linkedin.com/in/sandeeppatharkar
Skool: https://www.skool.com/aic-plus

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 - High Priority1

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

Block 2 - Customer Support1

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

Block 3 - Promotion1

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

Block 4 - Finance/Billing1

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

Block 5 - Creating Draft1

Type / Role
@n8n/n8n-nodes-langchain.openAi - openAi
Config choices
Version 1.5

Block 6 - Creating Email1

Type / Role
@n8n/n8n-nodes-langchain.openAi - openAi
Config choices
Version 1.5

Block 7 - Draft1

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

Block 8 - Auto Reply1

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

Block 9 - Send to Finance Dept1

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

Block 10 - Notify (1)1

Type / Role
n8n-nodes-base.telegram - telegram
Config choices
Version 1.2

Block 11 - Notify (2)1

Type / Role
n8n-nodes-base.telegram - telegram
Config choices
Version 1.2

Block 12 - Notify (3)1

Type / Role
n8n-nodes-base.telegram - telegram
Config choices
Version 1.2

Block 13 - Notify (4)1

Type / Role
n8n-nodes-base.telegram - telegram
Config choices
Version 1.2

Block 14 - Gmail Trigger1

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

Block 15 - Get row(s) in sheet

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 4.7

Block 16 - When clicking ‘Execute workflow’

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

Block 17 - Send Demo Emails

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

Block 18 - Sticky Note2

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

Block 19 - Mark as Read

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

Block 20 - Remove From Inbox

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

Block 21 - Mark as Read1

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

Block 22 - Remove From Inbox1

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

Block 23 - Mark as Read2

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

Block 24 - Remove From Inbox2

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

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

3. Summary Table

Workflow Classify and auto-reply to Gmail with OpenAI, Google Sheets RAG and Telegram
Complexity advanced
Nodes 43
Categories Ticket Management, AI Summarization
Author Sandeep Patharkar | www.FastTrackAiMastery.com
Published 26 Nov 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/11265/11265.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 Classify and auto-reply to Gmail with OpenAI, Google Sheets RAG and Telegram do?

Gmail Classifier —Classify emails using AI and automate responses This workflow delivers a complete, enterprise grade Gmail automation system designed for high volume teams. It classifies incomi...

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.