Intelligent Email Classification, Response, and WhatsApp Alert System - n8n Workflow

Use this smart n8n workflow to instantly classify incoming Gmail emails using GPT. Automatically label messages, draft urgent replies, auto-respond to support tickets, and send real-time WhatsApp alerts for critical issues.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?

Individuals or businesses struggling with high email volume and inbox management.
Teams needing immediate, categorized alerts for high-priority support or financial issues.
Users looking for advanced n8n templates that seamlessly integrate AI for complex decision-making.
n8n automation specialists seeking a practical example of the LangChain classifier n8n node in action.

Overview

Managing an overwhelming inbox consumes critical time. This intelligent n8n workflow solves the problem of manual email triage by instantly classifying every incoming message and automating the subsequent steps. It leverages the power of OpenAI (GPT-4.1-Mini) to analyze email content and categorize it into five defined types (High Priority, Customer Support, Promotion, Finance/Billing, or Random).

Based on this classification, the n8n automation takes appropriate action: auto-drafting responses for urgent messages, sending instant replies to support tickets, generating concise summaries for finance or promotional content, and notifying the user immediately via WhatsApp. This robust n8n workflow transforms your email management from reactive to proactive, ensuring critical communications are never missed and low-priority items are efficiently summarized.

How it Works

This automation is initiated by a specific n8n trigger and then branches into five distinct paths based on AI classification.


  1. Trigger: The n8n workflow starts immediately upon receiving a new email using the Gmail trigger n8n node, polling every minute.

  2. Classification: The email snippet is passed to the Email Classifier n8n node (powered by OpenAI), which assigns one of five categories based on predefined descriptions.

  3. High Priority Path: If classified as 'High Priority', the email is labeled in Gmail. Then, an OpenAI n8n node generates a professional draft reply. Finally, a WhatsApp n8n node sends a critical alert containing both the original email snippet and the generated draft to the user for immediate review.

  4. Customer Support Path: If categorized as 'Customer Support', the email is labeled. A different OpenAI n8n node drafts a personalized, empathetic auto-reply, which is then sent directly using the Gmail n8n node's 'Reply' operation. A WhatsApp n8n node confirms the reply was sent, including the full auto-response text.

  5. Promotion Path: If classified as 'Promotion', the email is labeled. An OpenAI n8n node summarizes the key offer details (e.g., expiry date, offer type). A WhatsApp n8n node sends this summarized promotional alert.

  6. Finance/Billing Path: If classified as 'Finance/Billing', the email is labeled. An OpenAI n8n node summarizes the financial inquiry into a professional format. This summary is then sent as a new email to the designated internal finance team using a separate Gmail n8n node. A final Finance Alert is sent via a WhatsApp n8n node.

  7. Random Path: Unclassified emails are labeled as 'Random (General/Other)' in Gmail, completing the organization process.

Installation Guide

To deploy this powerful n8n workflow, follow these steps:


  1. Import: Copy the provided JSON data and import it directly into your n8n instance as a new workflow.

  2. Credentials Setup: This n8n workflow requires three distinct credentials:

Gmail OAuth2: Connect your primary Gmail account for the Gmail trigger and subsequent labeling/reply actions.
OpenAI API: Connect your OpenAI account (the workflow uses gpt-4.1-mini).
WhatsApp API: Set up credentials for your WhatsApp Cloud API account to enable real-time alerts.

  1. Configuration: Update the placeholder variables within the WhatsApp n8n nodes:

Replace [YOURWHATSAPPNUMBER] with the specific phone number you wish to receive alerts on.
* In the 'Send to Finance Department' Gmail n8n node, replace [YOURGMAILADDRESS] with the finance department's email address.

  1. Activation: Once credentials are set and configurations are updated, activate the n8n workflow. The Gmail trigger n8n node will now poll for new emails every minute.

Node Details

Gmail Trigger n8n node: Starts the n8n workflow upon detecting a new email in the connected Gmail inbox. Configured to poll every minute.
Email Classifier n8n node (LangChain Text Classifier): The core AI decision-maker. It uses the input email snippet ({{ $json.snippet }}) and a list of five categories with detailed definitions to classify the intent of the email.
OpenAI Chat Model n8n node (LangChain ChatOpenAi): Used within the workflow as the underlying language model (gpt-4.1-mini) for the classifier node.
Gmail n8n node (High Priority/Customer Support/Promotion/Finance/Random): These nodes apply the appropriate custom Gmail label based on the AI classification and use the original message ID to target the correct email.
Creating a Draft n8n node (OpenAI): Generates a complete draft response (Subject and Message) for 'High Priority' emails, following specific professional instructions.
Draft email n8n node (Gmail): Takes the output from the AI and saves it as an official draft reply in the user's Gmail inbox for quick manual review and sending.
Auto Reply n8n node (Gmail): Executes an automated reply for 'Customer Support' emails, using the content generated by the 'Create Email' OpenAI n8n node.
WhatsApp n8n node (High Priority Alert, Confirmation, Promotional Alert, Finance Alert): Sends formatted real-time alerts to a specific phone number, ensuring immediate notification and providing necessary context from the original email and the automated action taken by the n8n workflow.

Related n8n Workflows

Free

Nodes: 7 Nodes
Updated: December 26 2025
View all
Created by
Nabin Bhandari
Nabin Bhandari

Featured*