8
n8n 中文网amn8n.com

我的工作流 4

中级

这是一个Building Blocks, AI, IT Ops领域的自动化工作流,包含 11 个节点。主要使用 PostgresTool, Agent, LmChatGroq, ChatTrigger, MemoryBufferWindow 等节点,结合人工智能技术实现智能自动化。 使用 Groq AI 聊天机器人通过自然语言查询 PostgreSQL 数据库

前置要求
  • PostgreSQL 数据库连接信息
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "ow1aBANn8lQH0TbA",
  "meta": {
    "instanceId": "47d295a7329d3547e0e6b56de9e439dc1a0a49c6d827b2320629f54300c47e41",
    "templateCredsSetupCompleted": true
  },
  "name": "我的工作流 4",
  "tags": [],
  "nodes": [
    {
      "id": "3be32b55-6c92-45e3-805f-3c582f6bb237",
      "name": "当收到聊天消息时",
      "type": "@n8n/n8n-nodes-langchain.chatTrigger",
      "position": [
        760,
        320
      ],
      "webhookId": "cf1de04f-3e38-426c-89f0-3bdb110a5dcf",
      "parameters": {},
      "typeVersion": 1.1
    },
    {
      "id": "c0685ca7-91bd-4177-848d-ea7f3a4c160f",
      "name": "聊天历史",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        1100,
        520
      ],
      "parameters": {},
      "typeVersion": 1.3
    },
    {
      "id": "b2e6112c-451e-434f-a732-4c469721f364",
      "name": "AI 代理",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        1180,
        320
      ],
      "parameters": {},
      "typeVersion": 1.7
    },
    {
      "id": "52a55d14-7a46-43fb-9f8c-5fdd099cc4b8",
      "name": "Groq聊天模型",
      "type": "@n8n/n8n-nodes-langchain.lmChatGroq",
      "position": [
        920,
        520
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "d9ff0f6e-e08d-49bc-bd29-1a6602b1562e",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        880,
        700
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "56b21c24-9a74-4f61-ad03-2e6c892350d6",
      "name": "便签 2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1060,
        700
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "63a28a91-68e3-45a5-b236-559db54f87b7",
      "name": "便签 3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1240,
        700
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "b6dad064-7699-4f07-99c5-cca3a5f3bb82",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        760,
        100
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "36b9bf75-cb1d-45ed-8e01-99c272580fae",
      "name": "PostgreSQL 架构",
      "type": "n8n-nodes-base.postgresTool",
      "position": [
        1480,
        520
      ],
      "parameters": {},
      "typeVersion": 2.5
    },
    {
      "id": "71f57073-6857-4b7f-9ee9-e1dc3ce250c5",
      "name": "PostgreSQL 定义",
      "type": "n8n-nodes-base.postgresTool",
      "position": [
        1660,
        520
      ],
      "parameters": {},
      "typeVersion": 2.5
    },
    {
      "id": "95e64a15-03c5-44d9-9a33-4cbd392ab008",
      "name": "PostgreSQL",
      "type": "n8n-nodes-base.postgresTool",
      "position": [
        1280,
        520
      ],
      "parameters": {},
      "typeVersion": 2.5
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "59656397-0d25-47f3-94f3-c00beb3bf8d8",
  "connections": {
    "PostgreSQL": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Chat History": {
      "ai_memory": [
        [
          {
            "node": "AI Agent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Groq Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "PostgreSQL Schema": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "PostgreSQL Definition": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "When chat message received": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

中级 - 构建模块, 人工智能, IT 运维

需要付费吗?

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

工作流信息
难度等级
中级
节点数量11
分类3
节点类型6
难度说明

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

作者
Gegenfeld

Gegenfeld

@gegenfeld

We at Gegenfeld are an EdTech platform dedicated to delivering high-quality on-demand courses and interactive training sessions for professional development at all skill levels. With our commitment to "Accelerate your future," we empower professionals to enhance their expertise through engaging, industry-focused learning experiences. On n8n, we share some of the workflows used in our interactive training to provide deeper insights and practical applications.

外部链接
在 n8n.io 查看

分享此工作流