自动工单生成器

中级

这是一个AI、IT Ops领域的自动化工作流,包含 8 个节点。主要使用 Code、Slack、Webhook、Agent、LmChatOpenAi 等节点,结合人工智能技术实现智能自动化。 自动工单生成器:将Slack对话转换为结构化项目工单

前置要求
  • Slack Bot Token 或 Webhook URL
  • HTTP Webhook 端点(n8n 会自动生成)
  • OpenAI API Key

分类

工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "8PxWIzEWlqJ3Anov",
  "meta": {
    "instanceId": "6bcff5ef8a06e8086902526a05c2a4c7bf5da8101f89e582301ed78094606f40",
    "templateCredsSetupCompleted": true
  },
  "name": "自动工单生成器",
  "tags": [],
  "nodes": [
    {
      "id": "a1297b26-107e-40dd-9695-8ecb0534cacb",
      "name": "OpenAI 聊天模型",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        -80,
        360
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4.1",
          "cachedResultName": "gpt-4.1"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "id": "KLN8ZfDzv8mW6pyu",
          "name": "OpenAi account"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "5b67ef11-54e0-41b0-afd0-f3c4f359e513",
      "name": "Webhook",
      "type": "n8n-nodes-base.webhook",
      "position": [
        -520,
        100
      ],
      "webhookId": "e5d97187-896a-423b-9ba7-e23044ae1d7e",
      "parameters": {
        "path": "slack-ticket-maker",
        "options": {},
        "httpMethod": "POST"
      },
      "typeVersion": 2
    },
    {
      "id": "02cbd3c7-b0ac-4556-a00b-6f357ed8f7e9",
      "name": "代码",
      "type": "n8n-nodes-base.code",
      "position": [
        -300,
        100
      ],
      "parameters": {
        "jsCode": "// Extract and reformat the nested payload\nconst originalPayload = $input.all()[0];\nconst slackEvent = originalPayload.json.body[\"\"];\n\n// Create clean new structure\nreturn {\n  headers: originalPayload.json.headers,\n  slack: {\n    user: slackEvent.user,\n    channel: slackEvent.channel,\n    text: slackEvent.text.replace(/<@U.*?>/, \"\").trim(),\n    team: slackEvent.team,\n    timestamp: slackEvent.event_ts,\n    is_thread: !!slackEvent.thread_ts,\n    thread_id: slackEvent.thread_ts || \"main\"\n  }\n};"
      },
      "typeVersion": 2
    },
    {
      "id": "bee83d84-b9b6-454a-91dd-eda6087ad2fd",
      "name": "简单记忆",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        140,
        360
      ],
      "parameters": {
        "sessionKey": "=slack_{{$json['slack']['channel']}}_user_{{$json['slack']['user']}}",
        "sessionIdType": "customKey"
      },
      "typeVersion": 1.3
    },
    {
      "id": "eaccaa91-8a69-49fd-8dd4-418f4ea1dbd0",
      "name": "AI PM Wellington",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -40,
        100
      ],
      "parameters": {
        "text": "=Your job is receiving a message  {{ $json[\"slack\"][\"text\"] }} and breaking it into tickets (epics, tasks and so on) for development/execution of a task\n\nSetps:\n> Avaluate the level of complexibility, how many cards to make and how you should structure it\n\n>Ask for a project name\n\n> If more information is needed, specify and ask it. Don't create the tickets and wait for a response. You may only ask for information up to 2 times before creating the tickets.\n\n> Break the ticket/project into EPICS, and then write tickets for each of those Epics\n\n> Tickets should have:\n- Title (MUST)\n- Short Description (MUST)\nSections with bullet points:\n1. Objectives / Goals\n2. Definition of Done\n3. Requirements / Acceptance Criteria\n4. Implementation Details\n5. Risks & Challenges\n6. Testing & Validation\n7. Timeline & Milestones\n8. Related Notes & References\n9. Additional Comments / Open Questions\n\n> The bullet points should be brief and concise \n\n> You sould ALWAYS send the messages to the Slack channel.\n\n> Format only tickets as MARKDOWN\n\n> Each ticket must be surrounded by a code block (```)\nExample: ```ticket```",
        "options": {},
        "promptType": "define"
      },
      "typeVersion": 1.8
    },
    {
      "id": "09a6a284-8d70-4b3b-9a66-3c9045528552",
      "name": "Slack",
      "type": "n8n-nodes-base.slack",
      "position": [
        320,
        100
      ],
      "webhookId": "7408d0f3-4e82-4a45-8ad6-9e573fdc7f30",
      "parameters": {
        "text": "={{$json[\"output\"]}}",
        "select": "channel",
        "channelId": {
          "__rl": true,
          "mode": "list",
          "value": "C08QXSK7U1H",
          "cachedResultName": "ticket-maker"
        },
        "otherOptions": {}
      },
      "credentials": {
        "slackApi": {
          "id": "tp5KWuJ5R85fEonh",
          "name": "Slack account"
        }
      },
      "typeVersion": 2.3
    },
    {
      "id": "bcfb3867-8c8c-45a9-a0a6-9286a42e8fdf",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1080,
        -100
      ],
      "parameters": {
        "color": 3,
        "width": 640,
        "height": 560,
        "content": "# Varritech 免费 n8n 工作流"
      },
      "typeVersion": 1
    },
    {
      "id": "af714830-26e0-4e93-8c46-765c0ccb445c",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        520,
        60
      ],
      "parameters": {
        "color": 4,
        "width": 640,
        "height": 560,
        "content": "# 需要帮助最大化您的AI工作流?"
      },
      "typeVersion": 1
    }
  ],
  "active": true,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "9fe68472-1bb0-4950-a4aa-eb2f51ecbfe9",
  "connections": {
    "Code": {
      "main": [
        [
          {
            "node": "AI PM Wellington",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Webhook": {
      "main": [
        [
          {
            "node": "Code",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Simple Memory": {
      "ai_memory": [
        [
          {
            "node": "AI PM Wellington",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "AI PM Wellington": {
      "main": [
        [
          {
            "node": "Slack",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI PM Wellington",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

这是一个中级难度的工作流,适用于AI、IT Ops等场景。适合有一定经验的用户,包含 6-15 个节点的中等复杂度工作流

需要付费吗?

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

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

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

作者
Varritech

Varritech

@varritech

Build your next app 500% faster with the latest AI-powered development

外部链接
在 n8n.io 上查看 →

分享此工作流