Guest User

json_flow

a guest
Jul 13th, 2025
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.25 KB | None | 0 0
  1. {
  2. "name": "My workflow 4",
  3. "nodes": [
  4. {
  5. "parameters": {
  6. "promptType": "define",
  7. "text": "={{ $json.chatInput }}\n",
  8. "options": {
  9. "systemMessage": "#Rol\nSos un asistente de ventas trabajando en una empresa que vende productos. Tu rol es asistir a los clientes con información sobre los productos que la empresa vende.\n\n#Instrucciones\nSeguí los siguientes pasos para responder las preguntas del usuario:\n1. Preguntale al usuario cuales productos le interesan\n2. Usa la herramienta base_de_productos si los productos que le interesan al usuario tienen stock\n3. Decile al usuario cuales son los precios de los productos que le interesan del punto 1, decile también si hay stock.\n\n#Reglas\n- Siempre comunícate en español\n- No inventes cosas, si necesitás mas información pedisela al usuario y si no tenés la información en la herramienta respondé que no lo podés ayudar\n\n#Ejemplos\nUsá los siguientes ejemplos cuando le estás diciendo al usuario que se tiene un producto:\n<ejemplo>\nTenemos la Cartera Patagonia, es un Morral liviano ideal para viajes cortos en color azul. Tiene un valor de $24.751,30\n</ejemplo>\n<ejemplo>\nTenemos el Bolso de Cuero, es un Bolso liviano ideal para uso diario en color verde. Tiene un valor de $27691,20\n</ejemplo>\n<ejemplo>\nLamentablemente no tenemos ningún bolso de color negro\n</ejemplo>\n<ejemplo>\nLamentablemente no tenemos ninuna mochila verde\n</ejemplo>\n<ejemplo>\nLamentablemente no tenemos ninuna cartera azul\n</ejemplo>\n\n\n#Contexto adicional\n- Tenemos cuatro sucursales en el barrio de Once, en Capital Federal, Argentina."
  10. }
  11. },
  12. "type": "@n8n/n8n-nodes-langchain.agent",
  13. "typeVersion": 2,
  14. "position": [
  15. -580,
  16. -200
  17. ],
  18. "id": "dcaa2a66-c8b9-47df-a336-571dcf068c6e",
  19. "name": "AI Agent"
  20. },
  21. {
  22. "parameters": {
  23. "httpMethod": "POST",
  24. "path": "chat-retail",
  25. "responseMode": "responseNode",
  26. "options": {}
  27. },
  28. "type": "n8n-nodes-base.webhook",
  29. "typeVersion": 2,
  30. "position": [
  31. -1060,
  32. -200
  33. ],
  34. "id": "65494918-f799-46aa-9fb6-03ac2dc27613",
  35. "name": "Webhook",
  36. "webhookId": "REDACTED"
  37. },
  38. {
  39. "parameters": {
  40. "sessionIdType": "customKey",
  41. "sessionKey": "{{ $json[\"user_id\"] }}",
  42. "databaseName": "chat"
  43. },
  44. "type": "@n8n/n8n-nodes-langchain.memoryMongoDbChat",
  45. "typeVersion": 1,
  46. "position": [
  47. -520,
  48. 20
  49. ],
  50. "id": "634f33c6-eeda-483e-a8e9-59d7103c64d1",
  51. "name": "MongoDB Chat Memory",
  52. "credentials": {
  53. "mongoDb": {
  54. "id": "REDACTED",
  55. "name": "MongoDB account"
  56. }
  57. }
  58. },
  59. {
  60. "parameters": {
  61. "respondWith": "json",
  62. "responseBody": "={{ JSON.stringify({ \"respuesta\": $json.output }) }}\n",
  63. "options": {}
  64. },
  65. "type": "n8n-nodes-base.respondToWebhook",
  66. "typeVersion": 1.4,
  67. "position": [
  68. -180,
  69. -200
  70. ],
  71. "id": "432ec599-43e3-4531-8324-16ffa4611e24",
  72. "name": "Respond to Webhook"
  73. },
  74. {
  75. "parameters": {
  76. "mode": "raw",
  77. "jsonOutput": "={\n \"chatInput\": \"{{ $json.body.body }}\"\n}\n",
  78. "options": {}
  79. },
  80. "type": "n8n-nodes-base.set",
  81. "typeVersion": 3.4,
  82. "position": [
  83. -840,
  84. -200
  85. ],
  86. "id": "591dfdbd-1501-49af-8964-11b6fd42ac38",
  87. "name": "Edit Fields"
  88. },
  89. {
  90. "parameters": {
  91. "model": "qwen3:1.7b",
  92. "options": {}
  93. },
  94. "type": "@n8n/n8n-nodes-langchain.lmChatOllama",
  95. "typeVersion": 1,
  96. "position": [
  97. -700,
  98. 20
  99. ],
  100. "id": "56510761-4ea9-4782-8065-2c97efe0a71a",
  101. "name": "Ollama Chat Model",
  102. "credentials": {
  103. "ollamaApi": {
  104. "id": "6iMtYcBoQzr0uPqW",
  105. "name": "Ollama account"
  106. }
  107. }
  108. },
  109. {
  110. "parameters": {
  111. "descriptionType": "manual",
  112. "toolDescription": "Buscar productos en la base de datos por nombre, color, precio, stock o descripción.",
  113. "collection": "productos",
  114. "options": {},
  115. "query": "={\n \"color\": \"{{input.color}}\"\n}"
  116. },
  117. "type": "n8n-nodes-base.mongoDbTool",
  118. "typeVersion": 1.2,
  119. "position": [
  120. -360,
  121. 20
  122. ],
  123. "id": "91bb59cb-4ee7-456d-aa1b-bdc89ced7cff",
  124. "name": "base_de_productos",
  125. "alwaysOutputData": true,
  126. "credentials": {
  127. "mongoDb": {
  128. "id": "REDACTED",
  129. "name": "MongoDB account 2"
  130. }
  131. }
  132. }
  133. ],
  134. "pinData": {},
  135. "connections": {
  136. "Webhook": {
  137. "main": [
  138. [
  139. {
  140. "node": "Edit Fields",
  141. "type": "main",
  142. "index": 0
  143. }
  144. ]
  145. ]
  146. },
  147. "MongoDB Chat Memory": {
  148. "ai_memory": [
  149. [
  150. {
  151. "node": "AI Agent",
  152. "type": "ai_memory",
  153. "index": 0
  154. }
  155. ]
  156. ]
  157. },
  158. "AI Agent": {
  159. "main": [
  160. [
  161. {
  162. "node": "Respond to Webhook",
  163. "type": "main",
  164. "index": 0
  165. }
  166. ]
  167. ]
  168. },
  169. "Edit Fields": {
  170. "main": [
  171. [
  172. {
  173. "node": "AI Agent",
  174. "type": "main",
  175. "index": 0
  176. }
  177. ]
  178. ]
  179. },
  180. "Ollama Chat Model": {
  181. "ai_languageModel": [
  182. [
  183. {
  184. "node": "AI Agent",
  185. "type": "ai_languageModel",
  186. "index": 0
  187. }
  188. ]
  189. ]
  190. },
  191. "base_de_productos": {
  192. "ai_tool": [
  193. [
  194. {
  195. "node": "AI Agent",
  196. "type": "ai_tool",
  197. "index": 0
  198. }
  199. ]
  200. ]
  201. }
  202. },
  203. "active": false,
  204. "settings": {
  205. "executionOrder": "v1"
  206. },
  207. "versionId": "e4768125-25b2-4d50-923a-22811b13e708",
  208. "meta": {
  209. "templateCredsSetupCompleted": true,
  210. "instanceId": "6eb839b60e4ac2dd6737209d02b584b5ab3c71f30b18737ae30ce7cbb695d0db"
  211. },
  212. "id": "jKx14Y3jKTlPKMu9",
  213. "tags": []
  214. }
Advertisement
Add Comment
Please, Sign In to add comment