Support ticket categorization with AI sentiment and reports (n8n)
Model notice
Before anything else: the template is set to models/gemini-2.0-flash, which Google shut down on June 1, 2026, so swap in gemini-3.6-flash (Google's listed replacement) in the Gemini chat model node. As shipped, the AI step fails, and because storage comes after it, tickets aren't even logged.
At a glance
- Setup estimate
- 1 h (ESTIMATE)
- Tools
- Industries
- SaaS, E-commerce, Agencies & consultancies, Healthcare & wellness
Problem
Requests arrive unsorted, and nobody sees trends
Who it's for
SaaS companies, online shops, agencies and service businesses that take support requests through a web form rather than a help desk. The trigger: requests pile up unsorted, and you want each one labeled (Billing, Bug Report, Feature Request, How-To, Complaint) with a sentiment, stored in a sheet, and a count by category emailed to the team.
Skip it if you already use a help desk with built-in tagging, or if requests contain health or other sensitive data you can't send to an AI provider.
Tools and what each does
- Typeform Trigger
- Fires on each new submission of your support form (fields named 'Enter your name', 'Enter your email', 'Your message').
- Basic LLM Chain + Google Gemini chat model
- Asks the model to return JSON with one category from the five above and a sentiment of Positive, Neutral or Negative.
- Code: Extract Category
- Strips ```json fences from the reply and parses the category and sentiment.
- Google Sheets (Store Data, then Fetch)
- Appends Name, Email, Message, Category, Sentiment and Timestamp, then reads the whole sheet back.
- Code: Increment Counter
- Counts rows per category across the entire sheet.
- Send Email (SMTP)
- Emails the category counts to a fixed address.
Browse by tool: n8n, Typeform, Google Gemini, Google Sheets
Steps
- A customer submits your Typeform support form.
- Gemini classifies the message into one category and one sentiment, returned as JSON.
- The Code node cleans and parses that JSON.
- Google Sheets appends a row with the customer's name, email, message, category, sentiment and a timestamp.
- The workflow reads every row in the sheet and counts tickets per category.
- An SMTP email titled 'Support Ticket Summary' lists the counts for the five categories.
Known problems in the source template
Found by reading the template's JSON, not by running it. Likely fails as shipped.
Problem: The 'report' is sent after every single submission, counts all tickets ever stored rather than today's, and contains no sentiment figures, unlike the daily sample in the template description. Its To address is [email protected].
Fix: Move the report to a daily schedule that counts that day's tickets, and set your own To address.
Problem: The Typeform form ID and Google Sheet ID are the author's.
Fix: Replace both with your own.
Before you start
- A Typeform account and a form with the three fields above (or matching changes to the field names in the nodes). Other form tools can be swapped in.
- A Google Gemini API key.
- A Google account connected to n8n and your own sheet with Name, Email, Message, Category, Sentiment and Timestamp columns.
- SMTP credentials, and the report's To and From addresses.
- Setup estimate: 1 h (ESTIMATE).
What can go wrong
Needs a Google Gemini API key, a Typeform account (other form tools can be swapped in) and SMTP email. Ticket text and customer details are sent to Google Gemini, so don't route health or other sensitive data through it without checking each provider's privacy terms. Spot-check AI categories and sentiment.
- Silent failureIf the model wraps its JSON in extra words, JSON.parse throws and that ticket is never stored. Add an error branch or a structured output parser.
- Data privacyCustomer names, emails and message text go to Google Gemini and sit in a Google Sheet. Check the Gemini API terms for how prompts are handled on your tier, and don't route health or other sensitive data through it.
- ReliabilitySpot-check categories and sentiment. Five fixed categories mean anything else (a refund that's also a complaint) is forced into one bucket.
How to adapt it
- Split the report off into its own workflow on a Schedule Trigger (daily or weekly) and filter rows by Timestamp, so the team gets one email per period.
- Add sentiment counts to the email, and a list of Negative/Complaint tickets with their messages.
- Route Complaints or Negative tickets straight to Slack or a phone alert with a Switch node after classification.
- Change the category list in the prompt and in the email together; the counter works on whatever labels you use.
- Replace the Typeform Trigger with n8n's own Form Trigger or a Google Forms sheet if you don't use Typeform.
Sources we checked
- Source template: n8n.io workflow 4447 checked
- Template JSON via n8n templates API checked
- Gemini API deprecations checked
- Status
- Researched: Sourced and summarized, not yet run end-to-end by us
- Last checked
- Details checked
Setup estimates are rough guesses for someone comfortable with the tools who already has the accounts and API keys. Real time is unknown until tested.