This workflow is an AI-assisted customer support automation built in n8n. It monitors incoming customer emails from Gmail, analyzes the message using AI, classifies the issue type, detects sentiment and priority, generates a professional draft response, logs the ticket in Google Sheets, and alerts the support team on Slack when urgent attention is required.

How the Workflow Works

When a new email arrives, the Gmail Trigger node captures the customer’s message. The first AI agent classifies the request into one of five categories: Billing, Technical, Refund, Feature Request, or General Query. This helps route and organize support tickets consistently.

image.png

A second AI agent performs sentiment and priority analysis. It identifies whether the customer’s tone is Positive, Neutral, or Negative, and assigns a priority level of Low, Medium, or High based on rules such as refund requests, payment failures, angry customers, login issues, or general information requests.

The response generation agent then creates a polite, concise, and empathetic draft email. The draft acknowledges the customer’s issue, explains the next steps, and avoids making unsupported promises such as refunds, discounts, or policy exceptions.

After the AI outputs are generated, a normalization step parses and cleans the responses into a structured ticket format. This includes the ticket ID, timestamp, customer email, subject, query, category, sentiment, priority, draft response, escalation status, and review status.

The workflow then performs three actions in parallel: it logs the ticket into Google Sheets, creates a Gmail draft for manual review, and checks whether the ticket should be escalated. If the priority is high or the sentiment is negative, the workflow sends a Slack notification to the support team with the customer query, AI-generated draft, and review instructions.

Key Features

Tech Stack

n8n, Gmail, OpenRouter AI Models, Google Sheets, Slack, and custom JavaScript normalization logic.

User Prompts

The following section lists down all the user prompts used by respective agents.