8
n8n 中文网amn8n.com

在 n8n 聊天机器人中导入 Langflow 流程并进行品牌定制

中级

这是一个Engineering, AI领域的自动化工作流,包含 7 个节点。主要使用 Set, HttpRequest, ChatTrigger 等节点,结合人工智能技术实现智能自动化。 使用 Langflow 后端和自定义品牌创建 AI 驱动的网站聊天机器人

前置要求
  • 可能需要目标 API 的认证凭证
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "jChHsZ0OR79bITzc",
  "meta": {
    "instanceId": "a4bfc93e975ca233ac45ed7c9227d84cf5a2329310525917adaf3312e10d5462",
    "templateCredsSetupCompleted": true
  },
  "name": "在n8n聊天机器人中导入Langflow流程并进行品牌定制",
  "tags": [],
  "nodes": [
    {
      "id": "5d3d611f-72e9-43b4-98ee-d4e10cd7591d",
      "name": "当收到聊天消息时",
      "type": "@n8n/n8n-nodes-langchain.chatTrigger",
      "position": [
        -720,
        0
      ],
      "webhookId": "560cad1a-7d5c-43ae-818e-1ff432e4cae4",
      "parameters": {
        "mode": "webhook",
        "public": true,
        "options": {
          "allowedOrigins": "*"
        }
      },
      "typeVersion": 1.1
    },
    {
      "id": "9bc309e9-0878-4140-8a2c-fadb51e3dd65",
      "name": "获取简报",
      "type": "n8n-nodes-base.set",
      "position": [
        -280,
        0
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "6a50a699-9598-452a-bc38-a87e2be9084c",
              "name": "output",
              "type": "string",
              "value": "={{ $json.outputs[0].outputs[0].results.message.data.text }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "fe301be1-4845-4e76-aee8-27c61bf894e1",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -740,
        -340
      ],
      "parameters": {
        "color": 6,
        "width": 720,
        "height": 220,
        "content": "### 在您的网站上启用n8n CDN"
      },
      "typeVersion": 1
    },
    {
      "id": "ca73efeb-bdbd-4824-9b3f-b6222d1db010",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -740,
        -960
      ],
      "parameters": {
        "color": 3,
        "width": 720,
        "height": 600,
        "content": "## Langflow"
      },
      "typeVersion": 1
    },
    {
      "id": "edd68237-94c1-4b21-ac10-fac5512dc7e0",
      "name": "便签 2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        0,
        -960
      ],
      "parameters": {
        "color": 6,
        "width": 800,
        "height": 840,
        "content": "### 自定义n8n聊天机器人"
      },
      "typeVersion": 1
    },
    {
      "id": "0fb9d211-07fd-4309-b91c-aa21e877a915",
      "name": "Langflow",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -500,
        0
      ],
      "parameters": {
        "url": "https://LANGFLOW_URL/api/v1/run/FLOW_ID?stream=false",
        "method": "POST",
        "options": {},
        "jsonBody": "={\n  \"input_value\": \"{{ $json.chatInput }}\",\n  \"output_type\": \"chat\",\n  \"input_type\": \"chat\"\n}",
        "sendBody": true,
        "sendHeaders": true,
        "specifyBody": "json",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "headerParameters": {
          "parameters": [
            {
              "name": "Content-Type",
              "value": "application/json"
            }
          ]
        }
      },
      "credentials": {
        "httpHeaderAuth": {
          "id": "u4ZE9bSDfxZX3Ljj",
          "name": "Langflow API"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "705ecc2a-b0af-4165-8ef3-c693e82cd1ce",
      "name": "便签 3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -560,
        -60
      ],
      "parameters": {
        "height": 220,
        "content": "设置LANGFLOW_URL和FLOW_ID"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "6fe12868-d03f-4c86-a472-3b5ce254d4ef",
  "connections": {
    "Langflow": {
      "main": [
        [
          {
            "node": "Edit Fields",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When chat message received": {
      "main": [
        [
          {
            "node": "Langflow",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

中级 - 工程, 人工智能

需要付费吗?

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

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

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

作者

Full-stack Web Developer based in Italy specialising in Marketing & AI-powered automations. For business enquiries, send me an email at info@n3w.it or add me on Linkedin.com/in/davideboizza

外部链接
在 n8n.io 查看

分享此工作流