8
n8n 中文网amn8n.com

开发者聊天问答捕获(Slack)

高级

这是一个Internal Wiki, AI Summarization领域的自动化工作流,包含 20 个节点。主要使用 If, Code, Notion, Airtable, GoogleSheets 等节点。 使用GPT-4o从Slack分类开发者问题到Notion和Airtable

前置要求
  • Notion API Key
  • Airtable API Key
  • Google Sheets API 凭证
  • Slack Bot Token 或 Webhook URL
  • OpenAI API Key
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "FVAlstK1A75QWcNY",
  "meta": {
    "instanceId": "8443f10082278c46aa5cf3acf8ff0f70061a2c58bce76efac814b16290845177",
    "templateCredsSetupCompleted": true
  },
  "name": "开发者聊天问答捕获(Slack)",
  "tags": [],
  "nodes": [
    {
      "id": "d605b180-fd35-4ab7-9bc3-b7ac4d07382a",
      "name": "配置GPT-4o模型",
      "type": "@n8n/n8n-nodes-langchain.lmChatAzureOpenAi",
      "position": [
        -48,
        160
      ],
      "parameters": {
        "model": "gpt-4o",
        "options": {}
      },
      "credentials": {
        "azureOpenAiApi": {
          "id": "C3WzT18XqF8OdVM6",
          "name": "Azure Open AI account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "673d6f84-b6df-4ab0-b660-68e9c2f42c58",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1008,
        144
      ],
      "parameters": {
        "height": 416,
        "content": "## 节点名称:Slack频道触发器 - 开发者问答"
      },
      "typeVersion": 1
    },
    {
      "id": "47fcda03-e6b3-4c57-9759-5ecd78e5111c",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -736,
        -528
      ],
      "parameters": {
        "height": 448,
        "content": "## 节点名称:验证Slack消息有效负载"
      },
      "typeVersion": 1
    },
    {
      "id": "ca80b0ca-55db-4daa-ae54-b0bebeeaa496",
      "name": "便签2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -48,
        -592
      ],
      "parameters": {
        "height": 496,
        "content": "## 节点名称:分类开发者问题(AI)"
      },
      "typeVersion": 1
    },
    {
      "id": "3de471ba-4941-4bd4-b4c8-c0ef1ddac91d",
      "name": "便签3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -384,
        -528
      ],
      "parameters": {
        "height": 448,
        "content": "## 节点名称:提取问题元数据(JavaScript)"
      },
      "typeVersion": 1
    },
    {
      "id": "4918701a-c839-4ccc-8520-68896948d3b7",
      "name": "便签4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -64,
        320
      ],
      "parameters": {
        "height": 384,
        "content": "## 节点名称:配置GPT-4o模型"
      },
      "typeVersion": 1
    },
    {
      "id": "e49f36cf-2e1c-46cb-82b8-933828f06eee",
      "name": "便签5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -448,
        528
      ],
      "parameters": {
        "height": 416,
        "content": "## 节点名称:将工作流错误记录到Google Sheets"
      },
      "typeVersion": 1
    },
    {
      "id": "2579076f-312f-42a3-a4ec-28a06734d309",
      "name": "便签 6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        288,
        -512
      ],
      "parameters": {
        "height": 432,
        "content": "## 节点名称:解析AI JSON输出"
      },
      "typeVersion": 1
    },
    {
      "id": "8acec43e-5345-47e6-b982-0ca2fc8bb8f6",
      "name": "便签7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        544,
        112
      ],
      "parameters": {
        "height": 448,
        "content": "## 节点名称:检查问题是否已回答"
      },
      "typeVersion": 1
    },
    {
      "id": "6aca240f-06ae-4efa-81da-de358ff558c2",
      "name": "便签8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        880,
        -736
      ],
      "parameters": {
        "height": 496,
        "content": "## 节点名称:将已回答问题保存到Notion FAQ"
      },
      "typeVersion": 1
    },
    {
      "id": "5e8735d8-e19a-4022-8a88-11a5c089628d",
      "name": "便签9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        912,
        336
      ],
      "parameters": {
        "height": 464,
        "content": "## 节点名称:将未回答问题记录到Airtable"
      },
      "typeVersion": 1
    },
    {
      "id": "0f0577a1-998f-4d2a-bcc8-bdad6ce83712",
      "name": "Slack频道触发器 - 开发者问答",
      "type": "n8n-nodes-base.slackTrigger",
      "position": [
        -944,
        -32
      ],
      "webhookId": "56e594a0-b975-429c-9a8a-52c768c1589e",
      "parameters": {
        "options": {},
        "trigger": [
          "message"
        ],
        "channelId": {
          "__rl": true,
          "mode": "list",
          "value": "C09CVLMSF3R",
          "cachedResultName": "issue-smarteremr"
        }
      },
      "credentials": {
        "slackApi": {
          "id": "rNqvWj9TfChPVRYY",
          "name": "Slack account vivek"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "4ae060d6-e45c-4186-8ca4-fc6254b937df",
      "name": "验证Slack消息有效负载",
      "type": "n8n-nodes-base.if",
      "position": [
        -672,
        -32
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "e2adb005-2b3c-4d1e-8445-442df1fe925a",
              "operator": {
                "type": "string",
                "operation": "notEmpty",
                "singleValue": true
              },
              "leftValue": "={{ $json.user }}",
              "rightValue": ""
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "e7aea1a1-c5d6-4036-b964-f7261b82f5a4",
      "name": "提取问题元数据(JavaScript)",
      "type": "n8n-nodes-base.code",
      "position": [
        -320,
        -48
      ],
      "parameters": {
        "jsCode": "return [{\n  question: $json.text.replace(/>|[\\n\"]/g, '').trim(),\n  user: $json.user,\n  timestamp: $json.ts,\n  channel: $json.channel\n}];\n"
      },
      "typeVersion": 2
    },
    {
      "id": "582017af-c1ee-4670-87a8-b3fd5baf3199",
      "name": "分类开发者问题(AI)",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -16,
        -48
      ],
      "parameters": {
        "text": "=You are a Slack Q&A classifier for developer discussions.  \nYou have the following internal FAQ knowledge:\n\n1. Q: How to connect local API server to staging database?  \n   A: Update the `.env` file with staging DB credentials and restart the service.\n\n2. Q: How to restart the backend server?  \n   A: Run `pm2 restart backend` or `npm run serve` depending on environment.\n\n3. Q: How to fix 401 error on /auth/login endpoint?  \n   A: Ensure the auth token is refreshed using the /refresh-token route before login.\n\n---\n\nYour job:\nWhen a new developer question comes in, check if it matches (or is similar) to one of the questions above.  \nIf yes, output JSON like this:\n{\n  \"status\": \"answered\",\n  \"answer_quality\": \"strong\",\n  \"canonical_answer\": \"(matching answer from above)\"\n}\n\nIf no match found, output:\n{\n  \"status\": \"unanswered\",\n  \"answer_quality\": \"weak\",\n  \"canonical_answer\": \"\"\n}\nAlways respond with clean JSON only.\n",
        "options": {
          "systemMessage": "=Question: {{$json.question}}\n"
        },
        "promptType": "define"
      },
      "typeVersion": 2.1
    },
    {
      "id": "fd788ab2-46df-498d-a8df-b4d45161ffd5",
      "name": "解析AI JSON输出",
      "type": "n8n-nodes-base.code",
      "position": [
        368,
        -48
      ],
      "parameters": {
        "jsCode": "return [JSON.parse($json.output)];\n"
      },
      "typeVersion": 2
    },
    {
      "id": "53a743a3-1b56-419b-a8f6-1a5c8af21ec1",
      "name": "检查问题是否已回答",
      "type": "n8n-nodes-base.if",
      "position": [
        656,
        -48
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "b082c89c-ddea-4183-ad99-04b76ffb9bdb",
              "operator": {
                "name": "filter.operator.equals",
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $json.status }}",
              "rightValue": "answered"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "050dfc42-d32a-48cc-ab95-f47ba238d719",
      "name": "将已回答问题保存到Notion FAQ",
      "type": "n8n-nodes-base.notion",
      "position": [
        944,
        -208
      ],
      "parameters": {
        "title": "={{ $('Slack Channel Trigger – Developer Q&A').item.json.text }}",
        "simple": false,
        "options": {},
        "resource": "databasePage",
        "databaseId": {
          "__rl": true,
          "mode": "list",
          "value": "29a802b9-1fa0-804a-b406-e078961e0659",
          "cachedResultUrl": "https://www.notion.so/29a802b91fa0804ab406e078961e0659",
          "cachedResultName": "Release Notes"
        },
        "propertiesUi": {
          "propertyValues": [
            {
              "key": "Status|rich_text",
              "textContent": "={{ $json.status }}"
            },
            {
              "key": "Priority|rich_text",
              "textContent": "={{ $json.answer_quality }}"
            },
            {
              "key": "FAQ Content|rich_text",
              "textContent": "={{ $json.canonical_answer }}"
            }
          ]
        }
      },
      "credentials": {
        "notionApi": {
          "id": "iDjtgSTYG9ECVBtT",
          "name": "Notion account 2"
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "9c8a1797-2cc1-415c-839c-88dd8b4aa1b5",
      "name": "将未回答问题记录到Airtable",
      "type": "n8n-nodes-base.airtable",
      "position": [
        944,
        160
      ],
      "parameters": {
        "base": {
          "__rl": true,
          "mode": "list",
          "value": "appsZ3Uuh5PnD215s",
          "cachedResultUrl": "https://airtable.com/appsZ3Uuh5PnD215s",
          "cachedResultName": "Github Issue"
        },
        "table": {
          "__rl": true,
          "mode": "list",
          "value": "tblZvyR7J8hndLlUZ",
          "cachedResultUrl": "https://airtable.com/appsZ3Uuh5PnD215s/tblZvyR7J8hndLlUZ",
          "cachedResultName": "Table 1"
        },
        "columns": {
          "value": {
            "Name": "={{ $('Slack Channel Trigger – Developer Q&A').item.json.text }}",
            "Status": "Todo",
            "FAQ Match": "={{ $json.answer_quality }}",
            "Error Code": "={{ $json.status }}",
            "Issue Number": "={{ $('Slack Channel Trigger – Developer Q&A').item.json.client_msg_id }}"
          },
          "schema": [
            {
              "id": "Name",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Status",
              "type": "options",
              "display": true,
              "options": [
                {
                  "name": "Todo",
                  "value": "Todo"
                },
                {
                  "name": "In progress",
                  "value": "In progress"
                },
                {
                  "name": "Done",
                  "value": "Done"
                }
              ],
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Status",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Error Code",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Error Code",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Error Category",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Error Category",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "FAQ Match",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "FAQ Match",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Root Cause",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Root Cause",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Suggested Action",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Suggested Action",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Confidence",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Confidence",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Severity",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Severity",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Affected Endpoint",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Affected Endpoint",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Source URL",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Source URL",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Repository",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "Repository",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Issue Number",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Issue Number",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Created At",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": true,
              "required": false,
              "displayName": "Created At",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "create"
      },
      "credentials": {
        "airtableTokenApi": {
          "id": "nWc9JHR6t25WPWVV",
          "name": "Airtable Personal Access Token account"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "9a40948e-659c-42ef-8817-985eab6191d6",
      "name": "将工作流错误记录到Google Sheets",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -384,
        336
      ],
      "parameters": {
        "columns": {
          "value": {},
          "schema": [
            {
              "id": "error_id",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "error_id",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "error",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "error",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "error_id"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "append",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": 1338537721,
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1Uldk_4BxWbdZTDZxFUeohIfeBmGHHqVEl9Ogb0l6R8Y/edit#gid=1338537721",
          "cachedResultName": "error log sheet"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1Uldk_4BxWbdZTDZxFUeohIfeBmGHHqVEl9Ogb0l6R8Y",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1Uldk_4BxWbdZTDZxFUeohIfeBmGHHqVEl9Ogb0l6R8Y/edit?usp=drivesdk",
          "cachedResultName": "Interviewer Brief Pack "
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "kpPEOLCGn963qpoh",
          "name": "automations@techdome.ai"
        }
      },
      "typeVersion": 4.6
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "5d86bdfd-9f04-44c3-b043-b573e72cfe3b",
  "connections": {
    "Parse AI JSON Output": {
      "main": [
        [
          {
            "node": "Check If Question Was Answered",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Configure GPT-4o Model": {
      "ai_languageModel": [
        [
          {
            "node": " Classify Developer Question (AI)",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Check If Question Was Answered": {
      "main": [
        [
          {
            "node": "Save Answered Question to Notion FAQ",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": " Log Unanswered Question to Airtable",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Validate Slack Message Payload": {
      "main": [
        [
          {
            "node": "Extract Question Metadata (JavaScript)",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Log Workflow Errors to Google Sheets",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    " Classify Developer Question (AI)": {
      "main": [
        [
          {
            "node": "Parse AI JSON Output",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract Question Metadata (JavaScript)": {
      "main": [
        [
          {
            "node": " Classify Developer Question (AI)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Slack Channel Trigger – Developer Q&A": {
      "main": [
        [
          {
            "node": "Validate Slack Message Payload",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

高级 - 内部知识库, AI 摘要总结

需要付费吗?

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

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

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

作者
Rahul Joshi

Rahul Joshi

@rahul08

Rahul Joshi is a seasoned technology leader specializing in the n8n automation tool and AI-driven workflow automation. With deep expertise in building open-source workflow automation and self-hosted automation platforms, he helps organizations eliminate manual processes through intelligent n8n ai agent automation solutions.

外部链接
在 n8n.io 查看

分享此工作流