@n8n/ai-workflow-builder 1.0.2 → 1.1.1

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 (238) hide show
  1. package/dist/agents/responder.agent.d.ts +1 -0
  2. package/dist/agents/responder.agent.js +9 -33
  3. package/dist/agents/responder.agent.js.map +1 -1
  4. package/dist/agents/supervisor.agent.d.ts +1 -0
  5. package/dist/agents/supervisor.agent.js +7 -38
  6. package/dist/agents/supervisor.agent.js.map +1 -1
  7. package/dist/ai-workflow-builder-agent.service.d.ts +2 -1
  8. package/dist/ai-workflow-builder-agent.service.js +18 -12
  9. package/dist/ai-workflow-builder-agent.service.js.map +1 -1
  10. package/dist/build.tsbuildinfo +1 -1
  11. package/dist/chains/conversation-compact.js +2 -13
  12. package/dist/chains/conversation-compact.js.map +1 -1
  13. package/dist/chains/parameter-updater.js +21 -7
  14. package/dist/chains/parameter-updater.js.map +1 -1
  15. package/dist/chains/prompt-categorization.js +3 -81
  16. package/dist/chains/prompt-categorization.js.map +1 -1
  17. package/dist/chains/workflow-name.js +2 -10
  18. package/dist/chains/workflow-name.js.map +1 -1
  19. package/dist/constants.d.ts +2 -0
  20. package/dist/constants.js +3 -1
  21. package/dist/constants.js.map +1 -1
  22. package/dist/multi-agent-workflow-subgraphs.d.ts +38 -1
  23. package/dist/multi-agent-workflow-subgraphs.js +34 -2
  24. package/dist/multi-agent-workflow-subgraphs.js.map +1 -1
  25. package/dist/parent-graph-state.d.ts +4 -0
  26. package/dist/parent-graph-state.js +14 -1
  27. package/dist/parent-graph-state.js.map +1 -1
  28. package/dist/prompts/agents/builder.prompt.d.ts +1 -0
  29. package/dist/prompts/agents/builder.prompt.js +242 -0
  30. package/dist/prompts/agents/builder.prompt.js.map +1 -0
  31. package/dist/prompts/agents/configurator.prompt.d.ts +2 -0
  32. package/dist/prompts/agents/configurator.prompt.js +125 -0
  33. package/dist/prompts/agents/configurator.prompt.js.map +1 -0
  34. package/dist/prompts/agents/discovery.prompt.d.ts +11 -0
  35. package/dist/prompts/agents/discovery.prompt.js +259 -0
  36. package/dist/prompts/agents/discovery.prompt.js.map +1 -0
  37. package/dist/prompts/agents/responder.prompt.d.ts +1 -0
  38. package/dist/prompts/agents/responder.prompt.js +41 -0
  39. package/dist/prompts/agents/responder.prompt.js.map +1 -0
  40. package/dist/prompts/agents/supervisor.prompt.d.ts +1 -0
  41. package/dist/prompts/agents/supervisor.prompt.js +43 -0
  42. package/dist/prompts/agents/supervisor.prompt.js.map +1 -0
  43. package/dist/prompts/builder/index.d.ts +2 -0
  44. package/dist/prompts/builder/index.js +7 -0
  45. package/dist/prompts/builder/index.js.map +1 -0
  46. package/dist/prompts/builder/prompt-builder.d.ts +17 -0
  47. package/dist/prompts/builder/prompt-builder.js +147 -0
  48. package/dist/prompts/builder/prompt-builder.js.map +1 -0
  49. package/dist/prompts/builder/types.d.ts +22 -0
  50. package/dist/prompts/builder/types.js +3 -0
  51. package/dist/prompts/builder/types.js.map +1 -0
  52. package/dist/prompts/chains/categorization.prompt.d.ts +43 -0
  53. package/dist/prompts/chains/categorization.prompt.js +86 -0
  54. package/dist/prompts/chains/categorization.prompt.js.map +1 -0
  55. package/dist/prompts/chains/compact.prompt.d.ts +2 -0
  56. package/dist/prompts/chains/compact.prompt.js +16 -0
  57. package/dist/prompts/chains/compact.prompt.js.map +1 -0
  58. package/dist/prompts/chains/parameter-updater/examples/if-node.d.ts +2 -0
  59. package/dist/{chains/prompts/examples/basic/if-node-examples.js → prompts/chains/parameter-updater/examples/if-node.js} +6 -3
  60. package/dist/prompts/chains/parameter-updater/examples/if-node.js.map +1 -0
  61. package/dist/prompts/chains/parameter-updater/examples/index.d.ts +6 -0
  62. package/dist/prompts/chains/parameter-updater/examples/index.js +16 -0
  63. package/dist/prompts/chains/parameter-updater/examples/index.js.map +1 -0
  64. package/dist/prompts/chains/parameter-updater/examples/resource-locator.d.ts +2 -0
  65. package/dist/{chains/prompts/examples/advanced/resource-locator-examples.js → prompts/chains/parameter-updater/examples/resource-locator.js} +7 -3
  66. package/dist/prompts/chains/parameter-updater/examples/resource-locator.js.map +1 -0
  67. package/dist/prompts/chains/parameter-updater/examples/set-node.d.ts +2 -0
  68. package/dist/{chains/prompts/examples/basic/set-node-examples.js → prompts/chains/parameter-updater/examples/set-node.js} +6 -3
  69. package/dist/prompts/chains/parameter-updater/examples/set-node.js.map +1 -0
  70. package/dist/prompts/chains/parameter-updater/examples/simple-updates.d.ts +2 -0
  71. package/dist/{chains/prompts/examples/basic → prompts/chains/parameter-updater/examples}/simple-updates.js +8 -5
  72. package/dist/prompts/chains/parameter-updater/examples/simple-updates.js.map +1 -0
  73. package/dist/prompts/chains/parameter-updater/examples/switch-node.d.ts +2 -0
  74. package/dist/prompts/chains/parameter-updater/examples/switch-node.js +131 -0
  75. package/dist/prompts/chains/parameter-updater/examples/switch-node.js.map +1 -0
  76. package/dist/prompts/chains/parameter-updater/examples/tool-nodes.d.ts +2 -0
  77. package/dist/{chains/prompts/examples/advanced/tool-node-examples.js → prompts/chains/parameter-updater/examples/tool-nodes.js} +6 -3
  78. package/dist/prompts/chains/parameter-updater/examples/tool-nodes.js.map +1 -0
  79. package/dist/prompts/chains/parameter-updater/guides/gmail.d.ts +2 -0
  80. package/dist/prompts/chains/parameter-updater/guides/gmail.js +28 -0
  81. package/dist/prompts/chains/parameter-updater/guides/gmail.js.map +1 -0
  82. package/dist/prompts/chains/parameter-updater/guides/http-request.d.ts +2 -0
  83. package/dist/{chains/prompts/node-types → prompts/chains/parameter-updater/guides}/http-request.js +34 -8
  84. package/dist/prompts/chains/parameter-updater/guides/http-request.js.map +1 -0
  85. package/dist/prompts/chains/parameter-updater/guides/if-node.d.ts +2 -0
  86. package/dist/{chains/prompts/node-types → prompts/chains/parameter-updater/guides}/if-node.js +6 -5
  87. package/dist/prompts/chains/parameter-updater/guides/if-node.js.map +1 -0
  88. package/dist/prompts/chains/parameter-updater/guides/index.d.ts +9 -0
  89. package/dist/prompts/chains/parameter-updater/guides/index.js +22 -0
  90. package/dist/prompts/chains/parameter-updater/guides/index.js.map +1 -0
  91. package/dist/prompts/chains/parameter-updater/guides/resource-locator.d.ts +2 -0
  92. package/dist/{chains/prompts/parameter-types → prompts/chains/parameter-updater/guides}/resource-locator.js +6 -2
  93. package/dist/prompts/chains/parameter-updater/guides/resource-locator.js.map +1 -0
  94. package/dist/prompts/chains/parameter-updater/guides/set-node.d.ts +2 -0
  95. package/dist/{chains/prompts/node-types → prompts/chains/parameter-updater/guides}/set-node.js +5 -2
  96. package/dist/prompts/chains/parameter-updater/guides/set-node.js.map +1 -0
  97. package/dist/prompts/chains/parameter-updater/guides/switch-node.d.ts +2 -0
  98. package/dist/prompts/chains/parameter-updater/guides/switch-node.js +75 -0
  99. package/dist/prompts/chains/parameter-updater/guides/switch-node.js.map +1 -0
  100. package/dist/prompts/chains/parameter-updater/guides/system-message.d.ts +2 -0
  101. package/dist/{chains/prompts/parameter-types → prompts/chains/parameter-updater/guides}/system-message.js +25 -4
  102. package/dist/prompts/chains/parameter-updater/guides/system-message.js.map +1 -0
  103. package/dist/prompts/chains/parameter-updater/guides/text-fields.d.ts +2 -0
  104. package/dist/{chains/prompts/parameter-types → prompts/chains/parameter-updater/guides}/text-fields.js +11 -2
  105. package/dist/prompts/chains/parameter-updater/guides/text-fields.js.map +1 -0
  106. package/dist/prompts/chains/parameter-updater/guides/tool-nodes.d.ts +2 -0
  107. package/dist/{chains/prompts/node-types → prompts/chains/parameter-updater/guides}/tool-nodes.js +5 -2
  108. package/dist/prompts/chains/parameter-updater/guides/tool-nodes.js.map +1 -0
  109. package/dist/prompts/chains/parameter-updater/index.d.ts +8 -0
  110. package/dist/prompts/chains/parameter-updater/index.js +35 -0
  111. package/dist/prompts/chains/parameter-updater/index.js.map +1 -0
  112. package/dist/prompts/chains/parameter-updater/instance-url.d.ts +1 -0
  113. package/dist/{chains/prompts → prompts/chains/parameter-updater}/instance-url.js +5 -6
  114. package/dist/prompts/chains/parameter-updater/instance-url.js.map +1 -0
  115. package/dist/{chains/prompts/base/core-instructions.d.ts → prompts/chains/parameter-updater/parameter-updater.prompt.d.ts} +3 -0
  116. package/dist/{chains/prompts/base/core-instructions.js → prompts/chains/parameter-updater/parameter-updater.prompt.js} +25 -2
  117. package/dist/prompts/chains/parameter-updater/parameter-updater.prompt.js.map +1 -0
  118. package/dist/prompts/chains/parameter-updater/registry.d.ts +4 -0
  119. package/dist/prompts/chains/parameter-updater/registry.js +65 -0
  120. package/dist/prompts/chains/parameter-updater/registry.js.map +1 -0
  121. package/dist/prompts/chains/parameter-updater/types.d.ts +18 -0
  122. package/dist/prompts/chains/parameter-updater/types.js +3 -0
  123. package/dist/prompts/chains/parameter-updater/types.js.map +1 -0
  124. package/dist/prompts/chains/parameter-updater/utils.d.ts +2 -0
  125. package/dist/prompts/chains/parameter-updater/utils.js +16 -0
  126. package/dist/prompts/chains/parameter-updater/utils.js.map +1 -0
  127. package/dist/prompts/chains/workflow-name.prompt.d.ts +2 -0
  128. package/dist/prompts/chains/workflow-name.prompt.js +11 -0
  129. package/dist/prompts/chains/workflow-name.prompt.js.map +1 -0
  130. package/dist/prompts/index.d.ts +12 -0
  131. package/dist/prompts/index.js +50 -0
  132. package/dist/prompts/index.js.map +1 -0
  133. package/dist/{tools/prompts/main-agent.prompt.js → prompts/legacy-agent.prompt.js} +14 -31
  134. package/dist/prompts/legacy-agent.prompt.js.map +1 -0
  135. package/dist/subgraphs/builder.subgraph.d.ts +2 -0
  136. package/dist/subgraphs/builder.subgraph.js +2 -163
  137. package/dist/subgraphs/builder.subgraph.js.map +1 -1
  138. package/dist/subgraphs/configurator.subgraph.d.ts +2 -0
  139. package/dist/subgraphs/configurator.subgraph.js +3 -84
  140. package/dist/subgraphs/configurator.subgraph.js.map +1 -1
  141. package/dist/subgraphs/discovery.subgraph.d.ts +18 -0
  142. package/dist/subgraphs/discovery.subgraph.js +28 -220
  143. package/dist/subgraphs/discovery.subgraph.js.map +1 -1
  144. package/dist/tools/add-node.tool.js +1 -1
  145. package/dist/tools/best-practices/chatbot.js +6 -7
  146. package/dist/tools/best-practices/chatbot.js.map +1 -1
  147. package/dist/tools/best-practices/content-generation.js +38 -2
  148. package/dist/tools/best-practices/content-generation.js.map +1 -1
  149. package/dist/tools/best-practices/data-transformation.js +17 -22
  150. package/dist/tools/best-practices/data-transformation.js.map +1 -1
  151. package/dist/tools/best-practices/index.js +2 -1
  152. package/dist/tools/best-practices/index.js.map +1 -1
  153. package/dist/types/config.d.ts +2 -0
  154. package/dist/types/coordination.d.ts +8 -2
  155. package/dist/types/coordination.js +4 -0
  156. package/dist/types/coordination.js.map +1 -1
  157. package/dist/types/discovery-types.d.ts +2 -0
  158. package/dist/utils/coordination-log.d.ts +2 -1
  159. package/dist/utils/coordination-log.js.map +1 -1
  160. package/dist/utils/state-modifier.d.ts +32 -0
  161. package/dist/utils/state-modifier.js +112 -0
  162. package/dist/utils/state-modifier.js.map +1 -0
  163. package/dist/utils/state-reducers.d.ts +4 -0
  164. package/dist/utils/state-reducers.js +25 -0
  165. package/dist/utils/state-reducers.js.map +1 -0
  166. package/dist/utils/stream-processor.js +2 -30
  167. package/dist/utils/stream-processor.js.map +1 -1
  168. package/dist/utils/subgraph-helpers.d.ts +3 -0
  169. package/dist/utils/subgraph-helpers.js +23 -0
  170. package/dist/utils/subgraph-helpers.js.map +1 -1
  171. package/dist/validation/checks/connections.js +9 -16
  172. package/dist/validation/checks/connections.js.map +1 -1
  173. package/dist/validation/checks/credentials.d.ts +3 -0
  174. package/dist/validation/checks/credentials.js +125 -0
  175. package/dist/validation/checks/credentials.js.map +1 -0
  176. package/dist/validation/checks/index.d.ts +1 -0
  177. package/dist/validation/checks/index.js +3 -1
  178. package/dist/validation/checks/index.js.map +1 -1
  179. package/dist/validation/checks/tools.js +0 -10
  180. package/dist/validation/checks/tools.js.map +1 -1
  181. package/dist/validation/programmatic.js +2 -0
  182. package/dist/validation/programmatic.js.map +1 -1
  183. package/dist/validation/types.d.ts +4 -1
  184. package/dist/validation/types.js +2 -0
  185. package/dist/validation/types.js.map +1 -1
  186. package/dist/validation/utils/node-type-map.d.ts +8 -0
  187. package/dist/validation/utils/node-type-map.js +50 -0
  188. package/dist/validation/utils/node-type-map.js.map +1 -0
  189. package/dist/workflow-builder-agent.d.ts +7 -3
  190. package/dist/workflow-builder-agent.js +24 -15
  191. package/dist/workflow-builder-agent.js.map +1 -1
  192. package/dist/workflow-state.js +3 -14
  193. package/dist/workflow-state.js.map +1 -1
  194. package/package.json +8 -7
  195. package/dist/chains/prompts/base/common-patterns.d.ts +0 -1
  196. package/dist/chains/prompts/base/common-patterns.js +0 -13
  197. package/dist/chains/prompts/base/common-patterns.js.map +0 -1
  198. package/dist/chains/prompts/base/core-instructions.js.map +0 -1
  199. package/dist/chains/prompts/base/expression-rules.d.ts +0 -1
  200. package/dist/chains/prompts/base/expression-rules.js +0 -15
  201. package/dist/chains/prompts/base/expression-rules.js.map +0 -1
  202. package/dist/chains/prompts/base/output-format.d.ts +0 -1
  203. package/dist/chains/prompts/base/output-format.js +0 -7
  204. package/dist/chains/prompts/base/output-format.js.map +0 -1
  205. package/dist/chains/prompts/examples/advanced/resource-locator-examples.d.ts +0 -1
  206. package/dist/chains/prompts/examples/advanced/resource-locator-examples.js.map +0 -1
  207. package/dist/chains/prompts/examples/advanced/tool-node-examples.d.ts +0 -1
  208. package/dist/chains/prompts/examples/advanced/tool-node-examples.js.map +0 -1
  209. package/dist/chains/prompts/examples/basic/if-node-examples.d.ts +0 -1
  210. package/dist/chains/prompts/examples/basic/if-node-examples.js.map +0 -1
  211. package/dist/chains/prompts/examples/basic/set-node-examples.d.ts +0 -1
  212. package/dist/chains/prompts/examples/basic/set-node-examples.js.map +0 -1
  213. package/dist/chains/prompts/examples/basic/simple-updates.d.ts +0 -1
  214. package/dist/chains/prompts/examples/basic/simple-updates.js.map +0 -1
  215. package/dist/chains/prompts/instance-url.d.ts +0 -1
  216. package/dist/chains/prompts/instance-url.js.map +0 -1
  217. package/dist/chains/prompts/node-types/http-request.d.ts +0 -1
  218. package/dist/chains/prompts/node-types/http-request.js.map +0 -1
  219. package/dist/chains/prompts/node-types/if-node.d.ts +0 -1
  220. package/dist/chains/prompts/node-types/if-node.js.map +0 -1
  221. package/dist/chains/prompts/node-types/set-node.d.ts +0 -1
  222. package/dist/chains/prompts/node-types/set-node.js.map +0 -1
  223. package/dist/chains/prompts/node-types/tool-nodes.d.ts +0 -1
  224. package/dist/chains/prompts/node-types/tool-nodes.js.map +0 -1
  225. package/dist/chains/prompts/parameter-types/resource-locator.d.ts +0 -1
  226. package/dist/chains/prompts/parameter-types/resource-locator.js.map +0 -1
  227. package/dist/chains/prompts/parameter-types/system-message.d.ts +0 -1
  228. package/dist/chains/prompts/parameter-types/system-message.js.map +0 -1
  229. package/dist/chains/prompts/parameter-types/text-fields.d.ts +0 -1
  230. package/dist/chains/prompts/parameter-types/text-fields.js.map +0 -1
  231. package/dist/chains/prompts/prompt-builder.d.ts +0 -15
  232. package/dist/chains/prompts/prompt-builder.js +0 -140
  233. package/dist/chains/prompts/prompt-builder.js.map +0 -1
  234. package/dist/chains/prompts/prompt-config.d.ts +0 -5
  235. package/dist/chains/prompts/prompt-config.js +0 -52
  236. package/dist/chains/prompts/prompt-config.js.map +0 -1
  237. package/dist/tools/prompts/main-agent.prompt.js.map +0 -1
  238. /package/dist/{tools/prompts/main-agent.prompt.d.ts → prompts/legacy-agent.prompt.d.ts} +0 -0
@@ -7,125 +7,17 @@ const tools_1 = require("@langchain/core/tools");
7
7
  const langgraph_1 = require("@langchain/langgraph");
8
8
  const zod_1 = require("zod");
9
9
  const errors_1 = require("../errors");
10
- const categorization_1 = require("../types/categorization");
10
+ const discovery_prompt_1 = require("../prompts/agents/discovery.prompt");
11
11
  const subgraph_interface_1 = require("./subgraph-interface");
12
12
  const get_best_practices_tool_1 = require("../tools/get-best-practices.tool");
13
+ const get_workflow_examples_tool_1 = require("../tools/get-workflow-examples.tool");
13
14
  const node_details_tool_1 = require("../tools/node-details.tool");
14
15
  const node_search_tool_1 = require("../tools/node-search.tool");
15
16
  const coordination_1 = require("../types/coordination");
16
17
  const cache_control_1 = require("../utils/cache-control");
17
18
  const context_builders_1 = require("../utils/context-builders");
19
+ const state_reducers_1 = require("../utils/state-reducers");
18
20
  const subgraph_helpers_1 = require("../utils/subgraph-helpers");
19
- const exampleCategorizations = [
20
- {
21
- prompt: 'Monitor social channels for product mentions and auto-respond with campaign messages',
22
- techniques: [
23
- categorization_1.WorkflowTechnique.MONITORING,
24
- categorization_1.WorkflowTechnique.CHATBOT,
25
- categorization_1.WorkflowTechnique.CONTENT_GENERATION,
26
- ],
27
- },
28
- {
29
- prompt: 'Collect partner referral submissions and verify client instances via BigQuery',
30
- techniques: [
31
- categorization_1.WorkflowTechnique.FORM_INPUT,
32
- categorization_1.WorkflowTechnique.HUMAN_IN_THE_LOOP,
33
- categorization_1.WorkflowTechnique.NOTIFICATION,
34
- ],
35
- },
36
- {
37
- prompt: 'Scrape competitor pricing pages weekly and generate a summary report of changes',
38
- techniques: [
39
- categorization_1.WorkflowTechnique.SCHEDULING,
40
- categorization_1.WorkflowTechnique.SCRAPING_AND_RESEARCH,
41
- categorization_1.WorkflowTechnique.DATA_EXTRACTION,
42
- categorization_1.WorkflowTechnique.DATA_ANALYSIS,
43
- ],
44
- },
45
- {
46
- prompt: 'Process uploaded PDF contracts to extract client details and update CRM records',
47
- techniques: [
48
- categorization_1.WorkflowTechnique.DOCUMENT_PROCESSING,
49
- categorization_1.WorkflowTechnique.DATA_EXTRACTION,
50
- categorization_1.WorkflowTechnique.DATA_TRANSFORMATION,
51
- categorization_1.WorkflowTechnique.ENRICHMENT,
52
- ],
53
- },
54
- {
55
- prompt: 'Build a searchable internal knowledge base from past support tickets',
56
- techniques: [
57
- categorization_1.WorkflowTechnique.DATA_TRANSFORMATION,
58
- categorization_1.WorkflowTechnique.DATA_ANALYSIS,
59
- categorization_1.WorkflowTechnique.KNOWLEDGE_BASE,
60
- ],
61
- },
62
- {
63
- prompt: 'Create an AI agent that writes and sends personalized emails to leads',
64
- techniques: [categorization_1.WorkflowTechnique.CONTENT_GENERATION, categorization_1.WorkflowTechnique.NOTIFICATION],
65
- },
66
- {
67
- prompt: 'Fetch trending topics from Google Trends and Reddit, select the best ones, and create social posts',
68
- techniques: [
69
- categorization_1.WorkflowTechnique.SCRAPING_AND_RESEARCH,
70
- categorization_1.WorkflowTechnique.TRIAGE,
71
- categorization_1.WorkflowTechnique.CONTENT_GENERATION,
72
- ],
73
- },
74
- {
75
- prompt: 'Trigger when a new contact is created in HubSpot and enrich their profile with LinkedIn data',
76
- techniques: [categorization_1.WorkflowTechnique.MONITORING, categorization_1.WorkflowTechnique.ENRICHMENT],
77
- },
78
- {
79
- prompt: 'Get stock prices from financial APIs and analyze volatility patterns',
80
- techniques: [categorization_1.WorkflowTechnique.SCRAPING_AND_RESEARCH, categorization_1.WorkflowTechnique.DATA_ANALYSIS],
81
- },
82
- {
83
- prompt: 'Generate video reels from templates and auto-post to social media on schedule',
84
- techniques: [
85
- categorization_1.WorkflowTechnique.SCHEDULING,
86
- categorization_1.WorkflowTechnique.DOCUMENT_PROCESSING,
87
- categorization_1.WorkflowTechnique.CONTENT_GENERATION,
88
- ],
89
- },
90
- {
91
- prompt: 'Receive news from Telegram channels, filter relevant ones, and forward to my channel',
92
- techniques: [
93
- categorization_1.WorkflowTechnique.MONITORING,
94
- categorization_1.WorkflowTechnique.TRIAGE,
95
- categorization_1.WorkflowTechnique.NOTIFICATION,
96
- ],
97
- },
98
- {
99
- prompt: 'Analyze YouTube video performance data and generate a weekly report',
100
- techniques: [
101
- categorization_1.WorkflowTechnique.SCRAPING_AND_RESEARCH,
102
- categorization_1.WorkflowTechnique.DATA_ANALYSIS,
103
- categorization_1.WorkflowTechnique.DATA_TRANSFORMATION,
104
- ],
105
- },
106
- {
107
- prompt: 'Create a chatbot that answers questions using data from a Google Sheet as knowledge base',
108
- techniques: [categorization_1.WorkflowTechnique.CHATBOT, categorization_1.WorkflowTechnique.KNOWLEDGE_BASE],
109
- },
110
- {
111
- prompt: 'Form submission with file upload triggers document extraction and approval workflow',
112
- techniques: [
113
- categorization_1.WorkflowTechnique.FORM_INPUT,
114
- categorization_1.WorkflowTechnique.DOCUMENT_PROCESSING,
115
- categorization_1.WorkflowTechnique.HUMAN_IN_THE_LOOP,
116
- ],
117
- },
118
- ];
119
- function formatTechniqueList() {
120
- return Object.entries(categorization_1.TechniqueDescription)
121
- .map(([key, description]) => `- **${key}**: ${description}`)
122
- .join('\n');
123
- }
124
- function formatExampleCategorizations() {
125
- return exampleCategorizations
126
- .map((example) => `- ${example.prompt} → ${example.techniques.join(', ')}`)
127
- .join('\n');
128
- }
129
21
  const discoveryOutputSchema = zod_1.z.object({
130
22
  nodesFound: zod_1.z
131
23
  .array(zod_1.z.object({
@@ -147,111 +39,6 @@ const discoveryOutputSchema = zod_1.z.object({
147
39
  }))
148
40
  .describe('List of n8n nodes identified as necessary for the workflow'),
149
41
  });
150
- const DISCOVERY_PROMPT = `You are a Discovery Agent for n8n AI Workflow Builder.
151
-
152
- YOUR ROLE: Identify relevant n8n nodes and their connection-changing parameters.
153
-
154
- AVAILABLE TOOLS:
155
- - get_best_practices: Retrieve best practices (internal context)
156
- - search_nodes: Find n8n nodes by keyword
157
- - get_node_details: Get complete node information including <connections>
158
- - submit_discovery_results: Submit final results
159
-
160
- PROCESS:
161
- 1. **Call get_best_practices** with identified techniques (internal context)
162
- 2. **Identify workflow components** from user request and best practices
163
- 3. **Call search_nodes IN PARALLEL** for all components (e.g., "Gmail", "OpenAI", "Schedule")
164
- 4. **Call get_node_details IN PARALLEL** for ALL promising nodes (batch multiple calls)
165
- 5. **Extract node information** from each node_details response:
166
- - Node name from <name> tag
167
- - Version number from <version> tag (required - extract the number)
168
- - Connection-changing parameters from <connections> section
169
- 6. **Call submit_discovery_results** with complete nodesFound array
170
-
171
- TECHNIQUE CATEGORIZATION:
172
- When calling get_best_practices, select techniques that match the user's workflow intent.
173
-
174
- <available_techniques>
175
- {techniques}
176
- </available_techniques>
177
-
178
- <example_categorizations>
179
- {exampleCategorizations}
180
- </example_categorizations>
181
-
182
- <technique_clarifications>
183
- Common distinctions to get right:
184
- - **NOTIFICATION vs CHATBOT**: Use NOTIFICATION when SENDING emails/messages/alerts (including to Telegram CHANNELS which are broadcast-only). Use CHATBOT only when RECEIVING and REPLYING to direct messages in a conversation.
185
- - **MONITORING**: Use when workflow TRIGGERS on external events (new record created, status changed, incoming webhook, new message in channel). NOT just scheduled runs.
186
- - **SCRAPING_AND_RESEARCH vs DATA_EXTRACTION**: Use SCRAPING when fetching from EXTERNAL sources (APIs, websites, social media). Use DATA_EXTRACTION for parsing INTERNAL data you already have.
187
- - **TRIAGE**: Use when SELECTING, PRIORITIZING, ROUTING, or QUALIFYING items (e.g., "pick the best", "route to correct team", "qualify leads").
188
- - **DOCUMENT_PROCESSING**: Use for ANY file handling - PDFs, images, videos, Excel, Google Sheets, audio files, file uploads in forms.
189
- - **HUMAN_IN_THE_LOOP**: Use when workflow PAUSES for human approval, review, signing documents, responding to polls, or any manual input before continuing.
190
- - **DATA_ANALYSIS**: Use when ANALYZING, CLASSIFYING, IDENTIFYING PATTERNS, or UNDERSTANDING data (e.g., "analyze outcomes", "learn from previous", "classify by type", "identify trends").
191
- - **KNOWLEDGE_BASE**: Use when storing/retrieving from a DATA SOURCE for Q&A - includes vector DBs, spreadsheets used as databases, document collections.
192
- - **DATA_TRANSFORMATION**: Use when CONVERTING data format, creating REPORTS/SUMMARIES from analyzed data, or restructuring output.
193
- </technique_clarifications>
194
-
195
- Technique selection rules:
196
- - Select ALL techniques that apply (most workflows use 2-4)
197
- - Maximum 5 techniques
198
- - Only select techniques you're confident apply
199
-
200
- CONNECTION-CHANGING PARAMETERS - CRITICAL RULES:
201
-
202
- A parameter is connection-changing ONLY IF it appears in <input> or <output> expressions within <node_details>.
203
-
204
- **How to identify:**
205
- 1. Look at the <connections> section in node details
206
- 2. Check if <input> or <output> uses expressions like: ={{...parameterName...}}
207
- 3. If a parameter is referenced in these expressions, it IS connection-changing
208
- 4. If a parameter is NOT in <input>/<output> expressions, it is NOT connection-changing
209
-
210
- **Example from AI Agent:**
211
- \`\`\`xml
212
- <input>={{...hasOutputParser, needsFallback...}}</input>
213
- \`\`\`
214
- → hasOutputParser and needsFallback ARE connection-changing (they control which inputs appear)
215
-
216
- **Counter-example:**
217
- \`\`\`xml
218
- <properties>
219
- <property name="promptType">...</property> <!-- NOT in <input>/<output> -->
220
- <property name="systemMessage">...</property> <!-- NOT in <input>/<output> -->
221
- </properties>
222
- \`\`\`
223
- → promptType and systemMessage are NOT connection-changing (they don't affect connections)
224
-
225
- **Common connection-changing parameters:**
226
- - Vector Store: mode (appears in <input>/<output> expressions)
227
- - AI Agent: hasOutputParser, needsFallback (appears in <input> expression)
228
- - Merge: numberInputs (appears in <input> expression)
229
- - Webhook: responseMode (appears in <output> expression)
230
-
231
- SUB-NODES SEARCHES:
232
- When searching for AI nodes, ALSO search for their required sub-nodes:
233
- - "AI Agent" → also search for "Chat Model", "Memory", "Output Parser"
234
- - "Basic LLM Chain" → also search for "Chat Model", "Output Parser"
235
- - "Vector Store" → also search for "Embeddings", "Document Loader"
236
- - Always use search_nodes to find the exact node names and versions - NEVER guess versions
237
-
238
- CRITICAL RULES:
239
- - NEVER ask clarifying questions
240
- - ALWAYS call get_best_practices first
241
- - THEN Call search_nodes to learn about available nodes and their inputs and outputs
242
- - FINALLY call get_node_details IN PARALLEL for speed to get more details about RELVANT node
243
- - ALWAYS extract version number from <version> tag in node details
244
- - NEVER guess node versions - always use search_nodes to find exact versions
245
- - ONLY flag connectionChangingParameters if they appear in <input> or <output> expressions
246
- - If no parameters appear in connection expressions, return empty array []
247
- - Output ONLY: nodesFound with {{ nodeName, version, reasoning, connectionChangingParameters }}
248
-
249
- DO NOT:
250
- - Output text commentary between tool calls
251
- - Include bestPractices or categorization in submit_discovery_results
252
- - Flag parameters that don't affect connections
253
- - Stop without calling submit_discovery_results
254
- `;
255
42
  exports.DiscoverySubgraphState = langgraph_1.Annotation.Root({
256
43
  userRequest: (0, langgraph_1.Annotation)({
257
44
  reducer: (x, y) => y ?? x,
@@ -268,6 +55,14 @@ exports.DiscoverySubgraphState = langgraph_1.Annotation.Root({
268
55
  bestPractices: (0, langgraph_1.Annotation)({
269
56
  reducer: (x, y) => y ?? x,
270
57
  }),
58
+ templateIds: (0, langgraph_1.Annotation)({
59
+ reducer: state_reducers_1.appendArrayReducer,
60
+ default: () => [],
61
+ }),
62
+ nodeConfigurations: (0, langgraph_1.Annotation)({
63
+ reducer: state_reducers_1.nodeConfigurationsReducer,
64
+ default: () => ({}),
65
+ }),
271
66
  });
272
67
  class DiscoverySubgraph extends subgraph_interface_1.BaseSubgraph {
273
68
  name = 'discovery_subgraph';
@@ -277,24 +72,29 @@ class DiscoverySubgraph extends subgraph_interface_1.BaseSubgraph {
277
72
  logger;
278
73
  create(config) {
279
74
  this.logger = config.logger;
280
- const tools = [
75
+ const includeExamples = config.featureFlags?.templateExamples === true;
76
+ const baseTools = [
281
77
  (0, get_best_practices_tool_1.createGetBestPracticesTool)(),
282
78
  (0, node_search_tool_1.createNodeSearchTool)(config.parsedNodeTypes),
283
79
  (0, node_details_tool_1.createNodeDetailsTool)(config.parsedNodeTypes),
284
80
  ];
81
+ const tools = includeExamples
82
+ ? [...baseTools, (0, get_workflow_examples_tool_1.createGetWorkflowExamplesTool)(config.logger)]
83
+ : baseTools;
285
84
  this.toolMap = new Map(tools.map((bt) => [bt.tool.name, bt.tool]));
286
85
  const submitTool = (0, tools_1.tool)(() => { }, {
287
86
  name: 'submit_discovery_results',
288
87
  description: 'Submit the final discovery results',
289
88
  schema: discoveryOutputSchema,
290
89
  });
90
+ const discoveryPrompt = (0, discovery_prompt_1.buildDiscoveryPrompt)({ includeExamples });
291
91
  const systemPrompt = prompts_1.ChatPromptTemplate.fromMessages([
292
92
  [
293
93
  'system',
294
94
  [
295
95
  {
296
96
  type: 'text',
297
- text: DISCOVERY_PROMPT,
97
+ text: discoveryPrompt,
298
98
  cache_control: { type: 'ephemeral' },
299
99
  },
300
100
  ],
@@ -330,8 +130,8 @@ class DiscoverySubgraph extends subgraph_interface_1.BaseSubgraph {
330
130
  const response = (await this.agent.invoke({
331
131
  messages: state.messages,
332
132
  prompt: state.userRequest,
333
- techniques: formatTechniqueList(),
334
- exampleCategorizations: formatExampleCategorizations(),
133
+ techniques: (0, discovery_prompt_1.formatTechniqueList)(),
134
+ exampleCategorizations: (0, discovery_prompt_1.formatExampleCategorizations)(),
335
135
  }));
336
136
  return { messages: [response] };
337
137
  }
@@ -348,12 +148,15 @@ class DiscoverySubgraph extends subgraph_interface_1.BaseSubgraph {
348
148
  this.logger?.error('[Discovery] No submit tool call found in last message');
349
149
  return {
350
150
  nodesFound: [],
151
+ templateIds: [],
351
152
  };
352
153
  }
353
154
  const bestPracticesTool = state.messages.find((m) => m.getType() === 'tool' && m?.text?.startsWith('<best_practices>'));
354
155
  return {
355
156
  nodesFound: output.nodesFound,
356
157
  bestPractices: bestPracticesTool?.text,
158
+ templateIds: state.templateIds ?? [],
159
+ nodeConfigurations: state.nodeConfigurations ?? {},
357
160
  };
358
161
  }
359
162
  shouldContinue(state) {
@@ -390,9 +193,12 @@ class DiscoverySubgraph extends subgraph_interface_1.BaseSubgraph {
390
193
  }
391
194
  transformOutput(subgraphOutput, _parentState) {
392
195
  const nodesFound = subgraphOutput.nodesFound || [];
196
+ const templateIds = subgraphOutput.templateIds || [];
197
+ const nodeConfigurations = subgraphOutput.nodeConfigurations || {};
393
198
  const discoveryContext = {
394
199
  nodesFound,
395
200
  bestPractices: subgraphOutput.bestPractices,
201
+ nodeConfigurations,
396
202
  };
397
203
  const logEntry = {
398
204
  phase: 'discovery',
@@ -408,6 +214,8 @@ class DiscoverySubgraph extends subgraph_interface_1.BaseSubgraph {
408
214
  return {
409
215
  discoveryContext,
410
216
  coordinationLog: [logEntry],
217
+ templateIds,
218
+ nodeConfigurations,
411
219
  };
412
220
  }
413
221
  }
@@ -1 +1 @@
1
- {"version":3,"file":"discovery.subgraph.js","sourceRoot":"","sources":["../../src/subgraphs/discovery.subgraph.ts"],"names":[],"mappings":";;;AAEA,uDAAuD;AACvD,qDAA6D;AAE7D,iDAAkE;AAClE,oDAAmE;AAGnE,6BAAwB;AAExB,qCAA2C;AAC3C,2DAIgC;AAEhC,6DAAoD;AAEpD,8EAA8E;AAC9E,kEAAmE;AACnE,gEAAiE;AAEjE,wDAAgE;AAChE,0DAAmE;AACnE,gEAAuF;AACvF,gEAAqF;AAMrF,MAAM,sBAAsB,GAGvB;IACJ;QACC,MAAM,EAAE,sFAAsF;QAC9F,UAAU,EAAE;YACX,kCAAiB,CAAC,UAAU;YAC5B,kCAAiB,CAAC,OAAO;YACzB,kCAAiB,CAAC,kBAAkB;SACpC;KACD;IACD;QACC,MAAM,EAAE,+EAA+E;QACvF,UAAU,EAAE;YACX,kCAAiB,CAAC,UAAU;YAC5B,kCAAiB,CAAC,iBAAiB;YACnC,kCAAiB,CAAC,YAAY;SAC9B;KACD;IACD;QACC,MAAM,EAAE,iFAAiF;QACzF,UAAU,EAAE;YACX,kCAAiB,CAAC,UAAU;YAC5B,kCAAiB,CAAC,qBAAqB;YACvC,kCAAiB,CAAC,eAAe;YACjC,kCAAiB,CAAC,aAAa;SAC/B;KACD;IACD;QACC,MAAM,EAAE,iFAAiF;QACzF,UAAU,EAAE;YACX,kCAAiB,CAAC,mBAAmB;YACrC,kCAAiB,CAAC,eAAe;YACjC,kCAAiB,CAAC,mBAAmB;YACrC,kCAAiB,CAAC,UAAU;SAC5B;KACD;IACD;QACC,MAAM,EAAE,sEAAsE;QAC9E,UAAU,EAAE;YACX,kCAAiB,CAAC,mBAAmB;YACrC,kCAAiB,CAAC,aAAa;YAC/B,kCAAiB,CAAC,cAAc;SAChC;KACD;IAED;QACC,MAAM,EAAE,uEAAuE;QAC/E,UAAU,EAAE,CAAC,kCAAiB,CAAC,kBAAkB,EAAE,kCAAi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c,CAAC,aAAa;aAChD,CAAC;SACF,CAAC;QAEF,OAAO;YACN,gBAAgB;YAChB,eAAe,EAAE,CAAC,QAAQ,CAAC;YAE3B,WAAW;YAEX,kBAAkB;SAClB,CAAC;IACH,CAAC;CACD;AA7OD,8CA6OC"}
@@ -159,7 +159,7 @@ CONNECTION PARAMETERS (NEVER rely on defaults - always set explicitly):
159
159
  - Vector Store (@n8n/n8n-nodes-langchain.vectorStoreInMemory):
160
160
  - For document input: { mode: "insert" }
161
161
  - For querying: { mode: "retrieve" }
162
- - For AI tool use: { mode: "retrieve-as-tool" }
162
+ - For AI Agent and tool use: { mode: "retrieve-as-tool" }
163
163
  - Document Loader (@n8n/n8n-nodes-langchain.documentDefaultDataLoader):
164
164
  - For text splitter input: { textSplittingMode: "custom" }
165
165
  - For built-in splitting: { textSplittingMode: "simple" }
@@ -11,13 +11,9 @@ class ChatbotBestPractices {
11
11
 
12
12
  Break chatbot logic into manageable steps and use error handling nodes (IF, Switch) with fallback mechanisms to manage unexpected inputs.
13
13
 
14
- Most chatbots run through external platforms like Slack, Telegram, or WhatsApp rather than through the n8n chat interface - if the user
15
- requests a service like this don't use the built in chat interface nodes. If the user mentions chatting but does not mention a service
16
- then use the built in n8n chat node.
14
+ Most chatbots run through external platforms like Slack, Telegram, or WhatsApp rather than through the n8n chat interface - if the user requests a service like this don't use the built in chat interface nodes. But, the n8n chat node is easier to get started with tests. If the user mentions chatting but does not mention a service then use the built in n8n chat node.
17
15
 
18
- CRITICAL: The user may ask to be able to chat to a workflow as well as trigger it via some other method, for example scheduling information
19
- gathering but also being able to chat with the agent - in scenarios like this the two separate workflows MUST be connected through shared memory,
20
- vector stores, data storage, or direct connections.
16
+ CRITICAL: The user may ask to be able to chat to a workflow as well as trigger it via some other method, for example scheduling information gathering but also being able to chat with the agent - in scenarios like this the two separate workflows MUST be connected through shared memory, vector stores, data storage, or direct connections.
21
17
 
22
18
  Example pattern:
23
19
  - Schedule Trigger → News Gathering Agent → [memory node via ai_memory]
@@ -59,7 +55,10 @@ Pitfalls:
59
55
 
60
56
  ### AI Agent (@n8n/n8n-nodes-langchain.agent)
61
57
 
62
- Purpose: Orchestrates logic, tool use, and LLM calls for intelligent responses
58
+ Purpose: Orchestrates logic, tool use, and LLM calls for intelligent responses.
59
+
60
+ Unless user asks for a node by name, always use the AI Agent node over provider-specific nodes (like OpenAI, Google Gemini) or use-case-specific AI nodes (like Message a model) for chatbot workflows. The AI Agent node provides better orchestration, tool integration, and memory management capabilities essential for conversational interfaces.
61
+ For example, for "create a chatbot using OpenAI", implement: AI Agent -- OpenAI Chat Model.
63
62
 
64
63
  ### Chat Model Nodes
65
64
 
@@ -1 +1 @@
1
- {"version":3,"file":"chatbot.js","sourceRoot":"","sources":["../../../src/tools/best-practices/chatbot.ts"],"names":[],"mappings":";;;AACA,2DAA2D;AAE3D,MAAa,oBAAoB;IACvB,SAAS,GAAG,kCAAiB,CAAC,OAAO,CAAC;IACtC,OAAO,GAAG,OAAO,CAAC;IAEV,aAAa,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwGjC,CAAC;IAED,gBAAgB;QACf,OAAO,IAAI,CAAC,aAAa,CAAC;IAC3B,CAAC;CACD;AAjHD,oDAiHC"}
1
+ {"version":3,"file":"chatbot.js","sourceRoot":"","sources":["../../../src/tools/best-practices/chatbot.ts"],"names":[],"mappings":";;;AACA,2DAA2D;AAE3D,MAAa,oBAAoB;IACvB,SAAS,GAAG,kCAAiB,CAAC,OAAO,CAAC;IACtC,OAAO,GAAG,OAAO,CAAC;IAEV,aAAa,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuGjC,CAAC;IAED,gBAAgB;QACf,OAAO,IAAI,CAAC,aAAa,CAAC;IAC3B,CAAC;CACD;AAhHD,oDAgHC"}
@@ -11,6 +11,42 @@ class ContentGenerationBestPractices {
11
11
 
12
12
  Break complex tasks into sequential steps (e.g., generate text, create image, compose video) for modularity and easier troubleshooting.
13
13
 
14
+ ## Node Selection Guidelines
15
+
16
+ Always prefer built-in n8n nodes over HTTP Request nodes when a dedicated node exists for the service or API you need to integrate with. Built-in nodes provide:
17
+ - Pre-configured authentication handling
18
+ - Optimized data structures and field mappings
19
+ - Better error handling and user experience
20
+ - Simplified setup without manual API configuration
21
+
22
+ Only use HTTP Request nodes when no built-in node exists for the service, or when you need to access an API endpoint not covered by the built-in node's operations.
23
+
24
+ ## Multi-Modal Content Generation - MANDATORY
25
+
26
+ When the user's request involves specific generative AI models or media-focused platforms, the workflow MUST include the appropriate media generation node from a
27
+ provider-specific node. The finished workflow MUST contain the relevant video, audio, or image generation capability.
28
+
29
+ Prompts that require multi-modal generation nodes:
30
+
31
+ Video Generation:
32
+ - Model mentions: Sora, Nano Banana, Veo, Runway, Pika
33
+ - Platform mentions: YouTube content, TikTok videos, Instagram Reels, video ads, short-form video
34
+ - Task mentions: generate video, create video, video from text, animate
35
+
36
+ Image Generation:
37
+ - Model mentions: DALL-E, Midjourney, Stable Diffusion, Imagen
38
+ - Platform mentions: thumbnails, social media graphics, product images, marketing visuals
39
+ - Task mentions: generate image, create artwork, design graphic, visualize
40
+
41
+ Audio Generation:
42
+ - Model mentions: ElevenLabs, text-to-speech, TTS
43
+ - Platform mentions: podcast audio, voiceovers, narration, audio content
44
+ - Task mentions: generate voice, create audio, synthesize speech, clone voice
45
+
46
+ If anything like the examples above are mentioned in the prompt, include the appropriate
47
+ provider node (OpenAI for DALL-E/Sora, Google Gemini for Nano Banana/Imagen, etc.)
48
+ with the media generation operation configured.
49
+
14
50
  ## Content-Specific Guidance
15
51
 
16
52
  For text generation, validate and sanitize input/output to avoid malformed data. When generating images, prefer binary data over URLs for uploads to avoid media type errors.
@@ -19,7 +55,7 @@ For text generation, validate and sanitize input/output to avoid malformed data.
19
55
 
20
56
  ### OpenAI (@n8n/n8n-nodes-langchain.openAi)
21
57
 
22
- Purpose: GPT-based text generation, DALL-E image generation, text-to-speech (TTS), and audio transcription
58
+ Purpose: GPT-based text generation, DALL-E image generation, text-to-speech (TTS), and audio transcription, SORA for video generation
23
59
 
24
60
  ### xAI Grok Chat Model (@n8n/n8n-nodes-langchain.lmChatXAiGrok)
25
61
 
@@ -27,7 +63,7 @@ Purpose: Conversational AI and text generation
27
63
 
28
64
  ### Google Gemini Chat Model (@n8n/n8n-nodes-langchain.lmChatGoogleGemini)
29
65
 
30
- Purpose: Image analysis and generation, video generation from text prompts, multimodal content creation
66
+ Purpose: Image analysis and generation, video generation from text prompts using nano banana, multimodal content creation
31
67
 
32
68
  ### ElevenLabs
33
69
 
@@ -1 +1 @@
1
- {"version":3,"file":"content-generation.js","sourceRoot":"","sources":["../../../src/tools/best-practices/content-generation.ts"],"names":[],"mappings":";;;AACA,2DAA2D;AAE3D,MAAa,8BAA8B;IACjC,SAAS,GAAG,kCAAiB,CAAC,kBAAkB,CAAC;IACjD,OAAO,GAAG,OAAO,CAAC;IAEV,aAAa,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiEjC,CAAC;IAED,gBAAgB;QACf,OAAO,IAAI,CAAC,aAAa,CAAC;IAC3B,CAAC;CACD;AA1ED,wEA0EC"}
1
+ {"version":3,"file":"content-generation.js","sourceRoot":"","sources":["../../../src/tools/best-practices/content-generation.ts"],"names":[],"mappings":";;;AACA,2DAA2D;AAE3D,MAAa,8BAA8B;IACjC,SAAS,GAAG,kCAAiB,CAAC,kBAAkB,CAAC;IACjD,OAAO,GAAG,OAAO,CAAC;IAEV,aAAa,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqGjC,CAAC;IAED,gBAAgB;QACf,OAAO,IAAI,CAAC,aAAa,CAAC;IAC3B,CAAC;CACD;AA9GD,wEA8GC"}
@@ -11,24 +11,12 @@ class DataTransformationBestPractices {
11
11
 
12
12
  ### Core Principles
13
13
  - **Structure**: Always follow Input → Transform → Output pattern
14
- - **Modularity**: Break complex workflows into sub-workflows using Execute Workflow node
15
14
  - **Optimization**: Filter and reduce data early to improve performance
16
- - **Documentation**: Use descriptive node names and sticky notes for clarity
17
- - **Testing**: Test with edge cases (empty data, missing fields, special characters)
18
15
 
19
16
  ### Design Best Practices
20
17
  - Plan transformation requirements in plain language before building
21
- - Keep main workflows to ~5 nodes, offload details to sub-workflows
22
- - Process inexpensive transformations first (especially data reduction)
23
18
  - Use Modular Design: Create reusable sub-workflows for common tasks like "Data Cleaning" or "Error Handler"
24
- - Batch large datasets using Split In Batches node to prevent timeouts
25
-
26
- ## Error Handling
27
- - **Validate Early**: Use IF node at workflow start to check required fields and data types
28
- - **Error Outputs**: Connect red error output connectors to logging/notification chains
29
- - **Continue on Fail**: Enable in node settings to flag errors without breaking workflow
30
- - **Global Error Workflow**: Create separate workflow with Error Trigger node as safety net
31
- - **Logging**: Log key events with context (which record failed, error message, etc.)
19
+ - Batch datasets over 100 items using Split In Batches node to prevent timeouts
32
20
 
33
21
  ## Recommended Nodes
34
22
 
@@ -52,6 +40,8 @@ class DataTransformationBestPractices {
52
40
  - Disabled: Carries forward all fields (potential bloat)
53
41
  - Always verify output structure after configuration
54
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
+
55
45
  #### IF/Filter Nodes
56
46
 
57
47
  **IF Node** (n8n-nodes-base.if):
@@ -75,10 +65,19 @@ class DataTransformationBestPractices {
75
65
  **Pitfalls**:
76
66
  - **Missing Keys**: Trying to merge on non-existent fields
77
67
  - **Field Name Mismatch**: Different field names in sources
78
- - **Solution**: Use Set node to normalize field names before merging
68
+ - **Solution**: Use Edit Fields node to normalize field names before merging
79
69
 
80
70
  #### Code Node (n8n-nodes-base.code)
81
71
 
72
+ **When NOT to Use**: Code node may be slower than core nodes (like Edit Fields, If, Switch, 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:
73
+ - Adding or removing fields from items (use the 'edit fields' node instead)
74
+ - Single-line data transformations of item fields (use the 'edit fields' node instead)
75
+ - Filtering items based on their fields (use the 'filter' node instead)
76
+ - Pivoting, aggregating or summarizing data across items (use the 'summarize' node instead)
77
+ - Splitting arrays inside items out into multiple items (use the 'split out' node instead)
78
+ - Sorting items in an array based on their fields (use the 'Sort' node instead)
79
+ - 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)
80
+
82
81
  **When to Use**: Complex transformations impossible with built-in nodes
83
82
 
84
83
  **Execution Modes**:
@@ -133,7 +132,7 @@ return items; // or return [{ json: {...} }];
133
132
 
134
133
  ### Critical Mistakes
135
134
 
136
- #### Set Node Issues
135
+ #### Edit Fields Node Issues
137
136
  - **Mistake**: Not understanding "Keep Only Set" behavior
138
137
  - Enabled: Drops all fields not explicitly defined (data loss risk)
139
138
  - Disabled: Carries forward all fields (potential bloat)
@@ -149,15 +148,11 @@ return items; // or return [{ json: {...} }];
149
148
  - **Missing Keys**: Trying to merge on non-existent fields
150
149
  - **Fix**: Validate both inputs have matching key fields
151
150
  - **Field Name Mismatch**: Different field names in sources
152
- - **Fix**: Use Set node to normalize field names before merging
151
+ - **Fix**: Use Edit Fields node to normalize field names before merging
153
152
 
154
153
  ### General Workflow Issues
155
- - **No Error Handling**: Workflow crashes on unexpected data
156
- - **Fix**: Add IF nodes for validation, use error outputs
157
- - **Hard-coded Values**: URLs, credentials, config in nodes
158
- - **Fix**: Use environment variables or config nodes
159
- - **Poor Naming**: Generic names like "Set1", "Function1"
160
- - **Fix**: Use descriptive names: "Clean Customer Data", "Calculate Totals"
154
+ - **No Error Handling**: Workflow crashes on unexpected data. **Fix**: Add IF nodes for validation, use error outputs
155
+ - **Hard-coded Values**: URLs, credentials, config in nodes. **Fix**: Use environment variables or config nodes
161
156
  - **Missing Documentation**: No comments or descriptions
162
157
  - **Fix**: Add sticky notes, node descriptions, code comments
163
158
 
@@ -1 +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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuKjC,CAAC;IAED,gBAAgB;QACf,OAAO,IAAI,CAAC,aAAa,CAAC;IAC3B,CAAC;CACD;AAhLD,0EAgLC"}
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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkKjC,CAAC;IAED,gBAAgB;QACf,OAAO,IAAI,CAAC,aAAa,CAAC;IAC3B,CAAC;CACD;AA3KD,0EA2KC"}
@@ -5,6 +5,7 @@ const categorization_1 = require("../../types/categorization");
5
5
  const chatbot_1 = require("./chatbot");
6
6
  const content_generation_1 = require("./content-generation");
7
7
  const data_extraction_1 = require("./data-extraction");
8
+ const data_transformation_1 = require("./data-transformation");
8
9
  const document_processing_1 = require("./document-processing");
9
10
  const form_input_1 = require("./form-input");
10
11
  const scraping_and_research_1 = require("./scraping-and-research");
@@ -14,7 +15,7 @@ exports.documentation = {
14
15
  [categorization_1.WorkflowTechnique.CONTENT_GENERATION]: new content_generation_1.ContentGenerationBestPractices(),
15
16
  [categorization_1.WorkflowTechnique.DATA_ANALYSIS]: undefined,
16
17
  [categorization_1.WorkflowTechnique.DATA_EXTRACTION]: new data_extraction_1.DataExtractionBestPractices(),
17
- [categorization_1.WorkflowTechnique.DATA_TRANSFORMATION]: undefined,
18
+ [categorization_1.WorkflowTechnique.DATA_TRANSFORMATION]: new data_transformation_1.DataTransformationBestPractices(),
18
19
  [categorization_1.WorkflowTechnique.DOCUMENT_PROCESSING]: new document_processing_1.DocumentProcessingBestPractices(),
19
20
  [categorization_1.WorkflowTechnique.ENRICHMENT]: undefined,
20
21
  [categorization_1.WorkflowTechnique.FORM_INPUT]: new form_input_1.FormInputBestPractices(),
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/tools/best-practices/index.ts"],"names":[],"mappings":";;;AACA,2DAAuF;AAEvF,uCAAiD;AACjD,6DAAsE;AAEtE,uDAAgE;AAEhE,+DAAwE;AAExE,6CAAsD;AAKtD,mEAA2E;AAI9D,QAAA,aAAa,GAAqE;IAC9F,CAAC,kCAAiB,CAAC,qBAAqB,CAAC,EAAE,IAAI,wDAAgC,EAAE;IACjF,CAAC,kCAAiB,CAAC,OAAO,CAAC,EAAE,IAAI,8BAAoB,EAAE;IACvD,CAAC,kCAAiB,CAAC,kBAAkB,CAAC,EAAE,IAAI,mDAA8B,EAAE;IAC5E,CAAC,kCAAiB,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AAC,EAAE,IAAI,qDAA+B,EAAE;IAC9E,CAAC,kCAAiB,CAAC,mBAAmB,CAAC,EAAE,IAAI,qDAA+B,EAAE;IAC9E,CAAC,kCAAiB,CAAC,UAAU,CAAC,EAAE,SAAS;IACzC,CAAC,kCAAiB,CAAC,UAAU,CAAC,EAAE,IAAI,mCAAsB,EAAE;IAC5D,CAAC,kCAAiB,CAAC,cAAc,CAAC,EAAE,SAAS;IAC7C,CAAC,kCAAiB,CAAC,YAAY,CAAC,EAAE,SAAS;IAC3C,CAAC,kCAAiB,CAAC,MAAM,CAAC,EAAE,SAAS;IACrC,CAAC,kCAAiB,CAAC,iBAAiB,CAAC,EAAE,SAAS;IAChD,CAAC,kCAAiB,CAAC,UAAU,CAAC,EAAE,SAAS;IACzC,CAAC,kCAAiB,CAAC,UAAU,CAAC,EAAE,SAAS;CACzC,CAAC"}
@@ -15,8 +15,10 @@ export interface NodePromptConfig {
15
15
  nodeTypePatterns: {
16
16
  set: string[];
17
17
  if: string[];
18
+ switch: string[];
18
19
  httpRequest: string[];
19
20
  tool: string[];
21
+ gmail: string[];
20
22
  };
21
23
  parameterKeywords: {
22
24
  resourceLocator: string[];
@@ -1,4 +1,4 @@
1
- export type SubgraphPhase = 'discovery' | 'builder' | 'configurator';
1
+ export type SubgraphPhase = 'discovery' | 'builder' | 'configurator' | 'state_management';
2
2
  export interface CoordinationLogEntry {
3
3
  phase: SubgraphPhase;
4
4
  status: 'completed' | 'error';
@@ -7,7 +7,7 @@ export interface CoordinationLogEntry {
7
7
  output?: string;
8
8
  metadata: CoordinationMetadata;
9
9
  }
10
- export type CoordinationMetadata = DiscoveryMetadata | BuilderMetadata | ConfiguratorMetadata | ErrorMetadata;
10
+ export type CoordinationMetadata = DiscoveryMetadata | BuilderMetadata | ConfiguratorMetadata | StateManagementMetadata | ErrorMetadata;
11
11
  export interface DiscoveryMetadata {
12
12
  phase: 'discovery';
13
13
  nodesFound: number;
@@ -30,7 +30,13 @@ export interface ErrorMetadata {
30
30
  failedSubgraph: SubgraphPhase;
31
31
  errorMessage: string;
32
32
  }
33
+ export interface StateManagementMetadata {
34
+ phase: 'state_management';
35
+ action: 'compact' | 'clear';
36
+ messagesRemoved?: number;
37
+ }
33
38
  export declare function createDiscoveryMetadata(data: Omit<DiscoveryMetadata, 'phase'>): DiscoveryMetadata;
34
39
  export declare function createBuilderMetadata(data: Omit<BuilderMetadata, 'phase'>): BuilderMetadata;
35
40
  export declare function createConfiguratorMetadata(data: Omit<ConfiguratorMetadata, 'phase'>): ConfiguratorMetadata;
36
41
  export declare function createErrorMetadata(data: Omit<ErrorMetadata, 'phase'>): ErrorMetadata;
42
+ export declare function createStateManagementMetadata(data: Omit<StateManagementMetadata, 'phase'>): StateManagementMetadata;