datameta-agent-workflow.json 10.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327
  1. {
  2. "name": "DataMeta管理智能体",
  3. "nodes": [
  4. {
  5. "name": "Chat Trigger",
  6. "webhookId": "datameta-agent",
  7. "id": "chat_trigger",
  8. "typeVersion": 1.1,
  9. "position": [0, 300],
  10. "type": "@n8n/n8n-nodes-langchain.chatTrigger",
  11. "parameters": {
  12. "public": true,
  13. "mode": "hostedChat",
  14. "options": {
  15. "title": "DataMeta管理助手",
  16. "subtitle": "我可以帮您管理元数据,支持查询、新增、更新、删除和标签管理",
  17. "inputPlaceholder": "请输入您的需求,例如:查看所有元数据"
  18. }
  19. }
  20. },
  21. {
  22. "name": "AI Agent",
  23. "id": "ai_agent",
  24. "typeVersion": 1.7,
  25. "position": [300, 300],
  26. "type": "@n8n/n8n-nodes-langchain.agent",
  27. "parameters": {
  28. "options": {
  29. "systemMessage": "你是一个元数据(DataMeta)管理助手。你可以帮助用户执行以下操作:\n\n1. **查询元数据列表** - 使用 list_datameta 工具\n2. **获取元数据详情** - 使用 get_datameta 工具\n3. **新增元数据** - 使用 add_datameta 工具\n4. **更新元数据** - 使用 update_datameta 工具\n5. **删除元数据** - 使用 delete_datameta 工具\n6. **查看可用标签** - 使用 list_labels 工具\n\n请根据用户的需求选择合适的工具来执行操作。\n\n重要提示:\n- 新增元数据时,name_zh(中文名)和 data_type(数据类型)是必填字段\n- 更新和删除操作需要提供元数据的 id\n- 设置标签时,需要先获取标签列表,然后在新增或更新时通过 tag 字段传入标签ID数组\n\n请用中文回复用户。",
  30. "maxIterations": 25
  31. }
  32. }
  33. },
  34. {
  35. "name": "DeepSeek Chat Model",
  36. "id": "deepseek_model",
  37. "typeVersion": 1,
  38. "position": [300, 500],
  39. "type": "@n8n/n8n-nodes-langchain.lmChatDeepSeek",
  40. "parameters": {
  41. "model": "deepseek-chat",
  42. "options": {
  43. "temperature": 0.7
  44. }
  45. },
  46. "credentials": {
  47. "deepSeekApi": {
  48. "id": "DeepSeek account",
  49. "name": "DeepSeek account"
  50. }
  51. }
  52. },
  53. {
  54. "name": "list_datameta",
  55. "id": "tool_list_datameta",
  56. "typeVersion": 1.1,
  57. "position": [500, 100],
  58. "type": "@n8n/n8n-nodes-langchain.toolHttpRequest",
  59. "parameters": {
  60. "method": "POST",
  61. "url": "https://company.citupro.com:18183/api/meta/node/list",
  62. "specifyBody": "json",
  63. "sendBody": true,
  64. "sendHeaders": true,
  65. "specifyHeaders": "keypair",
  66. "jsonBody": "={{ JSON.stringify({ current: $fromAI('current', '页码', 'number') || 1, name_zh: $fromAI('name_zh', '中文名筛选', 'string') || '', name_en: $fromAI('name_en', '英文名筛选', 'string') || '', category: $fromAI('category', '分类筛选', 'string') || '' }) }}",
  67. "authentication": "none",
  68. "toolDescription": "查询元数据列表(默认返回全部记录)。可选参数:current(页码,默认1), name_zh(中文名筛选), name_en(英文名筛选), category(分类筛选), tag(标签筛选数组)",
  69. "parametersHeaders": {
  70. "values": [
  71. {
  72. "name": "Content-Type",
  73. "valueProvider": "fieldValue",
  74. "value": "application/json"
  75. }
  76. ]
  77. }
  78. }
  79. },
  80. {
  81. "name": "get_datameta",
  82. "id": "tool_get_datameta",
  83. "typeVersion": 1.1,
  84. "position": [500, 200],
  85. "type": "@n8n/n8n-nodes-langchain.toolHttpRequest",
  86. "parameters": {
  87. "method": "POST",
  88. "url": "https://company.citupro.com:18183/api/meta/node/edit",
  89. "specifyBody": "json",
  90. "sendBody": true,
  91. "sendHeaders": true,
  92. "specifyHeaders": "keypair",
  93. "jsonBody": "={{ JSON.stringify({ id: $fromAI('id', '元数据ID', 'number') }) }}",
  94. "authentication": "none",
  95. "toolDescription": "根据ID获取元数据详情。必填参数:id(元数据ID,数字类型)",
  96. "parametersHeaders": {
  97. "values": [
  98. {
  99. "name": "Content-Type",
  100. "valueProvider": "fieldValue",
  101. "value": "application/json"
  102. }
  103. ]
  104. }
  105. }
  106. },
  107. {
  108. "name": "add_datameta",
  109. "id": "tool_add_datameta",
  110. "typeVersion": 1.1,
  111. "position": [500, 300],
  112. "type": "@n8n/n8n-nodes-langchain.toolHttpRequest",
  113. "parameters": {
  114. "method": "POST",
  115. "url": "https://company.citupro.com:18183/api/meta/node/add",
  116. "sendBody": true,
  117. "specifyBody": "keypair",
  118. "sendHeaders": true,
  119. "specifyHeaders": "keypair",
  120. "authentication": "none",
  121. "toolDescription": "Add new metadata to the system. Call this tool when user wants to create/add a new metadata. The AI must provide name_zh (Chinese name) and data_type (like varchar, integer, string) parameters.",
  122. "parametersBody": {
  123. "values": [
  124. {
  125. "name": "name_zh"
  126. },
  127. {
  128. "name": "data_type"
  129. }
  130. ]
  131. },
  132. "parametersHeaders": {
  133. "values": [
  134. {
  135. "name": "Content-Type",
  136. "valueProvider": "fieldValue",
  137. "value": "application/json"
  138. }
  139. ]
  140. }
  141. }
  142. },
  143. {
  144. "name": "update_datameta",
  145. "id": "tool_update_datameta",
  146. "typeVersion": 1.1,
  147. "position": [500, 400],
  148. "type": "@n8n/n8n-nodes-langchain.toolHttpRequest",
  149. "parameters": {
  150. "method": "POST",
  151. "url": "https://company.citupro.com:18183/api/meta/node/update",
  152. "sendBody": true,
  153. "specifyBody": "keypair",
  154. "sendHeaders": true,
  155. "specifyHeaders": "keypair",
  156. "authentication": "none",
  157. "toolDescription": "Update existing metadata. Required: id (metadata ID). Optional: data_type (new data type like varchar, string, integer).",
  158. "parametersBody": {
  159. "values": [
  160. {
  161. "name": "id"
  162. },
  163. {
  164. "name": "data_type"
  165. }
  166. ]
  167. },
  168. "parametersHeaders": {
  169. "values": [
  170. {
  171. "name": "Content-Type",
  172. "valueProvider": "fieldValue",
  173. "value": "application/json"
  174. }
  175. ]
  176. }
  177. }
  178. },
  179. {
  180. "name": "delete_datameta",
  181. "id": "tool_delete_datameta",
  182. "typeVersion": 1.1,
  183. "position": [500, 500],
  184. "type": "@n8n/n8n-nodes-langchain.toolHttpRequest",
  185. "parameters": {
  186. "method": "POST",
  187. "url": "https://company.citupro.com:18183/api/meta/node/delete",
  188. "specifyBody": "json",
  189. "sendBody": true,
  190. "sendHeaders": true,
  191. "specifyHeaders": "keypair",
  192. "jsonBody": "={{ JSON.stringify({ id: $fromAI('id', '元数据ID', 'number') }) }}",
  193. "authentication": "none",
  194. "toolDescription": "删除元数据。必填参数:id(要删除的元数据ID,数字类型)",
  195. "parametersHeaders": {
  196. "values": [
  197. {
  198. "name": "Content-Type",
  199. "valueProvider": "fieldValue",
  200. "value": "application/json"
  201. }
  202. ]
  203. }
  204. }
  205. },
  206. {
  207. "name": "list_labels",
  208. "id": "tool_list_labels",
  209. "typeVersion": 1.1,
  210. "position": [500, 600],
  211. "type": "@n8n/n8n-nodes-langchain.toolHttpRequest",
  212. "parameters": {
  213. "method": "POST",
  214. "url": "https://company.citupro.com:18183/api/interface/labellist",
  215. "specifyBody": "json",
  216. "sendBody": true,
  217. "sendHeaders": true,
  218. "specifyHeaders": "keypair",
  219. "jsonBody": "={{ JSON.stringify({ current: $fromAI('current', '页码', 'number') || 1, size: $fromAI('size', '每页数量', 'number') || 10, name_zh: $fromAI('name_zh', '中文名筛选', 'string') || '', name_en: $fromAI('name_en', '英文名筛选', 'string') || '' }) }}",
  220. "authentication": "none",
  221. "toolDescription": "查询可用的数据标签列表。可选参数:current(页码,默认1), size(每页数量,默认10), name_zh(中文名筛选), name_en(英文名筛选), category(分类筛选), group(分组筛选)",
  222. "parametersHeaders": {
  223. "values": [
  224. {
  225. "name": "Content-Type",
  226. "valueProvider": "fieldValue",
  227. "value": "application/json"
  228. }
  229. ]
  230. }
  231. }
  232. }
  233. ],
  234. "connections": {
  235. "Chat Trigger": {
  236. "main": [
  237. [
  238. {
  239. "node": "AI Agent",
  240. "type": "main",
  241. "index": 0
  242. }
  243. ]
  244. ]
  245. },
  246. "list_datameta": {
  247. "ai_tool": [
  248. [
  249. {
  250. "node": "AI Agent",
  251. "type": "ai_tool",
  252. "index": 0
  253. }
  254. ]
  255. ]
  256. },
  257. "delete_datameta": {
  258. "ai_tool": [
  259. [
  260. {
  261. "node": "AI Agent",
  262. "type": "ai_tool",
  263. "index": 0
  264. }
  265. ]
  266. ]
  267. },
  268. "get_datameta": {
  269. "ai_tool": [
  270. [
  271. {
  272. "node": "AI Agent",
  273. "type": "ai_tool",
  274. "index": 0
  275. }
  276. ]
  277. ]
  278. },
  279. "update_datameta": {
  280. "ai_tool": [
  281. [
  282. {
  283. "node": "AI Agent",
  284. "type": "ai_tool",
  285. "index": 0
  286. }
  287. ]
  288. ]
  289. },
  290. "DeepSeek Chat Model": {
  291. "ai_languageModel": [
  292. [
  293. {
  294. "node": "AI Agent",
  295. "type": "ai_languageModel",
  296. "index": 0
  297. }
  298. ]
  299. ]
  300. },
  301. "add_datameta": {
  302. "ai_tool": [
  303. [
  304. {
  305. "node": "AI Agent",
  306. "type": "ai_tool",
  307. "index": 0
  308. }
  309. ]
  310. ]
  311. },
  312. "list_labels": {
  313. "ai_tool": [
  314. [
  315. {
  316. "node": "AI Agent",
  317. "type": "ai_tool",
  318. "index": 0
  319. }
  320. ]
  321. ]
  322. }
  323. },
  324. "settings": {
  325. "executionOrder": "v1"
  326. }
  327. }