Automatically classify and route Gmail to Support, Sales, or Spam using Make.com and OpenAI. Step-by-step build, prompts, thresholds, and Slack routing.
Introduction
If your support and sales teams spend time triaging the inbox, you know the routine: open a message, read, guess category, forward, label, repeat. That manual triage costs time and introduces human error when volume spikes.
By the end of this guide you will have a production-ready Make.com scenario that watches Gmail for new messages, sends a compact payload to OpenAI for structured classification, then applies Gmail labels, forwards messages or notifies channels in Slack, and writes an audit row to Google Sheets.
Primary keyword: classify and route Gmail using Make.com and OpenAI
What You'll Need
- A Google Workspace account with Gmail access and ability to create OAuth connections. (Gmail API scopes required.)
- A Make.com account with paid plan that allows HTTP/OpenAI modules and app connections, and enough operations for your email volume.
- An OpenAI API key (use a model appropriate for structured JSON output).
- A Slack workspace where you can post to channels or DM users via a bot token.
- Google Sheets for logging (free tier fine).
- Basic familiarity with JSON and prompt design.
How It Works (The Logic)
When a new unread email arrives in Gmail, Make.com fetches the message body and headers, constructs a compact payload, then calls OpenAI asking for a strict JSON classification (intent, confidence, rationale). Make.com parses OpenAI's JSON and follows rules: apply Gmail label(s), forward or create ticket, send a Slack notification for low-confidence or high-priority items, and append a log row to Google Sheets. Message-ID is used to ensure idempotency.
Step-by-Step Setup
-
Create helper Gmail labels and Slack channels
- In Gmail create labels: Classified/Support, Classified/Sales, Classified/Spam, Classified/Review.
- In Slack, create channels: #inbound-support and #inbound-sales or use existing team channels.
-
Make.com scenario: Trigger, fetch, and decode
- Module 1: Gmail, "Watch Emails" or "List Messages" with query
is:unread label:INBOX. - Module 2: Gmail, "Get a Message" using messageId from Module 1, format "full". Map messageId, threadId, headers, and payload.
- Gotcha: Gmail payloads are multipart. Use a JSON tool or Make.com custom parsing to extract the first text/plain part, if missing fall back to stripped HTML. Decode base64url where necessary.
- Module 1: Gmail, "Watch Emails" or "List Messages" with query
-
Build the OpenAI request
- Module 3: OpenAI (or Make.com HTTP if you prefer) to call the Chat Completions or Responses endpoint.
- Prompt requirements: ask for one JSON object only. Use this strict system/user pairing:
- System: "You are an email routing assistant. Return only JSON with keys: intent, confidence, rationale. intent must be one of: SUPPORT, SALES, SPAM, OTHER. confidence is a decimal 0-1. rationale is a short sentence."
- User content: include From, Subject, first 800 characters of body_text (trim long bodies), and date.
- Example user prompt payload (compact): { "From": "{{from_email}}", "Subject": "{{subject}}", "Body": "{{body_text_truncated}}" }
- Gotcha: Trim long bodies before sending to control cost and latency. Preserve cues like pricing, demo requests, issue words, unsubscribe.
-
Parse OpenAI response and validate schema
- Module 4: JSON parse of OpenAI response. Validate that intent is one of the allowed values. If parsing or schema validation fails, set intent=OTHER and confidence=0.0.
- Implement a confidence threshold decision table (use a Make.com Router):
- If intent == SPAM and confidence >= 0.9, apply Spam label and archive.
- If intent == SALES and confidence >= 0.75, apply Sales label, forward to sales@yourdomain.com, and post a compact summary to #inbound-sales on Slack.
- If intent == SUPPORT and confidence >= 0.70, apply Support label, create a placeholder ticket (or forward), and message #inbound-support with links.
- If confidence < 0.65 or intent == OTHER, apply Review label and post to a #inbound-review channel for human triage.
- Gotcha: Use Message-ID or Gmail messageId to check Google Sheets log before acting. If already processed, stop.
-
Apply Gmail actions and notifications
- Module 5: Gmail, "Modify Message" to add labelIds for the chosen label(s) and optionally mark as read or archive.
- Module 6: If forwarding required, Gmail "Send Email" with the original message forwarded and a prefixed summary that includes the rationale and confidence.
- Module 7: Slack, "Post message" to the designated channel. Include subject, from, top 250 chars of body, intent, confidence, and a Make.com link back to the Gmail message.
-
Audit logging and monitoring
- Module 8: Google Sheets, append a row with: messageId, threadId, from, subject, intent, confidence, rationale, actions taken, processed_at.
- Optional: Add an aggregated daily digest using a scheduled Make.com scenario that emails a CSV of low-confidence items.
-
Error handling and retries
- Add a fallback branch: if OpenAI times out or returns invalid JSON, label Review and notify #inbound-review with the original message summary.
- Use Make.com retries for transient HTTP failures. For persistent failures, increment an error counter in the Google Sheet and alert an admin via Slack.
Real-World Business Scenario
A SaaS company we worked with processed 1,200 inbound inquiries per week. Before automation, support agents manually read and triaged each message. After deploying this Make.com + OpenAI workflow, 62% of emails were auto-labeled and routed without human touch, priority issues reached support channels instantly, and weekly triage time dropped by 8 staff-hours. Confidence thresholds and a manual review queue prevented misroutes for ambiguous messages.
Common Variations
- Batch classification: instead of real-time, run a scheduled scenario that processes a label like "To classify" every 5 minutes for rate-limited accounts.
- Two-stage model: use a small, cheaper model for first-pass classification and only call a higher-capability model for low-confidence cases.
- Replace forwarding with ticket creation: integrate with Zendesk, Freshdesk, or a custom API to create tickets instead of forwarding emails.
Final notes and next steps
You now have a concrete architecture and exact Make.com module flow to classify and route Gmail using OpenAI. Implement the schema validation, confidence thresholds, and idempotency checks described here to keep the system reliable in production. If you want help building this end to end or tailoring prompts and thresholds for your team, Olmec Dynamics builds bespoke automations like this, you can see what we do at Olmec Dynamics.
No related posts found in our blog index to link for this topic at time of writing.