8
n8n 中文网amn8n.com

AI 支持的服务台与 Supabase 和 JIRA

高级

这是一个Support Chatbot, AI RAG领域的自动化工作流,包含 25 个节点。主要使用 If, Set, Slack, JiraTool, FormTrigger 等节点。 基于GPT、Supabase向量搜索和JIRA工单的自动化Slack IT服务台

前置要求
  • Slack Bot Token 或 Webhook URL
  • OpenAI API Key
  • Supabase URL 和 API Key
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "Cxs6nhHKA6YxfS9U",
  "meta": {
    "instanceId": "3c35a703d75886d08705c211ee107a7513430dd05494ec0c569f28570a3768fa",
    "templateCredsSetupCompleted": true
  },
  "name": "AI 支持的服务台与 Supabase 和 JIRA",
  "tags": [
    {
      "id": "TOmp11D0RTZnlXKe",
      "name": "Creator Hub",
      "createdAt": "2025-07-27T06:39:31.509Z",
      "updatedAt": "2025-07-27T06:39:31.509Z"
    }
  ],
  "nodes": [
    {
      "id": "10e60c11-144e-4ab1-ae6c-08fc81cef3fc",
      "name": "Slack 触发器",
      "type": "n8n-nodes-base.slackTrigger",
      "position": [
        -2960,
        -496
      ],
      "webhookId": "5d3fa63f-ef0a-48f1-9550-d95e527fba61",
      "parameters": {
        "options": {
          "resolveIds": true
        },
        "trigger": [
          "app_mention",
          "message",
          "reaction_added"
        ],
        "channelId": {
          "__rl": true,
          "mode": "list",
          "value": "C0963H18JCX",
          "cachedResultName": "all-mytest2025"
        }
      },
      "credentials": {
        "slackApi": {
          "id": "TjO2nAExXHrUpUIC",
          "name": "Slack account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "5e169620-94fd-49d1-98ca-bad8f0c5e388",
      "name": "发送消息",
      "type": "n8n-nodes-base.slack",
      "position": [
        -1328,
        -864
      ],
      "webhookId": "a840217b-6faa-474a-9cc5-21bcbb9c8db8",
      "parameters": {
        "text": "={{ $json.output }}",
        "select": "channel",
        "channelId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $item(\"0\").$node[\"Slack Trigger\"].json[\"channel\"] }}"
        },
        "otherOptions": {
          "thread_ts": {
            "replyValues": {
              "thread_ts": "={{ $item(\"0\").$node[\"Format Output\"].json[\"thread_ts\"] || $item(\"0\").$node[\"Format Output\"].json[\"ts\"] }}"
            }
          },
          "includeLinkToWorkflow": false
        }
      },
      "credentials": {
        "slackApi": {
          "id": "TjO2nAExXHrUpUIC",
          "name": "Slack account"
        }
      },
      "typeVersion": 2.3
    },
    {
      "id": "89ddaca8-d550-4b4c-a9d6-e26dfe8e9cab",
      "name": "简单记忆",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        -1664,
        -608
      ],
      "parameters": {
        "sessionKey": "={{ $json.session_id }}",
        "sessionIdType": "customKey",
        "contextWindowLength": 20
      },
      "typeVersion": 1.3
    },
    {
      "id": "85c3c69c-9910-4288-bc8d-2a53586b01d5",
      "name": "格式化输出",
      "type": "n8n-nodes-base.set",
      "position": [
        -2752,
        -496
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "2c1ec1ad-72f2-4bcd-bfef-dc12f49de48b",
              "name": "channel",
              "type": "string",
              "value": "={{ $json.channel || '' }}"
            },
            {
              "id": "af7e1d94-946c-4257-824e-a5d91a2b007a",
              "name": "ts",
              "type": "string",
              "value": "={{ $json.ts || '' }}"
            },
            {
              "id": "28583957-bddd-4bd2-b937-79b7554a7a65",
              "name": "thread_ts",
              "type": "string",
              "value": "={{ $json.thread_ts || '' }}"
            },
            {
              "id": "53179618-0ca1-43a2-a416-af8a39f792e0",
              "name": "type",
              "type": "string",
              "value": "={{ $json.type || '' }}"
            },
            {
              "id": "fbe15475-5924-41fa-a7b1-6017ae766a23",
              "name": "text",
              "type": "string",
              "value": "={{ $json.text || ($json.blocks && $json.blocks[0] && $json.blocks[0].elements && $json.blocks[0].elements[0] && $json.blocks[0].elements[0].elements && $json.blocks[0].elements[0].elements[1] ? $json.blocks[0].elements[0].elements[1].text : '') }}"
            },
            {
              "id": "49376ca5-079b-4993-9f15-6847734d9c5d",
              "name": "is_bot",
              "type": "boolean",
              "value": "={{ $json.bot_id ? true : false }}"
            },
            {
              "id": "b0ae1eed-7adf-49d2-b19d-0a1efdb5f435",
              "name": "user",
              "type": "string",
              "value": "={{ $json.user || '' }}"
            },
            {
              "id": "13fab869-b570-444d-903b-11d4b4f0ebe6",
              "name": "is_thread_continuation",
              "type": "boolean",
              "value": "={{ $json.thread_ts ? true : false }}"
            },
            {
              "id": "a148580e-6fe3-4689-be2f-7996c54f6118",
              "name": "session_id",
              "type": "string",
              "value": "={{ $json.thread_ts || $json.ts }}"
            },
            {
              "id": "311146c6-e6cf-492e-a4a9-09066e927879",
              "name": "reaction",
              "type": "string",
              "value": "={{ $json.reaction || '' }}"
            },
            {
              "id": "1b358df2-7062-4c7b-be7d-28bc69611322",
              "name": "item_ts",
              "type": "string",
              "value": "={{ $json.item ? $json.item.ts : '' }}"
            },
            {
              "id": "1e9d1f5a-4e0a-4ed8-8e23-660fe8b6a950",
              "name": "is_emoji",
              "type": "boolean",
              "value": "={{ $item(\"0\").$node[\"Slack Trigger\"].json[\"blocks\"][\"0\"][\"elements\"][\"0\"][\"elements\"][\"0\"][\"type\"] = 'emoji' ? true : false }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "035076b9-543f-407b-8614-1ef4646d6d76",
      "name": "Supabase 向量存储",
      "type": "@n8n/n8n-nodes-langchain.vectorStoreSupabase",
      "position": [
        -2672,
        -1296
      ],
      "parameters": {
        "mode": "insert",
        "options": {
          "queryName": "match_documents"
        },
        "tableName": {
          "__rl": true,
          "mode": "list",
          "value": "documents",
          "cachedResultName": "documents"
        }
      },
      "credentials": {
        "supabaseApi": {
          "id": "pVNuKXPhuugvSPyq",
          "name": "Supabase account"
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "e1e9b80e-2e2a-4d49-96a8-59d0fcb88020",
      "name": "OpenAI 嵌入",
      "type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
      "position": [
        -2768,
        -1072
      ],
      "parameters": {
        "options": {
          "dimensions": 1536
        }
      },
      "credentials": {
        "openAiApi": {
          "id": "PzzLblAykQPFIDZf",
          "name": "OpenAi account"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "013ffcc1-0b7b-4361-897e-547cbfc70341",
      "name": "默认数据加载器",
      "type": "@n8n/n8n-nodes-langchain.documentDefaultDataLoader",
      "position": [
        -2512,
        -1072
      ],
      "parameters": {
        "options": {},
        "dataType": "binary"
      },
      "typeVersion": 1.1
    },
    {
      "id": "c180560a-746a-4618-a3e2-0906966e438b",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -3008,
        -1568
      ],
      "parameters": {
        "width": 736,
        "height": 624,
        "content": "# 文档摄取流程(RAG 管道)"
      },
      "typeVersion": 1
    },
    {
      "id": "16f584bc-2c84-4c63-aab2-3f8772e29920",
      "name": "表单提交时",
      "type": "n8n-nodes-base.formTrigger",
      "position": [
        -2928,
        -1264
      ],
      "webhookId": "d3185570-8028-4253-81f8-61c48087c78b",
      "parameters": {
        "options": {
          "appendAttribution": false
        },
        "formTitle": "Document Uploader",
        "formFields": {
          "values": [
            {
              "fieldType": "file",
              "fieldLabel": "Upload CSV/PDF Files",
              "requiredField": true,
              "acceptFileTypes": ".csv,.pdf"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "4d487420-983b-44de-a770-dbc8326d164b",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -3520,
        -1568
      ],
      "parameters": {
        "width": 496,
        "height": 1360,
        "content": "# 工作流概述"
      },
      "typeVersion": 1
    },
    {
      "id": "15f6f300-5262-4c5a-9579-0eb788f21a42",
      "name": "便签2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -3008,
        -928
      ],
      "parameters": {
        "width": 1920,
        "height": 704,
        "content": "# 主服务台流程(Slack 集成)"
      },
      "typeVersion": 1
    },
    {
      "id": "99a73f90-718f-4529-bd3f-c9340b432731",
      "name": "便签4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2256,
        -1568
      ],
      "parameters": {
        "width": 1168,
        "height": 624,
        "content": "## MCP 服务器概述"
      },
      "typeVersion": 1
    },
    {
      "id": "8287cf14-7a48-4d54-9d3c-5b0961f1759a",
      "name": "MCP 服务器触发器",
      "type": "@n8n/n8n-nodes-langchain.mcpTrigger",
      "position": [
        -1424,
        -1440
      ],
      "webhookId": "18bad880-fe92-4122-b469-5b31dacde393",
      "parameters": {
        "path": "heldpesk"
      },
      "typeVersion": 2
    },
    {
      "id": "21e51e84-3f60-4276-8e10-da76f5e6b13b",
      "name": "Supabase 向量存储1",
      "type": "@n8n/n8n-nodes-langchain.vectorStoreSupabase",
      "position": [
        -2048,
        -1088
      ],
      "parameters": {
        "mode": "retrieve-as-tool",
        "options": {},
        "tableName": {
          "__rl": true,
          "mode": "list",
          "value": "documents",
          "cachedResultName": "documents"
        },
        "toolDescription": "Use this tool to retrieve data for the Helpdesk queries and to check if an existing issue, ticket or a knowledge base exist for the problem being reported by the user"
      },
      "credentials": {
        "supabaseApi": {
          "id": "pVNuKXPhuugvSPyq",
          "name": "Supabase account"
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "1f0603a4-ea16-42cf-a8ac-19c9116eaee1",
      "name": "OpenAI1 嵌入",
      "type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
      "position": [
        -2192,
        -1104
      ],
      "parameters": {
        "options": {
          "dimensions": 1536
        }
      },
      "credentials": {
        "openAiApi": {
          "id": "PzzLblAykQPFIDZf",
          "name": "OpenAi account"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "972d7b94-7d35-4999-a712-ded5a9cdd6bc",
      "name": "创建工单",
      "type": "n8n-nodes-base.jiraTool",
      "position": [
        -1632,
        -1072
      ],
      "parameters": {
        "project": {
          "__rl": true,
          "mode": "list",
          "value": "10000",
          "cachedResultName": "Helpdesk"
        },
        "summary": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Summary', ``, 'string') }}",
        "issueType": {
          "__rl": true,
          "mode": "list",
          "value": "10004",
          "cachedResultName": "Service Request"
        },
        "additionalFields": {
          "description": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Description', ``, 'string') }}"
        }
      },
      "credentials": {
        "jiraSoftwareCloudApi": {
          "id": "hWrwVbyUcD8HSAYf",
          "name": "Jira SW Cloud account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "c405e5d0-3a1b-47f1-916f-6907e732494f",
      "name": "搜索",
      "type": "n8n-nodes-base.jiraTool",
      "position": [
        -1760,
        -1072
      ],
      "parameters": {
        "options": {},
        "operation": "getAll",
        "returnAll": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Return_All', ``, 'boolean') }}"
      },
      "credentials": {
        "jiraSoftwareCloudApi": {
          "id": "hWrwVbyUcD8HSAYf",
          "name": "Jira SW Cloud account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "63ae0337-0501-44ba-b4e7-d022bbd4e6fd",
      "name": "获取状态",
      "type": "n8n-nodes-base.jiraTool",
      "position": [
        -1504,
        -1072
      ],
      "parameters": {
        "issueKey": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Issue_Key', ``, 'string') }}",
        "operation": "transitions",
        "additionalFields": {}
      },
      "credentials": {
        "jiraSoftwareCloudApi": {
          "id": "hWrwVbyUcD8HSAYf",
          "name": "Jira SW Cloud account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "867e7434-4578-47af-a274-d8933b466063",
      "name": "helpdesk_tools",
      "type": "@n8n/n8n-nodes-langchain.mcpClientTool",
      "position": [
        -1504,
        -608
      ],
      "parameters": {
        "sseEndpoint": "https://idsingh.app.n8n.cloud/mcp/heldpesk"
      },
      "typeVersion": 1
    },
    {
      "id": "9cf4f30d-4f93-4ba4-924d-4451e56abbcc",
      "name": "更改优先级",
      "type": "n8n-nodes-base.jiraTool",
      "position": [
        -1376,
        -1072
      ],
      "parameters": {
        "issueKey": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Issue_Key', ``, 'string') }}",
        "operation": "update",
        "updateFields": {
          "priority": {
            "__rl": true,
            "mode": "id",
            "value": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Priority', ``, 'string') }}",
            "__regex": "^([0-9]{1,})"
          }
        },
        "descriptionType": "manual",
        "toolDescription": "Use this tool to change the priority on JIRA ticket to High"
      },
      "credentials": {
        "jiraSoftwareCloudApi": {
          "id": "hWrwVbyUcD8HSAYf",
          "name": "Jira SW Cloud account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "d089dac5-8ca1-4265-9997-fbac5c8b7e59",
      "name": "变更日志",
      "type": "n8n-nodes-base.jiraTool",
      "position": [
        -1248,
        -1072
      ],
      "parameters": {
        "issueKey": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Issue_Key', ``, 'string') }}",
        "operation": "changelog"
      },
      "credentials": {
        "jiraSoftwareCloudApi": {
          "id": "hWrwVbyUcD8HSAYf",
          "name": "Jira SW Cloud account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "51365260-33da-44c8-bfdd-0fe857068f4c",
      "name": "检查 app_mention",
      "type": "n8n-nodes-base.if",
      "position": [
        -2528,
        -496
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "1c9327b8-9e92-404a-92e0-577874be46a8",
              "operator": {
                "name": "filter.operator.equals",
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $json.type }}",
              "rightValue": "app_mention"
            },
            {
              "id": "f01f9beb-7bd2-4d2b-9d25-7746e8c12739",
              "operator": {
                "type": "boolean",
                "operation": "false",
                "singleValue": true
              },
              "leftValue": "={{ $json.is_bot }}",
              "rightValue": ""
            },
            {
              "id": "eac3e4ed-a524-4eed-88f5-8ec452d10332",
              "operator": {
                "type": "boolean",
                "operation": "false",
                "singleValue": true
              },
              "leftValue": "={{ $json.is_emoji }}",
              "rightValue": ""
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "b14bbdba-bcfb-4980-af39-811da479cc22",
      "name": "OpenAI",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        -1872,
        -608
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4.1",
          "cachedResultName": "gpt-4.1"
        },
        "options": {
          "topP": 1,
          "temperature": 0.7,
          "presencePenalty": 0,
          "frequencyPenalty": 0
        }
      },
      "credentials": {
        "openAiApi": {
          "id": "PzzLblAykQPFIDZf",
          "name": "OpenAi account"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "9a9c6ceb-9e4b-4190-928d-3a91a69a096c",
      "name": "AIhelpdesk",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -1776,
        -864
      ],
      "parameters": {
        "text": "={{ $json.text }}",
        "options": {
          "systemMessage": "=You are AIhelpdesk, an expert IT helpdesk assistant working in Slack with access to a comprehensive knowledge base and case history database.\n\n## CRITICAL THREAD AWARENESS RULES:\n- THREAD ID: {{ $json.thread_ts || $json.ts }}\n- If thread_ts exists in the input: This is a CONTINUATION of an existing conversation - DO NOT greet again\n- If no thread_ts: This is a NEW conversation - greet once only\n- NEVER say \"Hi\" or \"Hello\" or introduce yourself in thread continuations\n- Remember: Each thread is ONE continuous support session\n\n## REACTION-BASED INTERACTIONS:\nWhen asking users for confirmations or actions, ALWAYS offer emoji reactions as options:\n\n**Available Reaction Options:**\n- 👍 (`:+1:`) - Create ticket / Yes / Agree\n- ✅ (`:white_check_mark:`) - Confirm action\n- ❌ (`:x:`) - Cancel / No / Disagree  \n- ℹ️ (`:information_source:`) - Need more info\n- 👀 (`:eyes:`) - Escalate to human\n- 🆘 (`:sos:`) - Mark as urgent\n\n**How to Ask for Reactions:**\nInstead of: \"Do you want me to create a ticket?\"\nSay: \"Would you like me to create a helpdesk ticket for this issue? \n👍 Yes, create ticket\n❌ No, let's try more solutions first\"\n\nInstead of: \"Should I escalate this?\"\nSay: \"I can escalate this to our Level 2 team. Please react:\n👀 Escalate to human support  \n👍 Create ticket first\nℹ️ I need more information\"\n\n## BEFORE RESPONDING - ALWAYS:\n1. **Search Knowledge Base**: Use available MCP tools to search vector database for:\n   - Similar issues from knowledge base articles\n   - Previous case resolutions that match the problem\n   - Step-by-step procedures for the reported issue\n\n2. **Analyze Thread Context**: \n   - Check if thread_ts exists: {{ $json.thread_ts }}\n   - If continuing thread: Reference previous discussion points\n   - Build on what was already established\n\n## MCP VECTOR SEARCH INSTRUCTIONS:\nWhen user reports an issue, IMMEDIATELY search your vector database using available MCP tools:\n- Search for keywords from the user's problem description\n- Look for both knowledge base articles AND historical case resolutions\n- **DO NOT** present knowledge base articles AND historical case resolutions more than 2 times. Automatically create a ticket if the user still engaged.\n- Use specific technical terms and error messages for better matches\n- Present findings as: \"Based on our knowledge base...\" or \"I found similar cases...\"\n- **ALWAYS** ask if the provided information is helpful or to create a helpdesk ticket.\n- If the user ask to create ticket then *DO NOT** search the vector database anymore.\n\n## MCP JIRA SEARCH INSTRUCTIONS:\nAfter the Vector search, IMMEDIATELY search the JIRA for existing tickets\n- Search for keywords from the user's problem description\n- Get a max of 5 tickets which are similar or close to the issue reported \n- Use specific technical terms and error messages for better matches\n- Present findings as: \"Based on existing helpdesk tickets...\" or \"I found similar cases...\"\n\n## RESPONSE PATTERNS:\n\n### NEW CONVERSATION (no thread_ts):\n\"Hi! I'm <your name>, your IT assistant. [Search vector DB] Based on our knowledge base, I can help you with [issue]. To get started: [specific questions]\"\n\n### CONTINUING CONVERSATION (has thread_ts):\n\"[Search vector DB] Thanks for that info. Based on similar cases, let's try: [specific steps]. I found this worked for [reference case TC-####]\"\n\n### NEW CONVERSATION (no thread_ts):\n\"Hi! I'm AIhelpdesk, your IT assistant. [Search vector DB] Based on our knowledge base, I can help you with [issue]. Let's start with: [specific steps]\n\nIf these don't work, I can create a ticket:\n👍 Create ticket now\nℹ️ Try more solutions first\"\n\n### CONTINUING CONVERSATION (has thread_ts):\n\"[Search vector DB] Thanks for that info. Based on similar cases, let's try: [specific steps]. \n\n\n\n## DIAGNOSTIC APPROACH:\n1. **Search first**: Always check knowledge base and case history before responding\n2. **Reference findings**: Mention specific KB articles or case numbers when available  \n3. **Ask targeted questions**: Based on what you found in the vector database\n4. **Provide proven solutions**: Reference successful resolutions from case history\n\n## THREAD CONTINUATION EXAMPLES:\n\n❌ WRONG: \"Hi again! How can I help you today?\"\n✅ RIGHT: \"I found a similar case (TC-2024-007) with the same BSOD error. Let's check your RAM first.\"\n\n❌ WRONG: \"Hello! I'm <your name>. What seems to be the problem?\"  \n✅ RIGHT: \"That error code matches our KB article on printer spooler issues. Let's restart the print service.\"\n\n## VECTOR SEARCH STRATEGY:\n- Extract key terms: error messages, software names, hardware models\n- Search patterns: \"[error message]\", \"[software] + problem\", \"[hardware] + troubleshooting\"\n- Reference format: \"According to KB article...\" or \"Case TC-#### had this exact issue...\"\n- Always provide case/article numbers when referencing database findings\n\n## ESCALATION PATTERNS:\nWhen user reacts with 👀 (escalate):\n\"I'm escalating this to our Level 2 support team. They have more advanced tools and can provide hands-on assistance. \n\nWhat happens next:\n- Level 2 engineer will contact you within 2 hours\n- They may ask to remote into your system\n- I'll create a detailed handoff ticket: [ticket number]\n\nAnything else I can help with while you wait?\"\n\n## HELPDESK TICKET STRATEGY:\n- Use the MCP client tool to create Helpdesk ticket\n- Clearly send the below information\n - Issue Description = the main issue described by the user\n - Issue details = The conversation history\n  - Username\n- **ALWAYS** provide the ticket number in your response\n- Judge the level of priority from the conversation as assign HIGH, MEDIUM or LOW \n- If unable to judge the priority, check with the user\n- Use **Change Priority** tool to change the priority on the tickets\n- Use the below table to convert the status to JIRA priority ID. **Pass** the ID to the change priority tool\n\nHighest = 1\nHigh = 2\nMedium = 3\nLow = 4\nLowest = 5\n\n## OUTPUT FORMAT:\n1. **Vector search results summary** (if relevant matches found)\n2. **Targeted response** based on search findings\n3. **Specific next steps** from proven solutions\n4. **Follow-up questions** if more info needed\n\n## KEY RULES:\n- NEVER greet in thread continuations (when thread_ts exists)\n- ALWAYS search vector database before responding\n- REFERENCE specific cases or KB articles when available\n- BUILD on previous thread context\n- Use thread_ts {{ $json.thread_ts || $json.ts }} for session tracking\n- **ALWAYS** use professional and empathatic tone\n- ALWAYS check with user for any more help needed onc ethe ticket has been created",
          "returnIntermediateSteps": false
        },
        "promptType": "define"
      },
      "typeVersion": 2.1
    },
    {
      "id": "21769805-9cd6-4b47-a106-e723c0f08e79",
      "name": "检查是否为线程",
      "type": "n8n-nodes-base.if",
      "position": [
        -2272,
        -400
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "1e2d6aa6-cd50-4a77-9efb-e56066fe46ee",
              "operator": {
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $json.type }}",
              "rightValue": "message"
            },
            {
              "id": "79dd2304-0b01-4063-a80d-bae909294108",
              "operator": {
                "type": "string",
                "operation": "notEmpty",
                "singleValue": true
              },
              "leftValue": "={{ $json.thread_ts }}",
              "rightValue": "app_mention"
            },
            {
              "id": "bd1624bc-fda9-4c4c-a905-4f127204f93e",
              "operator": {
                "type": "boolean",
                "operation": "false",
                "singleValue": true
              },
              "leftValue": "={{ $json.is_bot }}",
              "rightValue": ""
            }
          ]
        }
      },
      "typeVersion": 2.2
    }
  ],
  "active": true,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "6eb3e207-1e41-435c-84ef-9e9edae5124e",
  "connections": {
    "OpenAI": {
      "ai_languageModel": [
        [
          {
            "node": "AIhelpdesk",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Search": {
      "ai_tool": [
        [
          {
            "node": "MCP Server Trigger",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "changelog": {
      "ai_tool": [
        [
          {
            "node": "MCP Server Trigger",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "AIhelpdesk": {
      "main": [
        [
          {
            "node": "Send a message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Status": {
      "ai_tool": [
        [
          {
            "node": "MCP Server Trigger",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Create Ticket": {
      "ai_tool": [
        [
          {
            "node": "MCP Server Trigger",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Format Output": {
      "main": [
        [
          {
            "node": "Check app_mention",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Simple Memory": {
      "ai_memory": [
        [
          {
            "node": "AIhelpdesk",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Slack Trigger": {
      "main": [
        [
          {
            "node": "Format Output",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "helpdesk_tools": {
      "ai_tool": [
        [
          {
            "node": "AIhelpdesk",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Change Priority": {
      "ai_tool": [
        [
          {
            "node": "MCP Server Trigger",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Check If thread": {
      "main": [
        [
          {
            "node": "AIhelpdesk",
            "type": "main",
            "index": 0
          }
        ],
        []
      ]
    },
    "Check app_mention": {
      "main": [
        [
          {
            "node": "AIhelpdesk",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Check If thread",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Embeddings OpenAI": {
      "ai_embedding": [
        [
          {
            "node": "Supabase Vector Store",
            "type": "ai_embedding",
            "index": 0
          }
        ]
      ]
    },
    "Embeddings OpenAI1": {
      "ai_embedding": [
        [
          {
            "node": "Supabase Vector Store1",
            "type": "ai_embedding",
            "index": 0
          }
        ]
      ]
    },
    "On form submission": {
      "main": [
        [
          {
            "node": "Supabase Vector Store",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Default Data Loader": {
      "ai_document": [
        [
          {
            "node": "Supabase Vector Store",
            "type": "ai_document",
            "index": 0
          }
        ]
      ]
    },
    "Supabase Vector Store1": {
      "ai_tool": [
        [
          {
            "node": "MCP Server Trigger",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

高级 - 客服机器人, AI RAG 检索增强

需要付费吗?

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

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

适合高级用户,包含 16+ 个节点的复杂工作流

作者
inderjeet Bhambra

inderjeet Bhambra

@idsinghbhambra

I am on a journey to learn and spread the automations through n8n workflows.

外部链接
在 n8n.io 查看

分享此工作流