@openapi-flow/n8n 0.0.0-stage → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (332) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +129 -2
  3. package/THIRD_PARTY_NOTICES.md +9 -0
  4. package/dist/legacy/workflow/common/plan-validation.d.ts +1 -0
  5. package/dist/legacy/workflow/common/plan-validation.js +11 -0
  6. package/dist/legacy/workflow/common/workflow-id.d.ts +1 -0
  7. package/dist/legacy/workflow/common/workflow-id.js +8 -0
  8. package/dist/legacy/workflow/inbound/build-inbound-workflow.d.ts +2 -0
  9. package/dist/legacy/workflow/inbound/build-inbound-workflow.js +60 -0
  10. package/dist/legacy/workflow/inbound/compile-inbound-workflow.d.ts +2 -0
  11. package/dist/legacy/workflow/inbound/compile-inbound-workflow.js +25 -0
  12. package/dist/legacy/workflow/inbound/inbound-response.d.ts +2 -0
  13. package/dist/legacy/workflow/inbound/inbound-response.js +51 -0
  14. package/dist/legacy/workflow/request/base-url.d.ts +1 -0
  15. package/dist/legacy/workflow/request/base-url.js +14 -0
  16. package/dist/legacy/workflow/request/build-request-workflow.d.ts +3 -0
  17. package/dist/legacy/workflow/request/build-request-workflow.js +47 -0
  18. package/dist/legacy/workflow/request/build-sequence-workflow.d.ts +3 -0
  19. package/dist/legacy/workflow/request/build-sequence-workflow.js +53 -0
  20. package/dist/legacy/workflow/request/compile-catalog-sequence.d.ts +2 -0
  21. package/dist/legacy/workflow/request/compile-catalog-sequence.js +122 -0
  22. package/dist/legacy/workflow/request/compile-sequence.d.ts +2 -0
  23. package/dist/legacy/workflow/request/compile-sequence.js +41 -0
  24. package/dist/legacy/workflow/request/compile-workflow.d.ts +4 -0
  25. package/dist/legacy/workflow/request/compile-workflow.js +93 -0
  26. package/dist/legacy/workflow/request/credential-binding.d.ts +5 -0
  27. package/dist/legacy/workflow/request/credential-binding.js +31 -0
  28. package/dist/legacy/workflow/request/effect-policy.d.ts +4 -0
  29. package/dist/legacy/workflow/request/effect-policy.js +16 -0
  30. package/dist/legacy/workflow/request/http-request-node.d.ts +2 -0
  31. package/dist/legacy/workflow/request/http-request-node.js +69 -0
  32. package/dist/legacy/workflow/request/prepare-sequence.d.ts +4 -0
  33. package/dist/legacy/workflow/request/prepare-sequence.js +103 -0
  34. package/dist/legacy/workflow/request/request-body.d.ts +4 -0
  35. package/dist/legacy/workflow/request/request-body.js +64 -0
  36. package/dist/legacy/workflow/request/request-headers.d.ts +4 -0
  37. package/dist/legacy/workflow/request/request-headers.js +30 -0
  38. package/dist/legacy/workflow/request/request-url.d.ts +4 -0
  39. package/dist/legacy/workflow/request/request-url.js +34 -0
  40. package/dist/legacy/workflow/request/response-assertion-code.d.ts +3 -0
  41. package/dist/legacy/workflow/request/response-assertion-code.js +28 -0
  42. package/dist/legacy/workflow/request/sequence-url.d.ts +4 -0
  43. package/dist/legacy/workflow/request/sequence-url.js +104 -0
  44. package/dist/legacy-api.d.ts +25 -0
  45. package/dist/legacy-api.js +20 -0
  46. package/dist/nodes/common/validation/compile-standalone-validator.d.ts +3 -0
  47. package/dist/nodes/common/validation/compile-standalone-validator.js +44 -0
  48. package/dist/nodes/gap/create-gap-node.d.ts +3 -0
  49. package/dist/nodes/gap/create-gap-node.js +35 -0
  50. package/dist/nodes/inputs/compile-template-input-validators.d.ts +3 -0
  51. package/dist/nodes/inputs/compile-template-input-validators.js +26 -0
  52. package/dist/nodes/inputs/create-template-input-nodes.d.ts +4 -0
  53. package/dist/nodes/inputs/create-template-input-nodes.js +61 -0
  54. package/dist/nodes/native/arrays/create-array-node-fragment.d.ts +4 -0
  55. package/dist/nodes/native/arrays/create-array-node-fragment.js +42 -0
  56. package/dist/nodes/native/arrays/create-array-reader-code.d.ts +3 -0
  57. package/dist/nodes/native/arrays/create-array-reader-code.js +12 -0
  58. package/dist/nodes/native/arrays/create-bound-native-array-capability.d.ts +4 -0
  59. package/dist/nodes/native/arrays/create-bound-native-array-capability.js +81 -0
  60. package/dist/nodes/native/arrays/create-native-array-capability.d.ts +4 -0
  61. package/dist/nodes/native/arrays/create-native-array-capability.js +12 -0
  62. package/dist/nodes/native/arrays/native-array-definition.d.ts +2 -0
  63. package/dist/nodes/native/arrays/native-array-definition.js +27 -0
  64. package/dist/nodes/native/common/create-material-planning-capability.d.ts +4 -0
  65. package/dist/nodes/native/common/create-material-planning-capability.js +14 -0
  66. package/dist/nodes/native/common/create-native-fragment.d.ts +2 -0
  67. package/dist/nodes/native/common/create-native-fragment.js +10 -0
  68. package/dist/nodes/native/common/define-material-bound-capability.d.ts +4 -0
  69. package/dist/nodes/native/common/define-material-bound-capability.js +33 -0
  70. package/dist/nodes/native/common/resolve-native-runtime-source.d.ts +3 -0
  71. package/dist/nodes/native/common/resolve-native-runtime-source.js +15 -0
  72. package/dist/nodes/native/common/response-reference-bindings.d.ts +4 -0
  73. package/dist/nodes/native/common/response-reference-bindings.js +15 -0
  74. package/dist/nodes/native/common/response-references.d.ts +3 -0
  75. package/dist/nodes/native/common/response-references.js +5 -0
  76. package/dist/nodes/native/create-exclusive-branch-merge-capability.d.ts +3 -0
  77. package/dist/nodes/native/create-exclusive-branch-merge-capability.js +43 -0
  78. package/dist/nodes/native/create-json-output-capability.d.ts +3 -0
  79. package/dist/nodes/native/create-json-output-capability.js +48 -0
  80. package/dist/nodes/native/create-native-capabilities.d.ts +2 -0
  81. package/dist/nodes/native/create-native-capabilities.js +15 -0
  82. package/dist/nodes/native/create-pass-through-capability.d.ts +3 -0
  83. package/dist/nodes/native/create-pass-through-capability.js +32 -0
  84. package/dist/nodes/native/create-response-array-capability.d.ts +3 -0
  85. package/dist/nodes/native/create-response-array-capability.js +78 -0
  86. package/dist/nodes/native/create-response-collection-capability.d.ts +3 -0
  87. package/dist/nodes/native/create-response-collection-capability.js +134 -0
  88. package/dist/nodes/native/if-capability.d.ts +2 -0
  89. package/dist/nodes/native/if-capability.js +80 -0
  90. package/dist/nodes/native/inputs/native-input-runtime.bundle.js +24 -0
  91. package/dist/nodes/native/inputs/prepend-native-parameter-guard.d.ts +4 -0
  92. package/dist/nodes/native/inputs/prepend-native-parameter-guard.js +52 -0
  93. package/dist/nodes/native/item-join/create-bound-item-join-capability.d.ts +3 -0
  94. package/dist/nodes/native/item-join/create-bound-item-join-capability.js +169 -0
  95. package/dist/nodes/native/item-join/create-item-join-capability.d.ts +4 -0
  96. package/dist/nodes/native/item-join/create-item-join-capability.js +10 -0
  97. package/dist/nodes/native/item-join/create-item-join-reader-code.d.ts +2 -0
  98. package/dist/nodes/native/item-join/create-item-join-reader-code.js +18 -0
  99. package/dist/nodes/native/item-join/item-join-definition.d.ts +2 -0
  100. package/dist/nodes/native/item-join/item-join-definition.js +33 -0
  101. package/dist/nodes/native/item-join/runtime/item-join-runtime.bundle.js +24 -0
  102. package/dist/nodes/native/item-join/runtime/join-api-items.d.ts +3 -0
  103. package/dist/nodes/native/item-join/runtime/join-api-items.js +37 -0
  104. package/dist/nodes/native/merge-append-capability.d.ts +2 -0
  105. package/dist/nodes/native/merge-append-capability.js +33 -0
  106. package/dist/nodes/native/registry/native-feature-definitions.d.ts +4 -0
  107. package/dist/nodes/native/registry/native-feature-definitions.js +93 -0
  108. package/dist/nodes/native/registry/native-feature-material-requirements.d.ts +3 -0
  109. package/dist/nodes/native/registry/native-feature-material-requirements.js +10 -0
  110. package/dist/nodes/native/registry/resolve-n8n-native-features.d.ts +3 -0
  111. package/dist/nodes/native/registry/resolve-n8n-native-features.js +6 -0
  112. package/dist/nodes/native/registry/resolve-n8n-native-planning-features.d.ts +3 -0
  113. package/dist/nodes/native/registry/resolve-n8n-native-planning-features.js +5 -0
  114. package/dist/nodes/native/registry/resolve-native-feature-registry.d.ts +3 -0
  115. package/dist/nodes/native/registry/resolve-native-feature-registry.js +99 -0
  116. package/dist/nodes/native/registry/validate-native-feature-context.d.ts +2 -0
  117. package/dist/nodes/native/registry/validate-native-feature-context.js +46 -0
  118. package/dist/nodes/native/response-array-definition.d.ts +2 -0
  119. package/dist/nodes/native/response-array-definition.js +27 -0
  120. package/dist/nodes/native/response-assertion-capability.d.ts +2 -0
  121. package/dist/nodes/native/response-assertion-capability.js +57 -0
  122. package/dist/nodes/native/response-check-code.d.ts +3 -0
  123. package/dist/nodes/native/response-check-code.js +65 -0
  124. package/dist/nodes/native/response-checks/create-response-check-guard.d.ts +4 -0
  125. package/dist/nodes/native/response-checks/create-response-check-guard.js +22 -0
  126. package/dist/nodes/native/response-checks/create-response-check-reader.d.ts +3 -0
  127. package/dist/nodes/native/response-checks/create-response-check-reader.js +23 -0
  128. package/dist/nodes/native/response-collection-definition.d.ts +2 -0
  129. package/dist/nodes/native/response-collection-definition.js +27 -0
  130. package/dist/nodes/native/stop-and-error-capability.d.ts +2 -0
  131. package/dist/nodes/native/stop-and-error-capability.js +43 -0
  132. package/dist/nodes/request/authentication/credential-field-name.d.ts +1 -0
  133. package/dist/nodes/request/authentication/credential-field-name.js +3 -0
  134. package/dist/nodes/request/authentication/resolve-http-request-authentication.d.ts +2 -0
  135. package/dist/nodes/request/authentication/resolve-http-request-authentication.js +42 -0
  136. package/dist/nodes/request/bindings/compile-native-output-validators.d.ts +3 -0
  137. package/dist/nodes/request/bindings/compile-native-output-validators.js +12 -0
  138. package/dist/nodes/request/bindings/compile-request-validator.d.ts +3 -0
  139. package/dist/nodes/request/bindings/compile-request-validator.js +13 -0
  140. package/dist/nodes/request/bindings/compile-source-response-validators.d.ts +2 -0
  141. package/dist/nodes/request/bindings/compile-source-response-validators.js +12 -0
  142. package/dist/nodes/request/bindings/create-bound-request-fragment.d.ts +3 -0
  143. package/dist/nodes/request/bindings/create-bound-request-fragment.js +82 -0
  144. package/dist/nodes/request/bindings/create-output-item-reader-code.d.ts +2 -0
  145. package/dist/nodes/request/bindings/create-output-item-reader-code.js +7 -0
  146. package/dist/nodes/request/bindings/create-output-reader-code.d.ts +3 -0
  147. package/dist/nodes/request/bindings/create-output-reader-code.js +26 -0
  148. package/dist/nodes/request/bindings/resolve-output-binding-sources.d.ts +3 -0
  149. package/dist/nodes/request/bindings/resolve-output-binding-sources.js +36 -0
  150. package/dist/nodes/request/create-http-request-node.d.ts +2 -0
  151. package/dist/nodes/request/create-http-request-node.js +73 -0
  152. package/dist/nodes/request/deployment/create-request-deployment-notes.d.ts +2 -0
  153. package/dist/nodes/request/deployment/create-request-deployment-notes.js +3 -0
  154. package/dist/nodes/request/deployment/resolve-http-request-deployment.d.ts +2 -0
  155. package/dist/nodes/request/deployment/resolve-http-request-deployment.js +33 -0
  156. package/dist/nodes/request/finalize-http-request-fragment.d.ts +3 -0
  157. package/dist/nodes/request/finalize-http-request-fragment.js +22 -0
  158. package/dist/nodes/request/resolve-http-request-node-configuration.d.ts +4 -0
  159. package/dist/nodes/request/resolve-http-request-node-configuration.js +41 -0
  160. package/dist/nodes/request/response/create-http-response-decoder.d.ts +4 -0
  161. package/dist/nodes/request/response/create-http-response-decoder.js +57 -0
  162. package/dist/nodes/request/response/decode-http-response.d.ts +3 -0
  163. package/dist/nodes/request/response/decode-http-response.js +42 -0
  164. package/dist/nodes/request/response/http-response-media.d.ts +2 -0
  165. package/dist/nodes/request/response/http-response-media.js +32 -0
  166. package/dist/nodes/request/response/http-response-node-name.d.ts +2 -0
  167. package/dist/nodes/request/response/http-response-node-name.js +4 -0
  168. package/dist/nodes/request/response/response-runtime.bundle.js +24 -0
  169. package/dist/nodes/request/runtime/materialize-http-request.d.ts +4 -0
  170. package/dist/nodes/request/runtime/materialize-http-request.js +35 -0
  171. package/dist/nodes/request/runtime/request-runtime.bundle.js +24 -0
  172. package/dist/nodes/request/serialization/create-serialized-http-request-node.d.ts +3 -0
  173. package/dist/nodes/request/serialization/create-serialized-http-request-node.js +17 -0
  174. package/dist/nodes/request/serialization/serialize-http-request.d.ts +5 -0
  175. package/dist/nodes/request/serialization/serialize-http-request.js +70 -0
  176. package/dist/public-api.d.ts +43 -0
  177. package/dist/public-api.js +26 -0
  178. package/dist/schemas/batch-execution-schema.d.ts +15 -0
  179. package/dist/schemas/batch-execution-schema.js +14 -0
  180. package/dist/schemas/create-native-comparison-planning-schema.d.ts +81 -0
  181. package/dist/schemas/create-native-comparison-planning-schema.js +36 -0
  182. package/dist/schemas/exclusive-branch-merge-schema.d.ts +4 -0
  183. package/dist/schemas/exclusive-branch-merge-schema.js +7 -0
  184. package/dist/schemas/item-join-schema.d.ts +13 -0
  185. package/dist/schemas/item-join-schema.js +26 -0
  186. package/dist/schemas/native-array-schema.d.ts +11 -0
  187. package/dist/schemas/native-array-schema.js +19 -0
  188. package/dist/schemas/native-capability-schemas.d.ts +100 -0
  189. package/dist/schemas/native-capability-schemas.js +62 -0
  190. package/dist/schemas/native-feature-registry-schema.d.ts +17 -0
  191. package/dist/schemas/native-feature-registry-schema.js +8 -0
  192. package/dist/schemas/native-runtime-input-schema.d.ts +5 -0
  193. package/dist/schemas/native-runtime-input-schema.js +5 -0
  194. package/dist/schemas/request-deployment-schema.d.ts +9 -0
  195. package/dist/schemas/request-deployment-schema.js +27 -0
  196. package/dist/schemas/response-array-schema.d.ts +11 -0
  197. package/dist/schemas/response-array-schema.js +19 -0
  198. package/dist/schemas/response-collection-schema.d.ts +11 -0
  199. package/dist/schemas/response-collection-schema.js +19 -0
  200. package/dist/schemas/template-deployment-selection-schema.d.ts +3 -0
  201. package/dist/schemas/template-deployment-selection-schema.js +10 -0
  202. package/dist/schemas/workflow-input-value-map-schema.d.ts +5 -0
  203. package/dist/schemas/workflow-input-value-map-schema.js +5 -0
  204. package/dist/schemas/workflow-template-schema.d.ts +11 -0
  205. package/dist/schemas/workflow-template-schema.js +10 -0
  206. package/dist/types/array-iteration.d.ts +8 -0
  207. package/dist/types/array-iteration.js +1 -0
  208. package/dist/types/array-split.d.ts +13 -0
  209. package/dist/types/array-split.js +1 -0
  210. package/dist/types/authentication.d.ts +14 -0
  211. package/dist/types/authentication.js +1 -0
  212. package/dist/types/batch-execution.d.ts +23 -0
  213. package/dist/types/batch-execution.js +1 -0
  214. package/dist/types/http-response-decoding.d.ts +16 -0
  215. package/dist/types/http-response-decoding.js +1 -0
  216. package/dist/types/item-join.d.ts +40 -0
  217. package/dist/types/item-join.js +1 -0
  218. package/dist/types/legacy/catalog-workflow.d.ts +37 -0
  219. package/dist/types/legacy/catalog-workflow.js +1 -0
  220. package/dist/types/legacy/inbound-workflow.d.ts +27 -0
  221. package/dist/types/legacy/inbound-workflow.js +1 -0
  222. package/dist/types/legacy/request-node.d.ts +23 -0
  223. package/dist/types/legacy/request-node.js +1 -0
  224. package/dist/types/legacy/request-workflow.d.ts +43 -0
  225. package/dist/types/legacy/request-workflow.js +1 -0
  226. package/dist/types/legacy/sequence-workflow.d.ts +57 -0
  227. package/dist/types/legacy/sequence-workflow.js +1 -0
  228. package/dist/types/native-array.d.ts +8 -0
  229. package/dist/types/native-array.js +1 -0
  230. package/dist/types/native-capability.d.ts +46 -0
  231. package/dist/types/native-capability.js +1 -0
  232. package/dist/types/native-feature-registry.d.ts +70 -0
  233. package/dist/types/native-feature-registry.js +14 -0
  234. package/dist/types/native-material-binding.d.ts +56 -0
  235. package/dist/types/native-material-binding.js +1 -0
  236. package/dist/types/native-runtime-parameters.d.ts +55 -0
  237. package/dist/types/native-runtime-parameters.js +1 -0
  238. package/dist/types/node-fragment.d.ts +51 -0
  239. package/dist/types/node-fragment.js +1 -0
  240. package/dist/types/output-binding-source.d.ts +27 -0
  241. package/dist/types/output-binding-source.js +1 -0
  242. package/dist/types/request-deployment.d.ts +17 -0
  243. package/dist/types/request-deployment.js +1 -0
  244. package/dist/types/request-materialization.d.ts +30 -0
  245. package/dist/types/request-materialization.js +1 -0
  246. package/dist/types/request-node-configuration.d.ts +13 -0
  247. package/dist/types/request-node-configuration.js +1 -0
  248. package/dist/types/response-check-compilation.d.ts +11 -0
  249. package/dist/types/response-check-compilation.js +1 -0
  250. package/dist/types/response-check-guard.d.ts +6 -0
  251. package/dist/types/response-check-guard.js +1 -0
  252. package/dist/types/response-collection.d.ts +7 -0
  253. package/dist/types/response-collection.js +1 -0
  254. package/dist/types/reviewable-workflow.d.ts +29 -0
  255. package/dist/types/reviewable-workflow.js +1 -0
  256. package/dist/types/schema-compilation.d.ts +5 -0
  257. package/dist/types/schema-compilation.js +1 -0
  258. package/dist/types/serialized-http-request.d.ts +4 -0
  259. package/dist/types/serialized-http-request.js +1 -0
  260. package/dist/types/workflow-compilation.d.ts +39 -0
  261. package/dist/types/workflow-compilation.js +1 -0
  262. package/dist/types/workflow-template.d.ts +121 -0
  263. package/dist/types/workflow-template.js +1 -0
  264. package/dist/utils/bundled-license-banner.d.ts +3 -0
  265. package/dist/utils/bundled-license-banner.js +32 -0
  266. package/dist/utils/javascript-json-literal.d.ts +2 -0
  267. package/dist/utils/javascript-json-literal.js +10 -0
  268. package/dist/utils/json-values-equal.cjs +24 -0
  269. package/dist/utils/json-values-equal.d.cts +1 -0
  270. package/dist/workflow/assemble-n8n-workflow.d.ts +2 -0
  271. package/dist/workflow/assemble-n8n-workflow.js +11 -0
  272. package/dist/workflow/batch/compile-batched-n8n-workflow.d.ts +3 -0
  273. package/dist/workflow/batch/compile-batched-n8n-workflow.js +36 -0
  274. package/dist/workflow/batch/create-batch-execution-scopes.d.ts +3 -0
  275. package/dist/workflow/batch/create-batch-execution-scopes.js +59 -0
  276. package/dist/workflow/batch/validate-batch-exclusive-rejoin.d.ts +3 -0
  277. package/dist/workflow/batch/validate-batch-exclusive-rejoin.js +49 -0
  278. package/dist/workflow/batch/validate-batch-item-flow.d.ts +3 -0
  279. package/dist/workflow/batch/validate-batch-item-flow.js +98 -0
  280. package/dist/workflow/build-n8n-workflow.d.ts +2 -0
  281. package/dist/workflow/build-n8n-workflow.js +140 -0
  282. package/dist/workflow/compile-native-material-fragments.d.ts +3 -0
  283. package/dist/workflow/compile-native-material-fragments.js +76 -0
  284. package/dist/workflow/compile-native-workflow-nodes.d.ts +3 -0
  285. package/dist/workflow/compile-native-workflow-nodes.js +25 -0
  286. package/dist/workflow/compile-planned-n8n-workflow.d.ts +3 -0
  287. package/dist/workflow/compile-planned-n8n-workflow.js +42 -0
  288. package/dist/workflow/compile-reviewable-n8n-workflow.d.ts +3 -0
  289. package/dist/workflow/compile-reviewable-n8n-workflow.js +92 -0
  290. package/dist/workflow/compile-validated-workflow-fragments.d.ts +3 -0
  291. package/dist/workflow/compile-validated-workflow-fragments.js +20 -0
  292. package/dist/workflow/compile-workflow-material-fragments.d.ts +4 -0
  293. package/dist/workflow/compile-workflow-material-fragments.js +18 -0
  294. package/dist/workflow/create-n8n-native-output-sources.d.ts +3 -0
  295. package/dist/workflow/create-n8n-native-output-sources.js +58 -0
  296. package/dist/workflow/entrypoint/manual-trigger.d.ts +4 -0
  297. package/dist/workflow/entrypoint/manual-trigger.js +16 -0
  298. package/dist/workflow/find-singleton-api-responses.d.ts +3 -0
  299. package/dist/workflow/find-singleton-api-responses.js +22 -0
  300. package/dist/workflow/inputs/compile-native-runtime-inputs.d.ts +5 -0
  301. package/dist/workflow/inputs/compile-native-runtime-inputs.js +129 -0
  302. package/dist/workflow/inputs/create-runtime-input-native-capabilities.d.ts +4 -0
  303. package/dist/workflow/inputs/create-runtime-input-native-capabilities.js +36 -0
  304. package/dist/workflow/resolve-n8n-native-materials.d.ts +2 -0
  305. package/dist/workflow/resolve-n8n-native-materials.js +16 -0
  306. package/dist/workflow/review/create-gap-review-content.d.ts +2 -0
  307. package/dist/workflow/review/create-gap-review-content.js +28 -0
  308. package/dist/workflow/review/create-gap-review-region.d.ts +2 -0
  309. package/dist/workflow/review/create-gap-review-region.js +23 -0
  310. package/dist/workflow/review/escape-review-markdown.d.ts +1 -0
  311. package/dist/workflow/review/escape-review-markdown.js +7 -0
  312. package/dist/workflow/review/gap-review-region-layout.d.ts +4 -0
  313. package/dist/workflow/review/gap-review-region-layout.js +21 -0
  314. package/dist/workflow/templates/compile-n8n-workflow-template.d.ts +3 -0
  315. package/dist/workflow/templates/compile-n8n-workflow-template.js +211 -0
  316. package/dist/workflow/templates/create-template-artifact-mapping.d.ts +2 -0
  317. package/dist/workflow/templates/create-template-artifact-mapping.js +58 -0
  318. package/dist/workflow/templates/create-template-gap-regions.d.ts +5 -0
  319. package/dist/workflow/templates/create-template-gap-regions.js +22 -0
  320. package/dist/workflow/templates/create-workflow-template-guide.d.ts +3 -0
  321. package/dist/workflow/templates/create-workflow-template-guide.js +44 -0
  322. package/dist/workflow/templates/prepare-template-api-fragments.d.ts +3 -0
  323. package/dist/workflow/templates/prepare-template-api-fragments.js +74 -0
  324. package/dist/workflow/templates/select-n8n-template-deployments.d.ts +3 -0
  325. package/dist/workflow/templates/select-n8n-template-deployments.js +12 -0
  326. package/dist/workflow/templates/workflow-template-identities.d.ts +5 -0
  327. package/dist/workflow/templates/workflow-template-identities.js +5 -0
  328. package/dist/workflow/validate-compiled-binding-sources.d.ts +4 -0
  329. package/dist/workflow/validate-compiled-binding-sources.js +40 -0
  330. package/dist/workflow/validate-node-fragments.d.ts +3 -0
  331. package/dist/workflow/validate-node-fragments.js +58 -0
  332. package/package.json +59 -4
@@ -0,0 +1,14 @@
1
+ import { defineMaterialBoundCapability } from './define-material-bound-capability.js';
2
+ /** A stable implementation definition, not a ready output contract or executable node. */
3
+ export function createMaterialPlanningCapability(definition, bind) {
4
+ function requireBinding() {
5
+ throw new Error(`Native feature ${definition.name} requires actual material contract binding before value references, output or compilation`);
6
+ }
7
+ return defineMaterialBoundCapability({
8
+ ...definition,
9
+ bindMaterialContracts: bind,
10
+ responseReferences: requireBinding,
11
+ outputSchema: requireBinding,
12
+ compile: requireBinding,
13
+ });
14
+ }
@@ -0,0 +1,2 @@
1
+ import type { N8nNodeFragment, N8nSdkNode } from '../../../types/node-fragment.js';
2
+ export declare function createNativeFragment(sdkNode: N8nSdkNode, inputs: string[], outputs: string[]): N8nNodeFragment;
@@ -0,0 +1,10 @@
1
+ export function createNativeFragment(sdkNode, inputs, outputs) {
2
+ return {
3
+ nodeId: sdkNode.id,
4
+ nodes: [sdkNode],
5
+ entry: sdkNode,
6
+ exit: sdkNode,
7
+ inputPorts: Object.fromEntries(inputs.map((port, index) => [port, index])),
8
+ outputPorts: Object.fromEntries(outputs.map((port, index) => [port, index])),
9
+ };
10
+ }
@@ -0,0 +1,4 @@
1
+ import type { MaterialBindableN8nCapability } from '../../../types/native-material-binding.js';
2
+ import type { N8nNativeCapability } from '../../../types/native-capability.js';
3
+ /** A material binder cannot silently discard a caller's different implementation or source receipt. */
4
+ export declare function defineMaterialBoundCapability(definition: MaterialBindableN8nCapability): N8nNativeCapability;
@@ -0,0 +1,33 @@
1
+ import { isDeepStrictEqual } from 'node:util';
2
+ /** A material binder cannot silently discard a caller's different implementation or source receipt. */
3
+ export function defineMaterialBoundCapability(definition) {
4
+ if (definition.materialRequirements !== undefined)
5
+ definition.materialRequirements = structuredClone(definition.materialRequirements);
6
+ const requirements = structuredClone(definition.materialRequirements);
7
+ if (definition.parameterReferenceSources !== undefined)
8
+ definition.parameterReferenceSources = structuredClone(definition.parameterReferenceSources);
9
+ const referenceSources = structuredClone(definition.parameterReferenceSources);
10
+ const bind = definition.bindMaterialContracts;
11
+ const fields = new Map(Object.entries(definition).filter(([key]) => key !== 'bindMaterialContracts' && key !== 'materialSources'));
12
+ const receipts = structuredClone(definition.materialSources);
13
+ definition.bindMaterialContracts = function (sources) {
14
+ const changed = [...fields]
15
+ .filter(([key, value]) => Reflect.get(this, key) !== value)
16
+ .map(([key]) => key);
17
+ const extra = Object.keys(this).filter((key) => key !== 'bindMaterialContracts' &&
18
+ key !== 'materialSources' &&
19
+ !fields.has(key));
20
+ if (!isDeepStrictEqual(this.materialSources, receipts))
21
+ changed.push('materialSources');
22
+ if (!isDeepStrictEqual(this.parameterReferenceSources, referenceSources) &&
23
+ !changed.includes('parameterReferenceSources'))
24
+ changed.push('parameterReferenceSources');
25
+ if (!isDeepStrictEqual(this.materialRequirements, requirements) &&
26
+ !changed.includes('materialRequirements'))
27
+ changed.push('materialRequirements');
28
+ if (changed.length || extra.length)
29
+ throw new Error(`Native material definition ${definition.name} changed ${[...changed, ...extra].join(', ')} without a coherent bindMaterialContracts implementation`);
30
+ return bind.call(this, sources);
31
+ };
32
+ return definition;
33
+ }
@@ -0,0 +1,3 @@
1
+ import type { ResolveNativeRuntimeSourceInput } from '../../../types/native-material-binding.js';
2
+ import type { N8nNativeOutputSource } from '../../../types/output-binding-source.js';
3
+ export declare function resolveNativeRuntimeSource(input: ResolveNativeRuntimeSourceInput): N8nNativeOutputSource;
@@ -0,0 +1,15 @@
1
+ import { isDeepStrictEqual } from 'node:util';
2
+ export function resolveNativeRuntimeSource(input) {
3
+ if (input.binding.kind === 'compiled' &&
4
+ !Array.isArray(input.compiledSources))
5
+ throw new Error(`Native ${input.consumerId}: compile.nativeOutputSources is required for the current material revision`);
6
+ const sources = input.binding.kind === 'provided'
7
+ ? input.binding.sources
8
+ : input.compiledSources;
9
+ const matches = sources.filter((source) => source.nodeId === input.contract.nodeId);
10
+ if (matches.length !== 1 ||
11
+ !matches[0].nodeName?.trim() ||
12
+ !isDeepStrictEqual(matches[0].schema, input.contract.schema))
13
+ throw new Error(`Native ${input.consumerId}: source ${input.contract.nodeId} requires exactly one matching actual compiled name/schema`);
14
+ return matches[0];
15
+ }
@@ -0,0 +1,4 @@
1
+ import type { WorkflowNativeReferenceBinding } from '@openapi-flow/core';
2
+ import type { NativeCheck } from '../../../types/native-capability.js';
3
+ /** The comparison implementation owns these operand locations. */
4
+ export declare function responseReferenceBindings(checks: NativeCheck[], prefix: string): WorkflowNativeReferenceBinding[];
@@ -0,0 +1,15 @@
1
+ /** The comparison implementation owns these operand locations. */
2
+ export function responseReferenceBindings(checks, prefix) {
3
+ return checks.flatMap((check, index) => ['left', 'right'].flatMap((side) => {
4
+ const operand = check[side];
5
+ return operand.source === 'response'
6
+ ? [
7
+ {
8
+ nodeIdPointer: `${prefix}/${index}/${side}/nodeId`,
9
+ valuePointer: `${prefix}/${index}/${side}/pointer`,
10
+ reference: { ...operand },
11
+ },
12
+ ]
13
+ : [];
14
+ }));
15
+ }
@@ -0,0 +1,3 @@
1
+ import type { WorkflowResponseReference } from '@openapi-flow/core';
2
+ import type { NativeCheck } from '../../../types/native-capability.js';
3
+ export declare function responseReferences(checks: NativeCheck[]): WorkflowResponseReference[];
@@ -0,0 +1,5 @@
1
+ export function responseReferences(checks) {
2
+ return checks
3
+ .flatMap((check) => [check.left, check.right])
4
+ .filter((operand) => operand.source === 'response');
5
+ }
@@ -0,0 +1,3 @@
1
+ import type { N8nNativeCapability } from '../../types/native-capability.js';
2
+ /** Separate semantic contract from the all-independent-inputs Merge capability. */
3
+ export declare function createExclusiveBranchMergeCapability(): N8nNativeCapability;
@@ -0,0 +1,43 @@
1
+ import { node } from '@n8n/workflow-sdk';
2
+ import { exclusiveBranchMergeParametersSchema } from '../../schemas/exclusive-branch-merge-schema.js';
3
+ import { createNativeFragment } from './common/create-native-fragment.js';
4
+ /** Separate semantic contract from the all-independent-inputs Merge capability. */
5
+ export function createExclusiveBranchMergeCapability() {
6
+ return {
7
+ name: 'rejoin-exclusive-branches',
8
+ description: 'Rejoin both alternative paths of one supplied IF instance using official Merge append. input1 and input2 each cover a distinct true/false path. Preserves existing items and ancestry; never creates an empty completion item. Both paths must return, including a skip path when no business call is required.',
9
+ parametersSchema: exclusiveBranchMergeParametersSchema,
10
+ parameterReferenceSources: ['exclusive-output'],
11
+ parameterReferenceBindings: (parameters) => [
12
+ {
13
+ nodeIdPointer: '/sourceNodeId',
14
+ reference: {
15
+ source: 'exclusive-output',
16
+ nodeId: exclusiveBranchMergeParametersSchema.parse(parameters).sourceNodeId,
17
+ },
18
+ },
19
+ ],
20
+ inputPorts: () => ['input1', 'input2'],
21
+ outputPorts: () => ['main'],
22
+ responseReferences: () => [],
23
+ waitsForAllInputs: false,
24
+ exclusiveOutputPorts: false,
25
+ rejoinsExclusiveOutputs: (parameters) => exclusiveBranchMergeParametersSchema.parse(parameters).sourceNodeId,
26
+ compile: ({ planned, position }) => {
27
+ const { sourceNodeId } = exclusiveBranchMergeParametersSchema.parse(planned.parameters);
28
+ return {
29
+ ...createNativeFragment(node({
30
+ type: 'n8n-nodes-base.merge',
31
+ version: 3.2,
32
+ config: {
33
+ id: planned.id,
34
+ name: planned.id,
35
+ position,
36
+ parameters: { mode: 'append', numberInputs: 2 },
37
+ },
38
+ }), ['input1', 'input2'], ['main']),
39
+ rejoinsExclusiveOutputs: sourceNodeId,
40
+ };
41
+ },
42
+ };
43
+ }
@@ -0,0 +1,3 @@
1
+ import type { CreateJsonOutputCapabilityInput, N8nNativeCapability } from '../../types/native-capability.js';
2
+ /** Explicit typed literals through Edit Fields JSON mode; no casts or mapping expressions. */
3
+ export declare function createJsonOutputCapability(input: CreateJsonOutputCapabilityInput): N8nNativeCapability;
@@ -0,0 +1,48 @@
1
+ import { node } from '@n8n/workflow-sdk';
2
+ import { z } from 'zod';
3
+ import { parseNativeNodeParameters } from '@openapi-flow/core';
4
+ import { javascriptJsonLiteral } from '../../utils/javascript-json-literal.js';
5
+ import { createNativeFragment } from './common/create-native-fragment.js';
6
+ import { prependNativeParameterGuard } from './inputs/prepend-native-parameter-guard.js';
7
+ /** Explicit typed literals through Edit Fields JSON mode; no casts or mapping expressions. */
8
+ export function createJsonOutputCapability(input) {
9
+ if (!input.name.trim() || !input.description.trim())
10
+ throw new Error('JSON output capability requires name and description');
11
+ const capability = {
12
+ ...input,
13
+ supportsRuntimeParameters: true,
14
+ inputPorts: () => ['main'],
15
+ outputPorts: () => ['main'],
16
+ responseReferences: () => [],
17
+ parameterReferenceSources: [],
18
+ parameterReferenceBindings: () => [],
19
+ waitsForAllInputs: false,
20
+ exclusiveOutputPorts: false,
21
+ outputSchema: () => z.toJSONSchema(input.parametersSchema, { io: 'output' }),
22
+ compile: (source) => {
23
+ const { planned, position } = source;
24
+ const jsonOutput = planned.runtimeParameters !== undefined
25
+ ? '={{ JSON.stringify($json) }}'
26
+ : `={{ ${javascriptJsonLiteral(parseNativeNodeParameters(planned, capability))} }}`;
27
+ const fragment = createNativeFragment(node({
28
+ type: 'n8n-nodes-base.set',
29
+ version: 3.4,
30
+ config: {
31
+ id: planned.id,
32
+ name: planned.id,
33
+ position,
34
+ parameters: {
35
+ mode: 'raw',
36
+ jsonOutput,
37
+ includeOtherFields: false,
38
+ options: { dotNotation: false },
39
+ },
40
+ },
41
+ }), ['main'], ['main']);
42
+ return planned.runtimeParameters !== undefined
43
+ ? prependNativeParameterGuard({ input: source, capability, fragment })
44
+ : fragment;
45
+ },
46
+ };
47
+ return capability;
48
+ }
@@ -0,0 +1,2 @@
1
+ import type { N8nNativeCapability, NativeItemExecutionOptions } from '../../types/native-capability.js';
2
+ export declare function createN8nNativeCapabilities(input?: NativeItemExecutionOptions): N8nNativeCapability[];
@@ -0,0 +1,15 @@
1
+ import { resolveN8nNativeFeatures } from './registry/resolve-n8n-native-features.js';
2
+ import { validateNativeFeatureContext } from './registry/validate-native-feature-context.js';
3
+ import { N8nNativeFeature } from '../../types/native-feature-registry.js';
4
+ export function createN8nNativeCapabilities(input = {}) {
5
+ validateNativeFeatureContext(input);
6
+ return resolveN8nNativeFeatures({
7
+ ...input,
8
+ features: [
9
+ N8nNativeFeature.If,
10
+ N8nNativeFeature.MergeAppend,
11
+ N8nNativeFeature.AssertResponses,
12
+ N8nNativeFeature.StopAndError,
13
+ ],
14
+ }).capabilities;
15
+ }
@@ -0,0 +1,3 @@
1
+ import type { N8nNativeCapability } from '../../types/native-capability.js';
2
+ /** An explicit identity step; never generate a request, value or completion item. */
3
+ export declare function createPassThroughCapability(): N8nNativeCapability;
@@ -0,0 +1,32 @@
1
+ import { node } from '@n8n/workflow-sdk';
2
+ import { passThroughParametersSchema } from '../../schemas/native-capability-schemas.js';
3
+ import { createNativeFragment } from './common/create-native-fragment.js';
4
+ /** An explicit identity step; never generate a request, value or completion item. */
5
+ export function createPassThroughCapability() {
6
+ return {
7
+ name: 'pass-through',
8
+ description: 'n8n No Operation: forward all input items unchanged with their original links. Main input/output, no configuration or new data. Can provide a common entry before a fan-out. This does not merge branches, collect results or replace a missing API.',
9
+ parametersSchema: passThroughParametersSchema,
10
+ parameterReferenceSources: [],
11
+ inputPorts: () => ['main'],
12
+ outputPorts: () => ['main'],
13
+ responseReferences: () => [],
14
+ parameterReferenceBindings: () => [],
15
+ waitsForAllInputs: false,
16
+ exclusiveOutputPorts: false,
17
+ compile: ({ planned, position }) => {
18
+ passThroughParametersSchema.parse(planned.parameters);
19
+ const fragment = createNativeFragment(node({
20
+ type: 'n8n-nodes-base.noOp',
21
+ version: 1,
22
+ config: {
23
+ id: planned.id,
24
+ name: planned.id,
25
+ position,
26
+ parameters: {},
27
+ },
28
+ }), ['main'], ['main']);
29
+ return { ...fragment, preservesInputItems: true };
30
+ },
31
+ };
32
+ }
@@ -0,0 +1,3 @@
1
+ import type { N8nNativeCapability } from '../../types/native-capability.js';
2
+ import type { CreateResponseArrayCapabilityInput } from '../../types/array-iteration.js';
3
+ export declare function createResponseArrayCapability(input: CreateResponseArrayCapabilityInput): N8nNativeCapability;
@@ -0,0 +1,78 @@
1
+ import { defineMaterialBoundCapability } from './common/define-material-bound-capability.js';
2
+ import { createResponseArrayItemSchema } from '@openapi-flow/core';
3
+ import { createResponseArrayParametersSchema } from '../../schemas/response-array-schema.js';
4
+ import { createArrayNodeFragment } from './arrays/create-array-node-fragment.js';
5
+ import { responseArrayDefinition } from './response-array-definition.js';
6
+ export function createResponseArrayCapability(input) {
7
+ if (input.itemMode !== undefined && input.itemMode !== 'linked')
8
+ throw new Error('response array capability: itemMode must be linked or omitted');
9
+ const linked = input.itemMode === 'linked';
10
+ const materials = new Map(input.materials.map((material) => [material.callId, material]));
11
+ if (!materials.size ||
12
+ materials.size !== input.materials.length ||
13
+ input.materials.some((material) => !material.callId.trim()))
14
+ throw new Error('response array capability requires unique API materials');
15
+ const parametersSchema = createResponseArrayParametersSchema([
16
+ ...materials.keys(),
17
+ ]);
18
+ function source(parameters) {
19
+ const material = materials.get(parameters.sourceNodeId);
20
+ if (!material)
21
+ throw new Error(`response array: unknown sourceNodeId ${parameters.sourceNodeId}`);
22
+ createResponseArrayItemSchema(material.operation, parameters.pointer);
23
+ return material;
24
+ }
25
+ return defineMaterialBoundCapability({
26
+ ...responseArrayDefinition,
27
+ parametersSchema,
28
+ materialSources: {
29
+ apiMaterials: structuredClone(input.materials),
30
+ nativeOutputs: [],
31
+ },
32
+ bindMaterialContracts: (sources) => createResponseArrayCapability({
33
+ materials: sources.apiMaterials,
34
+ itemMode: input.itemMode,
35
+ }),
36
+ responseReferences: (values) => {
37
+ const parameters = parametersSchema.parse(values);
38
+ source(parameters);
39
+ return [
40
+ {
41
+ source: 'response',
42
+ nodeId: parameters.sourceNodeId,
43
+ pointer: parameters.pointer,
44
+ },
45
+ ];
46
+ },
47
+ outputSchema: (values) => {
48
+ const parameters = parametersSchema.parse(values);
49
+ return {
50
+ type: 'object',
51
+ properties: {
52
+ item: createResponseArrayItemSchema(source(parameters).operation, parameters.pointer),
53
+ },
54
+ required: ['item'],
55
+ additionalProperties: false,
56
+ };
57
+ },
58
+ compile: ({ planned, position, apiNodeNames }) => {
59
+ const parameters = parametersSchema.parse(planned.parameters);
60
+ const material = source(parameters);
61
+ if (!Object.hasOwn(apiNodeNames, material.callId) ||
62
+ !apiNodeNames[material.callId].trim())
63
+ throw new Error(`apiNodeNames is missing ${material.callId}`);
64
+ return createArrayNodeFragment({
65
+ planned,
66
+ position,
67
+ parameters,
68
+ linked,
69
+ source: {
70
+ kind: 'api-response',
71
+ nodeId: material.callId,
72
+ nodeName: apiNodeNames[material.callId],
73
+ operation: material.operation,
74
+ },
75
+ });
76
+ },
77
+ });
78
+ }
@@ -0,0 +1,3 @@
1
+ import type { N8nNativeCapability } from '../../types/native-capability.js';
2
+ import type { CreateResponseCollectionCapabilityInput } from '../../types/response-collection.js';
3
+ export declare function createResponseCollectionCapability(input: CreateResponseCollectionCapabilityInput): N8nNativeCapability;
@@ -0,0 +1,134 @@
1
+ import { defineMaterialBoundCapability } from './common/define-material-bound-capability.js';
2
+ import { node } from '@n8n/workflow-sdk';
3
+ import { readFileSync } from 'node:fs';
4
+ import { createResponseValueSchema } from '@openapi-flow/core';
5
+ import { createResponseCollectionParametersSchema } from '../../schemas/response-collection-schema.js';
6
+ import { responseCollectionDefinition } from './response-collection-definition.js';
7
+ import { createOutputReaderCode } from '../request/bindings/create-output-reader-code.js';
8
+ import { javascriptJsonLiteral } from '../../utils/javascript-json-literal.js';
9
+ export function createResponseCollectionCapability(input) {
10
+ const materials = new Map(input.materials.map((material) => [material.callId, material]));
11
+ if (!materials.size ||
12
+ materials.size !== input.materials.length ||
13
+ input.materials.some((material) => !material.callId.trim()))
14
+ throw new Error('response collection capability requires unique API materials');
15
+ const parametersSchema = createResponseCollectionParametersSchema([
16
+ ...materials.keys(),
17
+ ]);
18
+ function source(parameters) {
19
+ const material = materials.get(parameters.sourceNodeId);
20
+ if (!material)
21
+ throw new Error(`response collection: unknown sourceNodeId ${parameters.sourceNodeId}`);
22
+ createResponseValueSchema(material.operation, parameters.pointer);
23
+ return material;
24
+ }
25
+ return defineMaterialBoundCapability({
26
+ ...responseCollectionDefinition,
27
+ parametersSchema,
28
+ materialSources: {
29
+ apiMaterials: structuredClone(input.materials),
30
+ nativeOutputs: [],
31
+ },
32
+ bindMaterialContracts: (sources) => createResponseCollectionCapability({ materials: sources.apiMaterials }),
33
+ responseReferences: (values) => {
34
+ const parameters = parametersSchema.parse(values);
35
+ source(parameters);
36
+ return [
37
+ {
38
+ source: 'response',
39
+ nodeId: parameters.sourceNodeId,
40
+ pointer: parameters.pointer,
41
+ },
42
+ ];
43
+ },
44
+ outputSchema: (values) => {
45
+ const parameters = parametersSchema.parse(values);
46
+ return {
47
+ type: 'object',
48
+ properties: {
49
+ items: {
50
+ type: 'array',
51
+ items: createResponseValueSchema(source(parameters).operation, parameters.pointer),
52
+ },
53
+ },
54
+ required: ['items'],
55
+ additionalProperties: false,
56
+ };
57
+ },
58
+ compile: ({ planned, position, apiNodeNames }) => {
59
+ const parameters = parametersSchema.parse(planned.parameters);
60
+ const material = source(parameters);
61
+ if (!Object.hasOwn(apiNodeNames, material.callId) ||
62
+ !apiNodeNames[material.callId].trim())
63
+ throw new Error(`apiNodeNames is missing ${material.callId}`);
64
+ const runtime = readFileSync(new URL('../request/runtime/request-runtime.bundle.js', import.meta.url), 'utf8');
65
+ const read = createOutputReaderCode([
66
+ {
67
+ kind: 'api-response',
68
+ nodeId: material.callId,
69
+ nodeName: apiNodeNames[material.callId],
70
+ operation: material.operation,
71
+ },
72
+ ], true);
73
+ const extract = node({
74
+ type: 'n8n-nodes-base.code',
75
+ version: 2,
76
+ config: {
77
+ id: `${planned.id}-read-values`,
78
+ name: `Read values ${planned.id}`,
79
+ position,
80
+ parameters: {
81
+ mode: 'runOnceForAllItems',
82
+ jsCode: `${runtime}\nconst parameters=${javascriptJsonLiteral(parameters)};\nreturn $input.all().map((_,inputIndex)=>{${read}\nconst value=OpenApiFlowRequestRuntime.pointerValue(responses[parameters.sourceNodeId],parameters.pointer);if(value===undefined)throw new Error('Missing response pointer '+parameters.sourceNodeId+parameters.pointer);return {json:{value},pairedItem:{item:inputIndex}};});`,
83
+ },
84
+ },
85
+ });
86
+ const aggregate = node({
87
+ type: 'n8n-nodes-base.aggregate',
88
+ version: 1,
89
+ config: {
90
+ id: planned.id,
91
+ name: planned.id,
92
+ position: [position[0] + 220, position[1]],
93
+ parameters: {
94
+ aggregate: 'aggregateIndividualFields',
95
+ fieldsToAggregate: {
96
+ fieldToAggregate: [
97
+ {
98
+ fieldToAggregate: 'value',
99
+ renameField: true,
100
+ outputFieldName: 'items',
101
+ },
102
+ ],
103
+ },
104
+ options: {
105
+ disableDotNotation: true,
106
+ mergeLists: false,
107
+ keepMissing: true,
108
+ includeBinaries: false,
109
+ },
110
+ },
111
+ },
112
+ });
113
+ return {
114
+ nodeId: planned.id,
115
+ bindingSources: [
116
+ {
117
+ kind: 'api-response',
118
+ nodeId: material.callId,
119
+ nodeName: apiNodeNames[material.callId],
120
+ operation: material.operation,
121
+ },
122
+ ],
123
+ nodes: [extract, aggregate],
124
+ entry: extract,
125
+ exit: aggregate,
126
+ inputPorts: { main: 0 },
127
+ outputPorts: { main: 0 },
128
+ internalEdges: [
129
+ { from: extract.id, output: 0, to: aggregate.id, input: 0 },
130
+ ],
131
+ };
132
+ },
133
+ });
134
+ }
@@ -0,0 +1,2 @@
1
+ import type { N8nNativeCapability, NativeItemExecutionOptions } from '../../types/native-capability.js';
2
+ export declare function createIfCapability(input?: NativeItemExecutionOptions): N8nNativeCapability;
@@ -0,0 +1,80 @@
1
+ import { node } from '@n8n/workflow-sdk';
2
+ import { ifParametersSchema } from '../../schemas/native-capability-schemas.js';
3
+ import { createIfPlanningParametersSchema } from '../../schemas/create-native-comparison-planning-schema.js';
4
+ import { createNativeFragment } from './common/create-native-fragment.js';
5
+ import { responseReferences } from './common/response-references.js';
6
+ import { responseReferenceBindings } from './common/response-reference-bindings.js';
7
+ import { conditionExpression } from './response-check-code.js';
8
+ import { createResponseCheckReader } from './response-checks/create-response-check-reader.js';
9
+ import { createResponseCheckGuard } from './response-checks/create-response-check-guard.js';
10
+ export function createIfCapability(input = {}) {
11
+ return {
12
+ name: 'if',
13
+ description: 'n8n IF: main input; true and false OUTPUT PORTS are mutually exclusive. Multiple edges from the SAME port all execute (fan-out) and can be joined. Type-strict declarative conditions.',
14
+ parametersSchema: ifParametersSchema,
15
+ parameterReferenceSources: ['response'],
16
+ createPlanningParametersSchema: createIfPlanningParametersSchema,
17
+ inputPorts: () => ['main'],
18
+ outputPorts: () => ['true', 'false'],
19
+ responseReferences: (parameters) => responseReferences(ifParametersSchema.parse(parameters).conditions),
20
+ parameterReferenceBindings: (parameters) => responseReferenceBindings(ifParametersSchema.parse(parameters).conditions, '/conditions'),
21
+ waitsForAllInputs: false,
22
+ exclusiveOutputPorts: true,
23
+ compile: ({ planned, apiNodeNames, apiResponseContracts, singletonApiResponseIds, position, }) => {
24
+ const parameters = ifParametersSchema.parse(planned.parameters);
25
+ const reader = createResponseCheckReader({
26
+ nodeId: planned.id,
27
+ checks: parameters.conditions,
28
+ apiNodeNames,
29
+ apiResponseContracts,
30
+ singletonApiResponseIds,
31
+ linked: input.itemMode === 'linked',
32
+ });
33
+ const fragment = createNativeFragment(node({
34
+ type: 'n8n-nodes-base.if',
35
+ version: 2.2,
36
+ config: {
37
+ id: planned.id,
38
+ name: planned.id,
39
+ position,
40
+ parameters: {
41
+ conditions: {
42
+ options: {
43
+ caseSensitive: true,
44
+ leftValue: '',
45
+ typeValidation: 'strict',
46
+ version: 2,
47
+ },
48
+ conditions: parameters.conditions.map((check, index) => ({
49
+ id: `${planned.id}-${index}`,
50
+ leftValue: conditionExpression(check, apiNodeNames, input.itemMode === 'linked', singletonApiResponseIds),
51
+ rightValue: true,
52
+ operator: { type: 'boolean', operation: 'equals' },
53
+ })),
54
+ combinator: parameters.combinator,
55
+ },
56
+ options: {},
57
+ },
58
+ },
59
+ }), ['main'], ['true', 'false']);
60
+ const partition = { ...fragment, partitionsInputItems: true };
61
+ if (!reader.bindingSources.length)
62
+ return partition;
63
+ const guard = createResponseCheckGuard({
64
+ nodeId: planned.id,
65
+ readerCode: reader.code,
66
+ linked: input.itemMode === 'linked',
67
+ position,
68
+ });
69
+ return {
70
+ ...partition,
71
+ entry: guard,
72
+ nodes: [guard, ...fragment.nodes],
73
+ internalEdges: [
74
+ { from: guard.id, output: 0, to: fragment.entry.id, input: 0 },
75
+ ],
76
+ bindingSources: reader.bindingSources,
77
+ };
78
+ },
79
+ };
80
+ }
@@ -0,0 +1,24 @@
1
+ /*! MIT License
2
+
3
+ Copyright (c) 2026 carefreelife98
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
22
+ */
23
+ var OpenApiFlowNativeInputRuntime;
24
+ (()=>{function f(e){if(e==="")return[];if(!e.startsWith("/")||/~(?![01])/u.test(e))throw new Error(`Invalid JSON Pointer: ${e}`);return e.slice(1).split("/").map(i=>i.replaceAll("~1","/").replaceAll("~0","~"))}function l(e){if(Array.isArray(e))return e.map(l);if(e===null||typeof e!="object")return e;let i=Object.create(null);for(let[c,r]of Object.entries(e))i[c]=l(r);return i}function y(e){let i=f(e.pointer);if(!i.length)throw new Error(`${e.source} must identify a JSON field`);let c=l(e.values),r=c;for(let[o,t]of i.entries()){if(Array.isArray(r)&&(!/^(0|[1-9][0-9]*)$/.test(t)||Number(t)>r.length))throw new Error(`${e.source} ${e.pointer} requires an explicit complete array prefix`);if(o===i.length-1){if(Object.hasOwn(r,t))throw new Error(`${e.source} conflicts with existing value at ${e.pointer}`);Reflect.set(r,t,l(e.value))}else{if(!Object.hasOwn(r,t)){let a="/"+i.slice(0,o+1).map(s=>s.replaceAll("~","~0").replaceAll("/","~1")).join("/");Reflect.set(r,t,e.containerKind(a)==="array"?[]:Object.create(null))}let n=Reflect.get(r,t);if(n===null||typeof n!="object")throw new Error(`${e.source} traverses non-container ${e.pointer}`);r=n}}return JSON.parse(JSON.stringify(c))}function d(e,i){let c=l(e.parameters),r=[...e.inputs].sort((o,t)=>{let n=f(o.targetPointer),a=f(t.targetPointer);for(let s=0;s<Math.min(n.length,a.length);s++)if(n[s]!==a[s])return/^(0|[1-9][0-9]*)$/.test(n[s])&&/^(0|[1-9][0-9]*)$/.test(a[s])?Number(n[s])-Number(a[s]):n[s].localeCompare(a[s]);return n.length-a.length});for(let o of r){if(!Object.hasOwn(i,o.id))throw new Error(`Missing native runtime input ${o.id} for ${e.nodeId}${o.targetPointer}`);let t=i[o.id];if(o.targetPointer===""){if(r.length!==1||Object.keys(c).length||t===null||typeof t!="object"||Array.isArray(t))throw new Error(`Native runtime input ${e.nodeId} must be an exclusive JSON parameter object`);c=l(t)}else c=y({values:c,pointer:o.targetPointer,value:t,source:`Native runtime input ${e.nodeId}`,containerKind(n){if(!Object.hasOwn(o.containerKinds,n))throw new Error(`Native runtime input ${e.nodeId} has no declared container at ${n}`);return o.containerKinds[n]}})}return c}OpenApiFlowNativeInputRuntime={materializeNativeRuntimeParameters:d};})();
@@ -0,0 +1,4 @@
1
+ import type { PrependNativeParameterGuardInput } from '../../../types/native-runtime-parameters.js';
2
+ import type { N8nNodeFragment } from '../../../types/node-fragment.js';
3
+ /** Validate the unchanged declared parameter object again immediately before the native node. */
4
+ export declare function prependNativeParameterGuard({ input, capability, fragment, }: PrependNativeParameterGuardInput): N8nNodeFragment;