Skip to main content

Gmail email classifier with GPT-4 auto-generated draft replies

Workflow preview

Workflow preview
100%
Gmail email classifier with GPT-4 auto-generated draft replies preview
Open on n8n.io

Important notice

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

1. Workflow Overview

How It Works This workflow automatically classifies incoming Gmail messages into categories such as High Priority , Inquiry , and Finance/Billing , and then generates professional draft replies usi...

Best for

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

Tools used

n8n-nodes-base.gmailtrigger, n8n-nodes-base.gmail, n8n-nodes-base.stickynote, @n8n/n8n-nodes-langchain.textclassifier, @n8n/n8n-nodes-langchain.openai, @n8n/n8n-nodes-langchain.lmchatopenai

Source and attribution

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

Original n8n.io source

1.1 Workflow description

Title
Gmail email classifier with GPT-4 auto-generated draft replies
Workflow name
Gmail email classifier with GPT-4 auto-generated draft replies

How It Works

This workflow automatically classifies incoming Gmail messages into categories such as High Priority, Inquiry, and Finance/Billing, and then generates professional draft replies using GPT-4. By combining Gmail integration with AI-powered text generation, the workflow helps business owners and freelancers reduce the time spent managing emails while ensuring that important messages are handled quickly and consistently.

When a new email arrives, the workflow:

  1. Triggers via Gmail.
  2. Uses an AI classifier to categorize the message.
  3. Applies the appropriate Gmail label.
  4. Passes the email body to GPT-4 to generate a tailored draft reply.
  5. Saves the draft in Gmail, ready for review and sending.

Requirements

  • A Gmail account with API access enabled.
  • An OpenAI API key with GPT-4 access.
  • n8n account or self-hosted instance.

Setup Instructions

  1. Import this workflow into your n8n instance.
  2. Under Credentials, connect your Gmail account and OpenAI API key.
  3. Replace placeholder YOUR_LABEL_ID_XXX values with your Gmail label IDs (obtainable via Gmail → List Labels).
  4. Execute the workflow and check that draft replies are generated in your Gmail account.

Customization

  • Add or edit categories to fit your business needs (e.g., “Sales Leads” or “Support”).
  • Adjust the GPT-4 prompts inside each “Generate Draft” node to match your preferred tone and style.
  • Combine with other workflows (e.g., CRM integration, Slack alerts) for a complete email automation system.

This template is especially useful for small businesses and freelancers who want to save time, improve response speed, and maintain professional communication without manually writing every reply.

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 - Gmail Trigger

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

Block 2 - Label: High Priority

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

Block 3 - Save Draft: High Priority

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

Block 4 - Label: Inquiry

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

Block 5 - Save Draft: Inquiry

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

Block 6 - Label: Finance/Billing

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

Block 7 - Save Draft: Finance/Billing

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

Block 8 - Sticky Note1

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

Block 9 - Sticky Note

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

Block 10 - Sticky Note2

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

Block 11 - Gmail Category Classifier

Type / Role
@n8n/n8n-nodes-langchain.textClassifier - textClassifier
Config choices
Version 1.1

Block 12 - Generate Draft: High Priority

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

Block 13 - Generate Draft: Inquiry

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

Block 14 - Generate Draft: Finance/Billing

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

Block 15 - LLM Support Model

Type / Role
@n8n/n8n-nodes-langchain.lmChatOpenAi - lmChatOpenAi
Config choices
Version 1.2

3. Summary Table

Workflow Gmail email classifier with GPT-4 auto-generated draft replies
Complexity advanced
Nodes 15
Categories Ticket Management, AI Summarization
Author Supira Inc.
Published 09 Sept 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/8426/8426.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 Gmail email classifier with GPT-4 auto-generated draft replies do?

How It Works This workflow automatically classifies incoming Gmail messages into categories such as High Priority , Inquiry , and Finance/Billing , and then generates professional draft replies usi...

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.