@atom8n/ai-workflow-builder 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (455) hide show
  1. package/dist/agents/responder.agent.d.ts +21 -0
  2. package/dist/agents/responder.agent.js +71 -0
  3. package/dist/agents/responder.agent.js.map +1 -0
  4. package/dist/agents/supervisor.agent.d.ts +31 -0
  5. package/dist/agents/supervisor.agent.js +68 -0
  6. package/dist/agents/supervisor.agent.js.map +1 -0
  7. package/dist/ai-workflow-builder-agent.service.d.ts +32 -0
  8. package/dist/ai-workflow-builder-agent.service.js +236 -0
  9. package/dist/ai-workflow-builder-agent.service.js.map +1 -0
  10. package/dist/build.tsbuildinfo +1 -0
  11. package/dist/chains/conversation-compact.d.ts +7 -0
  12. package/dist/chains/conversation-compact.js +56 -0
  13. package/dist/chains/conversation-compact.js.map +1 -0
  14. package/dist/chains/parameter-updater.d.ts +16 -0
  15. package/dist/chains/parameter-updater.js +112 -0
  16. package/dist/chains/parameter-updater.js.map +1 -0
  17. package/dist/chains/prompt-categorization.d.ts +3 -0
  18. package/dist/chains/prompt-categorization.js +31 -0
  19. package/dist/chains/prompt-categorization.js.map +1 -0
  20. package/dist/chains/test/integration/test-helpers.d.ts +3 -0
  21. package/dist/chains/test/integration/test-helpers.js +16 -0
  22. package/dist/chains/test/integration/test-helpers.js.map +1 -0
  23. package/dist/chains/workflow-name.d.ts +4 -0
  24. package/dist/chains/workflow-name.js +22 -0
  25. package/dist/chains/workflow-name.js.map +1 -0
  26. package/dist/constants.d.ts +14 -0
  27. package/dist/constants.js +18 -0
  28. package/dist/constants.js.map +1 -0
  29. package/dist/errors/index.d.ts +52 -0
  30. package/dist/errors/index.js +137 -0
  31. package/dist/errors/index.js.map +1 -0
  32. package/dist/index.d.ts +4 -0
  33. package/dist/index.js +22 -0
  34. package/dist/index.js.map +1 -0
  35. package/dist/llm-config.d.ts +11 -0
  36. package/dist/llm-config.js +126 -0
  37. package/dist/llm-config.js.map +1 -0
  38. package/dist/multi-agent-workflow-subgraphs.d.ts +122 -0
  39. package/dist/multi-agent-workflow-subgraphs.js +159 -0
  40. package/dist/multi-agent-workflow-subgraphs.js.map +1 -0
  41. package/dist/parent-graph-state.d.ts +27 -0
  42. package/dist/parent-graph-state.js +47 -0
  43. package/dist/parent-graph-state.js.map +1 -0
  44. package/dist/prompts/agents/builder.prompt.d.ts +1 -0
  45. package/dist/prompts/agents/builder.prompt.js +320 -0
  46. package/dist/prompts/agents/builder.prompt.js.map +1 -0
  47. package/dist/prompts/agents/configurator.prompt.d.ts +2 -0
  48. package/dist/prompts/agents/configurator.prompt.js +143 -0
  49. package/dist/prompts/agents/configurator.prompt.js.map +1 -0
  50. package/dist/prompts/agents/discovery.prompt.d.ts +11 -0
  51. package/dist/prompts/agents/discovery.prompt.js +260 -0
  52. package/dist/prompts/agents/discovery.prompt.js.map +1 -0
  53. package/dist/prompts/agents/responder.prompt.d.ts +1 -0
  54. package/dist/prompts/agents/responder.prompt.js +41 -0
  55. package/dist/prompts/agents/responder.prompt.js.map +1 -0
  56. package/dist/prompts/agents/supervisor.prompt.d.ts +1 -0
  57. package/dist/prompts/agents/supervisor.prompt.js +43 -0
  58. package/dist/prompts/agents/supervisor.prompt.js.map +1 -0
  59. package/dist/prompts/builder/index.d.ts +2 -0
  60. package/dist/prompts/builder/index.js +7 -0
  61. package/dist/prompts/builder/index.js.map +1 -0
  62. package/dist/prompts/builder/prompt-builder.d.ts +17 -0
  63. package/dist/prompts/builder/prompt-builder.js +147 -0
  64. package/dist/prompts/builder/prompt-builder.js.map +1 -0
  65. package/dist/prompts/builder/types.d.ts +22 -0
  66. package/dist/prompts/builder/types.js +3 -0
  67. package/dist/prompts/builder/types.js.map +1 -0
  68. package/dist/prompts/chains/categorization.prompt.d.ts +43 -0
  69. package/dist/prompts/chains/categorization.prompt.js +86 -0
  70. package/dist/prompts/chains/categorization.prompt.js.map +1 -0
  71. package/dist/prompts/chains/compact.prompt.d.ts +2 -0
  72. package/dist/prompts/chains/compact.prompt.js +16 -0
  73. package/dist/prompts/chains/compact.prompt.js.map +1 -0
  74. package/dist/prompts/chains/parameter-updater/examples/if-node.d.ts +2 -0
  75. package/dist/prompts/chains/parameter-updater/examples/if-node.js +141 -0
  76. package/dist/prompts/chains/parameter-updater/examples/if-node.js.map +1 -0
  77. package/dist/prompts/chains/parameter-updater/examples/index.d.ts +6 -0
  78. package/dist/prompts/chains/parameter-updater/examples/index.js +16 -0
  79. package/dist/prompts/chains/parameter-updater/examples/index.js.map +1 -0
  80. package/dist/prompts/chains/parameter-updater/examples/resource-locator.d.ts +2 -0
  81. package/dist/prompts/chains/parameter-updater/examples/resource-locator.js +83 -0
  82. package/dist/prompts/chains/parameter-updater/examples/resource-locator.js.map +1 -0
  83. package/dist/prompts/chains/parameter-updater/examples/set-node.d.ts +2 -0
  84. package/dist/prompts/chains/parameter-updater/examples/set-node.js +151 -0
  85. package/dist/prompts/chains/parameter-updater/examples/set-node.js.map +1 -0
  86. package/dist/prompts/chains/parameter-updater/examples/simple-updates.d.ts +2 -0
  87. package/dist/prompts/chains/parameter-updater/examples/simple-updates.js +54 -0
  88. package/dist/prompts/chains/parameter-updater/examples/simple-updates.js.map +1 -0
  89. package/dist/prompts/chains/parameter-updater/examples/switch-node.d.ts +2 -0
  90. package/dist/prompts/chains/parameter-updater/examples/switch-node.js +131 -0
  91. package/dist/prompts/chains/parameter-updater/examples/switch-node.js.map +1 -0
  92. package/dist/prompts/chains/parameter-updater/examples/tool-nodes.d.ts +2 -0
  93. package/dist/prompts/chains/parameter-updater/examples/tool-nodes.js +74 -0
  94. package/dist/prompts/chains/parameter-updater/examples/tool-nodes.js.map +1 -0
  95. package/dist/prompts/chains/parameter-updater/guides/embedding-nodes.d.ts +2 -0
  96. package/dist/prompts/chains/parameter-updater/guides/embedding-nodes.js +70 -0
  97. package/dist/prompts/chains/parameter-updater/guides/embedding-nodes.js.map +1 -0
  98. package/dist/prompts/chains/parameter-updater/guides/gmail.d.ts +2 -0
  99. package/dist/prompts/chains/parameter-updater/guides/gmail.js +28 -0
  100. package/dist/prompts/chains/parameter-updater/guides/gmail.js.map +1 -0
  101. package/dist/prompts/chains/parameter-updater/guides/http-request.d.ts +2 -0
  102. package/dist/prompts/chains/parameter-updater/guides/http-request.js +139 -0
  103. package/dist/prompts/chains/parameter-updater/guides/http-request.js.map +1 -0
  104. package/dist/prompts/chains/parameter-updater/guides/if-node.d.ts +2 -0
  105. package/dist/prompts/chains/parameter-updater/guides/if-node.js +159 -0
  106. package/dist/prompts/chains/parameter-updater/guides/if-node.js.map +1 -0
  107. package/dist/prompts/chains/parameter-updater/guides/index.d.ts +10 -0
  108. package/dist/prompts/chains/parameter-updater/guides/index.js +24 -0
  109. package/dist/prompts/chains/parameter-updater/guides/index.js.map +1 -0
  110. package/dist/prompts/chains/parameter-updater/guides/resource-locator.d.ts +2 -0
  111. package/dist/prompts/chains/parameter-updater/guides/resource-locator.js +99 -0
  112. package/dist/prompts/chains/parameter-updater/guides/resource-locator.js.map +1 -0
  113. package/dist/prompts/chains/parameter-updater/guides/set-node.d.ts +2 -0
  114. package/dist/prompts/chains/parameter-updater/guides/set-node.js +94 -0
  115. package/dist/prompts/chains/parameter-updater/guides/set-node.js.map +1 -0
  116. package/dist/prompts/chains/parameter-updater/guides/switch-node.d.ts +2 -0
  117. package/dist/prompts/chains/parameter-updater/guides/switch-node.js +75 -0
  118. package/dist/prompts/chains/parameter-updater/guides/switch-node.js.map +1 -0
  119. package/dist/prompts/chains/parameter-updater/guides/system-message.d.ts +2 -0
  120. package/dist/prompts/chains/parameter-updater/guides/system-message.js +96 -0
  121. package/dist/prompts/chains/parameter-updater/guides/system-message.js.map +1 -0
  122. package/dist/prompts/chains/parameter-updater/guides/text-fields.d.ts +2 -0
  123. package/dist/prompts/chains/parameter-updater/guides/text-fields.js +31 -0
  124. package/dist/prompts/chains/parameter-updater/guides/text-fields.js.map +1 -0
  125. package/dist/prompts/chains/parameter-updater/guides/tool-nodes.d.ts +2 -0
  126. package/dist/prompts/chains/parameter-updater/guides/tool-nodes.js +76 -0
  127. package/dist/prompts/chains/parameter-updater/guides/tool-nodes.js.map +1 -0
  128. package/dist/prompts/chains/parameter-updater/index.d.ts +8 -0
  129. package/dist/prompts/chains/parameter-updater/index.js +35 -0
  130. package/dist/prompts/chains/parameter-updater/index.js.map +1 -0
  131. package/dist/prompts/chains/parameter-updater/instance-url.d.ts +1 -0
  132. package/dist/prompts/chains/parameter-updater/instance-url.js +15 -0
  133. package/dist/prompts/chains/parameter-updater/instance-url.js.map +1 -0
  134. package/dist/prompts/chains/parameter-updater/parameter-updater.prompt.d.ts +4 -0
  135. package/dist/prompts/chains/parameter-updater/parameter-updater.prompt.js +52 -0
  136. package/dist/prompts/chains/parameter-updater/parameter-updater.prompt.js.map +1 -0
  137. package/dist/prompts/chains/parameter-updater/registry.d.ts +4 -0
  138. package/dist/prompts/chains/parameter-updater/registry.js +66 -0
  139. package/dist/prompts/chains/parameter-updater/registry.js.map +1 -0
  140. package/dist/prompts/chains/parameter-updater/types.d.ts +18 -0
  141. package/dist/prompts/chains/parameter-updater/types.js +3 -0
  142. package/dist/prompts/chains/parameter-updater/types.js.map +1 -0
  143. package/dist/prompts/chains/parameter-updater/utils.d.ts +2 -0
  144. package/dist/prompts/chains/parameter-updater/utils.js +16 -0
  145. package/dist/prompts/chains/parameter-updater/utils.js.map +1 -0
  146. package/dist/prompts/chains/workflow-name.prompt.d.ts +2 -0
  147. package/dist/prompts/chains/workflow-name.prompt.js +11 -0
  148. package/dist/prompts/chains/workflow-name.prompt.js.map +1 -0
  149. package/dist/prompts/index.d.ts +12 -0
  150. package/dist/prompts/index.js +50 -0
  151. package/dist/prompts/index.js.map +1 -0
  152. package/dist/prompts/legacy-agent.prompt.d.ts +6 -0
  153. package/dist/prompts/legacy-agent.prompt.js +594 -0
  154. package/dist/prompts/legacy-agent.prompt.js.map +1 -0
  155. package/dist/session-manager.service.d.ts +16 -0
  156. package/dist/session-manager.service.js +125 -0
  157. package/dist/session-manager.service.js.map +1 -0
  158. package/dist/subgraphs/builder.subgraph.d.ts +132 -0
  159. package/dist/subgraphs/builder.subgraph.js +173 -0
  160. package/dist/subgraphs/builder.subgraph.js.map +1 -0
  161. package/dist/subgraphs/configurator.subgraph.d.ts +142 -0
  162. package/dist/subgraphs/configurator.subgraph.js +173 -0
  163. package/dist/subgraphs/configurator.subgraph.js.map +1 -0
  164. package/dist/subgraphs/discovery.subgraph.d.ts +158 -0
  165. package/dist/subgraphs/discovery.subgraph.js +221 -0
  166. package/dist/subgraphs/discovery.subgraph.js.map +1 -0
  167. package/dist/subgraphs/subgraph-interface.d.ts +23 -0
  168. package/dist/subgraphs/subgraph-interface.js +7 -0
  169. package/dist/subgraphs/subgraph-interface.js.map +1 -0
  170. package/dist/tools/add-node.tool.d.ts +54 -0
  171. package/dist/tools/add-node.tool.js +176 -0
  172. package/dist/tools/add-node.tool.js.map +1 -0
  173. package/dist/tools/best-practices/chatbot.d.ts +7 -0
  174. package/dist/tools/best-practices/chatbot.js +118 -0
  175. package/dist/tools/best-practices/chatbot.js.map +1 -0
  176. package/dist/tools/best-practices/content-generation.d.ts +7 -0
  177. package/dist/tools/best-practices/content-generation.js +115 -0
  178. package/dist/tools/best-practices/content-generation.js.map +1 -0
  179. package/dist/tools/best-practices/data-analysis.d.ts +7 -0
  180. package/dist/tools/best-practices/data-analysis.js +367 -0
  181. package/dist/tools/best-practices/data-analysis.js.map +1 -0
  182. package/dist/tools/best-practices/data-extraction.d.ts +7 -0
  183. package/dist/tools/best-practices/data-extraction.js +122 -0
  184. package/dist/tools/best-practices/data-extraction.js.map +1 -0
  185. package/dist/tools/best-practices/data-transformation.d.ts +7 -0
  186. package/dist/tools/best-practices/data-transformation.js +162 -0
  187. package/dist/tools/best-practices/data-transformation.js.map +1 -0
  188. package/dist/tools/best-practices/document-processing.d.ts +7 -0
  189. package/dist/tools/best-practices/document-processing.js +335 -0
  190. package/dist/tools/best-practices/document-processing.js.map +1 -0
  191. package/dist/tools/best-practices/enrichment.d.ts +7 -0
  192. package/dist/tools/best-practices/enrichment.js +271 -0
  193. package/dist/tools/best-practices/enrichment.js.map +1 -0
  194. package/dist/tools/best-practices/form-input.d.ts +7 -0
  195. package/dist/tools/best-practices/form-input.js +173 -0
  196. package/dist/tools/best-practices/form-input.js.map +1 -0
  197. package/dist/tools/best-practices/human-in-the-loop.d.ts +7 -0
  198. package/dist/tools/best-practices/human-in-the-loop.js +268 -0
  199. package/dist/tools/best-practices/human-in-the-loop.js.map +1 -0
  200. package/dist/tools/best-practices/index.d.ts +3 -0
  201. package/dist/tools/best-practices/index.js +29 -0
  202. package/dist/tools/best-practices/index.js.map +1 -0
  203. package/dist/tools/best-practices/knowledge-base.d.ts +7 -0
  204. package/dist/tools/best-practices/knowledge-base.js +268 -0
  205. package/dist/tools/best-practices/knowledge-base.js.map +1 -0
  206. package/dist/tools/best-practices/monitoring.d.ts +7 -0
  207. package/dist/tools/best-practices/monitoring.js +178 -0
  208. package/dist/tools/best-practices/monitoring.js.map +1 -0
  209. package/dist/tools/best-practices/notification.d.ts +7 -0
  210. package/dist/tools/best-practices/notification.js +229 -0
  211. package/dist/tools/best-practices/notification.js.map +1 -0
  212. package/dist/tools/best-practices/scheduling.d.ts +7 -0
  213. package/dist/tools/best-practices/scheduling.js +281 -0
  214. package/dist/tools/best-practices/scheduling.js.map +1 -0
  215. package/dist/tools/best-practices/scraping-and-research.d.ts +7 -0
  216. package/dist/tools/best-practices/scraping-and-research.js +161 -0
  217. package/dist/tools/best-practices/scraping-and-research.js.map +1 -0
  218. package/dist/tools/best-practices/triage.d.ts +7 -0
  219. package/dist/tools/best-practices/triage.js +211 -0
  220. package/dist/tools/best-practices/triage.js.map +1 -0
  221. package/dist/tools/builder-tools.d.ts +16 -0
  222. package/dist/tools/builder-tools.js +36 -0
  223. package/dist/tools/builder-tools.js.map +1 -0
  224. package/dist/tools/categorize-prompt.tool.d.ts +5 -0
  225. package/dist/tools/categorize-prompt.tool.js +85 -0
  226. package/dist/tools/categorize-prompt.tool.js.map +1 -0
  227. package/dist/tools/connect-nodes.tool.d.ts +22 -0
  228. package/dist/tools/connect-nodes.tool.js +231 -0
  229. package/dist/tools/connect-nodes.tool.js.map +1 -0
  230. package/dist/tools/engines/node-search-engine.d.ts +16 -0
  231. package/dist/tools/engines/node-search-engine.js +123 -0
  232. package/dist/tools/engines/node-search-engine.js.map +1 -0
  233. package/dist/tools/get-best-practices.tool.d.ts +33 -0
  234. package/dist/tools/get-best-practices.tool.js +94 -0
  235. package/dist/tools/get-best-practices.tool.js.map +1 -0
  236. package/dist/tools/get-node-examples.tool.d.ts +119 -0
  237. package/dist/tools/get-node-examples.tool.js +189 -0
  238. package/dist/tools/get-node-examples.tool.js.map +1 -0
  239. package/dist/tools/get-node-parameter.tool.d.ts +4 -0
  240. package/dist/tools/get-node-parameter.tool.js +114 -0
  241. package/dist/tools/get-node-parameter.tool.js.map +1 -0
  242. package/dist/tools/get-workflow-examples.tool.d.ts +34 -0
  243. package/dist/tools/get-workflow-examples.tool.js +138 -0
  244. package/dist/tools/get-workflow-examples.tool.js.map +1 -0
  245. package/dist/tools/helpers/index.d.ts +4 -0
  246. package/dist/tools/helpers/index.js +21 -0
  247. package/dist/tools/helpers/index.js.map +1 -0
  248. package/dist/tools/helpers/progress.d.ts +9 -0
  249. package/dist/tools/helpers/progress.js +126 -0
  250. package/dist/tools/helpers/progress.js.map +1 -0
  251. package/dist/tools/helpers/response.d.ts +7 -0
  252. package/dist/tools/helpers/response.js +33 -0
  253. package/dist/tools/helpers/response.js.map +1 -0
  254. package/dist/tools/helpers/state.d.ts +14 -0
  255. package/dist/tools/helpers/state.js +85 -0
  256. package/dist/tools/helpers/state.js.map +1 -0
  257. package/dist/tools/helpers/validation.d.ts +13 -0
  258. package/dist/tools/helpers/validation.js +83 -0
  259. package/dist/tools/helpers/validation.js.map +1 -0
  260. package/dist/tools/node-details.tool.d.ts +31 -0
  261. package/dist/tools/node-details.tool.js +201 -0
  262. package/dist/tools/node-details.tool.js.map +1 -0
  263. package/dist/tools/node-search.tool.d.ts +62 -0
  264. package/dist/tools/node-search.tool.js +155 -0
  265. package/dist/tools/node-search.tool.js.map +1 -0
  266. package/dist/tools/remove-connection.tool.d.ts +24 -0
  267. package/dist/tools/remove-connection.tool.js +234 -0
  268. package/dist/tools/remove-connection.tool.js.map +1 -0
  269. package/dist/tools/remove-node.tool.d.ts +4 -0
  270. package/dist/tools/remove-node.tool.js +106 -0
  271. package/dist/tools/remove-node.tool.js.map +1 -0
  272. package/dist/tools/update-node-parameters.tool.d.ts +5 -0
  273. package/dist/tools/update-node-parameters.tool.js +156 -0
  274. package/dist/tools/update-node-parameters.tool.js.map +1 -0
  275. package/dist/tools/utils/connection-parameters.utils.d.ts +8 -0
  276. package/dist/tools/utils/connection-parameters.utils.js +47 -0
  277. package/dist/tools/utils/connection-parameters.utils.js.map +1 -0
  278. package/dist/tools/utils/connection.utils.d.ts +15 -0
  279. package/dist/tools/utils/connection.utils.js +321 -0
  280. package/dist/tools/utils/connection.utils.js.map +1 -0
  281. package/dist/tools/utils/mermaid.utils.d.ts +13 -0
  282. package/dist/tools/utils/mermaid.utils.js +647 -0
  283. package/dist/tools/utils/mermaid.utils.js.map +1 -0
  284. package/dist/tools/utils/node-configuration.utils.d.ts +13 -0
  285. package/dist/tools/utils/node-configuration.utils.js +75 -0
  286. package/dist/tools/utils/node-configuration.utils.js.map +1 -0
  287. package/dist/tools/utils/node-creation.utils.d.ts +8 -0
  288. package/dist/tools/utils/node-creation.utils.js +56 -0
  289. package/dist/tools/utils/node-creation.utils.js.map +1 -0
  290. package/dist/tools/utils/node-positioning.utils.d.ts +17 -0
  291. package/dist/tools/utils/node-positioning.utils.js +87 -0
  292. package/dist/tools/utils/node-positioning.utils.js.map +1 -0
  293. package/dist/tools/utils/parameter-update.utils.d.ts +6 -0
  294. package/dist/tools/utils/parameter-update.utils.js +75 -0
  295. package/dist/tools/utils/parameter-update.utils.js.map +1 -0
  296. package/dist/tools/utils/test/workflows/ai-assistant.workflow.d.ts +2 -0
  297. package/dist/tools/utils/test/workflows/ai-assistant.workflow.js +542 -0
  298. package/dist/tools/utils/test/workflows/ai-assistant.workflow.js.map +1 -0
  299. package/dist/tools/validate-configuration.tool.d.ts +4 -0
  300. package/dist/tools/validate-configuration.tool.js +70 -0
  301. package/dist/tools/validate-configuration.tool.js.map +1 -0
  302. package/dist/tools/validate-structure.tool.d.ts +4 -0
  303. package/dist/tools/validate-structure.tool.js +66 -0
  304. package/dist/tools/validate-structure.tool.js.map +1 -0
  305. package/dist/tools/validate-workflow.tool.d.ts +5 -0
  306. package/dist/tools/validate-workflow.tool.js +73 -0
  307. package/dist/tools/validate-workflow.tool.js.map +1 -0
  308. package/dist/tools/web/templates.d.ts +23 -0
  309. package/dist/tools/web/templates.js +106 -0
  310. package/dist/tools/web/templates.js.map +1 -0
  311. package/dist/types/best-practices.d.ts +6 -0
  312. package/dist/types/best-practices.js +3 -0
  313. package/dist/types/best-practices.js.map +1 -0
  314. package/dist/types/categorization.d.ts +23 -0
  315. package/dist/types/categorization.js +38 -0
  316. package/dist/types/categorization.js.map +1 -0
  317. package/dist/types/config.d.ts +55 -0
  318. package/dist/types/config.js +3 -0
  319. package/dist/types/config.js.map +1 -0
  320. package/dist/types/connections.d.ts +30 -0
  321. package/dist/types/connections.js +3 -0
  322. package/dist/types/connections.js.map +1 -0
  323. package/dist/types/coordination.d.ts +42 -0
  324. package/dist/types/coordination.js +23 -0
  325. package/dist/types/coordination.js.map +1 -0
  326. package/dist/types/discovery-types.d.ts +12 -0
  327. package/dist/types/discovery-types.js +3 -0
  328. package/dist/types/discovery-types.js.map +1 -0
  329. package/dist/types/index.d.ts +11 -0
  330. package/dist/types/index.js +18 -0
  331. package/dist/types/index.js.map +1 -0
  332. package/dist/types/langchain.d.ts +3 -0
  333. package/dist/types/langchain.js +15 -0
  334. package/dist/types/langchain.js.map +1 -0
  335. package/dist/types/messages.d.ts +32 -0
  336. package/dist/types/messages.js +3 -0
  337. package/dist/types/messages.js.map +1 -0
  338. package/dist/types/nodes.d.ts +27 -0
  339. package/dist/types/nodes.js +3 -0
  340. package/dist/types/nodes.js.map +1 -0
  341. package/dist/types/sessions.d.ts +8 -0
  342. package/dist/types/sessions.js +34 -0
  343. package/dist/types/sessions.js.map +1 -0
  344. package/dist/types/streaming.d.ts +33 -0
  345. package/dist/types/streaming.js +3 -0
  346. package/dist/types/streaming.js.map +1 -0
  347. package/dist/types/tools.d.ts +120 -0
  348. package/dist/types/tools.js +3 -0
  349. package/dist/types/tools.js.map +1 -0
  350. package/dist/types/utils.d.ts +2 -0
  351. package/dist/types/utils.js +3 -0
  352. package/dist/types/utils.js.map +1 -0
  353. package/dist/types/web/templates.d.ts +45 -0
  354. package/dist/types/web/templates.js +37 -0
  355. package/dist/types/web/templates.js.map +1 -0
  356. package/dist/types/workflow.d.ts +31 -0
  357. package/dist/types/workflow.js +3 -0
  358. package/dist/types/workflow.js.map +1 -0
  359. package/dist/utils/cache-control/helpers.d.ts +5 -0
  360. package/dist/utils/cache-control/helpers.js +126 -0
  361. package/dist/utils/cache-control/helpers.js.map +1 -0
  362. package/dist/utils/cache-control/index.d.ts +1 -0
  363. package/dist/utils/cache-control/index.js +9 -0
  364. package/dist/utils/cache-control/index.js.map +1 -0
  365. package/dist/utils/cleanup-dangling-tool-call-messages.d.ts +3 -0
  366. package/dist/utils/cleanup-dangling-tool-call-messages.js +10 -0
  367. package/dist/utils/cleanup-dangling-tool-call-messages.js.map +1 -0
  368. package/dist/utils/context-builders.d.ts +10 -0
  369. package/dist/utils/context-builders.js +71 -0
  370. package/dist/utils/context-builders.js.map +1 -0
  371. package/dist/utils/coordination-log.d.ts +15 -0
  372. package/dist/utils/coordination-log.js +75 -0
  373. package/dist/utils/coordination-log.js.map +1 -0
  374. package/dist/utils/http-proxy-agent.d.ts +2 -0
  375. package/dist/utils/http-proxy-agent.js +16 -0
  376. package/dist/utils/http-proxy-agent.js.map +1 -0
  377. package/dist/utils/node-helpers.d.ts +2 -0
  378. package/dist/utils/node-helpers.js +54 -0
  379. package/dist/utils/node-helpers.js.map +1 -0
  380. package/dist/utils/operations-processor.d.ts +14 -0
  381. package/dist/utils/operations-processor.js +196 -0
  382. package/dist/utils/operations-processor.js.map +1 -0
  383. package/dist/utils/state-modifier.d.ts +32 -0
  384. package/dist/utils/state-modifier.js +112 -0
  385. package/dist/utils/state-modifier.js.map +1 -0
  386. package/dist/utils/state-reducers.d.ts +3 -0
  387. package/dist/utils/state-reducers.js +20 -0
  388. package/dist/utils/state-reducers.js.map +1 -0
  389. package/dist/utils/stream-processor.d.ts +20 -0
  390. package/dist/utils/stream-processor.js +277 -0
  391. package/dist/utils/stream-processor.js.map +1 -0
  392. package/dist/utils/subgraph-helpers.d.ts +16 -0
  393. package/dist/utils/subgraph-helpers.js +117 -0
  394. package/dist/utils/subgraph-helpers.js.map +1 -0
  395. package/dist/utils/token-usage.d.ts +21 -0
  396. package/dist/utils/token-usage.js +45 -0
  397. package/dist/utils/token-usage.js.map +1 -0
  398. package/dist/utils/tool-executor.d.ts +3 -0
  399. package/dist/utils/tool-executor.js +108 -0
  400. package/dist/utils/tool-executor.js.map +1 -0
  401. package/dist/utils/trim-workflow-context.d.ts +2 -0
  402. package/dist/utils/trim-workflow-context.js +53 -0
  403. package/dist/utils/trim-workflow-context.js.map +1 -0
  404. package/dist/utils/workflow-validation.d.ts +2 -0
  405. package/dist/utils/workflow-validation.js +37 -0
  406. package/dist/utils/workflow-validation.js.map +1 -0
  407. package/dist/validation/checks/agent-prompt.d.ts +3 -0
  408. package/dist/validation/checks/agent-prompt.js +47 -0
  409. package/dist/validation/checks/agent-prompt.js.map +1 -0
  410. package/dist/validation/checks/connections.d.ts +4 -0
  411. package/dist/validation/checks/connections.js +163 -0
  412. package/dist/validation/checks/connections.js.map +1 -0
  413. package/dist/validation/checks/credentials.d.ts +3 -0
  414. package/dist/validation/checks/credentials.js +125 -0
  415. package/dist/validation/checks/credentials.js.map +1 -0
  416. package/dist/validation/checks/from-ai.d.ts +4 -0
  417. package/dist/validation/checks/from-ai.js +62 -0
  418. package/dist/validation/checks/from-ai.js.map +1 -0
  419. package/dist/validation/checks/index.d.ts +7 -0
  420. package/dist/validation/checks/index.js +18 -0
  421. package/dist/validation/checks/index.js.map +1 -0
  422. package/dist/validation/checks/nodes.d.ts +4 -0
  423. package/dist/validation/checks/nodes.js +44 -0
  424. package/dist/validation/checks/nodes.js.map +1 -0
  425. package/dist/validation/checks/tools.d.ts +4 -0
  426. package/dist/validation/checks/tools.js +38 -0
  427. package/dist/validation/checks/tools.js.map +1 -0
  428. package/dist/validation/checks/trigger.d.ts +8 -0
  429. package/dist/validation/checks/trigger.js +33 -0
  430. package/dist/validation/checks/trigger.js.map +1 -0
  431. package/dist/validation/programmatic.d.ts +3 -0
  432. package/dist/validation/programmatic.js +24 -0
  433. package/dist/validation/programmatic.js.map +1 -0
  434. package/dist/validation/types.d.ts +52 -0
  435. package/dist/validation/types.js +31 -0
  436. package/dist/validation/types.js.map +1 -0
  437. package/dist/validation/utils/expressions.d.ts +3 -0
  438. package/dist/validation/utils/expressions.js +37 -0
  439. package/dist/validation/utils/expressions.js.map +1 -0
  440. package/dist/validation/utils/is-tool.d.ts +2 -0
  441. package/dist/validation/utils/is-tool.js +7 -0
  442. package/dist/validation/utils/is-tool.js.map +1 -0
  443. package/dist/validation/utils/node-type-map.d.ts +8 -0
  444. package/dist/validation/utils/node-type-map.js +50 -0
  445. package/dist/validation/utils/node-type-map.js.map +1 -0
  446. package/dist/validation/utils/resolve-connections.d.ts +8 -0
  447. package/dist/validation/utils/resolve-connections.js +64 -0
  448. package/dist/validation/utils/resolve-connections.js.map +1 -0
  449. package/dist/workflow-builder-agent.d.ts +72 -0
  450. package/dist/workflow-builder-agent.js +401 -0
  451. package/dist/workflow-builder-agent.js.map +1 -0
  452. package/dist/workflow-state.d.ts +26 -0
  453. package/dist/workflow-state.js +79 -0
  454. package/dist/workflow-state.js.map +1 -0
  455. package/package.json +77 -0
@@ -0,0 +1,367 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DataAnalysisBestPractices = void 0;
4
+ const categorization_1 = require("../../types/categorization");
5
+ class DataAnalysisBestPractices {
6
+ technique = categorization_1.WorkflowTechnique.DATA_ANALYSIS;
7
+ version = '1.0.0';
8
+ documentation = `# Best Practices: Data Analysis Workflows
9
+
10
+ ## Workflow Design
11
+
12
+ Structure workflows following the Input → Transform → Output pattern. Use clear node naming (e.g., "Fetch Sales Data", "Calculate Averages", "IF High Variance?") to document the flow.
13
+
14
+ Start with appropriate triggers:
15
+ - Manual Trigger for on-demand analysis
16
+ - Cron/Schedule Trigger for periodic analysis (daily/weekly reports)
17
+ - Webhook Trigger for event-driven analysis
18
+
19
+ Break complex workflows into modular sub-workflows using the Execute Workflow node for reusable components like "Outlier Detection" or "Data Preparation".
20
+
21
+ CRITICAL: For large datasets, use Split In Batches node to process items in chunks (e.g., 100 at a time) to prevent memory issues. Always test with realistic data volumes.
22
+
23
+ Example pattern:
24
+ - Trigger → HTTP Request (fetch data) → Spreadsheet File (parse CSV) → Set (clean fields) → Filter (remove nulls) → Code (analyze) → HTML (format report) → Email (send results)
25
+
26
+ ## Data Preparation Strategy
27
+
28
+ 1. **Fetch Data**: Use dedicated integration nodes or HTTP Request for APIs. Import cURL commands directly to HTTP node for complex APIs.
29
+ 2. **Parse & Convert**: Convert to JSON using Spreadsheet File node for CSV/Excel. Enable "Convert types where required" on condition nodes.
30
+ 3. **Clean Data**: Use Set node with "Keep Only Set" enabled to drop unused fields. Filter node for removing null values or focusing on data subsets.
31
+ 4. **Merge/Enrich**: Use Merge node by key or index to combine multiple sources. Choose correct merge mode to avoid mismatched items.
32
+
33
+ ## Analysis Implementation
34
+
35
+ Use Function node (not Function Item) when analysis needs all items as a whole (calculating totals, finding trends). Function Item operates per item only.
36
+
37
+ For AI-powered analysis, filter irrelevant content first to minimize tokens. Batch data into single prompts when possible.
38
+
39
+ Always pin data after external calls to test downstream logic without re-fetching. This saves API costs and speeds development.
40
+
41
+ ## Output & Integration
42
+
43
+ Format results appropriately:
44
+ - HTML/Markdown nodes for reports
45
+ - Set node to prepare specific output fields (totalSales, anomalyCount)
46
+ - Database nodes to store analysis history
47
+ - Webhook Response for API-triggered workflows
48
+
49
+ Use conditional branches (IF nodes) for post-analysis actions:
50
+ - Create tasks if anomalies detected
51
+ - Send alerts for critical thresholds
52
+ - Avoid infinite loops by using proper conditions
53
+
54
+ ## Recommended Nodes
55
+
56
+ ### HTTP Request (n8n-nodes-base.httpRequest)
57
+
58
+ **Purpose**: Fetch datasets from URLs or APIs
59
+
60
+ **Use Cases**:
61
+ - Pull data from REST APIs for analysis
62
+ - Fetch CSV/JSON files from URLs
63
+ - Query external data sources
64
+
65
+ **Best Practices**:
66
+ - Import cURL commands for complex requests
67
+ - Use authentication credentials properly
68
+ - Handle pagination for large datasets
69
+
70
+ ### Spreadsheet File (n8n-nodes-base.spreadsheetFile)
71
+
72
+ **Purpose**: Parse CSV/Excel files into JSON items for processing
73
+
74
+ **Use Cases**:
75
+ - Import CSV data from file uploads
76
+ - Process Excel spreadsheets
77
+ - Convert tabular data to JSON
78
+
79
+ **Best Practices**:
80
+ - Specify correct file format
81
+ - Handle header rows properly
82
+ - Test with various file encodings
83
+
84
+ ### Set / Edit Fields (n8n-nodes-base.set)
85
+
86
+ **Purpose**: Clean data, select relevant fields, rename columns, convert data types
87
+
88
+ **Key Setting**: "Keep Only Set" - drops all fields not explicitly defined
89
+
90
+ **Use Cases**:
91
+ - Remove unused columns to reduce data size
92
+ - Rename fields to standardized names
93
+ - Convert data types (string to number)
94
+ - Add calculated fields
95
+
96
+ **Best Practices**:
97
+ - Enable "Keep Only Set" to drop unused data
98
+ - Always verify output structure
99
+ - Use expressions for calculated fields
100
+
101
+ ### Filter (n8n-nodes-base.filter)
102
+
103
+ **Purpose**: Remove unwanted items based on conditions
104
+
105
+ **Use Cases**:
106
+ - Remove null values
107
+ - Filter outliers before analysis
108
+ - Focus on specific data subsets
109
+
110
+ **Best Practices**:
111
+ - Filter early to reduce processing load
112
+ - Use multiple conditions when needed
113
+ - Document filter logic clearly
114
+
115
+ ### IF (n8n-nodes-base.if)
116
+
117
+ **Purpose**: Branch workflow based on analysis results
118
+
119
+ **Use Cases**:
120
+ - Route anomalies vs normal data
121
+ - Trigger alerts for threshold breaches
122
+ - Create conditional outputs
123
+
124
+ **Best Practices**:
125
+ - Enable "Convert types where required" for comparisons
126
+ - Use clear condition names
127
+ - Handle both true and false branches
128
+
129
+ ### Code / Function (n8n-nodes-base.function)
130
+
131
+ **Purpose**: Custom JavaScript for calculations, statistics, anomaly detection
132
+
133
+ **Use Cases**:
134
+ - Calculate statistical measures (mean, median, std dev)
135
+ - Detect outliers and anomalies
136
+ - Perform complex transformations
137
+ - Implement custom algorithms
138
+
139
+ **Best Practices**:
140
+ - Use Function node (not Function Item) for whole-dataset operations
141
+ - Return proper data structure: \`return items\`
142
+ - Add comments to explain logic
143
+ - Test with edge cases
144
+
145
+ **Note**: Consider using the newer Code node (n8n-nodes-base.code) as Function node is deprecated.
146
+
147
+ ### Aggregate (n8n-nodes-base.aggregate)
148
+
149
+ **Purpose**: Group items, gather values into arrays, count occurrences by category
150
+
151
+ **Use Cases**:
152
+ - Group sales by region
153
+ - Count items by category
154
+ - Calculate sums and averages per group
155
+
156
+ **Best Practices**:
157
+ - Choose appropriate aggregation function
158
+ - Use grouping keys effectively
159
+ - Simplifies statistical calculations
160
+
161
+ ### Split In Batches (n8n-nodes-base.splitInBatches)
162
+
163
+ **Purpose**: Process large datasets in chunks to prevent memory overload
164
+
165
+ **Use Cases**:
166
+ - Handle datasets with 1000+ items
167
+ - Process API results in batches
168
+ - Prevent workflow timeouts
169
+
170
+ **Best Practices**:
171
+ - Set appropriate batch size (e.g., 100 items)
172
+ - Test with realistic data volumes
173
+ - Use loop logic properly
174
+
175
+ ### Merge (n8n-nodes-base.merge)
176
+
177
+ **Purpose**: Combine data from multiple sources by key/index
178
+
179
+ **Modes**:
180
+ - Merge by Key: Join data like database operations
181
+ - Merge by Index: Combine parallel data streams
182
+ - Wait mode: Synchronize parallel branches
183
+
184
+ **Use Cases**:
185
+ - Join customer data with transaction data
186
+ - Combine multiple API responses
187
+ - Enrich data from multiple sources
188
+
189
+ **Best Practices**:
190
+ - Choose correct merge mode
191
+ - Ensure matching keys exist
192
+ - Handle missing data gracefully
193
+
194
+ ### Database Nodes
195
+
196
+ **MySQL** (n8n-nodes-base.mySql):
197
+ - Purpose: Query MySQL databases for analysis data
198
+ - Use cases: Fetch historical data, store results
199
+
200
+ **Postgres** (n8n-nodes-base.postgres):
201
+ - Purpose: Query PostgreSQL databases
202
+ - Use cases: Complex analytical queries, time-series data
203
+
204
+ **MongoDB** (n8n-nodes-base.mongoDb):
205
+ - Purpose: Query NoSQL document databases
206
+ - Use cases: Unstructured data analysis, JSON documents
207
+
208
+ **Best Practices**:
209
+ - Use parameterized queries for security
210
+ - Query source data efficiently with proper indexes
211
+ - Store analysis results for historical tracking
212
+ - Use appropriate data types
213
+
214
+ ### Google Sheets (n8n-nodes-base.googleSheets)
215
+
216
+ **Purpose**: Read/write spreadsheet data
217
+
218
+ **Use Cases**:
219
+ - Import data for analysis
220
+ - Append summary statistics
221
+ - Build analysis logs
222
+ - Share results with stakeholders
223
+
224
+ **Best Practices**:
225
+ - Use range specifications efficiently
226
+ - Handle large sheets with batching
227
+ - Consider API rate limits
228
+
229
+ ### AI Agent (@n8n/n8n-nodes-langchain.agent)
230
+
231
+ **Purpose**: Leverage AI for text analysis, sentiment detection, complex pattern recognition
232
+
233
+ **Use Cases**:
234
+ - Sentiment analysis of customer feedback
235
+ - Text classification
236
+ - Extract insights from unstructured data
237
+ - Natural language processing
238
+
239
+ **Best Practices**:
240
+ - Filter irrelevant content first to minimize tokens
241
+ - Batch data into single prompts when possible
242
+ - Use structured output for consistency
243
+ - Consider API costs and latency
244
+
245
+ ### HTML (n8n-nodes-base.html)
246
+
247
+ **Purpose**: Generate formatted reports with tables and styling
248
+
249
+ **Use Cases**:
250
+ - Create analysis reports
251
+ - Build dashboards
252
+ - Color-code data quality scores
253
+ - Format tables with results
254
+
255
+ **Best Practices**:
256
+ - Use templates for consistent formatting
257
+ - Include visualizations where helpful
258
+ - Make reports mobile-friendly
259
+
260
+ ### Email (n8n-nodes-base.emailSend)
261
+
262
+ **Purpose**: Send analysis reports to stakeholders automatically
263
+
264
+ **Use Cases**:
265
+ - Scheduled report delivery
266
+ - Alert notifications
267
+ - Share findings with teams
268
+
269
+ **Best Practices**:
270
+ - Use clear subject lines
271
+ - Include summary in email body
272
+ - Attach detailed reports when needed
273
+ - Schedule appropriately
274
+
275
+ ## Common Pitfalls to Avoid
276
+
277
+ ### Data Type Mismatches
278
+
279
+ **Problem**: JSON data types matter. Comparing string vs number yields incorrect results. The comparison "5" > "10" is lexicographically true (wrong for numbers).
280
+
281
+ **Solution**:
282
+ - Always convert data types before comparisons
283
+ - Use Number() or parseInt() for numeric operations
284
+ - Enable "Convert types where required" on IF nodes
285
+ - Validate data types early in workflow
286
+ - Use proper type casting in Code nodes
287
+
288
+ ### Memory Issues with Large Datasets
289
+
290
+ **Problem**: Processing thousands of items at once can crash workflows or timeout.
291
+
292
+ **Solution**:
293
+ - Use Split In Batches node for datasets over 100 items
294
+ - Set appropriate batch sizes (50-100 items)
295
+ - Test with realistic data volumes during development
296
+ - Monitor memory usage in production
297
+ - Consider sub-workflows for complex processing
298
+
299
+ ### Not Pinning Data During Development
300
+
301
+ **Problem**: Re-fetching data from APIs repeatedly wastes time and costs money during development.
302
+
303
+ **Solution**:
304
+ - Always pin data after external calls
305
+ - Test downstream logic without re-fetching
306
+ - Saves API costs and speeds development
307
+ - Use manual triggers to control execution
308
+
309
+ ### Incorrect Aggregation Logic
310
+
311
+ **Problem**: Using Function Item instead of Function node for whole-dataset calculations.
312
+
313
+ **Solution**:
314
+ - Use Function node (not Function Item) for totals, averages, trends
315
+ - Function Item operates per item only
316
+ - Understand the difference between item-level and dataset-level operations
317
+ - Use Aggregate node for common operations
318
+
319
+ ### Missing Data Cleaning
320
+
321
+ **Problem**: Null values, inconsistent formats, or outliers skew analysis results.
322
+
323
+ **Solution**:
324
+ - Use Filter node to remove null values
325
+ - Standardize data formats early
326
+ - Handle missing data explicitly
327
+ - Use Set node to clean and normalize fields
328
+ - Document data quality assumptions
329
+
330
+ ### Poor Error Handling
331
+
332
+ **Problem**: Failed API calls or data issues break the entire workflow.
333
+
334
+ **Solution**:
335
+ - Use "Continue on Fail" setting appropriately
336
+ - Add IF nodes to check for empty datasets
337
+ - Implement error logging
338
+ - Use Error Trigger workflows for global handling
339
+ - Validate data quality before analysis
340
+
341
+ ### Hardcoded Values
342
+
343
+ **Problem**: Thresholds, API endpoints, or configuration values are hardcoded in nodes.
344
+
345
+ **Solution**:
346
+ - Store configuration in environment variables
347
+ - Use Google Sheets or databases for thresholds
348
+ - Makes workflows reusable and maintainable
349
+ - Enable non-technical users to adjust parameters
350
+
351
+ ### Inefficient Query Patterns
352
+
353
+ **Problem**: Fetching entire datasets when only summary data is needed.
354
+
355
+ **Solution**:
356
+ - Use database aggregation functions
357
+ - Filter data at the source
358
+ - Use appropriate indexes
359
+ - Implement pagination for large results
360
+ - Consider pre-aggregated views
361
+ `;
362
+ getDocumentation() {
363
+ return this.documentation;
364
+ }
365
+ }
366
+ exports.DataAnalysisBestPractices = DataAnalysisBestPractices;
367
+ //# sourceMappingURL=data-analysis.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"data-analysis.js","sourceRoot":"","sources":["../../../src/tools/best-practices/data-analysis.ts"],"names":[],"mappings":";;;AACA,2DAA2D;AAE3D,MAAa,yBAAyB;IAC5B,SAAS,GAAG,kCAAiB,CAAC,aAAa,CAAC;IAC5C,OAAO,GAAG,OAAO,CAAC;IAEV,aAAa,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiWjC,CAAC;IAED,gBAAgB;QACf,OAAO,IAAI,CAAC,aAAa,CAAC;IAC3B,CAAC;CACD;AA1WD,8DA0WC"}
@@ -0,0 +1,7 @@
1
+ import type { BestPracticesDocument } from '../../types/best-practices';
2
+ export declare class DataExtractionBestPractices implements BestPracticesDocument {
3
+ readonly technique: "data_extraction";
4
+ readonly version = "1.0.0";
5
+ private readonly documentation;
6
+ getDocumentation(): string;
7
+ }
@@ -0,0 +1,122 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DataExtractionBestPractices = void 0;
4
+ const categorization_1 = require("../../types/categorization");
5
+ class DataExtractionBestPractices {
6
+ technique = categorization_1.WorkflowTechnique.DATA_EXTRACTION;
7
+ version = '1.0.0';
8
+ documentation = `# Best Practices: Data Extraction Workflows
9
+
10
+ ## Node Selection by Data Type
11
+
12
+ Choose the right node for your data source. Use Extract From File for CSV, Excel, PDF, and text files to convert binary data to JSON for further processing.
13
+
14
+ Use Information Extractor or AI nodes for extracting structured data from unstructured text such as PDFs or emails using LLMs.
15
+
16
+ For binary data, ensure you use nodes like Extract From File to handle files properly.
17
+
18
+ ### Referencing Binary Data from Other Nodes
19
+ When you need to reference binary data from a previous node, use this syntax:
20
+ - Expression: '{{ $('Node Name').item.binary.property_name }}' or {{ $binary.property_name }} if previous item
21
+ - Example for Gmail attachments: '{{ $('Gmail Trigger').item.binary.attachment_0 }}' or {{ $binary.attachment_0 }} if previous item
22
+ - Example for webhook data: '{{ $('Webhook').item.binary.data }}' or {{ $binary.data }} if previous item
23
+ - Important: The property name depends on how the previous node names the binary data
24
+
25
+ ## Data Structure & Type Management
26
+
27
+ Normalize data structure early in your workflow. Use transformation nodes like Split Out, Aggregate, or Set to ensure your data matches n8n's expected structure: an array of objects with a json key.
28
+ Not transforming incoming data to n8n's expected format causes downstream node failures.
29
+
30
+ When working with large amounts of information, n8n's display can be hard to view. Use the Edit Fields node to help organize and view data more clearly during development and debugging.
31
+
32
+ ## Large File Handling
33
+
34
+ Process files in batches or use sub-workflows to avoid memory issues. For large binary files, consider enabling filesystem mode (N8N_DEFAULT_BINARY_DATA_MODE=filesystem) if self-hosted, to store binary data on disk instead of memory.
35
+
36
+ Processing too many items or large files at once can crash your instance. Always batch or split processing for large datasets to manage memory effectively.
37
+
38
+ ## Binary Data Management
39
+
40
+ Binary data can be lost if intermediate nodes (like Set or Code) do not have "Include Other Input Fields" enabled, especially in sub-workflows. Always verify binary data is preserved through your workflow pipeline.
41
+
42
+ ## AI-Powered Extraction
43
+
44
+ Leverage AI for unstructured data using nodes like Information Extractor or Summarization Chain to extract structured data from unstructured sources such as PDFs, emails, or web pages.
45
+
46
+ ## Recommended Nodes
47
+
48
+ ### Loop Over Items (n8n-nodes-base.splitInBatches)
49
+
50
+ Purpose: Looping over a set of items extracted from a data set, for example if pulling a lot of data
51
+ from a Google Sheet or database then looping over the items is required. This node MUST be used
52
+ if the user mentions a large amount of data, it is necessary to batch the data to process all of it.
53
+
54
+ ### Extract From File (n8n-nodes-base.extractFromFile)
55
+
56
+ Purpose: Converts binary data from CSV, Excel, PDF, and text files to JSON for processing
57
+
58
+ Pitfalls:
59
+
60
+ - Ensure the correct binary field name is specified in the node configuration
61
+ - Verify file format compatibility before extraction
62
+
63
+ ### HTML Extract (n8n-nodes-base.htmlExtract)
64
+
65
+ Purpose: Scrapes data from web pages using CSS selectors
66
+
67
+ ### Split Out (n8n-nodes-base.splitOut)
68
+
69
+ Purpose: Processes arrays of items individually for sequential operations.
70
+ Example: If retrieving a JSON array using a HTTP request, this will return a single item,
71
+ containing that array. If you wish to use a Loop Over Items (n8n-nodes-base.splitInBatches) node]
72
+ then you will need to split out the array into items before looping over it. In a scenario like
73
+ this a split out node MUST be used before looping over the items.
74
+
75
+ ### Edit Fields (Set) (n8n-nodes-base.set)
76
+
77
+ Purpose: Data transformation and mapping to normalize structure
78
+
79
+ Pitfalls:
80
+
81
+ - Enable "Include Other Input Fields" to preserve binary data
82
+ - Pay attention to data types - mixing types causes unexpected failures
83
+
84
+ ### Information Extractor (@n8n/n8n-nodes-langchain.informationExtractor)
85
+
86
+ Purpose: AI-powered extraction of structured data from unstructured text
87
+
88
+ Pitfalls:
89
+
90
+ - Requires proper schema definition for extraction
91
+
92
+ ### Summarization Chain (@n8n/n8n-nodes-langchain.chainSummarization)
93
+
94
+ Purpose: Summarizes large text blocks using AI for condensed information extraction
95
+
96
+ Pitfalls:
97
+
98
+ - Context window limits may truncate very long documents
99
+ - Verify summary quality matches requirements
100
+
101
+ ### HTTP Request (n8n-nodes-base.httpRequest)
102
+
103
+ Purpose: Fetches data from APIs or web pages for extraction
104
+
105
+ ### Code (n8n-nodes-base.code)
106
+
107
+ Purpose: Custom logic for complex data transformations
108
+
109
+ ## Common Pitfalls to Avoid
110
+
111
+ Data Type Confusion: People often mix up data types - n8n can be very lenient but it can lead to problems. Pay close attention to what type you are getting and ensure consistency throughout the workflow.
112
+
113
+ Binary Data Loss: Binary data can be lost if intermediate nodes (Set, Code) do not have "Include Other Input Fields" enabled, especially in sub-workflows. Always verify binary data preservation.
114
+
115
+ Large Data Display Issues: n8n displaying large amounts of information can be hard to view during development. Use the Edit Fields node to help organize and view data more clearly.
116
+ `;
117
+ getDocumentation() {
118
+ return this.documentation;
119
+ }
120
+ }
121
+ exports.DataExtractionBestPractices = DataExtractionBestPractices;
122
+ //# sourceMappingURL=data-extraction.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"data-extraction.js","sourceRoot":"","sources":["../../../src/tools/best-practices/data-extraction.ts"],"names":[],"mappings":";;;AACA,2DAA2D;AAE3D,MAAa,2BAA2B;IAC9B,SAAS,GAAG,kCAAiB,CAAC,eAAe,CAAC;IAC9C,OAAO,GAAG,OAAO,CAAC;IAEV,aAAa,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4GjC,CAAC;IAED,gBAAgB;QACf,OAAO,IAAI,CAAC,aAAa,CAAC;IAC3B,CAAC;CACD;AArHD,kEAqHC"}
@@ -0,0 +1,7 @@
1
+ import type { BestPracticesDocument } from '../../types/best-practices';
2
+ export declare class DataTransformationBestPractices implements BestPracticesDocument {
3
+ readonly technique: "data_transformation";
4
+ readonly version = "1.0.0";
5
+ private readonly documentation;
6
+ getDocumentation(): string;
7
+ }
@@ -0,0 +1,162 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DataTransformationBestPractices = void 0;
4
+ const categorization_1 = require("../../types/categorization");
5
+ class DataTransformationBestPractices {
6
+ technique = categorization_1.WorkflowTechnique.DATA_TRANSFORMATION;
7
+ version = '1.0.0';
8
+ documentation = `# Best Practices: Data Transformation
9
+
10
+ ## Workflow Design
11
+
12
+ ### Core Principles
13
+ - **Structure**: Always follow Input → Transform → Output pattern
14
+ - **Optimization**: Filter and reduce data early to improve performance
15
+
16
+ ### Design Best Practices
17
+ - Plan transformation requirements in plain language before building
18
+ - Use Modular Design: Create reusable sub-workflows for common tasks like "Data Cleaning" or "Error Handler"
19
+ - Batch datasets over 100 items using Split In Batches node to prevent timeouts
20
+
21
+ ## Recommended Nodes
22
+
23
+ ### Essential Transformation Nodes
24
+
25
+ #### Edit Fields (Set) (n8n-nodes-base.set)
26
+
27
+ **Purpose**: Create, modify, rename fields; change data types
28
+
29
+ **Key Setting**: "Keep Only Set" - drops all fields not explicitly defined (default: disabled)
30
+
31
+ **Use Cases**:
32
+ - Extract specific columns
33
+ - Add calculated fields
34
+ - Convert data types (string to number)
35
+ - Format dates using expressions
36
+
37
+ **Pitfalls**:
38
+ - Not understanding "Keep Only Set" behavior can lead to data loss
39
+ - Enabled: Drops all fields not explicitly defined (data loss risk)
40
+ - Disabled: Carries forward all fields (potential bloat)
41
+ - Always verify output structure after configuration
42
+
43
+ **Testing tip**: When transforming data from a workflow trigger, you can set values with a fallback default e.g. set name to {{$json.name || 'Jane Doe'}} to help test the workflow.
44
+
45
+ #### IF/Filter Nodes
46
+
47
+ **IF Node** (n8n-nodes-base.if):
48
+ - **Purpose**: Conditional processing and routing
49
+ - **Best Practice**: Use early to validate inputs and remove bad data
50
+ - **Example**: Check if required fields exist before processing
51
+
52
+ **Filter Node** (n8n-nodes-base.filter):
53
+ - **Purpose**: Filter items based on conditions
54
+ - **Best Practice**: Use early in workflow to reduce data volume
55
+
56
+ #### Merge Node (n8n-nodes-base.merge)
57
+
58
+ **Purpose**: Combine two data streams
59
+
60
+ **Modes**:
61
+ - Merge by Key (like database join)
62
+ - Merge by Index
63
+ - Append
64
+
65
+ **Pitfalls**:
66
+ - **Missing Keys**: Trying to merge on non-existent fields
67
+ - **Field Name Mismatch**: Different field names in sources
68
+ - **Solution**: Use Edit Fields node to normalize field names before merging
69
+
70
+ #### Code Node (n8n-nodes-base.code)
71
+
72
+ **Built-in Nodes vs. Code Node**
73
+ - Prefer basic built-in nodes (Edit Fields, Filter, Split Out, Summarize, Aggregate, etc.) over Code node. Use Code only for complex logic that can't be achieved otherwise.
74
+ - Rule of thumb: if the goal can be achieved with fewer than 5 basic nodes, use basic nodes
75
+
76
+ **When NOT to Use**: Code node may be slower than core nodes (like Edit Fields, If, Switch, Split Out, Aggregate, etc.) as Code nodes run in a sandboxed environment. Avoid the code node where possible — it should only be used for complex transformations that can't be done with other nodes. For example, DO NOT use it for:
77
+ - Adding or removing fields from items (use the 'edit fields' node instead)
78
+ - Single-line data transformations of item fields (use the 'edit fields' node instead)
79
+ - Filtering items based on their fields (use the 'filter' node instead)
80
+ - Pivoting or summarizing data across multiple items (use the 'summarize' node instead)
81
+ - Splitting arrays inside items out into multiple items (use the 'split out' node instead)
82
+ - Aggregating multiple items into a single item (use the 'aggregate' node instead)
83
+ - Sorting items in an array based on their fields (use the 'Sort' node instead)
84
+ - Generating HTML from text or formatting text as HTML (use the 'HTML' node set to operation 'Generate HTML Template' or 'Convert to HTML Table' instead)
85
+
86
+ **When to Use**: Complex transformations impossible with built-in nodes
87
+
88
+ **Execution Modes**:
89
+ - "Run Once per Item": Process each item independently
90
+ - "Run Once for All Items": Access entire dataset (for aggregation)
91
+
92
+ **Return Format**: Must return array of objects with json property
93
+ \`\`\`javascript
94
+ return items; // or return [{ json: {...} }];
95
+ \`\`\`
96
+
97
+ **Pitfalls**:
98
+ - Wrong return format: Not returning array of objects with json property
99
+ - Overly complex: Stuffing entire workflow logic in one Code node
100
+ - Keep code nodes focused on single transformation aspect
101
+
102
+ #### Summarize Node (n8n-nodes-base.summarize)
103
+
104
+ **Purpose**: Pivot table-style aggregations (count, sum, average, min/max)
105
+
106
+ **Configuration**:
107
+ - Fields to Summarize: Choose aggregation function
108
+ - Fields to Split By: Grouping keys
109
+
110
+ **Output**: Single item with summary or multiple items per group
111
+
112
+ ### Data Restructuring Nodes
113
+
114
+ - **Split Out** (n8n-nodes-base.splitOut): Convert single item with array into multiple items
115
+ - **Aggregate** (n8n-nodes-base.aggregate): Combine multiple items into one
116
+ - **Remove Duplicates** (n8n-nodes-base.removeDuplicates): Delete duplicate items based on field criteria
117
+ - **Sort** (n8n-nodes-base.sort): Order items alphabetically/numerically
118
+ - **Limit** (n8n-nodes-base.limit): Trim to maximum number of items
119
+
120
+ ### Batch Processing
121
+
122
+ **Split In Batches** (n8n-nodes-base.splitInBatches):
123
+ - **Purpose**: Process large datasets in chunks
124
+ - **Use When**: Handling 100+ items with expensive operations (API calls, AI)
125
+
126
+ ## Input Data Validation
127
+ - Validate external data before processing: check for nulls, empty values, and edge cases (special chars, empty arrays)
128
+
129
+ ## Common Pitfalls to Avoid
130
+
131
+ ### Critical Mistakes
132
+
133
+ #### Edit Fields Node Issues
134
+ - **Mistake**: Not understanding "Keep Only Set" behavior
135
+ - Enabled: Drops all fields not explicitly defined (data loss risk)
136
+ - Disabled: Carries forward all fields (potential bloat)
137
+ - **Solution**: Always verify output structure after configuration
138
+
139
+ #### Code Node Errors
140
+ - **Wrong Return Format**: Not returning array of objects with json property
141
+ - **Fix**: Always return \`items\` or \`[{ json: {...} }]\`
142
+ - **Overly Complex**: Stuffing entire workflow logic in one Code node
143
+ - **Fix**: Keep code nodes focused on single transformation aspect
144
+
145
+ #### Merge Node Problems
146
+ - **Field Name Mismatch**: Different field names in sources
147
+ - **Fix**: Normalize field names with Edit Fields before merging
148
+
149
+ ### Performance Pitfalls
150
+ - Processing large datasets without batching → timeouts
151
+ - Not filtering early → unnecessary processing overhead
152
+ - Excessive node chaining → visual clutter and slow execution
153
+
154
+ ### Data Validation Pitfalls
155
+ - Assuming input data is always perfect → runtime errors
156
+ `;
157
+ getDocumentation() {
158
+ return this.documentation;
159
+ }
160
+ }
161
+ exports.DataTransformationBestPractices = DataTransformationBestPractices;
162
+ //# sourceMappingURL=data-transformation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"data-transformation.js","sourceRoot":"","sources":["../../../src/tools/best-practices/data-transformation.ts"],"names":[],"mappings":";;;AACA,2DAA2D;AAE3D,MAAa,+BAA+B;IAClC,SAAS,GAAG,kCAAiB,CAAC,mBAAmB,CAAC;IAClD,OAAO,GAAG,OAAO,CAAC;IAEV,aAAa,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoJjC,CAAC;IAED,gBAAgB;QACf,OAAO,IAAI,CAAC,aAAa,CAAC;IAC3B,CAAC;CACD;AA7JD,0EA6JC"}
@@ -0,0 +1,7 @@
1
+ import type { BestPracticesDocument } from '../../types/best-practices';
2
+ export declare class DocumentProcessingBestPractices implements BestPracticesDocument {
3
+ readonly technique: "document_processing";
4
+ readonly version = "1.0.0";
5
+ private readonly documentation;
6
+ getDocumentation(): string;
7
+ }