8
n8n 中文网amn8n.com

我的工作流程 2

中级

这是一个Ticket Management, AI Summarization领域的自动化工作流,包含 15 个节点。主要使用 If, Code, Slack, Webhook, GoogleSheets 等节点。 使用ScrapeGraphAI、Google表格和Slack提醒构建支持工单分析仪表板

前置要求
  • Slack Bot Token 或 Webhook URL
  • HTTP Webhook 端点(n8n 会自动生成)
  • Google Sheets API 凭证
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "VhEwspDqzu7ssFVE",
  "meta": {
    "instanceId": "f4b0efaa33080e7774e0d9285c40c7abcd2c6f7cf1a8b901fa7106170dd4cda3"
  },
  "name": "我的工作流程 2",
  "tags": [],
  "nodes": [
    {
      "id": "3b4ed448-99f2-41f3-b7fc-e5397dc6fac8",
      "name": "自动化支持监控触发器",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -288,
        608
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "hours"
            }
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "51925e8e-1ff5-435a-8454-1511b9e94f52",
      "name": "支持工单 Webhook 触发器",
      "type": "n8n-nodes-base.webhook",
      "position": [
        -288,
        400
      ],
      "webhookId": "support-ticket-webhook",
      "parameters": {
        "path": "support-ticket-webhook",
        "options": {
          "noResponseBody": false
        },
        "httpMethod": "POST"
      },
      "typeVersion": 1.1
    },
    {
      "id": "1216484d-7002-4116-a265-70ef1f20fe65",
      "name": "AI 支持仪表板抓取器",
      "type": "n8n-nodes-scrapegraphai.scrapegraphAi",
      "position": [
        128,
        304
      ],
      "parameters": {
        "userPrompt": "Extract all open support tickets from this support dashboard. Focus on ticket details, customer information, and current status. Use this schema for response: { \"request_id\": \"unique_id\", \"status\": \"completed\", \"platform\": \"Support System\", \"tickets\": [{ \"ticket_id\": \"TICKET-12345\", \"customer_name\": \"John Smith\", \"customer_email\": \"john@company.com\", \"customer_tier\": \"Premium\", \"subject\": \"Login Issues\", \"description\": \"Full ticket description here\", \"category\": \"Technical\", \"priority\": \"High\", \"status\": \"Open\", \"created_date\": \"2024-01-15T10:30:00Z\", \"last_updated\": \"2024-01-15T14:20:00Z\", \"assigned_agent\": \"Agent Name\", \"tags\": [\"login\", \"authentication\"], \"customer_satisfaction_score\": null, \"response_count\": 3, \"escalated\": false, \"sla_breach\": false, \"estimated_resolution_time\": \"2024-01-16T10:30:00Z\" }] }",
        "websiteUrl": "https://your-support-system.com/tickets/dashboard?status=open"
      },
      "typeVersion": 1
    },
    {
      "id": "ca23168f-68a1-48a3-af78-493f32b57270",
      "name": "AI 已关闭工单分析器",
      "type": "n8n-nodes-scrapegraphai.scrapegraphAi",
      "position": [
        128,
        512
      ],
      "parameters": {
        "userPrompt": "Extract recently closed support tickets for performance analysis. Focus on resolution metrics and customer feedback. Use this schema: { \"request_id\": \"unique_id\", \"status\": \"completed\", \"platform\": \"Support System\", \"tickets\": [{ \"ticket_id\": \"TICKET-67890\", \"customer_name\": \"Jane Doe\", \"customer_email\": \"jane@company.com\", \"customer_tier\": \"Standard\", \"subject\": \"Billing Question\", \"description\": \"Full ticket description\", \"category\": \"Billing\", \"priority\": \"Medium\", \"status\": \"Closed\", \"created_date\": \"2024-01-14T09:00:00Z\", \"closed_date\": \"2024-01-15T11:30:00Z\", \"resolution_time_hours\": 26.5, \"assigned_agent\": \"Agent Name\", \"customer_satisfaction_score\": 4.5, \"resolution_summary\": \"Issue resolved by updating billing information\", \"tags\": [\"billing\", \"account\"], \"first_response_time_minutes\": 15, \"total_responses\": 5, \"escalated\": false }] }",
        "websiteUrl": "https://your-support-system.com/tickets/closed?period=24h"
      },
      "typeVersion": 1
    },
    {
      "id": "b0e5acf3-809a-4fcf-9600-a6174525f282",
      "name": "AI 知识库分析器",
      "type": "n8n-nodes-scrapegraphai.scrapegraphAi",
      "position": [
        128,
        704
      ],
      "parameters": {
        "userPrompt": "Extract knowledge base articles and FAQ data to identify common issues and self-service opportunities. Use this schema: { \"request_id\": \"unique_id\", \"status\": \"completed\", \"platform\": \"Knowledge Base\", \"articles\": [{ \"article_id\": \"KB-001\", \"title\": \"How to Reset Password\", \"category\": \"Account Management\", \"views_count\": 1250, \"helpful_votes\": 89, \"not_helpful_votes\": 12, \"last_updated\": \"2024-01-10T00:00:00Z\", \"tags\": [\"password\", \"account\"], \"related_tickets_count\": 45, \"self_service_success_rate\": 0.75 }] }",
        "websiteUrl": "https://your-support-system.com/knowledge-base/search?q=frequently-asked"
      },
      "typeVersion": 1
    },
    {
      "id": "1e7fc7c7-1c39-4708-b46a-ad29aaf8cbac",
      "name": "高级支持分析与智能",
      "type": "n8n-nodes-base.code",
      "notes": "Processes support tickets with\nadvanced analytics, SLA monitoring,\nand escalation intelligence",
      "position": [
        720,
        512
      ],
      "parameters": {
        "jsCode": "// Advanced Customer Support Analytics & Intelligence Processing\nconst inputData = $input.all();\nconst processedTickets = [];\nconst analyticsData = [];\n\n// Configuration for support analytics and escalation rules\nconst supportConfig = {\n  slaThresholds: {\n    'Critical': { first_response_minutes: 15, resolution_hours: 4 },\n    'High': { first_response_minutes: 30, resolution_hours: 8 },\n    'Medium': { first_response_minutes: 120, resolution_hours: 24 },\n    'Low': { first_response_minutes: 480, resolution_hours: 72 }\n  },\n  customerTiers: {\n    'Enterprise': { priority_multiplier: 1.5, escalation_threshold: 0.5 },\n    'Premium': { priority_multiplier: 1.2, escalation_threshold: 0.7 },\n    'Standard': { priority_multiplier: 1.0, escalation_threshold: 1.0 },\n    'Basic': { priority_multiplier: 0.8, escalation_threshold: 1.2 }\n  },\n  categoryPatterns: {\n    'Technical': {\n      keywords: ['error', 'bug', 'not working', 'crash', 'performance', 'integration'],\n      avg_resolution_hours: 12,\n      escalation_rate: 0.15\n    },\n    'Billing': {\n      keywords: ['payment', 'invoice', 'charge', 'refund', 'subscription', 'billing'],\n      avg_resolution_hours: 6,\n      escalation_rate: 0.08\n    },\n    'Account': {\n      keywords: ['login', 'password', 'access', 'permissions', 'account', 'profile'],\n      avg_resolution_hours: 4,\n      escalation_rate: 0.05\n    },\n    'Feature Request': {\n      keywords: ['feature', 'enhancement', 'improvement', 'suggestion', 'request'],\n      avg_resolution_hours: 48,\n      escalation_rate: 0.03\n    },\n    'General Inquiry': {\n      keywords: ['question', 'information', 'how to', 'help', 'support'],\n      avg_resolution_hours: 8,\n      escalation_rate: 0.04\n    }\n  },\n  escalationTriggers: {\n    sla_breach: true,\n    high_priority_long_wait: true,\n    customer_tier_violation: true,\n    multiple_responses_no_resolution: true,\n    negative_sentiment: true\n  }\n};\n\n// Advanced ticket categorization using AI-like pattern matching\nfunction categorizeTicket(subject, description) {\n  const fullText = `${subject} ${description}`.toLowerCase();\n  let bestMatch = { category: 'General Inquiry', confidence: 0 };\n  \n  Object.entries(supportConfig.categoryPatterns).forEach(([category, config]) => {\n    let matchScore = 0;\n    config.keywords.forEach(keyword => {\n      if (fullText.includes(keyword)) {\n        matchScore += 1;\n      }\n    });\n    \n    const confidence = matchScore / config.keywords.length;\n    if (confidence > bestMatch.confidence) {\n      bestMatch = { category, confidence: Math.round(confidence * 100) };\n    }\n  });\n  \n  return bestMatch;\n}\n\n// Calculate SLA compliance and breach detection\nfunction calculateSLAMetrics(ticket) {\n  const priority = ticket.priority || 'Medium';\n  const slaConfig = supportConfig.slaThresholds[priority] || supportConfig.slaThresholds['Medium'];\n  const customerTier = supportConfig.customerTiers[ticket.customer_tier] || supportConfig.customerTiers['Standard'];\n  \n  // Adjust SLA based on customer tier\n  const adjustedSLA = {\n    first_response_minutes: Math.floor(slaConfig.first_response_minutes * customerTier.escalation_threshold),\n    resolution_hours: Math.floor(slaConfig.resolution_hours * customerTier.escalation_threshold)\n  };\n  \n  const createdTime = new Date(ticket.created_date);\n  const currentTime = new Date();\n  const lastUpdatedTime = new Date(ticket.last_updated || ticket.created_date);\n  \n  // Calculate time metrics\n  const ageInMinutes = (currentTime - createdTime) / (1000 * 60);\n  const ageInHours = ageInMinutes / 60;\n  const timeSinceLastUpdate = (currentTime - lastUpdatedTime) / (1000 * 60);\n  \n  // SLA breach detection\n  const slaBreaches = {\n    first_response_breach: ticket.response_count === 0 && ageInMinutes > adjustedSLA.first_response_minutes,\n    resolution_breach: ticket.status !== 'Closed' && ageInHours > adjustedSLA.resolution_hours,\n    update_breach: timeSinceLastUpdate > (adjustedSLA.first_response_minutes * 2)\n  };\n  \n  const overallSLABreach = Object.values(slaBreaches).some(breach => breach);\n  \n  return {\n    age_minutes: Math.round(ageInMinutes),\n    age_hours: Math.round(ageInHours * 100) / 100,\n    time_since_last_update_minutes: Math.round(timeSinceLastUpdate),\n    sla_thresholds: adjustedSLA,\n    sla_breaches: slaBreaches,\n    overall_sla_breach: overallSLABreach,\n    sla_status: overallSLABreach ? 'Breached' : 'On Track'\n  };\n}\n\n// Advanced escalation logic\nfunction calculateEscalationScore(ticket, slaMetrics, categorization) {\n  let escalationScore = 0;\n  const escalationReasons = [];\n  \n  // SLA breach escalation\n  if (slaMetrics.overall_sla_breach) {\n    escalationScore += 25;\n    escalationReasons.push('SLA Breach Detected');\n  }\n  \n  // Priority-based escalation\n  const priorityScores = { 'Critical': 20, 'High': 15, 'Medium': 5, 'Low': 0 };\n  escalationScore += priorityScores[ticket.priority] || 0;\n  \n  // Customer tier escalation\n  const tierScores = { 'Enterprise': 15, 'Premium': 10, 'Standard': 5, 'Basic': 0 };\n  escalationScore += tierScores[ticket.customer_tier] || 0;\n  \n  // Age-based escalation\n  if (slaMetrics.age_hours > 48) {\n    escalationScore += 15;\n    escalationReasons.push('Ticket Age Exceeds 48 Hours');\n  } else if (slaMetrics.age_hours > 24) {\n    escalationScore += 10;\n    escalationReasons.push('Ticket Age Exceeds 24 Hours');\n  }\n  \n  // Response pattern analysis\n  if (ticket.response_count > 5 && ticket.status !== 'Closed') {\n    escalationScore += 12;\n    escalationReasons.push('Multiple Responses Without Resolution');\n  }\n  \n  // Already escalated penalty\n  if (ticket.escalated) {\n    escalationScore += 20;\n    escalationReasons.push('Previously Escalated');\n  }\n  \n  // Technical complexity\n  if (categorization.category === 'Technical' && slaMetrics.age_hours > 8) {\n    escalationScore += 8;\n    escalationReasons.push('Complex Technical Issue');\n  }\n  \n  // Determine escalation level\n  let escalationLevel = 'None';\n  let requiresEscalation = false;\n  \n  if (escalationScore >= 50) {\n    escalationLevel = 'Critical - Immediate Manager Attention';\n    requiresEscalation = true;\n  } else if (escalationScore >= 35) {\n    escalationLevel = 'High - Team Lead Review';\n    requiresEscalation = true;\n  } else if (escalationScore >= 20) {\n    escalationLevel = 'Medium - Senior Agent Assignment';\n    requiresEscalation = true;\n  }\n  \n  return {\n    escalation_score: escalationScore,\n    escalation_level: escalationLevel,\n    requires_escalation: requiresEscalation,\n    escalation_reasons: escalationReasons\n  };\n}\n\n// Performance analytics calculation\nfunction calculatePerformanceMetrics(tickets) {\n  const totalTickets = tickets.length;\n  if (totalTickets === 0) return {};\n  \n  const closedTickets = tickets.filter(t => t.status === 'Closed');\n  const openTickets = tickets.filter(t => t.status !== 'Closed');\n  \n  // Resolution time analysis\n  const resolutionTimes = closedTickets\n    .filter(t => t.resolution_time_hours)\n    .map(t => t.resolution_time_hours);\n  \n  const avgResolutionTime = resolutionTimes.length > 0 \n    ? resolutionTimes.reduce((a, b) => a + b, 0) / resolutionTimes.length \n    : 0;\n  \n  // Customer satisfaction analysis\n  const satisfactionScores = closedTickets\n    .filter(t => t.customer_satisfaction_score)\n    .map(t => t.customer_satisfaction_score);\n  \n  const avgSatisfactionScore = satisfactionScores.length > 0\n    ? satisfactionScores.reduce((a, b) => a + b, 0) / satisfactionScores.length\n    : 0;\n  \n  // Category distribution\n  const categoryDistribution = {};\n  tickets.forEach(ticket => {\n    const category = ticket.ai_category || ticket.category || 'Unknown';\n    categoryDistribution[category] = (categoryDistribution[category] || 0) + 1;\n  });\n  \n  return {\n    total_tickets: totalTickets,\n    open_tickets: openTickets.length,\n    closed_tickets: closedTickets.length,\n    resolution_rate: Math.round((closedTickets.length / totalTickets) * 100),\n    avg_resolution_time_hours: Math.round(avgResolutionTime * 100) / 100,\n    avg_satisfaction_score: Math.round(avgSatisfactionScore * 100) / 100,\n    category_distribution: categoryDistribution,\n    escalation_rate: Math.round((tickets.filter(t => t.requires_escalation).length / totalTickets) * 100)\n  };\n}\n\n// Process each input (open tickets, closed tickets, knowledge base)\ninputData.forEach(input => {\n  if (input.json.result && input.json.result.tickets) {\n    const platform = input.json.result.platform || 'Support System';\n    \n    input.json.result.tickets.forEach(ticket => {\n      const categorization = categorizeTicket(ticket.subject, ticket.description);\n      const slaMetrics = calculateSLAMetrics(ticket);\n      const escalationAnalysis = calculateEscalationScore(ticket, slaMetrics, categorization);\n      \n      processedTickets.push({\n        json: {\n          // Ticket Identification\n          ticket_id: ticket.ticket_id,\n          platform: platform,\n          status: ticket.status,\n          created_date: ticket.created_date,\n          last_updated: ticket.last_updated,\n          closed_date: ticket.closed_date,\n          \n          // Customer Information\n          customer_name: ticket.customer_name,\n          customer_email: ticket.customer_email,\n          customer_tier: ticket.customer_tier || 'Standard',\n          \n          // Ticket Details\n          subject: ticket.subject,\n          description: ticket.description,\n          priority: ticket.priority || 'Medium',\n          original_category: ticket.category,\n          ai_category: categorization.category,\n          ai_categorization_confidence: categorization.confidence,\n          \n          // Agent and Assignment\n          assigned_agent: ticket.assigned_agent,\n          response_count: ticket.response_count || 0,\n          \n          // Time and SLA Metrics\n          age_minutes: slaMetrics.age_minutes,\n          age_hours: slaMetrics.age_hours,\n          time_since_last_update_minutes: slaMetrics.time_since_last_update_minutes,\n          sla_status: slaMetrics.sla_status,\n          sla_breach: slaMetrics.overall_sla_breach,\n          first_response_time_minutes: ticket.first_response_time_minutes,\n          resolution_time_hours: ticket.resolution_time_hours,\n          \n          // Escalation Analysis\n          escalation_score: escalationAnalysis.escalation_score,\n          escalation_level: escalationAnalysis.escalation_level,\n          requires_escalation: escalationAnalysis.requires_escalation,\n          escalation_reasons: escalationAnalysis.escalation_reasons,\n          previously_escalated: ticket.escalated || false,\n          \n          // Performance Metrics\n          customer_satisfaction_score: ticket.customer_satisfaction_score,\n          resolution_summary: ticket.resolution_summary,\n          \n          // Additional Context\n          tags: ticket.tags || [],\n          estimated_resolution_time: ticket.estimated_resolution_time,\n          \n          // Analytics Metadata\n          processed_at: new Date().toISOString(),\n          analytics_session: `analytics_${new Date().toISOString().split('T')[0].replace(/-/g, '')}`\n        }\n      });\n    });\n  }\n  \n  // Process knowledge base data\n  if (input.json.result && input.json.result.articles) {\n    const kbAnalytics = {\n      total_articles: input.json.result.articles.length,\n      high_traffic_articles: input.json.result.articles.filter(a => a.views_count > 1000).length,\n      self_service_opportunities: input.json.result.articles.filter(a => a.related_tickets_count > 20).length\n    };\n    \n    analyticsData.push({\n      json: {\n        analytics_type: 'knowledge_base',\n        data: kbAnalytics,\n        processed_at: new Date().toISOString()\n      }\n    });\n  }\n});\n\n// Generate overall performance analytics\nif (processedTickets.length > 0) {\n  const overallMetrics = calculatePerformanceMetrics(processedTickets.map(t => t.json));\n  analyticsData.push({\n    json: {\n      analytics_type: 'performance_summary',\n      data: overallMetrics,\n      processed_at: new Date().toISOString()\n    }\n  });\n}\n\n// Return both processed tickets and analytics data\nreturn [...processedTickets, ...analyticsData];"
      },
      "notesInFlow": true,
      "typeVersion": 2
    },
    {
      "id": "bdc4262f-f379-4b13-810b-d8f5c229656f",
      "name": "Google Sheets 支持分析仪表板",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1520,
        512
      ],
      "parameters": {
        "columns": {
          "value": {},
          "schema": [
            {
              "id": "ticket_id",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Ticket ID",
              "defaultMatch": true,
              "canBeUsedToMatch": true
            },
            {
              "id": "customer_name",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Customer",
              "defaultMatch": false,
              "canBeUsedToMatch": false
            },
            {
              "id": "customer_tier",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Customer Tier",
              "defaultMatch": false,
              "canBeUsedToMatch": false
            },
            {
              "id": "subject",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Subject",
              "defaultMatch": false,
              "canBeUsedToMatch": false
            },
            {
              "id": "priority",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Priority",
              "defaultMatch": false,
              "canBeUsedToMatch": false
            },
            {
              "id": "ai_category",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "AI Category",
              "defaultMatch": false,
              "canBeUsedToMatch": false
            },
            {
              "id": "status",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Status",
              "defaultMatch": false,
              "canBeUsedToMatch": false
            },
            {
              "id": "age_hours",
              "type": "number",
              "display": true,
              "required": false,
              "displayName": "Age (Hours)",
              "defaultMatch": false,
              "canBeUsedToMatch": false
            },
            {
              "id": "sla_status",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "SLA Status",
              "defaultMatch": false,
              "canBeUsedToMatch": false
            },
            {
              "id": "escalation_level",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Escalation Level",
              "defaultMatch": false,
              "canBeUsedToMatch": false
            },
            {
              "id": "requires_escalation",
              "type": "boolean",
              "display": true,
              "required": false,
              "displayName": "Requires Escalation",
              "defaultMatch": false,
              "canBeUsedToMatch": false
            },
            {
              "id": "assigned_agent",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Assigned Agent",
              "defaultMatch": false,
              "canBeUsedToMatch": false
            },
            {
              "id": "customer_satisfaction_score",
              "type": "number",
              "display": true,
              "required": false,
              "displayName": "CSAT Score",
              "defaultMatch": false,
              "canBeUsedToMatch": false
            }
          ],
          "mappingMode": "autoMapInputData",
          "matchingColumns": [
            "ticket_id"
          ]
        },
        "options": {},
        "operation": "appendOrUpdate",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/edit#gid=0",
          "cachedResultName": "Support Data"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/edit#gid=0",
          "cachedResultName": "Support Analytics Dashboard"
        },
        "authentication": "serviceAccount"
      },
      "typeVersion": 4.4
    },
    {
      "id": "8bcab229-4e1e-4733-8c15-0cad5d52790e",
      "name": "关键升级过滤器",
      "type": "n8n-nodes-base.if",
      "position": [
        720,
        256
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "conditions": [
            {
              "id": "critical-escalation",
              "operator": {
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $json.escalation_level }}",
              "rightValue": "Critical - Immediate Manager Attention"
            },
            {
              "id": "sla-breach",
              "operator": {
                "type": "boolean",
                "operation": "true"
              },
              "leftValue": "={{ $json.sla_breach }}",
              "rightValue": true
            },
            {
              "id": "high-tier-customer",
              "operator": {
                "type": "boolean",
                "operation": "true"
              },
              "leftValue": "={{ $json.customer_tier === 'Enterprise' && $json.requires_escalation }}",
              "rightValue": true
            }
          ],
          "combineOperation": "any"
        }
      },
      "typeVersion": 2
    },
    {
      "id": "e89856d6-57c0-4045-8436-7ec0a0b7dcec",
      "name": "Slack 经理升级警报",
      "type": "n8n-nodes-base.slack",
      "position": [
        1120,
        256
      ],
      "webhookId": "ebf5c02f-bca1-48ac-9347-d42e53db23ea",
      "parameters": {
        "text": "🚨 **SUPPORT ESCALATION ALERT** 🚨\n\n{% if $json.escalation_level contains 'Critical' %}🔴 **CRITICAL ESCALATION REQUIRED** 🔴{% else %}⚠️ **HIGH PRIORITY TICKET** ⚠️{% endif %}\n\n**Ticket**: {{ $json.ticket_id }}\n**Customer**: {{ $json.customer_name }} ({{ $json.customer_tier }} Tier)\n**Subject**: {{ $json.subject }}\n\n**Priority**: {{ $json.priority }}\n**Category**: {{ $json.ai_category }} ({{ $json.ai_categorization_confidence }}% confidence)\n**Assigned Agent**: {{ $json.assigned_agent || 'Unassigned' }}\n\n**Time Metrics**:\n⏰ **Ticket Age**: {{ $json.age_hours }} hours\n{% if $json.sla_breach %}🔴 **SLA STATUS**: BREACHED{% else %}🟢 **SLA STATUS**: {{ $json.sla_status }}{% endif %}\n⏱️ **Time Since Last Update**: {{ $json.time_since_last_update_minutes }} minutes\n\n**Escalation Analysis**:\n📊 **Escalation Score**: {{ $json.escalation_score }}/100\n🎯 **Escalation Level**: {{ $json.escalation_level }}\n\n**Why This Requires Attention**:\n{% for reason in $json.escalation_reasons %}- {{ reason }}\n{% endfor %}\n\n**Customer Context**:\n{% if $json.customer_satisfaction_score %}⭐ **Previous CSAT**: {{ $json.customer_satisfaction_score }}/5{% endif %}\n💬 **Response Count**: {{ $json.response_count }}\n{% if $json.previously_escalated %}⚠️ **Previously Escalated**: Yes{% endif %}\n\n**Ticket Description**:\n_{{ $json.description | truncate(200) }}_\n\n🔗 **Action Required**: Immediate manager review and assignment\n\n*Processed at {{ $json.processed_at | date('short') }} | Session: {{ $json.analytics_session }}*",
        "select": "channel",
        "channelId": {
          "__rl": true,
          "mode": "name",
          "value": "C1234567890"
        },
        "otherOptions": {},
        "authentication": "oAuth2"
      },
      "typeVersion": 2.2
    },
    {
      "id": "4db9ad91-4584-46d5-99f2-55907fcfb5ff",
      "name": "分析摘要过滤器",
      "type": "n8n-nodes-base.if",
      "position": [
        720,
        752
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "conditions": [
            {
              "id": "analytics-data",
              "operator": {
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $json.analytics_type }}",
              "rightValue": "performance_summary"
            }
          ],
          "combineOperation": "any"
        }
      },
      "typeVersion": 2
    },
    {
      "id": "f503cb4d-c6fb-4cd1-b9a8-be6c3414b773",
      "name": "Slack 分析摘要报告",
      "type": "n8n-nodes-base.slack",
      "position": [
        1120,
        752
      ],
      "webhookId": "419f9429-af3c-4e4b-989c-c66e0aa1b0a0",
      "parameters": {
        "text": "📊 **SUPPORT ANALYTICS SUMMARY** 📊\n\n**Overall Performance Metrics:**\n\n**Ticket Volume:**\n🎫 **Total Tickets**: {{ $json.data.total_tickets }}\n📂 **Open Tickets**: {{ $json.data.open_tickets }}\n✅ **Closed Tickets**: {{ $json.data.closed_tickets }}\n📈 **Resolution Rate**: {{ $json.data.resolution_rate }}%\n\n**Performance Indicators:**\n⏱️ **Avg Resolution Time**: {{ $json.data.avg_resolution_time_hours }} hours\n⭐ **Avg Customer Satisfaction**: {{ $json.data.avg_satisfaction_score }}/5\n🔺 **Escalation Rate**: {{ $json.data.escalation_rate }}%\n\n**Category Breakdown:**\n{% for category, count in $json.data.category_distribution %}📋 **{{ category }}**: {{ count }} tickets\n{% endfor %}\n\n**Key Insights:**\n{% if $json.data.escalation_rate > 15 %}⚠️ High escalation rate detected - review process efficiency{% endif %}\n{% if $json.data.avg_satisfaction_score < 4.0 %}⚠️ Customer satisfaction below target - investigate common issues{% endif %}\n{% if $json.data.resolution_rate < 80 %}⚠️ Resolution rate below target - resource allocation needed{% endif %}\n\n*Generated at {{ $json.processed_at | date('short') }}*",
        "select": "channel",
        "channelId": {
          "__rl": true,
          "mode": "name",
          "value": "C0987654321"
        },
        "otherOptions": {},
        "authentication": "oAuth2"
      },
      "typeVersion": 2.2
    },
    {
      "id": "ec369956-4844-4d70-851c-ffb1bf59b2ac",
      "name": "便签 - 触发器",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -400,
        -480
      ],
      "parameters": {
        "color": 7,
        "width": 350,
        "height": 1330,
        "content": "# 步骤 1:支持监控触发器 🎫"
      },
      "typeVersion": 1
    },
    {
      "id": "ecade188-9b0c-4d9f-a642-36354cc3d4bb",
      "name": "便签 - 数据提取",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        32,
        -464
      ],
      "parameters": {
        "color": 7,
        "width": 350,
        "height": 1282,
        "content": "# 步骤 2:多源支持数据提取 🔍"
      },
      "typeVersion": 1
    },
    {
      "id": "5a660240-1b28-4c05-9f1d-17655042bb85",
      "name": "便签 - 分析引擎",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        576,
        -592
      ],
      "parameters": {
        "color": 7,
        "width": 350,
        "height": 1090,
        "content": "# 步骤 3:高级支持分析 🧠"
      },
      "typeVersion": 1
    },
    {
      "id": "63852bb0-38e6-441f-9b43-ad866e34e391",
      "name": "便签 - 报告与警报",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1008,
        -320
      ],
      "parameters": {
        "color": 7,
        "width": 782,
        "height": 1266,
        "content": "# 步骤 4:智能升级与报告 📊"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "d6b51a9f-e1e1-4cef-87ee-3f05bc6888f7",
  "connections": {
    "Analytics Summary Filter": {
      "main": [
        [
          {
            "node": "Slack Analytics Summary Report",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Closed Tickets Analyzer": {
      "main": [
        [
          {
            "node": "Advanced Support Analytics & Intelligence",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Knowledge Base Analyzer": {
      "main": [
        [
          {
            "node": "Advanced Support Analytics & Intelligence",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Critical Escalation Filter": {
      "main": [
        [
          {
            "node": "Slack Manager Escalation Alert",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Support Dashboard Scraper": {
      "main": [
        [
          {
            "node": "Advanced Support Analytics & Intelligence",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Support Ticket Webhook Trigger": {
      "main": [
        [
          {
            "node": "AI Support Dashboard Scraper",
            "type": "main",
            "index": 0
          },
          {
            "node": "AI Closed Tickets Analyzer",
            "type": "main",
            "index": 0
          },
          {
            "node": "AI Knowledge Base Analyzer",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Automated Support Monitor Trigger": {
      "main": [
        [
          {
            "node": "AI Support Dashboard Scraper",
            "type": "main",
            "index": 0
          },
          {
            "node": "AI Closed Tickets Analyzer",
            "type": "main",
            "index": 0
          },
          {
            "node": "AI Knowledge Base Analyzer",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Advanced Support Analytics & Intelligence": {
      "main": [
        [
          {
            "node": "Google Sheets Support Analytics Dashboard",
            "type": "main",
            "index": 0
          },
          {
            "node": "Critical Escalation Filter",
            "type": "main",
            "index": 0
          },
          {
            "node": "Analytics Summary Filter",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

复制上方的 JSON 配置代码,在您的 n8n 实例中创建新工作流并选择「从 JSON 导入」,粘贴配置后根据需要修改凭证设置即可。

这个工作流适合什么场景?

中级 - 工单管理, AI 摘要总结

需要付费吗?

本工作流完全免费,您可以直接导入使用。但请注意,工作流中使用的第三方服务(如 OpenAI API)可能需要您自行付费。

工作流信息
难度等级
中级
节点数量15
分类2
节点类型8
难度说明

适合有一定经验的用户,包含 6-15 个节点的中等复杂度工作流

外部链接
在 n8n.io 查看

分享此工作流