Skip to main content

Automate email triage with GPT-4.1-mini classification and Gmail auto-replies

Workflow preview

Workflow preview
100%
Automate email triage with GPT-4.1-mini classification and Gmail auto-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: Detects new unread Gmail messages Extracts sender name for personalized replies Classifies the email into one of four categories Applies the correct Gmail label and either sends an au...

Best for

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

Tools used

n8n-nodes-base.gmailtrigger, n8n-nodes-base.if, @n8n/n8n-nodes-langchain.lmchatopenai, n8n-nodes-base.set, n8n-nodes-base.gmail, @n8n/n8n-nodes-langchain.openai, n8n-nodes-base.stickynote, @n8n/n8n-nodes-langchain.informationextractor

Source and attribution

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

Original n8n.io source

1.1 Workflow description

Title
Automate email triage with GPT-4.1-mini classification and Gmail auto-replies
Workflow name
Automate email triage with GPT-4.1-mini classification and Gmail auto-replies

How it works:

  • Detects new unread Gmail messages
  • Extracts sender name for personalized replies
  • Classifies the email into one of four categories
  • Applies the correct Gmail label and either sends an auto-reply, creates a draft, or logs the contact in Google Sheets

Setup steps:

  • Takes about 5–10 minutes to connect accounts and set labels
  • Connect Gmail, OpenAI, and optional Google Sheets in n8n
  • Add label IDs, Google Sheet ID, sheet name, and phone number in Set – Config
  • Create four Gmail labels for the categories
  • Keep full setup instructions in the sticky notes inside the workflow

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

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

Block 3 - OpenAI Chat Model

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

Block 4 - Name Found

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 5 - Name Not Found

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 6 - OpenAI Chat Model1

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

Block 7 - Label - Agency Lead

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

Block 8 - Label - Course Request

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

Block 9 - Label - Paid Collaborations

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

Block 10 - Label - Miscellaneous

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

Block 11 - Message a model

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

Block 12 - Create a draft

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

Block 13 - Sticky Note

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

Block 14 - Sticky Note1

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

Block 15 - Sticky Note2

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

Block 16 - Sticky Note3

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

Block 17 - Sticky Note4

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

Block 18 - Name Extractor

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

Block 19 - Single Intro Line

Type / Role
n8n-nodes-base.merge - merge
Config choices
Version 3.2

Block 20 - Reducing content before LLM

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 21 - AI-Classification & Sentiment Analysis

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

Block 22 - Standard Answer

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

Block 23 - Standard Answer 2

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

Block 24 - Update DB

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

3. Summary Table

Workflow Automate email triage with GPT-4.1-mini classification and Gmail auto-replies
Complexity advanced
Nodes 24
Categories Ticket Management, Multimodal AI
Author Giovanni Beggiato
Published 14 Aug 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/7399/7399.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 Automate email triage with GPT-4.1-mini classification and Gmail auto-replies do?

How it works: Detects new unread Gmail messages Extracts sender name for personalized replies Classifies the email into one of four categories Applies the correct Gmail label and either sends an au...

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, Multimodal AI use case.