This workflow follows the Agent → OpenAI Chat 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 →
{
"name": "Customer Support AI Agent",
"nodes": [
{
"parameters": {
"httpMethod": "POST",
"path": "support",
"responseMode": "responseNode",
"options": {}
},
"id": "b2c3d4e5-2222-4000-8000-000000000001",
"name": "Webhook",
"type": "n8n-nodes-base.webhook",
"typeVersion": 2,
"position": [
250,
300
]
},
{
"parameters": {
"resource": "chat",
"operation": "message",
"model": "gpt-4o",
"messages": {
"values": [
{
"role": "system",
"content": "You are a customer support intent classifier. Classify the customer message into exactly one of these intents: billing, technical_support, account_management, product_inquiry, complaint, other. Respond with ONLY a JSON object: {\"intent\": \"<intent>\", \"confidence\": <0-1>, \"needs_human\": <boolean>}. Set needs_human to true if the message is angry, involves legal threats, or is about account security."
},
{
"role": "user",
"content": "={{ $json.body.message }}"
}
]
},
"options": {
"temperature": 0.1,
"maxTokens": 256
}
},
"id": "b2c3d4e5-2222-4000-8000-000000000002",
"name": "Classify Intent",
"type": "@n8n/n8n-nodes-langchain.openAi",
"typeVersion": 1.6,
"position": [
500,
300
],
"credentials": {
"openAiApi": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"dataType": "stringValue",
"value1": "={{ JSON.parse($json.text).intent }}",
"rules": {
"rules": [
{
"value2": "billing",
"operation": "equal",
"output": 0
},
{
"value2": "technical_support",
"operation": "equal",
"output": 1
},
{
"value2": "account_management",
"operation": "equal",
"output": 2
},
{
"value2": "product_inquiry",
"operation": "equal",
"output": 3
},
{
"value2": "complaint",
"operation": "equal",
"output": 4
}
],
"fallbackOutput": 5
},
"options": {}
},
"id": "b2c3d4e5-2222-4000-8000-000000000003",
"name": "Route by Intent",
"type": "n8n-nodes-base.switch",
"typeVersion": 3.2,
"position": [
750,
300
]
},
{
"parameters": {
"resource": "chat",
"operation": "message",
"model": "gpt-4o",
"messages": {
"values": [
{
"role": "system",
"content": "You are a friendly customer support agent. The customer's intent has been classified as: {{ JSON.parse($('Classify Intent').item.json.text).intent }}. Provide a helpful, empathetic, and accurate response. If you cannot resolve the issue, let the customer know a human agent will follow up. Keep responses under 200 words."
},
{
"role": "user",
"content": "={{ $('Webhook').item.json.body.message }}"
}
]
},
"options": {
"temperature": 0.5,
"maxTokens": 512
}
},
"id": "b2c3d4e5-2222-4000-8000-000000000004",
"name": "Generate Response",
"type": "@n8n/n8n-nodes-langchain.openAi",
"typeVersion": 1.6,
"position": [
1000,
300
],
"credentials": {
"openAiApi": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"conditions": {
"options": {
"caseSensitive": false,
"leftValue": "",
"typeValidation": "loose"
},
"conditions": [
{
"id": "needs-human",
"leftValue": "={{ JSON.parse($('Classify Intent').item.json.text).needs_human }}",
"rightValue": true,
"operator": {
"type": "boolean",
"operation": "equals",
"name": "filter.operator.equals"
}
}
],
"combinator": "and"
},
"options": {}
},
"id": "b2c3d4e5-2222-4000-8000-000000000005",
"name": "Needs Human?",
"type": "n8n-nodes-base.if",
"typeVersion": 2.1,
"position": [
1250,
300
]
},
{
"parameters": {
"channel": "#support-escalations",
"text": "=:rotating_light: *Escalation Required*\n\n*Customer Message:* {{ $('Webhook').item.json.body.message }}\n*Intent:* {{ JSON.parse($('Classify Intent').item.json.text).intent }}\n*AI Response Draft:* {{ $('Generate Response').item.json.text }}\n*Customer Email:* {{ $('Webhook').item.json.body.email || 'N/A' }}",
"otherOptions": {}
},
"id": "b2c3d4e5-2222-4000-8000-000000000006",
"name": "Slack Escalate",
"type": "n8n-nodes-base.slack",
"typeVersion": 2.2,
"position": [
1500,
200
],
"credentials": {
"slackApi": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"options": {
"responseCode": 200
},
"respondWith": "json",
"responseBody": "={{ JSON.stringify({ response: $('Generate Response').item.json.text, intent: JSON.parse($('Classify Intent').item.json.text).intent, escalated: false }) }}"
},
"id": "b2c3d4e5-2222-4000-8000-000000000007",
"name": "Respond Direct",
"type": "n8n-nodes-base.respondToWebhook",
"typeVersion": 1.1,
"position": [
1500,
450
]
},
{
"parameters": {
"options": {
"responseCode": 200
},
"respondWith": "json",
"responseBody": "={{ JSON.stringify({ response: $('Generate Response').item.json.text, intent: JSON.parse($('Classify Intent').item.json.text).intent, escalated: true, message: 'A human agent will follow up shortly.' }) }}"
},
"id": "b2c3d4e5-2222-4000-8000-000000000008",
"name": "Respond Escalated",
"type": "n8n-nodes-base.respondToWebhook",
"typeVersion": 1.1,
"position": [
1750,
200
]
}
],
"connections": {
"Webhook": {
"main": [
[
{
"node": "Classify Intent",
"type": "main",
"index": 0
}
]
]
},
"Classify Intent": {
"main": [
[
{
"node": "Route by Intent",
"type": "main",
"index": 0
}
]
]
},
"Route by Intent": {
"main": [
[
{
"node": "Generate Response",
"type": "main",
"index": 0
}
],
[
{
"node": "Generate Response",
"type": "main",
"index": 0
}
],
[
{
"node": "Generate Response",
"type": "main",
"index": 0
}
],
[
{
"node": "Generate Response",
"type": "main",
"index": 0
}
],
[
{
"node": "Generate Response",
"type": "main",
"index": 0
}
],
[
{
"node": "Generate Response",
"type": "main",
"index": 0
}
]
]
},
"Generate Response": {
"main": [
[
{
"node": "Needs Human?",
"type": "main",
"index": 0
}
]
]
},
"Needs Human?": {
"main": [
[
{
"node": "Slack Escalate",
"type": "main",
"index": 0
}
],
[
{
"node": "Respond Direct",
"type": "main",
"index": 0
}
]
]
},
"Slack Escalate": {
"main": [
[
{
"node": "Respond Escalated",
"type": "main",
"index": 0
}
]
]
}
},
"settings": {
"executionOrder": "v1"
},
"staticData": null
}
Credentials you'll need
Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.
openAiApi
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
Customer Support AI Agent. Uses agent, lmChatOpenAi, mcpClientTool, memoryBufferWindow. Webhook trigger; 5 nodes.
Source: https://github.com/Trusera/ai-bom/blob/main/examples/demo-project/workflows/customer-support-agent.json — 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 is an AI-powered Dental Appointment Assistant that automates appointment booking, rescheduling, and cancellations through Telegram or a Webhook. It uses intelligent agents to understand
Build an MCP server with Airtable. Uses chatTrigger, agent, memoryBufferWindow, mcpClientTool. Chat trigger; 13 nodes.
Build an MCP server with Airtable. Uses chatTrigger, agent, memoryBufferWindow, mcpClientTool. Chat trigger; 13 nodes.
This template is designed for anyone who wants to integrate MCP with their AI Agents using Airtable. Whether you're a developer, a data analyst, or an automation enthusiast, if you're looking to lever
Build an MCP server with Airtable. Uses chatTrigger, agent, memoryBufferWindow, mcpClientTool. Chat trigger; 13 nodes.