8
n8n 中文网amn8n.com

Peliqan AI代理查询Cin7 ERP

中级

这是一个Internal Wiki, Multimodal AI领域的自动化工作流,包含 10 个节点。主要使用 PeliqanTool, Agent, ChatTrigger, LmChatOpenAi, MemoryBufferWindow 等节点。 通过Peliqan使用OpenAI聊天机器人查询Cin7 ERP业务数据

前置要求
  • OpenAI API Key
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "pBZWaawNMbd3tEI4",
  "meta": {
    "instanceId": "cbd8796a3029a9f181c009fb761c940559eea31ad59a753266d15d4a76041a7c",
    "templateCredsSetupCompleted": true
  },
  "name": "Peliqan AI Agent Cin7 ERP",
  "tags": [],
  "nodes": [
    {
      "id": "2538becc-d76f-46b5-a4d0-377e5ee7d3ca",
      "name": "当收到聊天消息时",
      "type": "@n8n/n8n-nodes-langchain.chatTrigger",
      "position": [
        464,
        96
      ],
      "webhookId": "f0cf0cfb-8b1b-4854-ac72-7fc85f9e3dd2",
      "parameters": {
        "public": true,
        "options": {}
      },
      "typeVersion": 1.1
    },
    {
      "id": "9db24d24-5222-4586-91a8-86ef4cff9867",
      "name": "AI 代理",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        640,
        96
      ],
      "parameters": {
        "options": {
          "systemMessage": "You are an assistant answering questions on internal business data from the Cin7 ERP system.\n\nYou can query Cin7 by running SQL queries on the Cin7 tables in the Peliqan data warehouse. To execute an SQL query: send the query to Peliqan tool \"Execute SQL\" in a key SQL_Query__View_. Get the results from key \"detail\".\n\nThis is the Cin7 data model of tables & columns that can be used in SQL queries:\n\nColumns in table cin7_omni.adjustments:\n\nid\ncreateddate\nmodifieddate\ncreatedby\nprocessedby\nisapproved\nreference\nbranchid\ncompleteddate\nadjustinaccountingsystem\nadjustmentreason\nalternativeaccountcode\nproducttotal\nsource\n\nColumns in table cin7_omni.adjustments__lineitems:\n\nid\ncreateddate\ntransactionid\nparentid\nproductid\nproductoptionid\nintegrationref\nsort\ncode\nname\noption1\noption2\noption3\nqty\nqtyadjusted\nholdingqty\naccount\nunitcost\n\nColumns in table cin7_omni.contacts:\n\nid\ncreateddate\nmodifieddate\nisactive\ncompany\nfirstname\nlastname\njobtitle\nemail\nwebsite\nphone\nfax\nmobile\naddress1\naddress2\ncity\nstate\npostcode\ncountry\npostaladdress1\npostaladdress2\npostalcity\npostalpostcode\npostalstate\npostalcountry\nnotes\nintegrationref\ntype\nsalespersonid\naccountnumber\nbillingid\nbillingcompany\naccountsfirstname\naccountslastname\nbillingemail\naccountsphone\nbillingcostcenter\ncostcenter\npricecolumn\npercentageoff\npaymentterms\ntaxstatus\ntaxnumber\ncreditlimit\nbalanceowing\nonhold\n\"group\"\nsubgroup\nstages\naccountingintegrationid__xero\naccountingintegrationid__quickbooksonline\naccountingintegrationid__quickbooksdesktop\n\nColumns in table cin7_omni.credit_notes:\n\nid\ncreateddate\nmodifieddate\ncreatedby\nprocessedby\nisapproved\nreference\nmemberid\nfirstname\nlastname\ncompany\nemail\nphone\nmobile\nfax\ndeliveryfirstname\ndeliverylastname\ndeliverycompany\ndeliveryaddress1\ndeliveryaddress2\ndeliverycity\ndeliverystate\ndeliverypostalcode\ndeliverycountry\nbillingfirstname\nbillinglastname\nbillingcompany\nbillingaddress1\nbillingaddress2\nbillingcity\nbillingpostalcode\nbillingstate\nbillingcountry\nbranchid\nbranchemail\nprojectname\ntrackingcode\ninternalcomments\nproducttotal\nfreighttotal\nfreightdescription\nsurcharge\nsurchargedescription\ndiscounttotal\ndiscountdescription\ntotal\ncurrencycode\ncurrencyrate\ncurrencysymbol\ntaxstatus\ntaxrate\nsource\nmemberemail\nmodifiedcogsdate\nstatus\nsalesreference\ncreditnotenumber\ncreditnotedate\ncompleteddate\ncustomerreport\nalternativeaccountcode\nsalespersonid\nlogisticscarrier\nlogisticsstatus\naccountingattributes__importdate\naccountingattributes__accountingimportstatus\n\nColumns in table cin7_omni.credit_notes__lineitems:\n\nid\ncreateddate\ntransactionid\nparentid\nproductid\nproductoptionid\nintegrationref\nsort\ncode\nname\noption1\noption2\noption3\nqty\nstylecode\nbarcode\nsizecodes\nlinecomments\nunitcost\nunitprice\ndiscount\nqtyshipped\naccountcode\n\nColumns in table cin7_omni.payments:\n\nid\ncreateddate\nmodifieddate\npaymentdate\namount\nmethod\nisauthorized\ntransactionref\ncomments\norderid\norderref\npaymentimportedref\nbatchreference\nreconciledate\nbranchid\nordertype\n\nColumns in table cin7_omni.product_categories:\n\nid\nparentid\nisactive\nsort\nname\ndescription\nimage\n\nColumns in table cin7_omni.products:\n\nid\nstatus\ncreateddate\nmodifieddate\nstylecode\nname\ndescription\ntags\npdfupload\npdfdescription\nsupplierid\nbrand\ncategory\nsubcategory\nchannels\nweight\nheight\nwidth\nlength\nvolume\nstockcontrol\nordertype\nproducttype\nproductsubtype\nprojectname\noptionlabel1\noptionlabel2\noptionlabel3\nsalesaccount\npurchasesaccount\nimportcustomsduty\nsizerangeid\ncustomfields__products_1000\n\nColumns in table cin7_omni.products__images:\n\nlink\n\nColumns in table cin7_omni.products__productoptions:\n\nid\ncreateddate\nmodifieddate\nstatus\nproductid\ncode\nbarcode\nproductoptioncode\nproductoptionsizecode\nproductoptionbarcode\nproductoptionsizebarcode\nsuppliercode\noption1\noption2\noption3\noptionweight\nsize\nsizeid\nretailprice\nwholesaleprice\nvipprice\nspecialprice\nspecialsstartdate\nspecialdays\nstockavailable\nstockonhand\nimage__link\npricecolumns__retailaud\npricecolumns__vipaud\npricecolumns__wholesaleaud\npricecolumns__priceusd\npricecolumns__costaud\npricecolumns__costusd\npricecolumns__specialprice\n\nColumns in table cin7_omni.purchase_orders:\n\nid\ncreateddate\nmodifieddate\ncreatedby\nprocessedby\nisapproved\nreference\nmemberid\nfirstname\nlastname\ncompany\nemail\nphone\nmobile\nfax\ndeliveryfirstname\ndeliverylastname\ndeliverycompany\ndeliveryaddress1\ndeliveryaddress2\ndeliverycity\ndeliverystate\ndeliverypostalcode\ndeliverycountry\nbillingfirstname\nbillinglastname\nbillingcompany\nbillingaddress1\nbillingaddress2\nbillingcity\nbillingpostalcode\nbillingstate\nbillingcountry\nbranchid\nbranchemail\nprojectname\ntrackingcode\ninternalcomments\nproducttotal\nfreighttotal\nfreightdescription\nsurcharge\nsurchargedescription\ndiscounttotal\ndiscountdescription\ntotal\ncurrencycode\ncurrencyrate\ncurrencysymbol\ntaxstatus\ntaxrate\nsource\nisvoid\naccountingattributes__importdate\naccountingattributes__accountingimportstatus\nmemberemail\nmembercostcenter\nmemberalternativetaxrate\ncostcenter\nalternativetaxrate\nestimateddeliverydate\nsalespersonid\nsalespersonemail\npaymentterms\ncustomerorderno\nvouchercode\ndeliveryinstructions\ncancellationdate\nmodifiedcogsdate\nstatus\nstage\nsupplierinvoicereference\nsupplieracceptancedate\nport\nestimatedarrivaldate\nfullyreceiveddate\ninvoicedate\nlogisticscarrier\nlogisticsstatus\n\nColumns in table cin7_omni.purchase_orders__lineitems:\n\nid\ncreateddate\ntransactionid\nparentid\nproductid\nproductoptionid\nintegrationref\nsort\ncode\nname\noption1\noption2\noption3\nqty\nstylecode\nbarcode\nsizecodes\nlinecomments\nunitprice\ndiscount\nqtyshipped\nholdingqty\naccountcode\n\nColumns in table cin7_omni.quotes:\n\nid\ncreateddate\nmodifieddate\ncreatedby\nprocessedby\nisapproved\nreference\nmemberid\nfirstname\nlastname\ncompany\nemail\nphone\nmobile\nfax\ndeliveryfirstname\ndeliverylastname\ndeliverycompany\ndeliveryaddress1\ndeliveryaddress2\ndeliverycity\ndeliverystate\ndeliverypostalcode\ndeliverycountry\nbillingfirstname\nbillinglastname\nbillingcompany\nbillingaddress1\nbillingaddress2\nbillingcity\nbillingpostalcode\nbillingstate\nbillingcountry\nbranchid\nbranchemail\nprojectname\ntrackingcode\ninternalcomments\nproducttotal\nfreighttotal\nfreightdescription\nsurcharge\nsurchargedescription\ndiscounttotal\ndiscountdescription\ntotal\ncurrencycode\ncurrencyrate\ncurrencysymbol\ntaxstatus\ntaxrate\nsource\nmemberemail\nmembercostcenter\nmemberalternativetaxrate\ncostcenter\nalternativetaxrate\nestimateddeliverydate\nsalespersonid\nsalespersonemail\npaymentterms\ncustomerorderno\nvouchercode\ndeliveryinstructions\ncancellationdate\nmodifiedcogsdate\nstatus\nstage\nprobability\nexpectedorderdate\nacceptancedate\n\nColumns in table cin7_omni.quotes__lineitems:\n\nid\ncreateddate\ntransactionid\nparentid\nproductid\nproductoptionid\nintegrationref\nsort\ncode\nname\noption1\noption2\noption3\nqty\nstylecode\nbarcode\nsizecodes\nlinecomments\nunitcost\nunitprice\ndiscount\nqtyshipped\nholdingqty\n\nColumns in table cin7_omni.sales_orders:\n\nid\ncreateddate\nmodifieddate\ncreatedby\nprocessedby\nisapproved\nreference\nmemberid\nfirstname\nlastname\ncompany\nemail\nphone\nmobile\nfax\ndeliveryfirstname\ndeliverylastname\ndeliverycompany\ndeliveryaddress1\ndeliveryaddress2\ndeliverycity\ndeliverystate\ndeliverypostalcode\ndeliverycountry\nbillingfirstname\nbillinglastname\nbillingcompany\nbillingaddress1\nbillingaddress2\nbillingcity\nbillingpostalcode\nbillingstate\nbillingcountry\nbranchid\nbranchemail\nprojectname\ntrackingcode\ninternalcomments\nproducttotal\nfreighttotal\nfreightdescription\nsurcharge\nsurchargedescription\ndiscounttotal\ndiscountdescription\ntotal\ncurrencycode\ncurrencyrate\ncurrencysymbol\ntaxstatus\ntaxrate\nsource\nisvoid\naccountingattributes__importdate\naccountingattributes__accountingimportstatus\nmemberemail\nmembercostcenter\nmemberalternativetaxrate\ncostcenter\nalternativetaxrate\nestimateddeliverydate\nsalespersonid\nsalespersonemail\npaymentterms\ncustomerorderno\nvouchercode\ndeliveryinstructions\ncancellationdate\nmodifiedcogsdate\nstatus\nstage\ninvoicedate\ninvoicenumber\ndispatcheddate\nlogisticscarrier\nlogisticsstatus\nedistatus\ndistributionbranchid\ndepartmentnumber\nstorelocationnumber\ndistributioncenter\nssccnumber\n\nColumns in table cin7_omni.sales_orders__lineitems:\n\nid\ncreateddate\ntransactionid\nparentid\nproductid\nproductoptionid\nintegrationref\nsort\ncode\nname\noption1\noption2\noption3\nqty\nstylecode\nbarcode\nsizecodes\nlinecomments\nunitcost\nunitprice\nuomprice\ndiscount\nuomqtyordered\nuomqtyshipped\nuomsize\nqtyshipped\nholdingqty\naccountcode\nstockcontrol\n\nColumns in table cin7_omni.sales_orders__lineitems__stockmovements:\n\nbatch\nquantity\nserial\n\nColumns in table cin7_omni.size_ranges:\n\nsizerangename\nsizes\nid\n\nColumns in table cin7_omni.stocks:\n\nproductid\nproductoptionid\nmodifieddate\nstylecode\ncode\nbarcode\nbranchid\nbranchname\nproductname\noption1\noption2\noption3\nsize\navailable\nstockonhand\nopensales\nincoming\nvirtual\nholding\n\nColumns in table cin7_omni.users:\n\nid\nisactive\nfirstname\nlastname\njobtitle\nemail"
        }
      },
      "typeVersion": 1.6,
      "alwaysOutputData": true
    },
    {
      "id": "1840df90-cf66-49c0-a0ab-2259ab757752",
      "name": "OpenAI 聊天模型",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        592,
        384
      ],
      "parameters": {
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "id": "LqJFRkYjgKQumtJx",
          "name": "OpenAi account dev@peliqan.io"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "86af58b1-c240-4083-b6d9-102edd331a95",
      "name": "便签5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -400,
        32
      ],
      "parameters": {
        "color": 4,
        "width": 786,
        "height": 580,
        "content": "## ℹ️ 简介"
      },
      "typeVersion": 1
    },
    {
      "id": "611bd81e-fcb8-4a45-b123-beff3c3b7395",
      "name": "便签4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1008,
        496
      ],
      "parameters": {
        "color": 2,
        "width": 471,
        "height": 80,
        "content": "⚠️ 要将 Peliqan 作为工具与操作\"执行 SQL 查询\"一起使用:"
      },
      "typeVersion": 1
    },
    {
      "id": "8284c916-0a01-4ebf-aeb7-e9e2c78c6b93",
      "name": "简单记忆",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        768,
        384
      ],
      "parameters": {},
      "typeVersion": 1.3
    },
    {
      "id": "b560538d-4f81-4e26-9dfb-1230f1b24b76",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        992,
        32
      ],
      "parameters": {
        "width": 512,
        "height": 576,
        "content": "## AI Agent 工具:SQL"
      },
      "typeVersion": 1
    },
    {
      "id": "97d823cf-7cc4-48f2-b994-ba73e0c8dc68",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        416,
        32
      ],
      "parameters": {
        "color": 3,
        "width": 544,
        "height": 576,
        "content": "## AI 聊天机器人"
      },
      "typeVersion": 1
    },
    {
      "id": "65ac29cf-8fb1-4149-95d2-20f9dd228598",
      "name": "便签2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        544,
        304
      ],
      "parameters": {
        "color": 6,
        "width": 384,
        "height": 224,
        "content": "## 大脑"
      },
      "typeVersion": 1
    },
    {
      "id": "1c239ab5-91c1-46b9-9282-c3be28469e95",
      "name": "通过 Peliqan 执行 SQL 查询",
      "type": "n8n-nodes-peliqan.peliqanTool",
      "position": [
        1184,
        320
      ],
      "parameters": {
        "querySql": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('SQL_Query', ``, 'string') }}",
        "resource": "query",
        "operation": "exec",
        "connection": "1163"
      },
      "credentials": {
        "peliqanApi": {
          "id": "d7QTqJXKU5v3t5zN",
          "name": "Peliqan account"
        }
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "4b8f53b9-463a-4075-b688-e504839d1e0d",
  "connections": {
    "Simple Memory": {
      "ai_memory": [
        [
          {
            "node": "AI Agent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "When chat message received": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Execute an SQL query via Peliqan": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

中级 - 内部知识库, 多模态 AI

需要付费吗?

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

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

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

作者
Peliqan

Peliqan

@peliqan

Peliqan.io is the one-click data foundation for our n8n AI Agents. Add all your business applications for RAG and "Text to SQL", and build AI chatbots and AI Agents that can interact with all internal company data from CRM, ERP, cloud storage, accounting, HRM/ATS etc.

外部链接
在 n8n.io 查看

分享此工作流