8
n8n 中文网amn8n.com

多源反馈处理:集成OpenAI和Slack通知

中级

这是一个Engineering, Multimodal AI领域的自动化工作流,包含 15 个节点。主要使用 Set, Slack, Webhook, FormTrigger, ChainLlm 等节点。 集成OpenAI和Slack通知的多源反馈处理系统

前置要求
  • Slack Bot Token 或 Webhook URL
  • HTTP Webhook 端点(n8n 会自动生成)
  • OpenAI API Key
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "nodes": [
    {
      "id": "fa6c3683-960f-49c8-8c83-691347da9016",
      "name": "表单提交时",
      "type": "n8n-nodes-base.formTrigger",
      "position": [
        -32,
        0
      ],
      "webhookId": "5f7b2e49-14d3-4eb7-9dad-b9ec5a297bc3",
      "parameters": {
        "options": {},
        "formTitle": "Product feedback",
        "formFields": {
          "values": [
            {
              "fieldLabel": "Your feedback",
              "requiredField": true
            },
            {
              "fieldType": "dropdown",
              "fieldLabel": "Feedback type",
              "fieldOptions": {
                "values": [
                  {
                    "option": "Bug"
                  },
                  {
                    "option": "Feature request"
                  },
                  {
                    "option": "Praise"
                  },
                  {
                    "option": "Other"
                  }
                ]
              },
              "requiredField": true
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "75dfc8e9-b916-4310-91dd-c1f08c1d037c",
      "name": "当由其他工作流执行时",
      "type": "n8n-nodes-base.executeWorkflowTrigger",
      "position": [
        -32,
        192
      ],
      "parameters": {
        "workflowInputs": {
          "values": [
            {
              "name": "feedback"
            },
            {
              "name": "feedback type"
            }
          ]
        }
      },
      "typeVersion": 1.1
    },
    {
      "id": "90729deb-9654-4a12-a528-470434627ae0",
      "name": "从表单准备数据",
      "type": "n8n-nodes-base.set",
      "position": [
        304,
        0
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "a1f1f4a2-39ad-4e12-a945-5b4733f4f5ea",
              "name": "feedback",
              "type": "string",
              "value": "={{ $json['Your feedback'] }}"
            },
            {
              "id": "db2b9184-9584-4a0d-ba37-632debb9309a",
              "name": "feedback type",
              "type": "string",
              "value": "={{ $json['Feedback type'] }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "ff6caf39-e310-4f6f-a2fc-0f55694154da",
      "name": "从子工作流准备数据",
      "type": "n8n-nodes-base.set",
      "position": [
        304,
        192
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "a1f1f4a2-39ad-4e12-a945-5b4733f4f5ea",
              "name": "feedback",
              "type": "string",
              "value": "={{ $json.feedback }}"
            },
            {
              "id": "db2b9184-9584-4a0d-ba37-632debb9309a",
              "name": "feedback type",
              "type": "string",
              "value": "={{ $json['feedback type'] }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "94050a85-f1e8-4310-b7aa-92b57b06e6a5",
      "name": "合并触发器数据",
      "type": "n8n-nodes-base.set",
      "position": [
        640,
        144
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "a1f1f4a2-39ad-4e12-a945-5b4733f4f5ea",
              "name": "feedback",
              "type": "string",
              "value": "={{ $json.feedback }}"
            },
            {
              "id": "db2b9184-9584-4a0d-ba37-632debb9309a",
              "name": "feedback type",
              "type": "string",
              "value": "={{ $json['feedback type'] }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "9ddc61d5-0781-4202-8a4a-67bc4cb9ca53",
      "name": "OpenAI 聊天模型",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        1024,
        320
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4.1-mini"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "id": "dMiSy27YCK6c6rra",
          "name": "Duv's OpenAI"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "1e270cb8-8cf8-472b-9d42-a92baece3831",
      "name": "总结反馈",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        960,
        144
      ],
      "parameters": {
        "text": "=Feedback:\n\n{{ $json.feedback }}\n\nFeedback type:\n\n{{ $json['feedback type'] }}",
        "batching": {},
        "messages": {
          "messageValues": [
            {
              "message": "Return a one-line summary of the feedback provided by the user message"
            }
          ]
        },
        "promptType": "define"
      },
      "typeVersion": 1.7
    },
    {
      "id": "da72acd7-ab2e-4acd-9a68-75f610c98ffd",
      "name": "Webhook",
      "type": "n8n-nodes-base.webhook",
      "position": [
        -32,
        384
      ],
      "webhookId": "516b9b23-c30c-4396-a32e-2f139beb3248",
      "parameters": {
        "path": "516b9b23-c30c-4396-a32e-2f139beb3248",
        "options": {},
        "httpMethod": "POST"
      },
      "typeVersion": 2.1
    },
    {
      "id": "190a9eb4-bb6e-4b0e-9a5a-641fa003292a",
      "name": "从webhook准备数据",
      "type": "n8n-nodes-base.set",
      "position": [
        304,
        384
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "a1f1f4a2-39ad-4e12-a945-5b4733f4f5ea",
              "name": "feedback",
              "type": "string",
              "value": "={{ $json.body.feedback }}"
            },
            {
              "id": "db2b9184-9584-4a0d-ba37-632debb9309a",
              "name": "feedback type",
              "type": "string",
              "value": "={{ $json.body['feedback type'] }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "fe6790a2-75ff-4b95-a4bf-4dffa084d1a7",
      "name": "在Slack上通知团队",
      "type": "n8n-nodes-base.slack",
      "position": [
        1312,
        144
      ],
      "webhookId": "6c3d312e-053d-405e-9111-9199c50a5be5",
      "parameters": {
        "text": "=We received a new feedback!\nIn summary: {{ $json.text }}\n\nType: {{ $('Consolidate trigger data').item.json['feedback type'] }}",
        "select": "channel",
        "channelId": {
          "__rl": true,
          "mode": "list",
          "value": "C025KLW3MQS",
          "cachedResultName": "général"
        },
        "otherOptions": {}
      },
      "credentials": {
        "slackApi": {
          "id": "EkDmLiXskPXRqVW4",
          "name": "Slack account"
        }
      },
      "typeVersion": 2.3
    },
    {
      "id": "e3c4b1a6-ad78-4a5a-84a6-8272778ab648",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -688,
        -160
      ],
      "parameters": {
        "width": 512,
        "height": 736,
        "content": "# 多触发器统一模式"
      },
      "typeVersion": 1
    },
    {
      "id": "d9106483-b0f6-416b-885f-7f296dfecd88",
      "name": "便签 1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -112,
        -160
      ],
      "parameters": {
        "color": 5,
        "width": 272,
        "height": 736,
        "content": "### 替换为您需要的工作流触发器"
      },
      "typeVersion": 1
    },
    {
      "id": "4ca8de38-4cf0-44e1-a957-143deca66458",
      "name": "便签 2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        224,
        -160
      ],
      "parameters": {
        "color": 6,
        "width": 272,
        "height": 736,
        "content": "### 在合并之前准备变量"
      },
      "typeVersion": 1
    },
    {
      "id": "f8a00250-d66f-4a77-8b21-269944962792",
      "name": "便签 3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        880,
        -48
      ],
      "parameters": {
        "width": 656,
        "height": 512,
        "content": "### 替换此节点并构建您的工作流"
      },
      "typeVersion": 1
    },
    {
      "id": "fecc47ea-839f-42b2-9220-48c9cc4e5d1d",
      "name": "便签 4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        560,
        -48
      ],
      "parameters": {
        "color": 4,
        "width": 256,
        "height": 368,
        "content": "### 合并节点"
      },
      "typeVersion": 1
    }
  ],
  "connections": {
    "Webhook": {
      "main": [
        [
          {
            "node": "Prepare data from webhook",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Summarise feedback",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "On form submission": {
      "main": [
        [
          {
            "node": "Prepare data from form",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Summarise feedback": {
      "main": [
        [
          {
            "node": "Notify the team on Slack",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prepare data from form": {
      "main": [
        [
          {
            "node": "Consolidate trigger data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Consolidate trigger data": {
      "main": [
        [
          {
            "node": "Summarise feedback",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prepare data from webhook": {
      "main": [
        [
          {
            "node": "Consolidate trigger data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prepare data from sub-workflow": {
      "main": [
        [
          {
            "node": "Consolidate trigger data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When Executed by Another Workflow": {
      "main": [
        [
          {
            "node": "Prepare data from sub-workflow",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

中级 - 工程, 多模态 AI

需要付费吗?

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

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

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

作者
Guillaume Duvernay

Guillaume Duvernay

@duv

AI and automation expert

外部链接
在 n8n.io 查看

分享此工作流