@n8n/workflow-sdk 0.9.0 → 0.10.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 (183) hide show
  1. package/dist/build.tsbuildinfo +1 -1
  2. package/dist/generate-types/generate-types.js +1 -1
  3. package/dist/generate-types/generate-types.js.map +1 -1
  4. package/dist/index.d.ts +1 -0
  5. package/dist/index.js +4 -2
  6. package/dist/index.js.map +1 -1
  7. package/dist/prompts/best-practices/guides/chatbot.d.ts +7 -0
  8. package/dist/prompts/best-practices/guides/chatbot.js +120 -0
  9. package/dist/prompts/best-practices/guides/chatbot.js.map +1 -0
  10. package/dist/prompts/best-practices/guides/content-generation.d.ts +7 -0
  11. package/dist/prompts/best-practices/guides/content-generation.js +117 -0
  12. package/dist/prompts/best-practices/guides/content-generation.js.map +1 -0
  13. package/dist/prompts/best-practices/guides/data-analysis.d.ts +7 -0
  14. package/dist/prompts/best-practices/guides/data-analysis.js +369 -0
  15. package/dist/prompts/best-practices/guides/data-analysis.js.map +1 -0
  16. package/dist/prompts/best-practices/guides/data-extraction.d.ts +7 -0
  17. package/dist/prompts/best-practices/guides/data-extraction.js +124 -0
  18. package/dist/prompts/best-practices/guides/data-extraction.js.map +1 -0
  19. package/dist/prompts/best-practices/guides/data-persistence.d.ts +7 -0
  20. package/dist/prompts/best-practices/guides/data-persistence.js +199 -0
  21. package/dist/prompts/best-practices/guides/data-persistence.js.map +1 -0
  22. package/dist/prompts/best-practices/guides/data-transformation.d.ts +7 -0
  23. package/dist/prompts/best-practices/guides/data-transformation.js +148 -0
  24. package/dist/prompts/best-practices/guides/data-transformation.js.map +1 -0
  25. package/dist/prompts/best-practices/guides/document-processing.d.ts +7 -0
  26. package/dist/prompts/best-practices/guides/document-processing.js +334 -0
  27. package/dist/prompts/best-practices/guides/document-processing.js.map +1 -0
  28. package/dist/prompts/best-practices/guides/enrichment.d.ts +7 -0
  29. package/dist/prompts/best-practices/guides/enrichment.js +273 -0
  30. package/dist/prompts/best-practices/guides/enrichment.js.map +1 -0
  31. package/dist/prompts/best-practices/guides/form-input.d.ts +7 -0
  32. package/dist/prompts/best-practices/guides/form-input.js +175 -0
  33. package/dist/prompts/best-practices/guides/form-input.js.map +1 -0
  34. package/dist/prompts/best-practices/guides/human-in-the-loop.d.ts +7 -0
  35. package/dist/prompts/best-practices/guides/human-in-the-loop.js +270 -0
  36. package/dist/prompts/best-practices/guides/human-in-the-loop.js.map +1 -0
  37. package/dist/prompts/best-practices/guides/knowledge-base.d.ts +7 -0
  38. package/dist/prompts/best-practices/guides/knowledge-base.js +270 -0
  39. package/dist/prompts/best-practices/guides/knowledge-base.js.map +1 -0
  40. package/dist/prompts/best-practices/guides/monitoring.d.ts +7 -0
  41. package/dist/prompts/best-practices/guides/monitoring.js +173 -0
  42. package/dist/prompts/best-practices/guides/monitoring.js.map +1 -0
  43. package/dist/prompts/best-practices/guides/notification.d.ts +7 -0
  44. package/dist/prompts/best-practices/guides/notification.js +137 -0
  45. package/dist/prompts/best-practices/guides/notification.js.map +1 -0
  46. package/dist/prompts/best-practices/guides/scheduling.d.ts +7 -0
  47. package/dist/prompts/best-practices/guides/scheduling.js +154 -0
  48. package/dist/prompts/best-practices/guides/scheduling.js.map +1 -0
  49. package/dist/prompts/best-practices/guides/scraping-and-research.d.ts +7 -0
  50. package/dist/prompts/best-practices/guides/scraping-and-research.js +160 -0
  51. package/dist/prompts/best-practices/guides/scraping-and-research.js.map +1 -0
  52. package/dist/prompts/best-practices/guides/triage.d.ts +7 -0
  53. package/dist/prompts/best-practices/guides/triage.js +151 -0
  54. package/dist/prompts/best-practices/guides/triage.js.map +1 -0
  55. package/dist/prompts/best-practices/index.d.ts +20 -0
  56. package/dist/prompts/best-practices/index.js +69 -0
  57. package/dist/prompts/best-practices/index.js.map +1 -0
  58. package/dist/prompts/best-practices/types.d.ts +25 -0
  59. package/dist/prompts/best-practices/types.js +40 -0
  60. package/dist/prompts/best-practices/types.js.map +1 -0
  61. package/dist/prompts/index.d.ts +3 -0
  62. package/dist/prompts/index.js +25 -0
  63. package/dist/prompts/index.js.map +1 -0
  64. package/dist/prompts/node-guidance/index.d.ts +3 -0
  65. package/dist/prompts/node-guidance/index.js +20 -0
  66. package/dist/prompts/node-guidance/index.js.map +1 -0
  67. package/dist/prompts/node-guidance/node-recommendations/audio-generation.d.ts +2 -0
  68. package/dist/prompts/node-guidance/node-recommendations/audio-generation.js +18 -0
  69. package/dist/prompts/node-guidance/node-recommendations/audio-generation.js.map +1 -0
  70. package/dist/prompts/node-guidance/node-recommendations/format-recommendation.d.ts +2 -0
  71. package/dist/prompts/node-guidance/node-recommendations/format-recommendation.js +27 -0
  72. package/dist/prompts/node-guidance/node-recommendations/format-recommendation.js.map +1 -0
  73. package/dist/prompts/node-guidance/node-recommendations/image-generation.d.ts +2 -0
  74. package/dist/prompts/node-guidance/node-recommendations/image-generation.js +18 -0
  75. package/dist/prompts/node-guidance/node-recommendations/image-generation.js.map +1 -0
  76. package/dist/prompts/node-guidance/node-recommendations/index.d.ts +6 -0
  77. package/dist/prompts/node-guidance/node-recommendations/index.js +17 -0
  78. package/dist/prompts/node-guidance/node-recommendations/index.js.map +1 -0
  79. package/dist/prompts/node-guidance/node-recommendations/text-manipulation.d.ts +2 -0
  80. package/dist/prompts/node-guidance/node-recommendations/text-manipulation.js +27 -0
  81. package/dist/prompts/node-guidance/node-recommendations/text-manipulation.js.map +1 -0
  82. package/dist/prompts/node-guidance/node-recommendations/types.d.ts +26 -0
  83. package/dist/prompts/node-guidance/node-recommendations/types.js +16 -0
  84. package/dist/prompts/node-guidance/node-recommendations/types.js.map +1 -0
  85. package/dist/prompts/node-guidance/node-recommendations/video-generation.d.ts +2 -0
  86. package/dist/prompts/node-guidance/node-recommendations/video-generation.js +15 -0
  87. package/dist/prompts/node-guidance/node-recommendations/video-generation.js.map +1 -0
  88. package/dist/prompts/node-guidance/node-tips/index.d.ts +3 -0
  89. package/dist/prompts/node-guidance/node-tips/index.js +8 -0
  90. package/dist/prompts/node-guidance/node-tips/index.js.map +1 -0
  91. package/dist/prompts/node-guidance/node-tips/structured-output-parser.d.ts +2 -0
  92. package/dist/prompts/node-guidance/node-tips/structured-output-parser.js +35 -0
  93. package/dist/prompts/node-guidance/node-tips/structured-output-parser.js.map +1 -0
  94. package/dist/prompts/node-guidance/node-tips/types.d.ts +7 -0
  95. package/dist/prompts/node-guidance/node-tips/types.js +3 -0
  96. package/dist/prompts/node-guidance/node-tips/types.js.map +1 -0
  97. package/dist/prompts/node-guidance/node-tips/webhook.d.ts +2 -0
  98. package/dist/prompts/node-guidance/node-tips/webhook.js +38 -0
  99. package/dist/prompts/node-guidance/node-tips/webhook.js.map +1 -0
  100. package/dist/prompts/node-guidance/parameter-guides/embedding-nodes.d.ts +2 -0
  101. package/dist/prompts/node-guidance/parameter-guides/embedding-nodes.js +70 -0
  102. package/dist/prompts/node-guidance/parameter-guides/embedding-nodes.js.map +1 -0
  103. package/dist/prompts/node-guidance/parameter-guides/gmail.d.ts +2 -0
  104. package/dist/prompts/node-guidance/parameter-guides/gmail.js +53 -0
  105. package/dist/prompts/node-guidance/parameter-guides/gmail.js.map +1 -0
  106. package/dist/prompts/node-guidance/parameter-guides/http-request.d.ts +2 -0
  107. package/dist/prompts/node-guidance/parameter-guides/http-request.js +139 -0
  108. package/dist/prompts/node-guidance/parameter-guides/http-request.js.map +1 -0
  109. package/dist/prompts/node-guidance/parameter-guides/if-node.d.ts +2 -0
  110. package/dist/prompts/node-guidance/parameter-guides/if-node.js +159 -0
  111. package/dist/prompts/node-guidance/parameter-guides/if-node.js.map +1 -0
  112. package/dist/prompts/node-guidance/parameter-guides/index.d.ts +12 -0
  113. package/dist/prompts/node-guidance/parameter-guides/index.js +26 -0
  114. package/dist/prompts/node-guidance/parameter-guides/index.js.map +1 -0
  115. package/dist/prompts/node-guidance/parameter-guides/predecessor-output.d.ts +2 -0
  116. package/dist/prompts/node-guidance/parameter-guides/predecessor-output.js +25 -0
  117. package/dist/prompts/node-guidance/parameter-guides/predecessor-output.js.map +1 -0
  118. package/dist/prompts/node-guidance/parameter-guides/resource-locator.d.ts +2 -0
  119. package/dist/prompts/node-guidance/parameter-guides/resource-locator.js +40 -0
  120. package/dist/prompts/node-guidance/parameter-guides/resource-locator.js.map +1 -0
  121. package/dist/prompts/node-guidance/parameter-guides/set-node.d.ts +2 -0
  122. package/dist/prompts/node-guidance/parameter-guides/set-node.js +94 -0
  123. package/dist/prompts/node-guidance/parameter-guides/set-node.js.map +1 -0
  124. package/dist/prompts/node-guidance/parameter-guides/switch-node.d.ts +2 -0
  125. package/dist/prompts/node-guidance/parameter-guides/switch-node.js +75 -0
  126. package/dist/prompts/node-guidance/parameter-guides/switch-node.js.map +1 -0
  127. package/dist/prompts/node-guidance/parameter-guides/system-message.d.ts +2 -0
  128. package/dist/prompts/node-guidance/parameter-guides/system-message.js +96 -0
  129. package/dist/prompts/node-guidance/parameter-guides/system-message.js.map +1 -0
  130. package/dist/prompts/node-guidance/parameter-guides/text-fields.d.ts +2 -0
  131. package/dist/prompts/node-guidance/parameter-guides/text-fields.js +31 -0
  132. package/dist/prompts/node-guidance/parameter-guides/text-fields.js.map +1 -0
  133. package/dist/prompts/node-guidance/parameter-guides/tool-nodes.d.ts +2 -0
  134. package/dist/prompts/node-guidance/parameter-guides/tool-nodes.js +76 -0
  135. package/dist/prompts/node-guidance/parameter-guides/tool-nodes.js.map +1 -0
  136. package/dist/prompts/node-guidance/parameter-guides/types.d.ts +18 -0
  137. package/dist/prompts/node-guidance/parameter-guides/types.js +3 -0
  138. package/dist/prompts/node-guidance/parameter-guides/types.js.map +1 -0
  139. package/dist/prompts/node-selection/ai-nodes.d.ts +2 -0
  140. package/dist/prompts/node-selection/ai-nodes.js +35 -0
  141. package/dist/prompts/node-selection/ai-nodes.js.map +1 -0
  142. package/dist/prompts/node-selection/connection-parameters.d.ts +1 -0
  143. package/dist/prompts/node-selection/connection-parameters.js +13 -0
  144. package/dist/prompts/node-selection/connection-parameters.js.map +1 -0
  145. package/dist/prompts/node-selection/index.d.ts +5 -0
  146. package/dist/prompts/node-selection/index.js +16 -0
  147. package/dist/prompts/node-selection/index.js.map +1 -0
  148. package/dist/prompts/node-selection/native-preference.d.ts +1 -0
  149. package/dist/prompts/node-selection/native-preference.js +18 -0
  150. package/dist/prompts/node-selection/native-preference.js.map +1 -0
  151. package/dist/prompts/node-selection/trigger-selection.d.ts +1 -0
  152. package/dist/prompts/node-selection/trigger-selection.js +23 -0
  153. package/dist/prompts/node-selection/trigger-selection.js.map +1 -0
  154. package/dist/prompts/node-selection/use-case-patterns.d.ts +2 -0
  155. package/dist/prompts/node-selection/use-case-patterns.js +58 -0
  156. package/dist/prompts/node-selection/use-case-patterns.js.map +1 -0
  157. package/dist/prompts/sdk-reference/additional-functions.d.ts +1 -0
  158. package/dist/prompts/sdk-reference/additional-functions.js +20 -0
  159. package/dist/prompts/sdk-reference/additional-functions.js.map +1 -0
  160. package/dist/prompts/sdk-reference/expressions.d.ts +1 -0
  161. package/dist/prompts/sdk-reference/expressions.js +34 -0
  162. package/dist/prompts/sdk-reference/expressions.js.map +1 -0
  163. package/dist/prompts/sdk-reference/index.d.ts +5 -0
  164. package/dist/prompts/sdk-reference/index.js +14 -0
  165. package/dist/prompts/sdk-reference/index.js.map +1 -0
  166. package/dist/prompts/sdk-reference/workflow-patterns-detailed.d.ts +1 -0
  167. package/dist/prompts/sdk-reference/workflow-patterns-detailed.js +398 -0
  168. package/dist/prompts/sdk-reference/workflow-patterns-detailed.js.map +1 -0
  169. package/dist/prompts/sdk-reference/workflow-patterns.d.ts +2 -0
  170. package/dist/prompts/sdk-reference/workflow-patterns.js +479 -0
  171. package/dist/prompts/sdk-reference/workflow-patterns.js.map +1 -0
  172. package/dist/prompts/sdk-reference/workflow-rules.d.ts +1 -0
  173. package/dist/prompts/sdk-reference/workflow-rules.js +23 -0
  174. package/dist/prompts/sdk-reference/workflow-rules.js.map +1 -0
  175. package/dist/workflow-builder/plugins/defaults.js +1 -0
  176. package/dist/workflow-builder/plugins/defaults.js.map +1 -1
  177. package/dist/workflow-builder/plugins/validators/filter-node-validator.d.ts +2 -0
  178. package/dist/workflow-builder/plugins/validators/filter-node-validator.js +90 -0
  179. package/dist/workflow-builder/plugins/validators/filter-node-validator.js.map +1 -0
  180. package/dist/workflow-builder/plugins/validators/index.d.ts +1 -0
  181. package/dist/workflow-builder/plugins/validators/index.js +3 -1
  182. package/dist/workflow-builder/plugins/validators/index.js.map +1 -1
  183. package/package.json +50 -4
@@ -0,0 +1,479 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.WORKFLOW_PATTERNS_CONCISE = exports.WORKFLOW_SDK_PATTERNS = void 0;
4
+ const SDK_IMPORT = "import { workflow, node, trigger, sticky, placeholder, newCredential, ifElse, switchCase, merge, splitInBatches, nextBatch, languageModel, memory, tool, outputParser, embedding, embeddings, vectorStore, retriever, documentLoader, textSplitter, fromAi, expr } from '@n8n/workflow-sdk';";
5
+ exports.WORKFLOW_SDK_PATTERNS = `<linear_chain>
6
+ \`\`\`javascript
7
+ ${SDK_IMPORT}
8
+
9
+ // 1. Define all nodes first
10
+ const startTrigger = trigger({
11
+ type: 'n8n-nodes-base.manualTrigger',
12
+ version: 1,
13
+ config: { name: 'Start' }
14
+ });
15
+
16
+ const fetchData = node({
17
+ type: 'n8n-nodes-base.httpRequest',
18
+ version: 4.3,
19
+ config: { name: 'Fetch Data', parameters: { method: 'GET', url: '...' } }
20
+ });
21
+
22
+ const processData = node({
23
+ type: 'n8n-nodes-base.set',
24
+ version: 3.4,
25
+ config: { name: 'Process Data', parameters: {} }
26
+ });
27
+
28
+ // 2. Compose workflow
29
+ export default workflow('id', 'name')
30
+ .add(startTrigger)
31
+ .to(fetchData)
32
+ .to(processData);
33
+ \`\`\`
34
+
35
+ </linear_chain>
36
+
37
+ <independent_sources>
38
+ When nodes return more than 1 item, chaining causes item multiplication: if Source A returns N items, a chained Source B runs N times instead of once.
39
+
40
+ **When to use \`executeOnce: true\`:**
41
+ - A node fetches data independently but is chained after another data source (prevents N×M multiplication)
42
+ - A node should summarize/aggregate all upstream items in a single call (e.g., AI summary, send one notification)
43
+ - A node calls an API that doesn't vary per input item
44
+
45
+ Fix with \`executeOnce: true\` (simplest) or parallel branches + Merge (when combining results):
46
+
47
+ \`\`\`javascript
48
+ // sourceA outputs 10 items. sourceB outputs 10 items.
49
+ // WRONG - processResults runs 100 times
50
+ // startTrigger.to(sourceA.to(sourceB.to(processResults)))
51
+
52
+ // FIX 1 - executeOnce: sourceB runs once regardless of input items
53
+ const sourceB = node({ ..., config: { ..., executeOnce: true } });
54
+ startTrigger.to(sourceA.to(sourceB.to(processResults)));
55
+
56
+ // FIX 2 - parallel branches + Merge (combine by position)
57
+ const combineResults = merge({
58
+ version: 3.2,
59
+ config: { name: 'Combine Results', parameters: { mode: 'combine', combineBy: 'combineByPosition' } }
60
+ });
61
+ export default workflow('id', 'name')
62
+ .add(startTrigger)
63
+ .to(sourceA.to(combineResults.input(0)))
64
+ .add(startTrigger)
65
+ .to(sourceB.to(combineResults.input(1)))
66
+ .add(combineResults)
67
+ .to(processResults);
68
+
69
+ // FIX 3 - parallel branches + Merge (append)
70
+ const allResults = merge({
71
+ version: 3.2,
72
+ config: { name: 'All Results', parameters: { mode: 'append' } }
73
+ });
74
+ export default workflow('id', 'name')
75
+ .add(startTrigger)
76
+ .to(sourceA.to(allResults.input(0)))
77
+ .add(startTrigger)
78
+ .to(sourceB.to(allResults.input(1)))
79
+ .add(allResults)
80
+ .to(processResults);
81
+ \`\`\`
82
+
83
+ </independent_sources>
84
+
85
+ <zero_item_safety>
86
+ Nodes that fetch or filter data may return 0 items, which stops the entire downstream chain.
87
+ Use \`alwaysOutputData: true\` on data-fetching nodes to ensure the chain continues with an empty item \`{json: {}}\`.
88
+
89
+ \`\`\`javascript
90
+ // Data Table might be empty (fresh table, no matching rows)
91
+ const getReflections = node({
92
+ type: 'n8n-nodes-base.dataTable',
93
+ version: 1.1,
94
+ config: {
95
+ name: 'Get Reflections',
96
+ alwaysOutputData: true, // Chain continues even if table is empty
97
+ parameters: { resource: 'row', operation: 'get', returnAll: true }
98
+ }
99
+ });
100
+
101
+ // Downstream Code node handles the empty case
102
+ const processData = node({
103
+ type: 'n8n-nodes-base.code',
104
+ version: 2,
105
+ config: {
106
+ name: 'Process Data',
107
+ parameters: {
108
+ mode: 'runOnceForAllItems',
109
+ jsCode: \\\`
110
+ const items = $input.all();
111
+ // items will be [{json: {}}] if upstream had no data
112
+ const hasData = items.length > 0 && Object.keys(items[0].json).length > 0;
113
+ // ... handle both cases
114
+ \\\`.trim()
115
+ }
116
+ }
117
+ });
118
+ \`\`\`
119
+
120
+ **When to use \`alwaysOutputData: true\`:**
121
+ - Data Table with \`operation: 'get'\` (table may be empty or freshly created)
122
+ - Any lookup/search/filter node whose result feeds into downstream processing
123
+ - HTTP Request that may return an empty array
124
+
125
+ **When NOT to use it:**
126
+ - Trigger nodes (they always produce output)
127
+ - Code nodes (handle empty input in your code logic instead)
128
+ - Nodes at the end of the chain (no downstream to protect)
129
+
130
+ </zero_item_safety>
131
+
132
+ <conditional_branching>
133
+
134
+ **CRITICAL:** Each branch defines a COMPLETE processing path. Chain multiple steps INSIDE the branch using .to().
135
+
136
+ Every IF/Filter \`conditions\` parameter MUST include \`options\`, \`conditions\`, and \`combinator\`:
137
+ \`\`\`javascript
138
+ const checkValid = ifElse({
139
+ version: 2.2,
140
+ config: {
141
+ name: 'Check Valid',
142
+ parameters: {
143
+ conditions: {
144
+ options: { caseSensitive: true, leftValue: '', typeValidation: 'strict' },
145
+ conditions: [{ leftValue: '={{ $json.status }}', operator: { type: 'string', operation: 'equals' }, rightValue: 'active' }],
146
+ combinator: 'and'
147
+ }
148
+ }
149
+ }
150
+ });
151
+
152
+ export default workflow('id', 'name')
153
+ .add(startTrigger)
154
+ .to(checkValid
155
+ .onTrue(formatData.to(enrichData.to(saveToDb))) // Chain 3 nodes on true branch
156
+ .onFalse(logError));
157
+ \`\`\`
158
+
159
+ </conditional_branching>
160
+
161
+ <multi_way_routing>
162
+
163
+ Switch rules use \`rules.values\` (NOT \`rules.rules\`). Each rule needs \`outputKey\` and a complete \`conditions\` object:
164
+ \`\`\`javascript
165
+ const routeByPriority = switchCase({
166
+ version: 3.2,
167
+ config: {
168
+ name: 'Route by Priority',
169
+ parameters: {
170
+ rules: {
171
+ values: [
172
+ { outputKey: 'urgent', conditions: { options: { caseSensitive: true, leftValue: '', typeValidation: 'strict' }, conditions: [{ leftValue: '={{ $json.priority }}', operator: { type: 'string', operation: 'equals' }, rightValue: 'urgent' }], combinator: 'and' } },
173
+ { outputKey: 'normal', conditions: { options: { caseSensitive: true, leftValue: '', typeValidation: 'strict' }, conditions: [{ leftValue: '={{ $json.priority }}', operator: { type: 'string', operation: 'equals' }, rightValue: 'normal' }], combinator: 'and' } },
174
+ ]
175
+ }
176
+ }
177
+ }
178
+ });
179
+
180
+ export default workflow('id', 'name')
181
+ .add(startTrigger)
182
+ .to(routeByPriority
183
+ .onCase('urgent', processUrgent.to(notifyTeam.to(escalate)))
184
+ .onCase('normal', processNormal)
185
+ .onDefault(archive));
186
+ \`\`\`
187
+
188
+ </multi_way_routing>
189
+
190
+ <parallel_execution>
191
+ \`\`\`javascript
192
+ // First declare the Merge node using merge()
193
+ const combineResults = merge({
194
+ version: 3.2,
195
+ config: { name: 'Combine Results', parameters: { mode: 'combine' } }
196
+ });
197
+
198
+ // Declare branch nodes
199
+ const branch1 = node({ type: 'n8n-nodes-base.httpRequest', ... });
200
+ const branch2 = node({ type: 'n8n-nodes-base.httpRequest', ... });
201
+ const processResults = node({ type: 'n8n-nodes-base.set', ... });
202
+
203
+ // Connect branches to specific merge inputs using .input(n)
204
+ export default workflow('id', 'name')
205
+ .add(trigger({ ... }))
206
+ .to(branch1.to(combineResults.input(0))) // Connect to input 0
207
+ .add(trigger({ ... }))
208
+ .to(branch2.to(combineResults.input(1))) // Connect to input 1
209
+ .add(combineResults)
210
+ .to(processResults); // Process merged results
211
+ \`\`\`
212
+
213
+ </parallel_execution>
214
+
215
+ <batch_processing>
216
+ \`\`\`javascript
217
+ const startTrigger = trigger({
218
+ type: 'n8n-nodes-base.manualTrigger',
219
+ version: 1,
220
+ config: { name: 'Start' }
221
+ });
222
+
223
+ const fetchRecords = node({
224
+ type: 'n8n-nodes-base.httpRequest',
225
+ version: 4.3,
226
+ config: { name: 'Fetch Records', parameters: { method: 'GET', url: '...' } }
227
+ });
228
+
229
+ const finalizeResults = node({
230
+ type: 'n8n-nodes-base.set',
231
+ version: 3.4,
232
+ config: { name: 'Finalize', parameters: {} }
233
+ });
234
+
235
+ const processRecord = node({
236
+ type: 'n8n-nodes-base.httpRequest',
237
+ version: 4.3,
238
+ config: { name: 'Process Record', parameters: { method: 'POST', url: '...' } }
239
+ });
240
+
241
+ const sibNode = splitInBatches({ version: 3, config: { name: 'Batch Process', parameters: { batchSize: 10 } } });
242
+
243
+ export default workflow('id', 'name')
244
+ .add(startTrigger)
245
+ .to(fetchRecords)
246
+ .to(sibNode
247
+ .onDone(finalizeResults)
248
+ .onEachBatch(processRecord.to(nextBatch(sibNode)))
249
+ );
250
+ \`\`\`
251
+
252
+ </batch_processing>
253
+
254
+ <multiple_triggers>
255
+ \`\`\`javascript
256
+ const webhookTrigger = trigger({
257
+ type: 'n8n-nodes-base.webhook',
258
+ version: 2.1,
259
+ config: { name: 'Webhook' }
260
+ });
261
+
262
+ const processWebhook = node({
263
+ type: 'n8n-nodes-base.set',
264
+ version: 3.4,
265
+ config: { name: 'Process Webhook', parameters: {} }
266
+ });
267
+
268
+ const scheduleTrigger = trigger({
269
+ type: 'n8n-nodes-base.scheduleTrigger',
270
+ version: 1.3,
271
+ config: { name: 'Daily Schedule', parameters: {} }
272
+ });
273
+
274
+ const processSchedule = node({
275
+ type: 'n8n-nodes-base.set',
276
+ version: 3.4,
277
+ config: { name: 'Process Schedule', parameters: {} }
278
+ });
279
+
280
+ export default workflow('id', 'name')
281
+ .add(webhookTrigger)
282
+ .to(processWebhook)
283
+ .add(scheduleTrigger)
284
+ .to(processSchedule);
285
+ \`\`\`
286
+
287
+ </multiple_triggers>
288
+
289
+ <fan_in>
290
+ \`\`\`javascript
291
+ // Each trigger's execution runs in COMPLETE ISOLATION.
292
+ // Different branches have no effect on each other.
293
+ // Never duplicate chains for "isolation" - it's already guaranteed.
294
+
295
+ const webhookTrigger = trigger({
296
+ type: 'n8n-nodes-base.webhook',
297
+ version: 2.1,
298
+ config: { name: 'Webhook Trigger' }
299
+ });
300
+
301
+ const scheduleTrigger = trigger({
302
+ type: 'n8n-nodes-base.scheduleTrigger',
303
+ version: 1.3,
304
+ config: { name: 'Daily Schedule' }
305
+ });
306
+
307
+ const processData = node({
308
+ type: 'n8n-nodes-base.set',
309
+ version: 3.4,
310
+ config: { name: 'Process Data', parameters: {} }
311
+ });
312
+
313
+ const sendNotification = node({
314
+ type: 'n8n-nodes-base.slack',
315
+ version: 2.3,
316
+ config: { name: 'Notify Slack', parameters: {} }
317
+ });
318
+
319
+ export default workflow('id', 'name')
320
+ .add(webhookTrigger)
321
+ .to(processData)
322
+ .to(sendNotification)
323
+ .add(scheduleTrigger)
324
+ .to(processData);
325
+ \`\`\`
326
+
327
+ </fan_in>
328
+
329
+ <ai_agent_basic>
330
+ \`\`\`javascript
331
+ const openAiModel = languageModel({
332
+ type: '@n8n/n8n-nodes-langchain.lmChatOpenAi',
333
+ version: 1.3,
334
+ config: { name: 'OpenAI Model', parameters: {} }
335
+ });
336
+
337
+ const startTrigger = trigger({
338
+ type: 'n8n-nodes-base.manualTrigger',
339
+ version: 1,
340
+ config: { name: 'Start' }
341
+ });
342
+
343
+ const aiAgent = node({
344
+ type: '@n8n/n8n-nodes-langchain.agent',
345
+ version: 3.1,
346
+ config: {
347
+ name: 'AI Assistant',
348
+ parameters: { promptType: 'define', text: 'You are a helpful assistant' },
349
+ subnodes: { model: openAiModel }
350
+ }
351
+ });
352
+
353
+ export default workflow('ai-assistant', 'AI Assistant')
354
+ .add(startTrigger)
355
+ .to(aiAgent);
356
+ \`\`\`
357
+
358
+ </ai_agent_basic>
359
+
360
+ <ai_agent_with_tools>
361
+ \`\`\`javascript
362
+ const openAiModel = languageModel({
363
+ type: '@n8n/n8n-nodes-langchain.lmChatOpenAi',
364
+ version: 1.3,
365
+ config: {
366
+ name: 'OpenAI Model',
367
+ parameters: {},
368
+ credentials: { openAiApi: newCredential('OpenAI') }
369
+ }
370
+ });
371
+
372
+ const calculatorTool = tool({
373
+ type: '@n8n/n8n-nodes-langchain.toolCalculator',
374
+ version: 1,
375
+ config: { name: 'Calculator', parameters: {} }
376
+ });
377
+
378
+ const startTrigger = trigger({
379
+ type: 'n8n-nodes-base.manualTrigger',
380
+ version: 1,
381
+ config: { name: 'Start' }
382
+ });
383
+
384
+ const aiAgent = node({
385
+ type: '@n8n/n8n-nodes-langchain.agent',
386
+ version: 3.1,
387
+ config: {
388
+ name: 'Math Agent',
389
+ parameters: { promptType: 'define', text: 'You can use tools to help users' },
390
+ subnodes: { model: openAiModel, tools: [calculatorTool] }
391
+ }
392
+ });
393
+
394
+ export default workflow('ai-calculator', 'AI Calculator')
395
+ .add(startTrigger)
396
+ .to(aiAgent);
397
+ \`\`\`
398
+
399
+ </ai_agent_with_tools>
400
+
401
+ <ai_agent_with_from_ai>
402
+ \`\`\`javascript
403
+ const openAiModel = languageModel({
404
+ type: '@n8n/n8n-nodes-langchain.lmChatOpenAi',
405
+ version: 1.3,
406
+ config: {
407
+ name: 'OpenAI Model',
408
+ parameters: {},
409
+ credentials: { openAiApi: newCredential('OpenAI') }
410
+ }
411
+ });
412
+
413
+ const gmailTool = tool({
414
+ type: 'n8n-nodes-base.gmailTool',
415
+ version: 1,
416
+ config: {
417
+ name: 'Gmail Tool',
418
+ parameters: {
419
+ sendTo: fromAi('recipient', 'Email address'),
420
+ subject: fromAi('subject', 'Email subject'),
421
+ message: fromAi('body', 'Email content')
422
+ },
423
+ credentials: { gmailOAuth2: newCredential('Gmail') }
424
+ }
425
+ });
426
+
427
+ const startTrigger = trigger({
428
+ type: 'n8n-nodes-base.manualTrigger',
429
+ version: 1,
430
+ config: { name: 'Start' }
431
+ });
432
+
433
+ const aiAgent = node({
434
+ type: '@n8n/n8n-nodes-langchain.agent',
435
+ version: 3.1,
436
+ config: {
437
+ name: 'Email Agent',
438
+ parameters: { promptType: 'define', text: 'You can send emails' },
439
+ subnodes: { model: openAiModel, tools: [gmailTool] }
440
+ }
441
+ });
442
+
443
+ export default workflow('ai-email', 'AI Email Sender')
444
+ .add(startTrigger)
445
+ .to(aiAgent);
446
+ \`\`\`
447
+ </ai_agent_with_from_ai>
448
+
449
+ <ai_agent_with_structured_output>
450
+ \`\`\`javascript
451
+ const structuredParser = outputParser({
452
+ type: '@n8n/n8n-nodes-langchain.outputParserStructured',
453
+ version: 1.3,
454
+ config: {
455
+ name: 'Structured Output Parser',
456
+ parameters: {
457
+ schemaType: 'fromJson',
458
+ jsonSchemaExample: '{ "sentiment": "positive", "confidence": 0.95, "summary": "brief summary" }'
459
+ }
460
+ }
461
+ });
462
+
463
+ const aiAgent = node({
464
+ type: '@n8n/n8n-nodes-langchain.agent',
465
+ version: 3.1,
466
+ config: {
467
+ name: 'Sentiment Analyzer',
468
+ parameters: { promptType: 'define', text: 'Analyze the sentiment of the input text', hasOutputParser: true },
469
+ subnodes: { model: openAiModel, outputParser: structuredParser }
470
+ }
471
+ });
472
+
473
+ export default workflow('ai-sentiment', 'AI Sentiment Analyzer')
474
+ .add(startTrigger)
475
+ .to(aiAgent);
476
+ \`\`\`
477
+ </ai_agent_with_structured_output>`;
478
+ exports.WORKFLOW_PATTERNS_CONCISE = exports.WORKFLOW_SDK_PATTERNS;
479
+ //# sourceMappingURL=workflow-patterns.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workflow-patterns.js","sourceRoot":"","sources":["../../../src/prompts/sdk-reference/workflow-patterns.ts"],"names":[],"mappings":";;;AAUA,MAAM,UAAU,GACf,8RAA8R,CAAC;AAMnR,QAAA,qBAAqB,GAAG;;EAEnC,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mCAsduB,CAAC;AAEF,oCA1drB,6BAAqB,CA0dyB"}
@@ -0,0 +1 @@
1
+ export declare const WORKFLOW_RULES = "Follow these rules strictly when generating workflows:\n\n1. **Always use newCredential() for authentication**\n - When a node needs credentials, always use `newCredential('Name')` in the credentials config\n - NEVER use placeholder strings, fake API keys, or hardcoded auth values\n - Example: `credentials: { slackApi: newCredential('Slack Bot') }`\n - The credential type must match what the node expects\n\n2. **Handle empty outputs with `alwaysOutputData: true`**\n - Nodes that query data (Data Table get, Google Sheets lookup, HTTP Request, etc.) may return 0 items\n - When a node returns 0 items, all downstream nodes are SKIPPED \u2014 the workflow chain breaks silently\n - Set `alwaysOutputData: true` on any node whose output feeds downstream nodes and might return empty results\n - Common cases: fresh/empty Data Tables, filtered queries, conditional lookups, API searches with no matches\n - Example: `config: { ..., alwaysOutputData: true }`\n\n3. **Use `executeOnce: true` for single-execution nodes**\n - When a node receives N items but should only execute once (not N times), set `executeOnce: true`\n - Common cases: sending a summary notification, generating a report, calling an API that doesn't need per-item execution\n - Example: `config: { ..., executeOnce: true }`";
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.WORKFLOW_RULES = void 0;
4
+ exports.WORKFLOW_RULES = `Follow these rules strictly when generating workflows:
5
+
6
+ 1. **Always use newCredential() for authentication**
7
+ - When a node needs credentials, always use \`newCredential('Name')\` in the credentials config
8
+ - NEVER use placeholder strings, fake API keys, or hardcoded auth values
9
+ - Example: \`credentials: { slackApi: newCredential('Slack Bot') }\`
10
+ - The credential type must match what the node expects
11
+
12
+ 2. **Handle empty outputs with \`alwaysOutputData: true\`**
13
+ - Nodes that query data (Data Table get, Google Sheets lookup, HTTP Request, etc.) may return 0 items
14
+ - When a node returns 0 items, all downstream nodes are SKIPPED — the workflow chain breaks silently
15
+ - Set \`alwaysOutputData: true\` on any node whose output feeds downstream nodes and might return empty results
16
+ - Common cases: fresh/empty Data Tables, filtered queries, conditional lookups, API searches with no matches
17
+ - Example: \`config: { ..., alwaysOutputData: true }\`
18
+
19
+ 3. **Use \`executeOnce: true\` for single-execution nodes**
20
+ - When a node receives N items but should only execute once (not N times), set \`executeOnce: true\`
21
+ - Common cases: sending a summary notification, generating a report, calling an API that doesn't need per-item execution
22
+ - Example: \`config: { ..., executeOnce: true }\``;
23
+ //# sourceMappingURL=workflow-rules.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workflow-rules.js","sourceRoot":"","sources":["../../../src/prompts/sdk-reference/workflow-rules.ts"],"names":[],"mappings":";;;AAQa,QAAA,cAAc,GAAG;;;;;;;;;;;;;;;;;;qDAkBuB,CAAC"}
@@ -15,6 +15,7 @@ const coreValidators = [
15
15
  validators_1.fromAiValidator,
16
16
  validators_1.setNodeValidator,
17
17
  validators_1.mergeNodeValidator,
18
+ validators_1.filterNodeValidator,
18
19
  validators_1.expressionPrefixValidator,
19
20
  validators_1.dateMethodValidator,
20
21
  validators_1.expressionPathValidator,
@@ -1 +1 @@
1
- {"version":3,"file":"defaults.js","sourceRoot":"","sources":["../../../src/workflow-builder/plugins/defaults.ts"],"names":[],"mappings":";;AAyFA,wDA2BC;AA7GD,6DAA+F;AAE/F,+CAA+C;AAE/C,6CAgBsB;AAatB,MAAM,cAAc,GAAsB;IAEzC,6BAAgB;IAChB,oCAAuB;IACvB,8BAAiB;IAGjB,2BAAc;IACd,8BAAiB;IACjB,iCAAoB;IACpB,8BAAiB;IACjB,4BAAe;IAGf,6BAAgB;IAChB,+BAAkB;IAGlB,sCAAyB;IACzB,gCAAmB;IACnB,oCAAuB;IAGvB,sCAAyB;IACzB,uCAA0B;CAC1B,CAAC;AAKF,MAAM,qBAAqB,GAA6B;IACvD,kCAAa;IACb,sCAAiB;IACjB,0CAAqB;CACrB,CAAC;AAKF,MAAM,eAAe,GAAuB,CAAC,4BAAc,CAAC,CAAC;AAU7D,SAAgB,sBAAsB,CAAC,QAAwB;IAE9D,KAAK,MAAM,SAAS,IAAI,cAAc,EAAE,CAAC;QACxC,IAAI,CAAC;YACJ,QAAQ,CAAC,iBAAiB,CAAC,SAAS,CAAC,CAAC;QACvC,CAAC;QAAC,MAAM,CAAC;QAET,CAAC;IACF,CAAC;IAGD,KAAK,MAAM,OAAO,IAAI,qBAAqB,EAAE,CAAC;QAC7C,IAAI,CAAC;YACJ,QAAQ,CAAC,wBAAwB,CAAC,OAAO,CAAC,CAAC;QAC5C,CAAC;QAAC,MAAM,CAAC;QAET,CAAC;IACF,CAAC;IAGD,KAAK,MAAM,UAAU,IAAI,eAAe,EAAE,CAAC;QAC1C,IAAI,CAAC;YACJ,QAAQ,CAAC,kBAAkB,CAAC,UAAU,CAAC,CAAC;QACzC,CAAC;QAAC,MAAM,CAAC;QAET,CAAC;IACF,CAAC;AACF,CAAC"}
1
+ {"version":3,"file":"defaults.js","sourceRoot":"","sources":["../../../src/workflow-builder/plugins/defaults.ts"],"names":[],"mappings":";;AA2FA,wDA2BC;AA/GD,6DAA+F;AAE/F,+CAA+C;AAE/C,6CAiBsB;AAatB,MAAM,cAAc,GAAsB;IAEzC,6BAAgB;IAChB,oCAAuB;IACvB,8BAAiB;IAGjB,2BAAc;IACd,8BAAiB;IACjB,iCAAoB;IACpB,8BAAiB;IACjB,4BAAe;IAGf,6BAAgB;IAChB,+BAAkB;IAClB,gCAAmB;IAGnB,sCAAyB;IACzB,gCAAmB;IACnB,oCAAuB;IAGvB,sCAAyB;IACzB,uCAA0B;CAC1B,CAAC;AAKF,MAAM,qBAAqB,GAA6B;IACvD,kCAAa;IACb,sCAAiB;IACjB,0CAAqB;CACrB,CAAC;AAKF,MAAM,eAAe,GAAuB,CAAC,4BAAc,CAAC,CAAC;AAU7D,SAAgB,sBAAsB,CAAC,QAAwB;IAE9D,KAAK,MAAM,SAAS,IAAI,cAAc,EAAE,CAAC;QACxC,IAAI,CAAC;YACJ,QAAQ,CAAC,iBAAiB,CAAC,SAAS,CAAC,CAAC;QACvC,CAAC;QAAC,MAAM,CAAC;QAET,CAAC;IACF,CAAC;IAGD,KAAK,MAAM,OAAO,IAAI,qBAAqB,EAAE,CAAC;QAC7C,IAAI,CAAC;YACJ,QAAQ,CAAC,wBAAwB,CAAC,OAAO,CAAC,CAAC;QAC5C,CAAC;QAAC,MAAM,CAAC;QAET,CAAC;IACF,CAAC;IAGD,KAAK,MAAM,UAAU,IAAI,eAAe,EAAE,CAAC;QAC1C,IAAI,CAAC;YACJ,QAAQ,CAAC,kBAAkB,CAAC,UAAU,CAAC,CAAC;QACzC,CAAC;QAAC,MAAM,CAAC;QAET,CAAC;IACF,CAAC;AACF,CAAC"}
@@ -0,0 +1,2 @@
1
+ import { type ValidatorPlugin } from '../types';
2
+ export declare const filterNodeValidator: ValidatorPlugin;
@@ -0,0 +1,90 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.filterNodeValidator = void 0;
4
+ const types_1 = require("../types");
5
+ const FILTER_NODE_TYPES = ['n8n-nodes-base.if', 'n8n-nodes-base.switch', 'n8n-nodes-base.filter'];
6
+ function validateFilterValue(filterValue, nodeRef, paramPath, nodeName, originalName) {
7
+ const issues = [];
8
+ if (!filterValue.options || typeof filterValue.options !== 'object') {
9
+ issues.push({
10
+ code: 'FILTER_MISSING_OPTIONS',
11
+ message: `${nodeRef} is missing 'options' in ${paramPath}. Add: options: { caseSensitive: true, leftValue: '', typeValidation: 'strict' }`,
12
+ severity: 'error',
13
+ nodeName,
14
+ originalName,
15
+ parameterPath: `${paramPath}.options`,
16
+ });
17
+ }
18
+ if (!Array.isArray(filterValue.conditions) || filterValue.conditions.length === 0) {
19
+ issues.push({
20
+ code: 'FILTER_MISSING_CONDITIONS',
21
+ message: `${nodeRef} is missing or has empty 'conditions' array in ${paramPath}. Add at least one condition with leftValue, operator, and rightValue.`,
22
+ severity: 'error',
23
+ nodeName,
24
+ originalName,
25
+ parameterPath: `${paramPath}.conditions`,
26
+ });
27
+ }
28
+ if (filterValue.combinator === undefined) {
29
+ issues.push({
30
+ code: 'FILTER_MISSING_COMBINATOR',
31
+ message: `${nodeRef} is missing 'combinator' in ${paramPath}. Add: combinator: 'and'`,
32
+ severity: 'error',
33
+ nodeName,
34
+ originalName,
35
+ parameterPath: `${paramPath}.combinator`,
36
+ });
37
+ }
38
+ return issues;
39
+ }
40
+ exports.filterNodeValidator = {
41
+ id: 'core:filter-node',
42
+ name: 'Filter Node Validator',
43
+ nodeTypes: FILTER_NODE_TYPES,
44
+ priority: 40,
45
+ validateNode(node, graphNode, ctx) {
46
+ const issues = [];
47
+ const params = node.config?.parameters;
48
+ if (!params)
49
+ return issues;
50
+ const mapKey = (0, types_1.findMapKey)(graphNode, ctx);
51
+ const originalName = node.name;
52
+ const renamed = (0, types_1.isAutoRenamed)(mapKey, originalName);
53
+ const displayName = renamed ? mapKey : originalName;
54
+ const origForWarning = renamed ? originalName : undefined;
55
+ const nodeRef = (0, types_1.formatNodeRef)(displayName, origForWarning, node.type);
56
+ const conditions = params.conditions;
57
+ if (conditions &&
58
+ typeof conditions === 'object' &&
59
+ ('conditions' in conditions || 'options' in conditions || 'combinator' in conditions)) {
60
+ issues.push(...validateFilterValue(conditions, nodeRef, 'conditions', displayName, origForWarning));
61
+ }
62
+ const rules = params.rules;
63
+ if (rules && typeof rules === 'object') {
64
+ if ('rules' in rules && !('values' in rules)) {
65
+ issues.push({
66
+ code: 'SWITCH_WRONG_RULES_KEY',
67
+ message: `${nodeRef} uses 'rules.rules' but the Switch node expects 'rules.values'. Rename the inner key from 'rules' to 'values'.`,
68
+ severity: 'error',
69
+ nodeName: displayName,
70
+ originalName: origForWarning,
71
+ parameterPath: 'rules',
72
+ });
73
+ }
74
+ const values = (rules.values ?? rules.rules);
75
+ if (Array.isArray(values)) {
76
+ for (let i = 0; i < values.length; i++) {
77
+ const rule = values[i];
78
+ const ruleConditions = rule?.conditions;
79
+ if (ruleConditions &&
80
+ typeof ruleConditions === 'object' &&
81
+ 'conditions' in ruleConditions) {
82
+ issues.push(...validateFilterValue(ruleConditions, nodeRef, `rules.values[${i}].conditions`, displayName, origForWarning));
83
+ }
84
+ }
85
+ }
86
+ }
87
+ return issues;
88
+ },
89
+ };
90
+ //# sourceMappingURL=filter-node-validator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"filter-node-validator.js","sourceRoot":"","sources":["../../../../src/workflow-builder/plugins/validators/filter-node-validator.ts"],"names":[],"mappings":";;;AAaA,oCAOkB;AAElB,MAAM,iBAAiB,GAAG,CAAC,mBAAmB,EAAE,uBAAuB,EAAE,uBAAuB,CAAC,CAAC;AAKlG,SAAS,mBAAmB,CAC3B,WAAoC,EACpC,OAAe,EACf,SAAiB,EACjB,QAAgB,EAChB,YAAgC;IAEhC,MAAM,MAAM,GAAsB,EAAE,CAAC;IAErC,IAAI,CAAC,WAAW,CAAC,OAAO,IAAI,OAAO,WAAW,CAAC,OAAO,KAAK,QAAQ,EAAE,CAAC;QACrE,MAAM,CAAC,IAAI,CAAC;YACX,IAAI,EAAE,wBAAwB;YAC9B,OAAO,E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YAC3F,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;gBAC3B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;oBACxC,MAAM,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;oBACvB,MAAM,cAAc,GAAG,IAAI,EAAE,UAAiD,CAAC;oBAC/E,IACC,cAAc;wBACd,OAAO,cAAc,KAAK,QAAQ;wBAClC,YAAY,IAAI,cAAc,EAC7B,CAAC;wBACF,MAAM,CAAC,IAAI,CACV,GAAG,mBAAmB,CACrB,cAAc,EACd,OAAO,EACP,gBAAgB,CAAC,cAAc,EAC/B,WAAW,EACX,cAAc,CACd,CACD,CAAC;oBACH,CAAC;gBACF,CAAC;YACF,CAAC;QACF,CAAC;QAED,OAAO,MAAM,CAAC;IACf,CAAC;CACD,CAAC"}
@@ -5,6 +5,7 @@ export { disconnectedNodeValidator } from './disconnected-node-validator';
5
5
  export { expressionPathValidator } from './expression-path-validator';
6
6
  export { subnodeConnectionValidator } from './subnode-connection-validator';
7
7
  export { expressionPrefixValidator } from './expression-prefix-validator';
8
+ export { filterNodeValidator } from './filter-node-validator';
8
9
  export { fromAiValidator } from './from-ai-validator';
9
10
  export { httpRequestValidator } from './http-request-validator';
10
11
  export { maxNodesValidator } from './max-nodes-validator';
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.toolNodeValidator = exports.setNodeValidator = exports.noNodesValidator = exports.missingTriggerValidator = exports.mergeNodeValidator = exports.maxNodesValidator = exports.httpRequestValidator = exports.fromAiValidator = exports.expressionPrefixValidator = exports.subnodeConnectionValidator = exports.expressionPathValidator = exports.disconnectedNodeValidator = exports.dateMethodValidator = exports.chainLlmValidator = exports.agentValidator = void 0;
3
+ exports.toolNodeValidator = exports.setNodeValidator = exports.noNodesValidator = exports.missingTriggerValidator = exports.mergeNodeValidator = exports.maxNodesValidator = exports.httpRequestValidator = exports.fromAiValidator = exports.filterNodeValidator = exports.expressionPrefixValidator = exports.subnodeConnectionValidator = exports.expressionPathValidator = exports.disconnectedNodeValidator = exports.dateMethodValidator = exports.chainLlmValidator = exports.agentValidator = void 0;
4
4
  var agent_validator_1 = require("./agent-validator");
5
5
  Object.defineProperty(exports, "agentValidator", { enumerable: true, get: function () { return agent_validator_1.agentValidator; } });
6
6
  var chain_llm_validator_1 = require("./chain-llm-validator");
@@ -15,6 +15,8 @@ var subnode_connection_validator_1 = require("./subnode-connection-validator");
15
15
  Object.defineProperty(exports, "subnodeConnectionValidator", { enumerable: true, get: function () { return subnode_connection_validator_1.subnodeConnectionValidator; } });
16
16
  var expression_prefix_validator_1 = require("./expression-prefix-validator");
17
17
  Object.defineProperty(exports, "expressionPrefixValidator", { enumerable: true, get: function () { return expression_prefix_validator_1.expressionPrefixValidator; } });
18
+ var filter_node_validator_1 = require("./filter-node-validator");
19
+ Object.defineProperty(exports, "filterNodeValidator", { enumerable: true, get: function () { return filter_node_validator_1.filterNodeValidator; } });
18
20
  var from_ai_validator_1 = require("./from-ai-validator");
19
21
  Object.defineProperty(exports, "fromAiValidator", { enumerable: true, get: function () { return from_ai_validator_1.fromAiValidator; } });
20
22
  var http_request_validator_1 = require("./http-request-validator");
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/workflow-builder/plugins/validators/index.ts"],"names":[],"mappings":";;;AAMA,qDAAmD;AAA1C,iHAAA,cAAc,OAAA;AACvB,6DAA0D;AAAjD,wHAAA,iBAAiB,OAAA;AAC1B,iEAA8D;AAArD,4HAAA,mBAAmB,OAAA;AAC5B,6EAA0E;AAAjE,wIAAA,yBAAyB,OAAA;AAClC,yEAAsE;AAA7D,oIAAA,uBAAuB,OAAA;AAChC,+EAA4E;AAAnE,0IAAA,0BAA0B,OAAA;AACnC,6EAA0E;AAAjE,wIAAA,yBAAyB,OAAA;AACl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