This workflow corresponds to n8n.io template #14826 — we link there as the canonical source.
This workflow follows the Agent → HTTP Request recipe pattern — see all workflows that pair these two integrations.
The workflow JSON
Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →
{
"meta": {
"templateCredsSetupCompleted": true
},
"nodes": [
{
"id": "94cd9674-983f-47f4-ae32-df54556141e3",
"name": "Email Trigger (IMAP)",
"type": "n8n-nodes-base.emailReadImap",
"position": [
-1328,
416
],
"parameters": {
"options": {}
},
"typeVersion": 2.1
},
{
"id": "f531a644-2fbd-4509-ac1d-f7c4a0229b76",
"name": "Webhook Trigger",
"type": "n8n-nodes-base.webhook",
"position": [
-1184,
544
],
"parameters": {
"path": "support-ticket",
"options": {},
"httpMethod": "POST",
"responseMode": "lastNode"
},
"typeVersion": 2.1
},
{
"id": "9f2d29fe-938c-4a07-a5ab-e45e46040367",
"name": "Workflow Configuration",
"type": "n8n-nodes-base.set",
"position": [
-864,
432
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "id-1",
"name": "crmApiUrl",
"type": "string",
"value": "<__PLACEHOLDER_VALUE__CRM/Helpdesk API URL__>"
},
{
"id": "id-2",
"name": "escalationWebhookUrl",
"type": "string",
"value": "<__PLACEHOLDER_VALUE__Escalation Webhook URL__>"
},
{
"id": "id-3",
"name": "observabilityEndpoint",
"type": "string",
"value": "<__PLACEHOLDER_VALUE__Observability Logging Endpoint__>"
}
]
},
"includeOtherFields": true
},
"typeVersion": 3.4
},
{
"id": "5807dd75-bd42-488f-8b38-33e7c9090dc0",
"name": "Clean HTML",
"type": "n8n-nodes-base.html",
"position": [
-640,
432
],
"parameters": {
"options": {},
"operation": "extractHtmlContent",
"dataPropertyName": "={{ $json.html || $json.body || $json.text }}",
"extractionValues": {
"values": [
{}
]
}
},
"typeVersion": 1.2
},
{
"id": "b5d78aa5-8191-44c9-953a-eb9e70b29ca2",
"name": "Normalize Ticket Data",
"type": "n8n-nodes-base.set",
"position": [
-448,
432
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "id-1",
"name": "ticket_id",
"type": "string",
"value": "={{ $json.id || $json.messageId || $now }}"
},
{
"id": "id-2",
"name": "user_email",
"type": "string",
"value": "={{ $json.from || $json.email }}"
},
{
"id": "id-3",
"name": "original_message",
"type": "string",
"value": "={{ $json.text }}"
},
{
"id": "id-4",
"name": "timestamp",
"type": "string",
"value": "={{ $now }}"
},
{
"id": "id-5",
"name": "source_channel",
"type": "string",
"value": "={{ $json.source || \"email\" }}"
}
]
},
"includeOtherFields": true
},
"typeVersion": 3.4
},
{
"id": "fbf994d0-0641-48ad-94c3-30e97cbebe8a",
"name": "Language Detection & Translation Agent",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
-224,
432
],
"parameters": {
"text": "={{ $json.original_message }}",
"options": {
"systemMessage": "You are a language detection and translation specialist.\n\nYour task is to:\n1. Detect the language of the provided message\n2. If the language is NOT English, translate it to English while preserving meaning and tone\n3. If the language is already English, return the original text\n4. Provide a confidence score (0-1) for your language detection\n\nReturn your response in the exact JSON format specified by the output parser."
},
"promptType": "define",
"hasOutputParser": true
},
"typeVersion": 3
},
{
"id": "b662fa18-eab1-4ebf-b49f-0f83d8160bb9",
"name": "Anthropic Model - Translation",
"type": "@n8n/n8n-nodes-langchain.lmChatAnthropic",
"position": [
-224,
656
],
"parameters": {
"model": {
"__rl": true,
"mode": "list",
"value": "claude-sonnet-4-5-20250929",
"cachedResultName": "Claude Sonnet 4.5"
},
"options": {}
},
"typeVersion": 1.3
},
{
"id": "b5995109-2cd4-4eb4-9b13-d49d8bdc3f51",
"name": "Translation Output Parser",
"type": "@n8n/n8n-nodes-langchain.outputParserStructured",
"position": [
-96,
656
],
"parameters": {
"schemaType": "manual",
"inputSchema": "{\n\t\"type\": \"object\",\n\t\"properties\": {\n\t\t\"original_language\": {\n\t\t\t\"type\": \"string\",\n\t\t\t\"description\": \"ISO language code detected\"\n\t\t},\n\t\t\"translated_text\": {\n\t\t\t\"type\": \"string\",\n\t\t\t\"description\": \"English translation or original if already English\"\n\t\t},\n\t\t\"confidence\": {\n\t\t\t\"type\": \"number\",\n\t\t\t\"description\": \"Confidence score 0-1 for language detection\"\n\t\t}\n\t}\n}"
},
"typeVersion": 1.3
},
{
"id": "38fb7221-a88a-42ff-af54-1e66fd934355",
"name": "Support Intelligence Agent",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
128,
432
],
"parameters": {
"text": "={{ $json.translated_text }}",
"options": {
"systemMessage": "You are a senior support analyst specializing in ticket classification and triage.\n\nAnalyze the provided support message and classify it according to these criteria:\n\n1. **Sentiment**: positive, neutral, or negative\n2. **Urgency**: low, medium, high, or critical\n3. **Category**: billing, bug, feature_request, account, technical, or other\n4. **Summary**: A concise 1-2 line summary of the issue\n5. **Churn Risk**: Score from 0 to 1 indicating likelihood of customer churn\n6. **Recommended Path**: auto_reply, escalate, or engineering\n\nBe thorough and accurate. Return your analysis in the exact JSON format specified."
},
"promptType": "define",
"hasOutputParser": true
},
"typeVersion": 3
},
{
"id": "2a8056e0-fb4d-45ae-a3d9-55418e22ed67",
"name": "Anthropic Model - Intelligence",
"type": "@n8n/n8n-nodes-langchain.lmChatAnthropic",
"position": [
128,
656
],
"parameters": {
"model": {
"__rl": true,
"mode": "list",
"value": "claude-sonnet-4-5-20250929",
"cachedResultName": "Claude Sonnet 4.5"
},
"options": {}
},
"typeVersion": 1.3
},
{
"id": "3b36035f-2435-40f6-b93d-a6b24648e7f6",
"name": "Intelligence Output Parser",
"type": "@n8n/n8n-nodes-langchain.outputParserStructured",
"position": [
256,
656
],
"parameters": {
"schemaType": "manual",
"inputSchema": "{\n\t\"type\": \"object\",\n\t\"properties\": {\n\t\t\"sentiment\": {\n\t\t\t\"type\": \"string\",\n\t\t\t\"enum\": [\"positive\", \"neutral\", \"negative\"],\n\t\t\t\"description\": \"Sentiment of the support ticket\"\n\t\t},\n\t\t\"urgency\": {\n\t\t\t\"type\": \"string\",\n\t\t\t\"enum\": [\"low\", \"medium\", \"high\", \"critical\"],\n\t\t\t\"description\": \"Urgency level of the ticket\"\n\t\t},\n\t\t\"category\": {\n\t\t\t\"type\": \"string\",\n\t\t\t\"enum\": [\"billing\", \"bug\", \"feature_request\", \"account\", \"technical\", \"other\"],\n\t\t\t\"description\": \"Category of the support ticket\"\n\t\t},\n\t\t\"summary\": {\n\t\t\t\"type\": \"string\",\n\t\t\t\"description\": \"Brief 1-2 line summary\"\n\t\t},\n\t\t\"churn_risk\": {\n\t\t\t\"type\": \"number\",\n\t\t\t\"description\": \"Score 0-1\",\n\t\t\t\"minimum\": 0,\n\t\t\t\"maximum\": 1\n\t\t},\n\t\t\"recommended_path\": {\n\t\t\t\"type\": \"string\",\n\t\t\t\"enum\": [\"auto_reply\", \"escalate\", \"engineering\"],\n\t\t\t\"description\": \"Recommended action path for the ticket\"\n\t\t}\n\t},\n\t\"required\": [\"sentiment\", \"urgency\", \"category\", \"summary\", \"churn_risk\", \"recommended_path\"]\n}"
},
"typeVersion": 1.3
},
{
"id": "cb696409-0fea-40fe-8abb-3e77df06373a",
"name": "Decision Router",
"type": "n8n-nodes-base.switch",
"position": [
576,
416
],
"parameters": {
"rules": {
"values": [
{
"outputKey": "Auto Reply",
"conditions": {
"options": {
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"operator": {
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $json.recommended_path }}",
"rightValue": "auto_reply"
}
]
},
"renameOutput": true
},
{
"outputKey": "Escalate",
"conditions": {
"options": {
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "or",
"conditions": [
{
"operator": {
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $json.urgency }}",
"rightValue": "critical"
},
{
"operator": {
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $json.recommended_path }}",
"rightValue": "escalate"
}
]
},
"renameOutput": true
}
]
},
"options": {
"ignoreCase": true,
"fallbackOutput": "extra",
"renameFallbackOutput": "Escalate"
}
},
"typeVersion": 3.4
},
{
"id": "612315ef-ca8e-4109-a72b-a3b8618bfbb1",
"name": "Draft Reply Generator",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
896,
112
],
"parameters": {
"text": "=Original message: {{ $json.original_message }}\n\nCategory: {{ $json.category }}\nSentiment: {{ $json.sentiment }}\nUrgency: {{ $json.urgency }}",
"options": {
"systemMessage": "You are a professional customer support representative.\n\nDraft a reply to the customer based on the provided ticket information:\n- Use an empathetic and professional tone\n- Provide clear and actionable solutions when possible\n- Keep the response under 200 words\n- Do NOT make promises about features or timelines unless explicitly stated\n- Do NOT hallucinate information\n- If you cannot provide a solution, acknowledge the issue and indicate it will be reviewed\n\nReturn ONLY the draft reply text, nothing else."
},
"promptType": "define"
},
"typeVersion": 3
},
{
"id": "709cfaed-f51e-475b-8da5-f8c1c6e318c3",
"name": "Anthropic Model - Reply",
"type": "@n8n/n8n-nodes-langchain.lmChatAnthropic",
"position": [
880,
352
],
"parameters": {
"model": {
"__rl": true,
"mode": "list",
"value": "claude-sonnet-4-5-20250929",
"cachedResultName": "Claude Sonnet 4.5"
},
"options": {}
},
"typeVersion": 1.3
},
{
"id": "7be958ba-ce7b-4bd2-807d-a713cf5363ab",
"name": "Update CRM/Helpdesk",
"type": "n8n-nodes-base.httpRequest",
"position": [
1232,
112
],
"parameters": {
"url": "={{ $('Workflow Configuration').first().json.crmApiUrl }}",
"method": "POST",
"options": {},
"sendBody": true,
"sendHeaders": true,
"bodyParameters": {
"parameters": [
{
"name": "ticket_id",
"value": "={{ $('Normalize Ticket Data').item.json.ticket_id }}"
},
{
"name": "priority",
"value": "={{ $('Support Intelligence Agent').item.json.urgency }}"
},
{
"name": "tags",
"value": "={{ $('Support Intelligence Agent').item.json.category }}"
},
{
"name": "summary",
"value": "={{ $('Support Intelligence Agent').item.json.summary }}"
},
{
"name": "sentiment",
"value": "={{ $('Support Intelligence Agent').item.json.sentiment }}"
},
{
"name": "churn_risk",
"value": "={{ $('Support Intelligence Agent').item.json.churn_risk }}"
},
{
"name": "draft_reply",
"value": "={{ $('Draft Reply Generator').item.json.output }}"
},
{
"name": "original_language",
"value": "={{ $('Language Detection & Translation Agent').item.json.original_language }}"
}
]
},
"headerParameters": {
"parameters": [
{
"name": "Content-Type",
"value": "application/json"
}
]
}
},
"typeVersion": 4.3
},
{
"id": "e268d393-0027-46a5-8c5e-50d6ea0d4a60",
"name": "Escalate to Team",
"type": "n8n-nodes-base.httpRequest",
"position": [
1104,
688
],
"parameters": {
"url": "={{ $('Workflow Configuration').first().json.escalationWebhookUrl }}",
"method": "POST",
"options": {},
"sendBody": true,
"sendHeaders": true,
"bodyParameters": {
"parameters": [
{
"name": "ticket_id",
"value": "={{ $json.ticket_id }}"
},
{
"name": "urgency",
"value": "={{ $json.urgency }}"
},
{
"name": "category",
"value": "={{ $json.category }}"
},
{
"name": "sentiment",
"value": "={{ $json.sentiment }}"
},
{
"name": "summary",
"value": "={{ $json.summary }}"
},
{
"name": "churn_risk",
"value": "={{ $json.churn_risk }}"
},
{
"name": "user_email",
"value": "={{ $json.user_email }}"
},
{
"name": "original_message",
"value": "={{ $json.original_message }}"
}
]
},
"headerParameters": {
"parameters": [
{
"name": "Content-Type",
"value": "application/json"
}
]
}
},
"typeVersion": 4.3
},
{
"id": "c5804c5a-150c-4397-8676-5426d65df02d",
"name": "Log Observability Metrics",
"type": "n8n-nodes-base.code",
"position": [
1520,
480
],
"parameters": {
"mode": "runOnceForEachItem",
"jsCode": "// Log observability metrics\nconst startTime = $('Workflow Configuration').item.json.timestamp || new Date().toISOString();\nconst currentTime = new Date().toISOString();\n\n// Calculate response time in milliseconds\nconst responseTime = new Date(currentTime) - new Date(startTime);\n\n// Determine escalation status based on which path was taken\nconst escalationStatus = $input.item.json.escalated || false;\n\n// Get intelligence data from Support Intelligence Agent\nconst intelligenceData = $('Support Intelligence Agent').item.json;\n\nconst metrics = {\n response_time: responseTime,\n escalation_status: escalationStatus,\n model_used: 'anthropic',\n category: intelligenceData.category || 'unknown',\n urgency: intelligenceData.urgency || 'unknown',\n sentiment: intelligenceData.sentiment || 'unknown',\n churn_risk: intelligenceData.churn_risk || 'unknown',\n timestamp: currentTime\n};\n\n// Get observability endpoint from Workflow Configuration\nconst observabilityEndpoint = $('Workflow Configuration').item.json.observability_endpoint;\n\nif (observabilityEndpoint) {\n try {\n // Send metrics to observability endpoint\n await $http.post(observabilityEndpoint, {\n body: metrics,\n headers: {\n 'Content-Type': 'application/json'\n }\n });\n \n return {\n json: {\n success: true,\n metrics: metrics,\n message: 'Metrics logged successfully'\n }\n };\n } catch (error) {\n return {\n json: {\n success: false,\n metrics: metrics,\n error: error.message,\n message: 'Failed to send metrics to observability endpoint'\n }\n };\n }\n} else {\n // If no endpoint configured, just return the metrics\n return {\n json: {\n success: true,\n metrics: metrics,\n message: 'No observability endpoint configured, metrics collected only'\n }\n };\n}"
},
"typeVersion": 2
},
{
"id": "65d76d99-fcf7-4da3-8e5d-e2815d00b652",
"name": "Sticky Note1",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1408,
304
],
"parameters": {
"color": 7,
"width": 448,
"height": 432,
"content": "## Input Layer\nReceive tickets via email or webhook"
},
"typeVersion": 1
},
{
"id": "e56fb971-f92b-4b6e-869e-fe479514d1e0",
"name": "Sticky Note",
"type": "n8n-nodes-base.stickyNote",
"position": [
-944,
304
],
"parameters": {
"color": 7,
"height": 432,
"content": "## Configuration\nSet CRM, escalation, and logging endpoints"
},
"typeVersion": 1
},
{
"id": "3e2f398e-508a-4208-b20d-fe4c24c20665",
"name": "Sticky Note2",
"type": "n8n-nodes-base.stickyNote",
"position": [
-672,
320
],
"parameters": {
"color": 7,
"width": 384,
"height": 304,
"content": "## Data Processing\nClean HTML and normalize ticket data"
},
"typeVersion": 1
},
{
"id": "afc4ca83-0c95-4b24-8b29-4205eca6439f",
"name": "Sticky Note3",
"type": "n8n-nodes-base.stickyNote",
"position": [
-256,
304
],
"parameters": {
"color": 7,
"width": 320,
"height": 352,
"content": "## Translation Layer\nDetect language and translate to English"
},
"typeVersion": 1
},
{
"id": "d27cfcf4-56df-4461-a040-54cdb8022c02",
"name": "Sticky Note4",
"type": "n8n-nodes-base.stickyNote",
"position": [
96,
304
],
"parameters": {
"color": 7,
"width": 352,
"height": 352,
"content": "## AI Classification\nAnalyze sentiment, urgency, and category"
},
"typeVersion": 1
},
{
"id": "65165788-adeb-415a-abb2-e41d5b3877b3",
"name": "Sticky Note5",
"type": "n8n-nodes-base.stickyNote",
"position": [
480,
304
],
"parameters": {
"color": 7,
"width": 304,
"height": 352,
"content": "## Decision Routing\nRoute tickets based on AI recommendation"
},
"typeVersion": 1
},
{
"id": "e3c19d7e-a721-4600-95d0-9af278402289",
"name": "Sticky Note6",
"type": "n8n-nodes-base.stickyNote",
"position": [
800,
-64
],
"parameters": {
"color": 7,
"width": 624,
"height": 368,
"content": "## Auto Reply Flow\nGenerate AI reply and update CRM"
},
"typeVersion": 1
},
{
"id": "93d853a9-960c-41c8-9150-781e0e91b9f9",
"name": "Sticky Note7",
"type": "n8n-nodes-base.stickyNote",
"position": [
1456,
400
],
"parameters": {
"color": 7,
"width": 304,
"height": 240,
"content": "## Observability\nLog metrics for monitoring and insights"
},
"typeVersion": 1
},
{
"id": "aa5dadcc-1f48-4255-b19a-c58fe5494634",
"name": "Sticky Note8",
"type": "n8n-nodes-base.stickyNote",
"position": [
992,
528
],
"parameters": {
"color": 7,
"width": 352,
"height": 336,
"content": "## Escalation Flow\nSend high-risk tickets to support team"
},
"typeVersion": 1
},
{
"id": "142cd556-55ec-49b1-aed6-55d71edb5e2b",
"name": "Sticky Note9",
"type": "n8n-nodes-base.stickyNote",
"position": [
-2336,
288
],
"parameters": {
"width": 384,
"height": 592,
"content": "## How it works\nThis workflow automates customer support ticket processing using AI-powered analysis and intelligent routing.\n\nIncoming messages from email or webhook are cleaned, normalized, and translated into English if needed. An AI agent then analyzes each ticket to determine sentiment, urgency, category, and churn risk.\n\nAll actions are logged with observability metrics for monitoring performance and response quality.\n\n## Setup steps\n- Configure IMAP or webhook for incoming tickets\n- Add AI model credentials (Anthropic/OpenAI)\n- Set CRM or helpdesk API endpoint\n- Configure escalation webhook for alerts\n- Set observability/logging endpoint (optional)"
},
"typeVersion": 1
}
],
"connections": {
"Clean HTML": {
"main": [
[
{
"node": "Normalize Ticket Data",
"type": "main",
"index": 0
}
]
]
},
"Decision Router": {
"main": [
[
{
"node": "Draft Reply Generator",
"type": "main",
"index": 0
}
],
[
{
"node": "Escalate to Team",
"type": "main",
"index": 0
}
]
]
},
"Webhook Trigger": {
"main": [
[
{
"node": "Workflow Configuration",
"type": "main",
"index": 0
}
]
]
},
"Escalate to Team": {
"main": [
[
{
"node": "Log Observability Metrics",
"type": "main",
"index": 0
}
]
]
},
"Update CRM/Helpdesk": {
"main": [
[
{
"node": "Log Observability Metrics",
"type": "main",
"index": 0
}
]
]
},
"Email Trigger (IMAP)": {
"main": [
[
{
"node": "Workflow Configuration",
"type": "main",
"index": 0
}
]
]
},
"Draft Reply Generator": {
"main": [
[
{
"node": "Update CRM/Helpdesk",
"type": "main",
"index": 0
}
]
]
},
"Normalize Ticket Data": {
"main": [
[
{
"node": "Language Detection & Translation Agent",
"type": "main",
"index": 0
}
]
]
},
"Workflow Configuration": {
"main": [
[
{
"node": "Clean HTML",
"type": "main",
"index": 0
}
]
]
},
"Anthropic Model - Reply": {
"ai_languageModel": [
[
{
"node": "Draft Reply Generator",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Translation Output Parser": {
"ai_outputParser": [
[
{
"node": "Language Detection & Translation Agent",
"type": "ai_outputParser",
"index": 0
}
]
]
},
"Intelligence Output Parser": {
"ai_outputParser": [
[
{
"node": "Support Intelligence Agent",
"type": "ai_outputParser",
"index": 0
}
]
]
},
"Support Intelligence Agent": {
"main": [
[
{
"node": "Decision Router",
"type": "main",
"index": 0
}
]
]
},
"Anthropic Model - Translation": {
"ai_languageModel": [
[
{
"node": "Language Detection & Translation Agent",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Anthropic Model - Intelligence": {
"ai_languageModel": [
[
{
"node": "Support Intelligence Agent",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Language Detection & Translation Agent": {
"main": [
[
{
"node": "Support Intelligence Agent",
"type": "main",
"index": 0
}
]
]
}
}
}
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
This workflow automates customer support ticket processing using AI-powered analysis, classification, and intelligent routing.
Source: https://n8n.io/workflows/14826/ — original creator credit. Request a take-down →
Related workflows
Workflows that share integrations, category, or trigger type with this one. All free to copy and import.
This workflow automates customer support ticket processing using AI-powered analysis.
⏺ 🚀 How it works
Fully automates your service order pipeline from incoming booking to supplier confirmation — with built-in SLA enforcement and automatic escalation if a supplier goes silent. 📥 Receives orders via web
Tired of grinding out YouTube content? This n8n workflow turns AI into your personal video factory—creating engaging, faceless shorts on autopilot. Perfect for creators, marketers, or side-hustlers lo
Faceless YouTube Generator. Uses httpRequest, limit, googleDrive, googleSheets. Webhook trigger; 49 nodes.