Automated Gmail Classification & Response System with GPT and WhatsApp Alerts
This n8n template uses AI to automatically classify incoming Gmail messages into five categories and route them to the right people or departments. It can also reply automatically and send WhatsApp alerts for urgent or relevant messages. This helps ensure high-priority emails never get missed, while other messages are handled efficiently.
##How It Works Trigger A new email in Gmail triggers the workflow.
Classification (OpenAI GPT) The email is analyzed by an OpenAI GPT model and classified into one of:
High Priority Customer Support Promotion Finance/Billing Random/Other
Conditional Logic & Actions High Priority → Create draft reply + send WhatsApp alert.
Customer Support → Auto-reply + send WhatsApp confirmation alert.
Promotion → Summarize email + send WhatsApp promotional alert.
Finance/Billing → Forward to finance team + send WhatsApp finance alert.
Random/Other → Label and log only.
Multi-Channel Output Responses are sent via Gmail. Alerts are sent via WhatsApp (or another compatible API).
##Setup Instructions Step 1: Gmail Authorization Add a Gmail node in n8n. Connect using OAuth2 and grant read/send permissions.
Step 2: OpenAI API Key Get your API key from OpenAI. Add it to n8n credentials for the OpenAI node.
Step 3: WhatsApp Integration Use your WhatsApp Business API or a provider like Twilio or 360Dialog.
Replace placeholders with your details:
[YOUR_WHATSAPP_NUMBER] [YOUR_FINANCE_TEAM_NUMBER] [YOUR_SUPPORT_TEAM_NUMBER]
Step 4: Import & Run Import the workflow JSON into n8n. Adjust prompts, labels, and routing logic as needed. Execute and monitor results.
##Good to Know Fully customizable — add or remove categories, adjust responses, and change alert channels.
Can be integrated with Slack, Discord, Trello, Notion, Jira, or CRM systems.
Scales easily across teams and departments.
##Requirements Gmail account with OAuth2 credentials set up in n8n
OpenAI API key for classification and content generation
WhatsApp (or other messaging service) integration
Optional: Slack, Notion, CRM, or accounting tool integrations
##Customization Ideas Create support tickets in Trello, Notion, or Jira from Customer Support emails.
Sync Finance emails with QuickBooks, Stripe, or Google Sheets.
Replace WhatsApp alerts with Slack or Discord messages.
Use Zapier/Make for cross-platform automations.
Related Templates
Convert JSON Objects to Base64 Strings with File Processing
Encode JSON to Base64 String in n8n This example workflow demonstrates how to convert a JSON object into a base64-encod...
AI Agent with Ollama for current weather and wiki
This workflow template demonstrates how to create an AI-powered agent that provides users with current weather informati...
Automate Daily YouTrack Task Summaries to Discord by Assignee
Daily YouTrack In-Progress Tasks Summary to Discord by Assignee Keep your team in sync with a daily summary of tasks cu...
🔒 Please log in to import templates to n8n and favorite templates
Workflow Visualization
Loading...
Preparing workflow renderer
Comments (0)
Login to post comments