Introduction Your support team receives a ticket in Spanish at 2 AM.
It sits in the queue for six hours because nobody on your morning shift speaks the language fluently. When it finally gets assigned, the agent spends 20 minutes composing a response from scratch, fact-checking with your knowledge base, and writing it out. By then, your customer has already left a negative review. This scenario plays out thousands of times every week across global companies. Support tickets arrive in a mix of languages and urgency levels. Your team sorts them manually, categorises them by language, and drafts responses from scratch. The entire process is slow, prone to mistakes, and burns through your budget on junior staff doing clerical work instead of handling genuinely complex issues. The solution is to automate the entire triage and response drafting workflow. By combining language detection, priority classification, and intelligent response generation, you can have high-quality draft responses waiting in your ticketing system within seconds of a ticket arriving. This post shows you exactly how to build that system.
The Automated Workflow We will use n8n as the orchestration backbone because it handles webhooks reliably, stores structured data without friction, and integrates natively with both ChatGPT Writer and Okara AI.
The workflow will listen for new support tickets, detect the language, classify priority, draft a response, and post the draft back to your ticketing system. The workflow steps are: 1. Webhook trigger from your ticketing system (Zendesk, Freshdesk, Intercom, or custom API).
-
Language detection using GPT-4.1 mini.
-
Priority classification using the same model.
-
Response generation using GPT-4o for complex tickets or GPT-4.1 mini for routine ones.
-
Encryption and storage in Okara AI for sensitive tickets.
-
Posting the draft back to your ticketing system as an internal note. Setting up the webhook trigger in n8n: Create a new workflow in n8n and add a Webhook node. Configure it to accept POST requests. Your ticketing system will send data in this format:
json
{ "ticket_id": "TKT-12847", "customer_email": "maria@example.com", "subject": "Problema con mi factura", "body": "No puedo acceder a mi cuenta. Me da un error 403.", "created_at": "2026-03-15T14:22:00Z", "priority": "unassigned"
}
Copy the webhook URL and register it in your ticketing system's outgoing webhook settings. Test it by sending a sample ticket. Language detection node: Add an OpenAI node after the webhook. Configure it to call GPT-4.1 mini with this prompt:
Detect the language of the following customer support ticket and respond only with the ISO 639-1 language code (e.g. en, es, fr, de, ja, zh). Ticket:
{{ $json.body }}
{{ $json.subject }}
Store the result in a variable called language_code. You should also extract the full language name for later use:
Respond with a JSON object: {"code": "es", "name": "Spanish"}
Priority classification node: Add another OpenAI node. This time, use GPT-4.1 mini to classify the ticket as urgent, high, medium, or low:
Classify the following support ticket by priority based on urgency, customer sentiment, and business impact. Subject: {{ $json.subject }}
Body: {{ $json.body }} Respond with only a JSON object: {"priority": "high", "reason": "Account access blocked", "estimated_resolution_time_hours": 1}
Store these values in separate variables: ticket_priority, priority_reason, and est_resolution_time. Conditional response generation: Now add a Switch node that branches based on the ticket_priority variable. This ensures you use the right model for the right ticket. For routine tickets (medium and low priority), use GPT-4.1 mini for speed and cost savings. For urgent and high-priority tickets, use GPT-4o for better reasoning. Routine ticket response generation (GPT-4.1 mini):
You are a professional customer support agent. Draft a response to this ticket in {{ $json.language_name }}. Ticket Subject: {{ $json.subject }}
Ticket Body: {{ $json.body }}
Priority: {{ $json.priority }} Guidelines:
- Keep the response under 200 words.
- Be empathetic and professional.
- Offer a concrete next step.
- Do not make promises you cannot keep. Respond with only the draft message, no additional commentary.
Complex ticket response generation (GPT-4o):
You are a senior customer support specialist. This is a high-priority or complex ticket that requires careful attention. Draft a response in {{ $json.language_name }}. Ticket Subject: {{ $json.subject }}
Ticket Body: {{ $json.body }}
Priority: {{ $json.ticket_priority }}
Reason for priority: {{ $json.priority_reason }} Guidelines:
- Address the root cause of the issue.
- Provide multiple solutions if applicable.
- Anticipate follow-up questions.
- Be empathetic and professional.
- Offer escalation options if needed. Respond with only the draft message, no additional commentary.
Okara AI encryption for sensitive data: For tickets containing payment information, personal data, or security issues, route them through Okara AI before response generation. This ensures sensitive details are encrypted and only visible to authorised staff. Add a Switch node that checks for keywords like "payment", "credit card", "password", "breach", "ssn", or "bank account". If found, send the ticket body and subject to Okara AI first:
POST /api/v1/encrypt
Content-Type: application/json
Authorization: Bearer {{ env.OKARA_API_KEY }} { "ticket_id": "{{ $json.ticket_id }}", "data": { "subject": "{{ $json.subject }}", "body": "{{ $json.body }}" }, "recipients": ["support-team@company.com"], "auto_delete_days": 30
}
The Okara API returns an encrypted link. Store this in a variable and include it in the final response draft instead of the raw sensitive data. Posting the draft back to your ticketing system: After the response is generated, add a final node that sends the draft back to your ticketing system as an internal note. For Zendesk, the endpoint is:
PUT /api/v2/tickets/{{ $json.ticket_id }}.json
Content-Type: application/json
Authorization: Bearer {{ env.ZENDESK_API_KEY }} { "ticket": { "comment": { "body": "**DRAFT RESPONSE** (Auto-generated by Alchemy workflow)\n\nLanguage: {{ $json.language_name }}\nPriority: {{ $json.ticket_priority }}\nEstimated resolution time: {{ $json.est_resolution_time }} hours\n\n---\n\n{{ $json.draft_response }}", "public": false }, "priority": "{{ $json.ticket_priority }}" }
}
For Freshdesk, adjust the endpoint to /api/v2/tickets/{{ $json.ticket_id }}.json and use the same structure. For custom systems, map the fields accordingly. Error handling and retries: Add error handling nodes after each API call. If language detection fails, default to English and flag the ticket for manual review. If response generation times out, catch the error and post a note asking a human agent to take over:
{ "status": "error", "message": "Response generation timed out. Please handle manually.", "ticket_id": "{{ $json.ticket_id }}", "timestamp": "{{ $now.toIso() }}"
}
The Manual Alternative If you prefer more control over individual tickets before they are sent, you can run this workflow in "draft-only" mode.
Instead of automatically posting responses to your ticketing system, the workflow saves drafts to a shared Google Sheet or Airtable base. Your support team reviews each draft, edits it as needed, and approves it before sending. This approach takes longer but gives your team the final say on tone, accuracy, and brand voice. Use an Airtable node at the end of the workflow instead of the ticketing system node:
POST /v0/{{ env.AIRTABLE_BASE_ID }}/Draft%20Responses
Content-Type: application/json
Authorization: Bearer {{ env.AIRTABLE_API_KEY }} { "records": [ { "fields": { "Ticket ID": "{{ $json.ticket_id }}", "Language": "{{ $json.language_name }}", "Priority": "{{ $json.ticket_priority }}", "Customer Email": "{{ $json.customer_email }}", "Draft Response": "{{ $json.draft_response }}", "Status": "Pending Review" } } ]
}
Your team can then filter by priority, language, or status, review the draft, and approve it with a single click.
Pro Tips Batch similar languages together. If your support team has multilingual speakers, group draft generation by language.
This makes it easier to assign tickets to the right person and improves consistency in tone. Monitor API rate limits closely. GPT-4o has stricter rate limits than GPT-4.1 mini. If your workflow hits rate limits during peak hours, switch complex tickets to Claude Opus 4.6, which often has higher rate limits depending on your plan. n8n will queue requests automatically, but this adds latency. Store response templates by category. Before running the workflow, ask GPT-4.1 mini to categorise each ticket (billing issue, account access, feature request, bug report, etc.). Use this category to inject relevant knowledge base articles or pre-written guidelines into the response generation prompt. This dramatically improves draft quality. Test your webhook authentication. The most common failure point is authentication between your ticketing system and n8n. Ensure API keys are stored as environment variables in n8n, not hardcoded. Test the connection once with a sample ticket before going live. Set up alerts for failed tickets. Add a Slack notification node that fires whenever a ticket fails language detection, priority classification, or response generation. This helps you catch systematic problems early (e.g. your ticketing system changed its API response format).
Cost Breakdown
| Tool | Plan Needed | Monthly Cost | Notes |
|---|---|---|---|
| n8n Cloud | Team (paid) | £24 | Handles webhooks, scheduling, and conditional logic. Self-hosted option available for £0 if you run your own server. |
| OpenAI API (GPT-4.1 mini) | Pay-as-you-go | £5-15 | Language detection and routine responses. Approximately 500-2000 tokens per ticket. |
| OpenAI API (GPT-4o) | Pay-as-you-go | £15-40 | Complex ticket responses. Approximately 1500-3000 tokens per ticket. |
| Okara AI | Standard | £30 | Encryption and secure storage for sensitive tickets. Optional depending on compliance requirements. |
| Zendesk API | Included with plan | £0 | Your existing ticketing system. No additional cost for API calls. |
| Total (approximate) | , | £74-129 | Scales with ticket volume. Typical support team processes 500-1000 tickets per month. |