Automate Gmail classification with OpenAI and create structured Zendesk tickets via Make.com. Includes prompt, JSON schema, idempotency keys and throttling.
Introduction
Support teams lose time when messages arrive in an inbox and someone manually reads, tags, and converts them into tickets. That cost multiplies when messages include multiple intents, missing metadata, or urgent billing issues that need immediate escalation.
This guide shows how to build a production-ready Make.com scenario that pulls new Gmail messages, sends the message text to OpenAI for structured classification, and creates a Zendesk ticket with custom fields filled from the classifier output. By the end you will have a reliable, idempotent pipeline with retries, backoff, and logging.
What you will know by the end: the exact OpenAI prompt and JSON schema to use, which Make.com modules to add, how to prevent duplicate tickets, and how to handle rate limits and errors in production.
What You'll Need
- Google Workspace account with the support mailbox and admin permission to create filters and labels
- OpenAI API key with quota suitable for your expected throughput
- Zendesk account with API access and permission to create tickets and custom fields
- Make.com account able to host webhooks and run multi-step scenarios (paid plan recommended for reliability and throughput)
- Basic Google Sheets or Make.com data store for audit logging and idempotency
Notes on plans and permissions: Gmail webhooks via Make.com and Zendesk API usage generally require admin-level consent. OpenAI costs can be significant at scale; plan for caching and batching if you have high volume.
How It Works (The Logic)
Trigger: new message arrives in Gmail with a staging label. Make.com fetches the message, extracts subject, body, sender, and message-id. The body and a short context block are sent to OpenAI with a deterministic prompt that returns a validated JSON object: category, urgency, intent, customer_id, summary, confidence.
If confidence is high the scenario creates or updates a Zendesk ticket with mapped custom fields and posts a short audit row into Google Sheets. If confidence is low the message is labelled for human triage and a low-confidence ticket is created in a separate queue.
Flow summary: Gmail label trigger → Fetch message → Dedupe check → OpenAI classify → Branch by confidence and routing → Create/update Zendesk ticket → Log result
Step-by-Step Setup
- Create Gmail staging label and lightweight pre-filter
Create a Gmail filter that applies a label like classify-inbox to inbound messages you want processed. Exclude messages already labelled classified so you do not loop. This reduces Make.com triggers and makes processing deterministic.
Gotcha: set the filter to skip the Conversation Inbox if you do not want internal thread replies processed.
- Build the OpenAI prompt and JSON schema
Use a short, strict prompt that asks for JSON only. Example schema you can validate in Make.com:
{ "category": "billing|technical|product|sales|general", "urgency": "low|medium|high", "intent": "ticket|faq|bounce|escalation", "customer_id": "string or null", "summary": "one sentence", "confidence": number }
Sample prompt: "You are a support triage assistant. Read the email below and return only JSON matching the schema: {schema}. Use only the categories and values shown. If you cannot confidently classify return confidence: 0."
Test this prompt interactively with several real emails and tune examples until classifier confidence matches human judgement.
- Create a new Scenario in Make.com and add the Gmail trigger
Add the Gmail module 'Watch emails' and set it to only trigger on the classify-inbox label. In the module set Include body so the payload contains the message text. Use a short polling interval if your plan allows it.
Gotcha: Gmail timestamps and thread behaviour can confuse dedupe checks. Use message-id as a unique key.
- Add a deduplication check using Google Sheets or Make.com data store
Before calling OpenAI, search your audit log for the message-id. If a row exists, stop the run. If not, continue and create a provisional log row with status processing and a unique run_id.
Why this matters: webhooks or retries can cause duplicate runs. A message-id key prevents duplicate Zendesk tickets.
- Call OpenAI for classification
Add the OpenAI (HTTP or connector) module. Send a payload containing subject, the first 4000 characters of the body, sender email, and any headers you want.
Ensure you request a concise JSON response. In the request include examples for edge cases. Configure timeout and retry behavior in Make.com for transient OpenAI errors.
Rate-limit note: implement a simple queue if you expect bursts, or batch non-urgent messages into small groups processed every few minutes.
- Validate and parse OpenAI output
Add a JSON validation step. If the response is not valid JSON or missing required fields, set confidence to 0 and route to the low-confidence path. If valid, parse fields and map them to variables for Zendesk creation.
Gotcha: OpenAI can hallucinate fields. Always validate keys and types before mapping into Zendesk.
- Branch by confidence and business rules
Add a router. If confidence >= 0.75 and category is known, go to the normal ticket creation branch. If confidence < 0.75, set the label needs-human-triage, create a low-priority ticket in the triage group, and notify the support lead.
Add additional business logic like: if category is billing and urgency is high, route to the finance queue.
- Create or update Zendesk ticket
Use the Zendesk connector in Make.com. For existing customers, search Zendesk by requester email. If a ticket for the same message-id exists, update it. If not, create a new ticket and set custom fields from the classifier output:
- ticket.subject = email subject
- ticket.description = classifier summary plus excerpt
- custom_field_category = category
- custom_field_urgency = urgency
- custom_field_customer_id = customer_id
- ticket.priority = map urgency to Zendesk priorities
Include the original message-id in a custom field to keep links to the email.
- Append audit row and label the Gmail message
After Zendesk creation, append a Google Sheets row with message-id, run_id, timestamp, category, confidence, ticket_id, and status created.
Update the Gmail message to remove the classify-inbox label and add classified and any routing labels like billing-high.
- Implement retries, backoff, and error handling
Configure Make.com to retry transient failures. For OpenAI 429s, use exponential backoff and a retry queue. For permanent failures, update the audit row with the error and send a short alert email to ops.
- Test thoroughly
Run with a set of representative messages: billing disputes, password resets, multi-issue emails, and messages with personal email domains. Validate:
- JSON output is valid and maps to Zendesk fields
- Idempotency prevents duplicate tickets
- Low-confidence messages go to the triage queue
- Labels applied in Gmail are correct
Real-World Business Scenario
A SaaS vendor used this pattern to triage their support inbox. Before automation, the team manually classified and routed inbound mail, creating tickets with inconsistent fields. After deploying this Make.com scenario, tickets arrived in Zendesk with category, urgency, and a short summary prefilled. The team reduced manual triage time by 60 percent and responded faster to high-urgency billing issues.
If you already use form-to-CRM or booking flows, this pattern fits alongside those automations. See our guide on connecting form submissions into CRM records for related patterns, such as How to Connect Typeform to HubSpot and Auto-Create New Leads Using Make.com, and our scheduling handoff workflow How to Create ClickUp Tasks from Calendly Bookings Using Make.com and Slack.
Common Variations
- Batch classification: process non-urgent messages in 5 minute batches to reduce OpenAI calls and cost.
- Local classifier fallback: use a lightweight keyword classifier locally for low-value messages, call OpenAI only for ambiguous or high-value ones.
- Multi-language support: detect language first and call language-specific prompts or translation before classification.
Where this leaves you
You now have a practical, production-ready architecture to classify Gmail messages with OpenAI and create structured Zendesk tickets using Make.com. The key points are a strict JSON prompt, idempotency by message-id, confidence-based routing, and audit logging.
Olmec Dynamics builds and runs these kinds of automations for businesses. If you want help implementing this pipeline or tuning the prompt, you can see examples of our work and contact us at Olmec Dynamics: https://olmecdynamics.com