AutomationFlowsGeneral › AI Support Ticket Router & Auto-Reply

AI Support Ticket Router & Auto-Reply

Original n8n title: AI Support Ticket Router & Auto-reply (ollama)

AI Support Ticket Router & Auto-Reply (Ollama). Uses httpRequest. Webhook trigger; 7 nodes.

Webhook trigger★★★★☆ complexity7 nodesHTTP Request
General Trigger: Webhook Nodes: 7 Complexity: ★★★★☆ Added:

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 →

Download .json
{
  "name": "AI Support Ticket Router & Auto-Reply (Ollama)",
  "nodes": [
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "support-ticket",
        "responseMode": "responseNode",
        "options": {}
      },
      "id": "webhook",
      "name": "New Support Ticket",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2,
      "position": [
        240,
        300
      ]
    },
    {
      "parameters": {
        "url": "http://localhost:11434/api/generate",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={{ JSON.stringify({ model: 'llama3:8b', prompt: 'You are a support ticket analyzer. Analyze this ticket and return ONLY valid JSON.\\n\\nTicket:\\nFrom: ' + ($json.body.email || 'unknown') + '\\nSubject: ' + ($json.body.subject || 'no subject') + '\\nMessage: ' + ($json.body.message || '') + '\\n\\nReturn:\\n{\\n  \"category\": \"BUG|FEATURE_REQUEST|BILLING|ACCOUNT|HOW_TO|INTEGRATION|OTHER\",\\n  \"priority\": \"P1_CRITICAL|P2_HIGH|P3_MEDIUM|P4_LOW\",\\n  \"sentiment\": \"angry|frustrated|neutral|positive\",\\n  \"requires_human\": true/false,\\n  \"suggested_response\": \"A helpful auto-reply (2-3 sentences)\",\\n  \"internal_notes\": \"Brief notes for the support team\",\\n  \"relevant_docs\": \"Suggest which help article topics might be relevant\"\\n}', stream: false, options: { temperature: 0.2, num_predict: 500 } }) }}",
        "options": {
          "timeout": 60000
        }
      },
      "id": "analyze",
      "name": "Analyze Ticket (Ollama)",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        480,
        300
      ]
    },
    {
      "parameters": {
        "jsCode": "const response = JSON.parse($input.first().json.data).response;\nconst match = response.match(/\\{[\\s\\S]*\\}/);\nif (match) {\n  const analysis = JSON.parse(match[0]);\n  const ticket = $('New Support Ticket').first().json.body;\n  return [{ json: { ...ticket, ...analysis, analyzed_at: new Date().toISOString() } }];\n}\nthrow new Error('Failed to parse analysis');"
      },
      "id": "parse",
      "name": "Parse Analysis",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        720,
        300
      ]
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true
          },
          "combinator": "or",
          "conditions": [
            {
              "leftValue": "={{ $json.priority }}",
              "rightValue": "P1_CRITICAL",
              "operator": {
                "type": "string",
                "operation": "equals"
              }
            },
            {
              "leftValue": "={{ $json.requires_human }}",
              "rightValue": true,
              "operator": {
                "type": "boolean",
                "operation": "equals"
              }
            }
          ]
        }
      },
      "id": "route",
      "name": "Needs Human?",
      "type": "n8n-nodes-base.if",
      "typeVersion": 2,
      "position": [
        960,
        300
      ]
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "action",
              "name": "action",
              "value": "ESCALATE: Route to human agent immediately",
              "type": "string"
            },
            {
              "id": "auto_reply_sent",
              "name": "auto_reply_sent",
              "value": "false",
              "type": "string"
            }
          ]
        }
      },
      "id": "escalate",
      "name": "Escalate to Human",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        1200,
        200
      ]
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "action",
              "name": "action",
              "value": "AUTO-REPLY: Send suggested response",
              "type": "string"
            },
            {
              "id": "auto_reply_sent",
              "name": "auto_reply_sent",
              "value": "true",
              "type": "string"
            }
          ]
        }
      },
      "id": "auto-reply",
      "name": "Send Auto-Reply",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        1200,
        400
      ]
    },
    {
      "parameters": {
        "respondWith": "json",
        "responseBody": "={{ JSON.stringify({ status: 'processed', category: $json.category, priority: $json.priority, action: $json.action }) }}"
      },
      "id": "respond",
      "name": "Return Status",
      "type": "n8n-nodes-base.respondToWebhook",
      "typeVersion": 1.1,
      "position": [
        1440,
        300
      ]
    }
  ],
  "connections": {
    "New Support Ticket": {
      "main": [
        [
          {
            "node": "Analyze Ticket (Ollama)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Analyze Ticket (Ollama)": {
      "main": [
        [
          {
            "node": "Parse Analysis",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Parse Analysis": {
      "main": [
        [
          {
            "node": "Needs Human?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Needs Human?": {
      "main": [
        [
          {
            "node": "Escalate to Human",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Send Auto-Reply",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Escalate to Human": {
      "main": [
        [
          {
            "node": "Return Status",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Auto-Reply": {
      "main": [
        [
          {
            "node": "Return Status",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1"
  },
  "tags": [
    {
      "name": "AI"
    },
    {
      "name": "Ollama"
    },
    {
      "name": "Support"
    },
    {
      "name": "Automation"
    }
  ]
}
Pro

For the full experience including quality scoring and batch install features for each workflow upgrade to Pro

About this workflow

AI Support Ticket Router & Auto-Reply (Ollama). Uses httpRequest. Webhook trigger; 7 nodes.

Source: https://github.com/bonskari/n8n-ai-workflows/blob/main/download/ai-support-ticket-router.json — original creator credit. Request a take-down →

More General workflows → · Browse all categories →

Related workflows

Workflows that share integrations, category, or trigger type with this one. All free to copy and import.

General

Demo Workflow How To Use Workflowstaticdata. Uses noOp, httpRequest, scheduleTrigger, stickyNote. Webhook trigger; 9 nodes.

HTTP Request
General

Auto-Approve Workflow copy. Uses emailSend, httpRequest, respondToWebhook. Webhook trigger; 9 nodes.

Email Send, HTTP Request
General

New Workflow Template (Auto-Export). Uses httpRequest, respondToWebhook. Webhook trigger; 4 nodes.

HTTP Request
General

Respond With File Download To Incoming Http Request. Uses httpRequest, respondToWebhook. Webhook trigger; 3 nodes.

HTTP Request
General

Blotato-Api. Uses @blotato/n8n-nodes-blotato. Webhook trigger; 53 nodes.

@Blotato/N8N Nodes Blotato