Quick Overview
This workflow monitors unread Gmail support emails, uses Google Gemini to classify and summarize each message and draft a reply, logs the ticket details to Google Sheets, creates a Gmail draft response, and sends a Slack alert when the ticket is marked high priority.
How it works
- Triggers every minute when a new unread email arrives in Gmail.
- Adds brand context and support guidelines, then builds a prompt that asks Google Gemini to return a JSON classification, priority, summary, and suggested reply.
- Sends the prompt to the Google Gemini API and parses the returned JSON into structured ticket fields.
- Appends the ticket details (sender, subject, category, priority, summary, and suggested reply) to a Google Sheets tab.
- Creates a Gmail draft reply in the original thread using the suggested response text.
- Sends a Slack message to a chosen channel when the ticket priority is high.
Setup
- Connect credentials for Gmail, Google Gemini (PaLM) API, Google Sheets, and Slack.
- Update the brand name and support guidelines values used to guide Gemini’s response.
- Select the target Google Sheets spreadsheet and the “Tickets” sheet (and ensure your header columns match the fields you want to log).
- Choose the Slack channel to receive high-priority alerts.