π« Triage and draft support email replies with Gmail and OpenAI GPT-4.1
β‘ 162 views Β· π« Ticket Management & Triage
Description
Quick Overview
This workflow monitors a Gmail inbox for unread support emails, uses OpenAI-powered multi-agent triage to route each message to a billing, technical, or account specialist, and then creates a drafted reply back in the same Gmail thread for human review.
How it works
- Triggers every minute when a new unread email arrives in Gmail.
- Extracts and normalizes the sender email address, subject line, plain-text body, and Gmail thread ID.
- Sends the email content to an OpenAI-based orchestrator that assigns priority and routes the request to exactly one specialist (Billing, Technical, or Account).
- The selected specialist uses OpenAI to draft a domain-appropriate customer reply, while the orchestrator returns a structured result including category, priority, draft_reply, and whether human handling is needed.
- Creates a Gmail draft reply using the generated text and attaches it to the original thread with a βRe:β subject for review before sending.
Setup
- Connect a Gmail OAuth2 credential for both the Gmail Trigger (reading unread emails) and Gmail node that creates the draft reply.
- Add an OpenAI API credential for the orchestrator model and each specialist model.
- (Optional) Adjust the Gmail Trigger filters (for example, restrict to a specific support label) to control which emails are triaged.
π Nodes Used
Gmail, Gmail Trigger, AI Agent, OpenAI Chat Model, Structured Output Parser, AI Agent Tool
π₯ Import
Download workflow.json and import into n8n:
Workflow menu β Import from File