Automated email classification & response system with Gmail, GPT, and Sheets
Email Automation Workflow Template This n8n template demonstrates how to automate email classification, labeling, draft generation, and logging using Gmail, OpenAI, and Google Sheets. Use cases include customer suppor...
Template notes
Email Automation Workflow Template
This n8n template demonstrates how to automate email classification, labeling, draft generation, and logging using Gmail, OpenAI, and Google Sheets. Use cases include customer support management, sales inquiry handling, and keeping track of incoming emails efficiently in a structured way.
---
Good to know
- Gmail OAuth2 credentials are required for sending, labeling, and drafting emails. - OpenAI credentials are needed for generating draft responses. - Google Sheets must have Logs and Errors sheets with the correct columns (Original Email, Decision, Output Email for Logs; Node with Error, Error Message, Time, Execution ID, Workflow ID for Errors). - The workflow is designed to handle multiple emails simultaneously and continues even if a node fails.
---
How it works
1. The workflow is triggered by new emails in Gmail. 2. Emails are classified into categories: Support, Sales, Complaints, Information, or Other. 3. Based on the classification: - Support and Sales emails → Draft response generated with OpenAI and labeled in Gmail. - Complaints, Information, and Other → Emails labeled accordingly. 4. All processed emails and generated outputs are logged in Google Sheets (Logs). 5. Any workflow errors are captured in the Errors sheet for debugging.