@n8n/instance-ai 1.24.4 → 1.25.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 (270) hide show
  1. package/README.md +2 -3
  2. package/dist/agent/credential-guardrails.prompt.d.ts +1 -0
  3. package/dist/agent/credential-guardrails.prompt.js +2 -1
  4. package/dist/agent/credential-guardrails.prompt.js.map +1 -1
  5. package/dist/agent/instance-agent.js +11 -18
  6. package/dist/agent/instance-agent.js.map +1 -1
  7. package/dist/agent/shared-prompts.d.ts +2 -2
  8. package/dist/agent/shared-prompts.js +2 -2
  9. package/dist/agent/shared-prompts.js.map +1 -1
  10. package/dist/agent/sub-agent-factory.d.ts +1 -1
  11. package/dist/agent/sub-agent-factory.js +2 -1
  12. package/dist/agent/sub-agent-factory.js.map +1 -1
  13. package/dist/agent/system-prompt.d.ts +1 -0
  14. package/dist/agent/system-prompt.js +29 -4
  15. package/dist/agent/system-prompt.js.map +1 -1
  16. package/dist/build.tsbuildinfo +1 -1
  17. package/dist/constants/max-steps.d.ts +0 -1
  18. package/dist/constants/max-steps.js +0 -1
  19. package/dist/constants/max-steps.js.map +1 -1
  20. package/dist/debug/sanitize-debug-snapshot.js +3 -3
  21. package/dist/debug/sanitize-debug-snapshot.js.map +1 -1
  22. package/dist/error-formatting.js +5 -12
  23. package/dist/error-formatting.js.map +1 -1
  24. package/dist/index.d.ts +5 -10
  25. package/dist/index.js +10 -9
  26. package/dist/index.js.map +1 -1
  27. package/dist/knowledge-base/materialize-knowledge-base.js +24 -16
  28. package/dist/knowledge-base/materialize-knowledge-base.js.map +1 -1
  29. package/dist/mcp/mcp-client-manager.js +3 -4
  30. package/dist/mcp/mcp-client-manager.js.map +1 -1
  31. package/dist/runtime/background-task-manager.js +5 -5
  32. package/dist/runtime/background-task-manager.js.map +1 -1
  33. package/dist/runtime/resumable-stream-executor.js +2 -3
  34. package/dist/runtime/resumable-stream-executor.js.map +1 -1
  35. package/dist/runtime/run-state-registry.js +1 -1
  36. package/dist/runtime/run-state-registry.js.map +1 -1
  37. package/dist/skills/materialize-runtime-skills.js +30 -23
  38. package/dist/skills/materialize-runtime-skills.js.map +1 -1
  39. package/dist/skills/runtime-skills.d.ts +1 -0
  40. package/dist/skills/runtime-skills.js +11 -0
  41. package/dist/skills/runtime-skills.js.map +1 -1
  42. package/dist/skills/skill-gates.d.ts +2 -0
  43. package/dist/skills/skill-gates.js +4 -1
  44. package/dist/skills/skill-gates.js.map +1 -1
  45. package/dist/storage/workflow-loop-storage.d.ts +550 -0
  46. package/dist/storage/workflow-loop-storage.js +31 -1
  47. package/dist/storage/workflow-loop-storage.js.map +1 -1
  48. package/dist/stream/consume-with-hitl.d.ts +0 -28
  49. package/dist/stream/consume-with-hitl.js +0 -50
  50. package/dist/stream/consume-with-hitl.js.map +1 -1
  51. package/dist/tools/activity.tool.d.ts +2 -0
  52. package/dist/tools/activity.tool.js +102 -0
  53. package/dist/tools/activity.tool.js.map +1 -0
  54. package/dist/tools/credentials.tool.js +5 -3
  55. package/dist/tools/credentials.tool.js.map +1 -1
  56. package/dist/tools/executions.tool.js +47 -10
  57. package/dist/tools/executions.tool.js.map +1 -1
  58. package/dist/tools/filesystem/create-tools-from-mcp-server.js +1 -0
  59. package/dist/tools/filesystem/create-tools-from-mcp-server.js.map +1 -1
  60. package/dist/tools/index.d.ts +1 -1
  61. package/dist/tools/index.js +45 -55
  62. package/dist/tools/index.js.map +1 -1
  63. package/dist/tools/n8n-docs/schemas.js +1 -1
  64. package/dist/tools/n8n-docs/schemas.js.map +1 -1
  65. package/dist/tools/n8n-docs.tool.d.ts +2 -1
  66. package/dist/tools/n8n-docs.tool.js +11 -3
  67. package/dist/tools/n8n-docs.tool.js.map +1 -1
  68. package/dist/tools/orchestration/agent-persistence.d.ts +0 -12
  69. package/dist/tools/orchestration/agent-persistence.js +0 -34
  70. package/dist/tools/orchestration/agent-persistence.js.map +1 -1
  71. package/dist/tools/orchestration/build-agent.tool.js +3 -3
  72. package/dist/tools/orchestration/build-agent.tool.js.map +1 -1
  73. package/dist/tools/orchestration/complete-checkpoint.tool.js +1 -1
  74. package/dist/tools/orchestration/complete-checkpoint.tool.js.map +1 -1
  75. package/dist/tools/orchestration/plan.tool.js +5 -1
  76. package/dist/tools/orchestration/plan.tool.js.map +1 -1
  77. package/dist/tools/orchestration/report-verification-verdict.tool.js +7 -1
  78. package/dist/tools/orchestration/report-verification-verdict.tool.js.map +1 -1
  79. package/dist/tools/orchestration/tracing-utils.d.ts +1 -6
  80. package/dist/tools/orchestration/tracing-utils.js +0 -99
  81. package/dist/tools/orchestration/tracing-utils.js.map +1 -1
  82. package/dist/tools/orchestration/verification/analyze-result.d.ts +5 -0
  83. package/dist/tools/orchestration/verification/analyze-result.js +27 -5
  84. package/dist/tools/orchestration/verification/analyze-result.js.map +1 -1
  85. package/dist/tools/orchestration/verification/claim.d.ts +14 -0
  86. package/dist/tools/orchestration/verification/claim.js +52 -0
  87. package/dist/tools/orchestration/verification/claim.js.map +1 -0
  88. package/dist/tools/orchestration/verification/finalize-result.d.ts +5 -2
  89. package/dist/tools/orchestration/verification/finalize-result.js +21 -25
  90. package/dist/tools/orchestration/verification/finalize-result.js.map +1 -1
  91. package/dist/tools/orchestration/verification/resolve-target.js +39 -15
  92. package/dist/tools/orchestration/verification/resolve-target.js.map +1 -1
  93. package/dist/tools/orchestration/verification/resolved-parameter-warnings.d.ts +58 -0
  94. package/dist/tools/orchestration/verification/resolved-parameter-warnings.js +127 -0
  95. package/dist/tools/orchestration/verification/resolved-parameter-warnings.js.map +1 -0
  96. package/dist/tools/orchestration/verification/scripted-gate-run.d.ts +3 -0
  97. package/dist/tools/orchestration/verification/scripted-gate-run.js +22 -2
  98. package/dist/tools/orchestration/verification/scripted-gate-run.js.map +1 -1
  99. package/dist/tools/orchestration/verification/types.d.ts +8 -1
  100. package/dist/tools/orchestration/verify-built-workflow.tool.d.ts +3 -0
  101. package/dist/tools/orchestration/verify-built-workflow.tool.js +141 -18
  102. package/dist/tools/orchestration/verify-built-workflow.tool.js.map +1 -1
  103. package/dist/tools/research.tool.js +3 -2
  104. package/dist/tools/research.tool.js.map +1 -1
  105. package/dist/tools/task-control.tool.js +8 -1
  106. package/dist/tools/task-control.tool.js.map +1 -1
  107. package/dist/tools/tool-ids.d.ts +1 -3
  108. package/dist/tools/tool-ids.js +2 -3
  109. package/dist/tools/tool-ids.js.map +1 -1
  110. package/dist/tools/web-research/sanitize-web-content.d.ts +1 -2
  111. package/dist/tools/web-research/sanitize-web-content.js +6 -19
  112. package/dist/tools/web-research/sanitize-web-content.js.map +1 -1
  113. package/dist/tools/workflows/build-workflow.tool.d.ts +12 -0
  114. package/dist/tools/workflows/build-workflow.tool.js +158 -12
  115. package/dist/tools/workflows/build-workflow.tool.js.map +1 -1
  116. package/dist/tools/workflows/detect-unparseable-openai-schema.js +1 -1
  117. package/dist/tools/workflows/detect-unparseable-openai-schema.js.map +1 -1
  118. package/dist/tools/workflows/detect-wrong-kind-locator.js +7 -9
  119. package/dist/tools/workflows/detect-wrong-kind-locator.js.map +1 -1
  120. package/dist/tools/workflows/reconcile-simulation-plan.js +1 -1
  121. package/dist/tools/workflows/reconcile-simulation-plan.js.map +1 -1
  122. package/dist/tools/workflows/resolve-credentials.js.map +1 -1
  123. package/dist/tools/workflows/setup-items.d.ts +5 -0
  124. package/dist/tools/workflows/setup-items.js +29 -0
  125. package/dist/tools/workflows/setup-items.js.map +1 -1
  126. package/dist/tools/workflows/setup-panel-state.d.ts +31 -0
  127. package/dist/tools/workflows/setup-panel-state.js +197 -0
  128. package/dist/tools/workflows/setup-panel-state.js.map +1 -0
  129. package/dist/tools/workflows/setup-workflow.service.d.ts +3 -1
  130. package/dist/tools/workflows/setup-workflow.service.js +20 -13
  131. package/dist/tools/workflows/setup-workflow.service.js.map +1 -1
  132. package/dist/tools/workflows/validate-workflow.service.js.map +1 -1
  133. package/dist/tools/workflows/wait-gate-script.js +1 -1
  134. package/dist/tools/workflows/wait-gate-script.js.map +1 -1
  135. package/dist/tools/workflows/workflow-build-reporting.d.ts +1 -0
  136. package/dist/tools/workflows/workflow-build-reporting.js +1 -0
  137. package/dist/tools/workflows/workflow-build-reporting.js.map +1 -1
  138. package/dist/tools/workflows/workflow-build-telemetry.d.ts +5 -1
  139. package/dist/tools/workflows/workflow-build-telemetry.js +8 -0
  140. package/dist/tools/workflows/workflow-build-telemetry.js.map +1 -1
  141. package/dist/tools/workflows/workflow-file-bindings.js +0 -2
  142. package/dist/tools/workflows/workflow-file-bindings.js.map +1 -1
  143. package/dist/tools/workflows/workflow-source-compiler.js +80 -25
  144. package/dist/tools/workflows/workflow-source-compiler.js.map +1 -1
  145. package/dist/tools/workflows/workflow-validation-warnings.d.ts +13 -2
  146. package/dist/tools/workflows/workflow-validation-warnings.js +55 -1
  147. package/dist/tools/workflows/workflow-validation-warnings.js.map +1 -1
  148. package/dist/tools/workflows.tool.d.ts +1 -5
  149. package/dist/tools/workflows.tool.js +112 -136
  150. package/dist/tools/workflows.tool.js.map +1 -1
  151. package/dist/tracing/langsmith-tracing.d.ts +10 -22
  152. package/dist/tracing/langsmith-tracing.js +106 -110
  153. package/dist/tracing/langsmith-tracing.js.map +1 -1
  154. package/dist/tracing/sandbox-tracing.d.ts +17 -0
  155. package/dist/tracing/sandbox-tracing.js +60 -0
  156. package/dist/tracing/sandbox-tracing.js.map +1 -0
  157. package/dist/tracing/trace-payloads.d.ts +1 -0
  158. package/dist/tracing/trace-payloads.js +17 -4
  159. package/dist/tracing/trace-payloads.js.map +1 -1
  160. package/dist/tracing/trace-replay.js.map +1 -1
  161. package/dist/types.d.ts +53 -66
  162. package/dist/types.js.map +1 -1
  163. package/dist/utils/eval-agents.js +3 -7
  164. package/dist/utils/eval-agents.js.map +1 -1
  165. package/dist/utils/generate-validated-json.js +2 -6
  166. package/dist/utils/generate-validated-json.js.map +1 -1
  167. package/dist/workflow-loop/guidance.d.ts +1 -0
  168. package/dist/workflow-loop/guidance.js +48 -4
  169. package/dist/workflow-loop/guidance.js.map +1 -1
  170. package/dist/workflow-loop/render-claim.d.ts +6 -0
  171. package/dist/workflow-loop/render-claim.js +61 -0
  172. package/dist/workflow-loop/render-claim.js.map +1 -0
  173. package/dist/workflow-loop/setup-verification-policy.d.ts +3 -1
  174. package/dist/workflow-loop/setup-verification-policy.js +38 -0
  175. package/dist/workflow-loop/setup-verification-policy.js.map +1 -1
  176. package/dist/workflow-loop/verification-obligation.d.ts +1 -0
  177. package/dist/workflow-loop/verification-obligation.js +47 -14
  178. package/dist/workflow-loop/verification-obligation.js.map +1 -1
  179. package/dist/workflow-loop/verification-progress.d.ts +62 -0
  180. package/dist/workflow-loop/verification-progress.js +64 -0
  181. package/dist/workflow-loop/verification-progress.js.map +1 -0
  182. package/dist/workflow-loop/workflow-loop-controller.js +2 -0
  183. package/dist/workflow-loop/workflow-loop-controller.js.map +1 -1
  184. package/dist/workflow-loop/workflow-loop-state.d.ts +993 -0
  185. package/dist/workflow-loop/workflow-loop-state.js +32 -1
  186. package/dist/workflow-loop/workflow-loop-state.js.map +1 -1
  187. package/dist/workflow-loop/workflow-task-service.d.ts +6 -1
  188. package/dist/workflow-loop/workflow-task-service.js +86 -6
  189. package/dist/workflow-loop/workflow-task-service.js.map +1 -1
  190. package/dist/workspace/lazy-runtime-workspace.js +57 -9
  191. package/dist/workspace/lazy-runtime-workspace.js.map +1 -1
  192. package/dist/workspace/prebaked-workspace-bundle.js +93 -58
  193. package/dist/workspace/prebaked-workspace-bundle.js.map +1 -1
  194. package/dist/workspace/sandbox-fs.js +56 -32
  195. package/dist/workspace/sandbox-fs.js.map +1 -1
  196. package/dist/workspace/sandbox-setup.js +65 -52
  197. package/dist/workspace/sandbox-setup.js.map +1 -1
  198. package/dist/workspace/workspace-files.js +76 -57
  199. package/dist/workspace/workspace-files.js.map +1 -1
  200. package/knowledge-base/reference/workflow-builder-guardrails.md +4 -2
  201. package/package.json +10 -10
  202. package/skills/agent-builder/SKILL.md +15 -6
  203. package/skills/credential-recipe-research/SKILL.md +1 -1
  204. package/skills/debugging-executions/SKILL.md +24 -0
  205. package/skills/instance-awareness/SKILL.md +122 -0
  206. package/skills/intent-recognition/SKILL.md +83 -49
  207. package/skills/n8n-docs-assistant/SKILL.md +5 -9
  208. package/skills/planned-task-runtime/SKILL.md +2 -2
  209. package/skills/post-build-flow/SKILL.md +173 -23
  210. package/skills/workflow-builder/SKILL.md +45 -21
  211. package/dist/agent/sub-agent-briefing.d.ts +0 -20
  212. package/dist/agent/sub-agent-briefing.js +0 -39
  213. package/dist/agent/sub-agent-briefing.js.map +0 -1
  214. package/dist/tools/evals/analyze-agent-input-columns.service.d.ts +0 -6
  215. package/dist/tools/evals/analyze-agent-input-columns.service.js +0 -17
  216. package/dist/tools/evals/analyze-agent-input-columns.service.js.map +0 -1
  217. package/dist/tools/evals/apply-pin-data.service.d.ts +0 -3
  218. package/dist/tools/evals/apply-pin-data.service.js +0 -19
  219. package/dist/tools/evals/apply-pin-data.service.js.map +0 -1
  220. package/dist/tools/evals/column-ref-utils.d.ts +0 -20
  221. package/dist/tools/evals/column-ref-utils.js +0 -274
  222. package/dist/tools/evals/column-ref-utils.js.map +0 -1
  223. package/dist/tools/evals/describe-metric-for-workflow.service.d.ts +0 -6
  224. package/dist/tools/evals/describe-metric-for-workflow.service.js +0 -90
  225. package/dist/tools/evals/describe-metric-for-workflow.service.js.map +0 -1
  226. package/dist/tools/evals/detect-agent-named-refs.service.d.ts +0 -9
  227. package/dist/tools/evals/detect-agent-named-refs.service.js +0 -83
  228. package/dist/tools/evals/detect-agent-named-refs.service.js.map +0 -1
  229. package/dist/tools/evals/detect-ai-nodes.d.ts +0 -7
  230. package/dist/tools/evals/detect-ai-nodes.js +0 -75
  231. package/dist/tools/evals/detect-ai-nodes.js.map +0 -1
  232. package/dist/tools/evals/detect-tool-refs.service.d.ts +0 -7
  233. package/dist/tools/evals/detect-tool-refs.service.js +0 -66
  234. package/dist/tools/evals/detect-tool-refs.service.js.map +0 -1
  235. package/dist/tools/evals/ensure-eval-data-table.service.d.ts +0 -15
  236. package/dist/tools/evals/ensure-eval-data-table.service.js +0 -83
  237. package/dist/tools/evals/ensure-eval-data-table.service.js.map +0 -1
  238. package/dist/tools/evals/eval-data-requirements.service.d.ts +0 -20
  239. package/dist/tools/evals/eval-data-requirements.service.js +0 -187
  240. package/dist/tools/evals/eval-data-requirements.service.js.map +0 -1
  241. package/dist/tools/evals/evals.tool.d.ts +0 -45
  242. package/dist/tools/evals/evals.tool.js +0 -454
  243. package/dist/tools/evals/evals.tool.js.map +0 -1
  244. package/dist/tools/evals/extract-rows-from-history.service.d.ts +0 -17
  245. package/dist/tools/evals/extract-rows-from-history.service.js +0 -103
  246. package/dist/tools/evals/extract-rows-from-history.service.js.map +0 -1
  247. package/dist/tools/evals/format-eval-setup-task.d.ts +0 -16
  248. package/dist/tools/evals/format-eval-setup-task.js +0 -167
  249. package/dist/tools/evals/format-eval-setup-task.js.map +0 -1
  250. package/dist/tools/evals/generate-sample-rows.service.d.ts +0 -35
  251. package/dist/tools/evals/generate-sample-rows.service.js +0 -259
  252. package/dist/tools/evals/generate-sample-rows.service.js.map +0 -1
  253. package/dist/tools/evals/generate-tool-ref-pin-data.service.d.ts +0 -11
  254. package/dist/tools/evals/generate-tool-ref-pin-data.service.js +0 -112
  255. package/dist/tools/evals/generate-tool-ref-pin-data.service.js.map +0 -1
  256. package/dist/tools/evals/metric-catalog.d.ts +0 -63
  257. package/dist/tools/evals/metric-catalog.js +0 -81
  258. package/dist/tools/evals/metric-catalog.js.map +0 -1
  259. package/dist/tools/orchestration/eval-data-agent.tool.d.ts +0 -2
  260. package/dist/tools/orchestration/eval-data-agent.tool.js +0 -184
  261. package/dist/tools/orchestration/eval-data-agent.tool.js.map +0 -1
  262. package/dist/tools/orchestration/eval-setup-agent.prompt.d.ts +0 -1
  263. package/dist/tools/orchestration/eval-setup-agent.prompt.js +0 -238
  264. package/dist/tools/orchestration/eval-setup-agent.prompt.js.map +0 -1
  265. package/dist/tools/orchestration/eval-setup-agent.tool.d.ts +0 -31
  266. package/dist/tools/orchestration/eval-setup-agent.tool.js +0 -204
  267. package/dist/tools/orchestration/eval-setup-agent.tool.js.map +0 -1
  268. package/dist/tools/workflows/observed-workflow-checksums.d.ts +0 -4
  269. package/dist/tools/workflows/observed-workflow-checksums.js +0 -82
  270. package/dist/tools/workflows/observed-workflow-checksums.js.map +0 -1
@@ -33,6 +33,50 @@ For trigger `inputData` shapes, read
33
33
  the sandbox workspace when available, or load this skill's
34
34
  `references/trigger-input-data-shapes.md` linked file.
35
35
 
36
+ ## Setup panel
37
+
38
+ Use this section when the system prompt describes the persistent setup panel,
39
+ setup returns `announced: true`, or the current user input contains
40
+ `<workflow-test-request>`. Otherwise, keep the setup card flow below.
41
+
42
+ - Verify what the build can simulate before asking the user to finish setup.
43
+ Missing credentials do not prevent this verification. Report which outputs
44
+ were simulated. A simulated result does not prove a live connection.
45
+ - When setup returns `announced: true`, summarize the open items and any
46
+ validation warnings. End the turn. The user can complete setup in the panel
47
+ while chat stays available. Do not wait, poll, or open a trigger-test card.
48
+ - On a later user turn, trust `<workflow-setup-state>` over earlier setup
49
+ results. If items settled, none remain open, and there are no validation
50
+ warnings, verify the current saved configuration with `verify-built-workflow`.
51
+ It refreshes the credential plan.
52
+ Report remaining simulations or connection failures. Do not claim live
53
+ success from the earlier build result.
54
+ - `<workflow-test-request>` in the current user input means the user clicked
55
+ Execute. A block in conversation history does not request another execution.
56
+ Use the workflow ID in the current block. Inspect its current
57
+ `<workflow-setup-state>` and read the saved workflow with
58
+ `workflows(action="get-as-code")`. Do not call `workflows(action="setup")`
59
+ for this precheck. It announces setup and ends the turn. If the target is
60
+ absent from the state block, inspect its saved configuration. If required
61
+ setup cannot be confirmed, report what is missing and end the turn.
62
+ If required items remain open for this
63
+ workflow, report them and end the turn without a live run. Otherwise,
64
+ use `executions(action="run")` with suitable trigger input. The user has
65
+ already requested this test; do not ask whether they want it. The execution
66
+ tool still enforces its approval policy. Do not publish the workflow to test it.
67
+ - Read the execution output and summarize what ran and what it returned. For
68
+ failures, inspect `executions(action="debug")`. Fix the same workflow when
69
+ possible. Use the current saved source so panel edits are preserved. Report
70
+ unresolved setup or failures in chat. Before another live run, inspect the
71
+ successful effect nodes from the failed run. Follow
72
+ [Cleaning up after a live test](#cleaning-up-after-a-live-test) for any artifacts
73
+ they left behind. After a repair and that artifact check, test the updated
74
+ workflow and inspect its output. Do not substitute mocked verification
75
+ for the requested execution.
76
+
77
+ A setup card that was already open keeps its apply and trigger-test resume
78
+ flow. Its result is not a panel announcement unless it has `announced: true`.
79
+
36
80
  ## Verification follow-up
37
81
 
38
82
  When the current message contains `<workflow-verification-follow-up>`, verify
@@ -41,14 +85,17 @@ obligation is `ready_to_verify` or `verifying`, call `verify-built-workflow`. Do
41
85
  **not** call `workflows(action="setup")` in this turn and do **not** declare the
42
86
  workflow finished if `outcome.setupRequirement.status === "required"` — setup is
43
87
  routed automatically as a separate `<workflow-setup-required>` step after
44
- verification.
88
+ verification. For a multi-trigger outcome, verify every trigger that does not
89
+ yet have a recorded successful verification. Make all of these calls in this turn.
45
90
 
46
91
  ## Setup follow-up
47
92
 
48
93
  When the current message contains `<workflow-setup-required>`, your first action
49
94
  is to call `workflows(action="setup")` with the `workflowId` from the payload. Do
50
95
  not verify, do not ask, do not write a message first — the inline setup card in
51
- the AI Assistant panel is the user-visible surface. If it returns `deferred:
96
+ the n8n Assistant panel is the user-visible surface. If the result has
97
+ `announced: true`, use the persistent panel instructions above and end the turn.
98
+ If it returns `deferred:
52
99
  true`, respect the user's choice and do not retry with any other setup tool.
53
100
  A result carrying `skippedByUser` names credentials the user already passed on:
54
101
  never re-open setup for those, in this turn or any later one — see
@@ -93,7 +140,7 @@ it has you fetch, never from memory:
93
140
  - `placeholders` — one entry per marker: `name`, user-facing `title`, an
94
141
  optional `info` clarifying the value itself — its format or which of the
95
142
  provider's tokens it is (e.g. "Starts with tvly-"). Never where to obtain
96
- it, and never a URL or domain: the user asks the AI Assistant for that from
143
+ it, and never a URL or domain: the user asks the n8n Assistant for that from
97
144
  the credential form. `type` is `password` unless clearly non-secret (at
98
145
  least one placeholder must stay `password`). Add `optional: true` only when
99
146
  the provider documents the value as optional (e.g. an org/region
@@ -101,7 +148,7 @@ it has you fetch, never from memory:
101
148
  omitted from the request.
102
149
  - `docsUrl` — the provider page where a logged-in user CREATES/COPIES the
103
150
  secret (e.g. `https://replicate.com/account/api-tokens`) — never the API
104
- reference. Not shown in the form: the AI Assistant help thread uses it to
151
+ reference. Not shown in the form: the n8n Assistant help thread uses it to
105
152
  send the user to the exact page. Found via the `credential-recipe-research`
106
153
  procedure; omit when it finds nothing conclusive.
107
154
  - `testUrl` — a documented side-effect-free GET that rejects a bad key with
@@ -193,6 +240,14 @@ workflow does not need to be active. Form, webhook, chat, and other event-based
193
240
  triggers are all testable while the workflow is unpublished. Never publish a
194
241
  workflow as a precondition for running it.
195
242
 
243
+ **Webhook input must carry the fields the workflow reads.** A flat `inputData`
244
+ becomes the request `body` only; `query`, `headers` and `params` stay empty. When
245
+ any expression reads `$json.query.*`, `$json.headers.*` or `$json.params.*`, pass
246
+ the request envelope `{ body: {...}, query: {...}, headers: {...}, params: {...} }` (or a
247
+ `fixtureOverrides` entry on the trigger node). Otherwise the field resolves empty,
248
+ the run still succeeds, and that field is unverified — say so instead of
249
+ reporting it as working.
250
+
196
251
  Do not proactively offer, recommend, or mention publishing until a successful
197
252
  execution has run every required node on the claimed path without mocked
198
253
  credentials, simulated node output, fixture overrides, or temporary pin data
@@ -201,6 +256,14 @@ publish-readiness evidence. If the user explicitly asks to publish before a
201
256
  live execution succeeds, warn that the live path remains untested, then follow
202
257
  the requested publish flow.
203
258
 
259
+ `workflows(action="publish")` enforces this. While the latest verification left
260
+ nodes unreached or simulated, the call is refused and returns
261
+ `verificationDisclosure` — the coverage facts, generated from the run. Relay
262
+ those facts to the user and offer a live end-to-end test. Publish only if they
263
+ still ask, by calling publish again with `acknowledgeUnverified: true`. Never
264
+ set that flag to skip the disclosure. The user also sees the same facts in the
265
+ publish approval prompt, so a summary that contradicts them is visible to them.
266
+
204
267
  Execution evidence can come from a run you started or a run the user started.
205
268
  If the user says they ran the workflow manually, call
206
269
  `executions(action="list", workflowId)`, identify the relevant run, and inspect
@@ -210,7 +273,7 @@ when the inspected result confirms success and that every required node on the
210
273
  claimed path ran. Do not count it if mocked, simulated, fixture, or pinned output
211
274
  was used. You may offer publishing after that confirmation.
212
275
 
213
- For workflows produced by `build-workflow`, **always verify with
276
+ For post-build verification of workflows produced by `build-workflow`, **always verify with
214
277
  `verify-built-workflow`, never with raw `executions(action="run")`.** It reuses
215
278
  the build outcome simulation plan, mocked credentials, and temporary pin data, so
216
279
  destructive nodes are pinned and it is safe to call repeatedly. A raw
@@ -250,17 +313,43 @@ For a workflow with more than one trigger (`triggerNodes` has multiple entries),
250
313
  entry in `triggerNodes`. Naming no trigger verifies only the auto-detected
251
314
  one. An unresolvable name is rejected outright, so a rejected call means the
252
315
  name is wrong — re-read `triggerNodes`, never fall back to editing.
253
- - Each pass covers its own trigger's branch, so its `nodesNotReached` will list
254
- the other triggers' nodes. That is expected, not a defect: coverage is the
255
- **union** across passes. Only treat a node as unverified once no pass reached
256
- it.
257
- - Report per-trigger coverage — name each trigger and whether its branch ran.
258
- Claim the workflow is verified only when every trigger's branch has a
259
- successful pass.
316
+ - Each pass reports `nodesNotReached` only for its selected trigger's main-flow
317
+ branch. Coverage is the **union** across successful passes. Run every trigger
318
+ before you report a workflow coverage gap. Different triggers can select
319
+ different outputs of a shared Switch or If node.
320
+ - A failed rerun removes that trigger's earlier coverage. Verify that trigger
321
+ again before you claim that the workflow is verified.
322
+ - Report each trigger and whether its branch ran. Use the combined `claim` to
323
+ describe the result (see "Claiming success").
260
324
  - When the user asked for a live run, pass `triggerNodeName` to
261
325
  `executions(action="run")` the same way — one run per trigger — and report
262
326
  each branch's result.
263
327
 
328
+ ### Fixing a workflow that is already published
329
+
330
+ The publishing rules above assume a new workflow. A repair of a workflow that
331
+ is already published is different. That workflow runs in production right now,
332
+ and it runs the version published before your fix. Your save creates a draft,
333
+ and the draft is not live. The published version keeps running, broken, until
334
+ somebody publishes the fix.
335
+
336
+ For a repair on a published workflow:
337
+
338
+ - Telling the user the fix is not live yet is not an offer to publish. Say it.
339
+ - Do NOT report the workflow as fixed, live, running, or working in production
340
+ while the published version is the older one. Say the fix is in the draft.
341
+ - `verify-built-workflow` returns `claim.liveState`. `live-stale` means the
342
+ published version is older than the draft you just verified. The result also
343
+ carries `liveStateNote`. Relay it.
344
+ - Without a claim, call `workflows(action="get", workflowId)` and compare
345
+ `versionId` (the draft) with `activeVersionId` (the published version). They
346
+ differ while the fix is not live. A null `activeVersionId` means the workflow
347
+ is not published at all.
348
+ - Ask whether to publish the fix. Publish only after the user agrees.
349
+ - Name the version in a retest invitation: the draft, or the published version.
350
+ "Send another email to test it" is wrong when the fix is still a draft — the
351
+ test would run the broken version and look like the fix failed.
352
+
264
353
  ## After build-workflow succeeds
265
354
 
266
355
  1. Read `workflowId`, `workItemId`, `triggerNodes`, `verificationReadiness`,
@@ -276,16 +365,23 @@ For a workflow with more than one trigger (`triggerNodes` has multiple entries),
276
365
  `workflow-builder` skill and patch the same workflow with `build-workflow`
277
366
  using the existing `workflowId` and `workItemId`; then inspect and verify
278
367
  again.
279
- - If `verificationReadiness.status === "already_verified"`, treat the
280
- workflow as verified and do **not** call `verify-built-workflow` again.
368
+ - If `verificationReadiness.status === "already_verified"`, do not repeat
369
+ automatic verification. Read the saved claim before describing the workflow
370
+ as verified. For tracked multi-trigger builds, follow the verification
371
+ obligation until every trigger has a successful pass.
281
372
 
282
373
  - If `verificationReadiness.status === "ready"`, call
283
374
  `verify-built-workflow` with the `workflowId`, the `workItemId` when you
284
375
  have it, and the trigger-appropriate `inputData` shape. When `triggerNodes`
285
376
  has more than one entry, call it once per trigger with `triggerNodeName`.
286
- - If `verificationReadiness.status === "needs_setup"`, call
287
- `workflows(action="setup")` with the workflowId so the user can configure it
288
- through the inline setup card in the AI Assistant panel.
377
+ - If `verificationReadiness.status === "needs_setup"` and the persistent setup
378
+ panel is enabled, first try `verify-built-workflow` when verification has not
379
+ run. It can verify simulated paths or report that a simulation plan is
380
+ unavailable. Then announce setup with `workflows(action="setup")`. Do not use
381
+ a live execution to work around a blocker.
382
+ - If `verificationReadiness.status === "needs_setup"` and the persistent setup
383
+ panel is disabled, call `workflows(action="setup")` with the workflow ID.
384
+ The user configures the workflow through the inline setup card.
289
385
  - If `verificationReadiness.status === "not_verifiable"`, do not infer
290
386
  lower-level verification conditions; use the readiness guidance to give a
291
387
  clear warning or manual-test note. This is a warning completion state, not
@@ -317,10 +413,26 @@ For a workflow with more than one trigger (`triggerNodes` has multiple entries),
317
413
  budget is exhausted.
318
414
  - Relay `simulationNote` (nodes whose output was simulated) to the user
319
415
  whenever it is present.
416
+ - Read `resolvedParameterWarnings`. A simulated node's preview is fixture
417
+ data: it never proves an expression resolved. Each warning names a
418
+ parameter that resolved to empty or threw on the real input — the usual
419
+ causes are a trigger input that lacks the field (body-only webhook input
420
+ for a `$json.query.*` expression) or a wrong expression. Fix the input
421
+ shape or the expression, re-run, and never report that field as working
422
+ while a warning stands. Each warning carries the execution ID that was
423
+ checked. Use that ID with `executions(action="get-resolved-node-parameters")`
424
+ to inspect the same input.
425
+ - Read `skippedParameterChecks`. These nodes have unchecked dynamic fields.
426
+ The list shows at most 20 checks. `skippedParameterCheckCount` includes
427
+ omitted checks, which also leave dynamic fields unverified.
428
+ State that limitation even if the run succeeded and no parameter warnings
429
+ were returned. Do not request parameter values when sharing is disabled.
320
430
  3. After verification handling, if `setupRequirement.status === "required"` and
321
431
  setup has not already run for this build, call `workflows(action="setup")`
322
432
  with the workflowId.
323
- 4. When `workflows(action="setup")` opens the inline setup card, the card is the
433
+ 4. When `workflows(action="setup")` returns `announced: true`, summarize the
434
+ panel state and end the turn. The live-test follow-up waits for a later user
435
+ turn or Execute request. When the tool opens the inline setup card, the card is the
324
436
  user-visible surface. Do not tell the user to open the editor, use the canvas,
325
437
  or click a Setup button; the user does not need to navigate anywhere.
326
438
  5. When `workflows(action="setup")` returns `deferred: true`, or reports
@@ -350,7 +462,9 @@ For a workflow with more than one trigger (`triggerNodes` has multiple entries),
350
462
  proved it works end-to-end with full coverage.
351
463
  9. Only call `workflows(action="publish")` when the user explicitly asks to
352
464
  publish. Never publish automatically or proactively offer publishing before
353
- the publish-readiness requirement above is met.
465
+ the publish-readiness requirement above is met. A repair of a workflow that
466
+ is already published is the exception — follow
467
+ [Fixing a workflow that is already published](#fixing-a-workflow-that-is-already-published).
354
468
  10. After a direct new primary workflow is successfully published, follow
355
469
  [Error workflow follow-up](#error-workflow-follow-up).
356
470
  Do not replace this explicit opt-in with a generic "add
@@ -417,6 +531,9 @@ After workflow setup completes or is applied, if the latest verification for
417
531
  that workflow used mocked credentials, simulated node output, fixture overrides,
418
532
  temporary pin data, or another mocked input, ask whether the user wants a live
419
533
  test without mocks. Ask only about the live test. Do not run it automatically.
534
+ An explicit test request in the current user input, including
535
+ `<workflow-test-request>`, already answers
536
+ this question. Run the requested test through `executions(action="run")`.
420
537
  Do not offer publishing as an alternative or describe the workflow as ready to
421
538
  use or publish.
422
539
 
@@ -476,9 +593,39 @@ result.
476
593
 
477
594
  ## Claiming success
478
595
 
479
- Do not tell the user a workflow is "fixed", "verified", "tested", "working", or
480
- has "no errors" unless you have a passing `verify-built-workflow`,
481
- `executions(action="run")`, or inspected user-run execution that exercised the
596
+ For tracked multi-trigger builds, `claim` combines the saved successful passes.
597
+ A `verified` claim requires every trigger to pass and real coverage for every planned node.
598
+ Verify `claim.pendingTriggers` within the attempt limit. `nodesNotReached`
599
+ outside the claim describes only the current trigger's branch.
600
+
601
+ `verify-built-workflow` returns a `claim`, and its `level` decides what you may
602
+ say:
603
+
604
+ - `verified` — you may call the workflow verified, tested, or working.
605
+ - `partial`, `unproven`, or `failed` — you may NOT. Name what is unconfirmed
606
+ instead.
607
+
608
+ `claim.liveState` decides separately whether you may call the workflow live. A
609
+ run always executes the draft, so `verified` says nothing about production:
610
+
611
+ - `live-stale` — the published version is older than the draft you verified.
612
+ Do NOT call the workflow live, running, or working in production. Say the fix
613
+ is in the draft, and see
614
+ [Fixing a workflow that is already published](#fixing-a-workflow-that-is-already-published).
615
+ - `live-current` — the published version is the one you verified.
616
+ - `unpublished` — the workflow does not run in production at all.
617
+
618
+ **`success: true` does not mean verified.** It means the run ended without an
619
+ error, and a run with every write simulated also ends without an error. Read
620
+ `claim.level`, not `success`.
621
+
622
+ Nothing else tells the user how strong the claim is. Your message is the only
623
+ place they learn it, so name the unreached and simulated nodes yourself, and say
624
+ what stays unconfigured and what that means when the workflow runs.
625
+
626
+ Without a claim, do not tell the user a workflow is "fixed", "verified",
627
+ "tested", "working", or has "no errors" unless you have a passing
628
+ `executions(action="run")` or an inspected user-run execution that exercised the
482
629
  path being claimed. Do not call a workflow "ready to use" or "ready to publish"
483
630
  unless a passing execution met the publish-readiness requirement above. A
484
631
  successful `build-workflow`/save, a static `workflows(action="validate")`, or
@@ -489,7 +636,10 @@ applies to rows or records written to an external system: never make quantitativ
489
636
  claims ("22 rows written", "columns matched") that you did not read back from
490
637
  the effect node's actual output (`executions(action="get-node-output")`) or from
491
638
  the target system itself — a successful run status does not prove the _right
492
- data_ was written, only that nodes ran. If you could not run the
639
+ data_ was written, only that nodes ran. Output of a simulated or pinned node is
640
+ fixture data: never quote it as what the workflow produced, and never cite it as
641
+ proof that an expression resolved — use `resolvedParameterWarnings` or
642
+ `executions(action="get-resolved-node-parameters")` for that. If you could not run the
493
643
  failing path or inspect the artifact, say so plainly — "I couldn't verify X
494
644
  because Y" — and name what is unconfirmed. An honest "could not verify" beats an
495
645
  unverified success claim.
@@ -112,7 +112,7 @@ numbers, custom URLs, notification targets, chat IDs) and resource IDs where
112
112
  named none. Never hardcode fake values (`user@example.com`, `YOUR_API_KEY`,
113
113
  bearer tokens, sample channel/chat IDs or recipient lists) and never ask for
114
114
  setup values before the first successful build — placeholders cover them, and
115
- `workflows(action="setup")` opens an inline setup card in the AI
115
+ `workflows(action="setup")` opens an inline setup card in the n8n
116
116
  Assistant panel afterwards for the user to fill in.
117
117
  Do not replace concrete user-provided or discoverable values with
118
118
  placeholders: if the prompt gives a real URL, channel name, table name, label,
@@ -146,8 +146,7 @@ setup steps or node semantics from memory when those sources can answer.
146
146
  instead of improvising.
147
147
  3. **Official n8n docs** — for credential setup, product features, hosting, or
148
148
  node docs that the knowledge base does not cover, load `n8n-docs-assistant`
149
- then load `n8n-docs` via `load_tool` (search "n8n docs" if it is not
150
- visible) and call `n8n-docs`. Prefer docs over web search for n8n-specific
149
+ and call `n8n-docs`. Prefer docs over web search for n8n-specific
151
150
  questions.
152
151
 
153
152
  For workflows with multiple external systems, multiple requested effects,
@@ -217,6 +216,12 @@ follow its build → publish → assign steps.
217
216
  and later `fixtureOverrides` can exercise those scenarios. Do not simulate
218
217
  every external read by default; use this when branch coverage or deterministic
219
218
  proof depends on controlling the upstream data.
219
+ Decide grouping now, while writing the source: `.group(...)` lives in the code, so
220
+ it cannot be added after the build. See [Node Groups](#node-groups) for the
221
+ criteria, and reach a decision either way — groups declared, or this workflow does
222
+ not warrant them. When the canvas will be over the ceiling and no valid group can hold
223
+ the remaining nodes, pass `groupingDecision: 'not_warranted'` with a `groupingReason`
224
+ to `build-workflow`; without groups or that reason the build is refused.
220
225
  7. Before the first `build-workflow` (and again after substantive edits), run
221
226
  SDK validation on the workspace source file via
222
227
  `workspace_execute_command`:
@@ -586,8 +591,12 @@ unsolicited `sticky()`, forbidden builder constructs (e.g. `.map()`), and
586
591
  repeated `.onTrue()` / `.onFalse()` overwrites on the same IF variable. Fix
587
592
  every reported error and warning before calling `build-workflow`.
588
593
 
589
- - Avoid code node where possible, use n8n nodes that help do the same thing.
590
- If it makes it simpler, go ahead and use code node.
594
+ - Native node first: shape, compute, default or format fields with
595
+ **Edit Fields (Set)** and expressions (full JavaScript); **Filter**, **IF** /
596
+ **Switch**, **Sort**, **Remove Duplicates**, **Aggregate**, **Split Out**,
597
+ **Limit** and **Merge** cover the rest. A Code node is only for multi-pass
598
+ algorithms, `$getWorkflowStaticData` state, fence-stripping model output,
599
+ try/catch around upstream node access, or a step needing three or more nodes.
591
600
  - Write Code nodes in JavaScript unless the user explicitly asks for Python.
592
601
  `language: 'pythonNative'` runs a locked-down runner that defines only `_items`
593
602
  (all-items mode), `_item` (per-item mode) and `print()` — no `_('Node Name')`,
@@ -598,8 +607,8 @@ every reported error and warning before calling `build-workflow`.
598
607
  anything the runner would reject.
599
608
  - SDK builder code is a restricted subset of TypeScript that builds a static
600
609
  graph; it is not a Code node and does not run. Build strings with template
601
- literals; do runtime joining, aggregation, or transforms in a Code node or
602
- `expr()`. Full allowed/forbidden list:
610
+ literals; do runtime joining, aggregation, or transforms with `expr()` in a
611
+ native node. Full allowed/forbidden list and "Native node mappings" table:
603
612
  `${N8N_WORKSPACE_DIR}/knowledge-base/reference/workflow-sdk-language.md`.
604
613
  - Use `@n8n/workflow-sdk`.
605
614
  - Do not specify node positions. They are auto-calculated by the layout engine.
@@ -696,18 +705,14 @@ import {
696
705
 
697
706
  ## Node Groups
698
707
 
699
- Organise multi-stage workflows into named node groups — visual frames on the canvas — so the
700
- result is readable the first time the user sees it. Group each clear stage (ingest → transform
701
- → deliver); small workflows don't need groups. Give every group a one-sentence
702
- `description` — groups are collapsed by default, so name + description is what the user sees
703
- first.
708
+ {{GROUPING_GUIDANCE_PLACEHOLDER}}
704
709
 
705
- `.group(name, members, { description })` on the workflow builder; members are the node handles.
706
- Read `knowledge-base/reference/node-groups.md` for the exact rules (trigger nodes excluded,
707
- one connected section, AI sub-nodes stay with their Agent) before creating groups. Agent save
708
- tools drop an invalid group from the saved workflow and report a warning, so fix the source
709
- instead of re-emitting it. When editing an existing workflow, keep existing `.group(...)` calls
710
- and their descriptions intact unless the change is about grouping.
710
+ Declare a group with `.group(name, members, { description })` on the workflow builder; members
711
+ are the node handles. Before you emit a `.group(...)`, read
712
+ `${N8N_WORKSPACE_DIR}/knowledge-base/reference/node-groups.md` — it carries the rules that make
713
+ a group valid and the contract for editing an existing workflow's groups. Do not restate those
714
+ rules from memory: an invalid group is dropped from the saved workflow with a warning, so the
715
+ source has to be fixed rather than re-emitted.
711
716
 
712
717
  ## Workflow Rules
713
718
 
@@ -921,6 +926,13 @@ isImportant.onFalse(sendHolding);
921
926
  For Switch, wire cases the same way — `.to(switchNode).onCase(0, a).onCase(1, b)`
922
927
  or inline — using zero-based `.onCase(index, target)` for each rule output.
923
928
 
929
+ Error routes work the same way on any node: `.to(fetchNode).onError(notify)`
930
+ routes the error output and leaves the cursor on `fetchNode`, so a following
931
+ `.to(next)` continues the main branch and a second `.onError()` adds another
932
+ handler. The inline form `.to(fetchNode.onError(notify))` is equivalent. Both
933
+ forms set `onError: 'continueErrorOutput'` on the node for you. Call
934
+ `.onError()` once for each handler — it takes one handler, not an array.
935
+
924
936
  For Split in Batches, use it for per-item side effects and loop back with
925
937
  `nextBatch`. Do not add a separate IF gate just to check whether items exist.
926
938
 
@@ -938,8 +950,9 @@ For AI Agent workflows:
938
950
  - `placeholder('hint')`: marks a parameter value for user input (use directly as
939
951
  the parameter value; `workflow-sdk validate` flags wrapping it in `expr()`).
940
952
  - `.output(n)`: selects a zero-based output index.
941
- - `.onError(handler)`: connects a node's error output to a handler. Requires
942
- `onError: 'continueErrorOutput'` in the node config.
953
+ - `.onError(handler)`: connects a node's error output to a handler, on the node
954
+ or on the workflow builder. It sets `onError: 'continueErrorOutput'` on the
955
+ node, so you do not declare that in the config.
943
956
  - `nodeJson(node, 'field.path')`: creates an explicit expression reference to a
944
957
  specific node's JSON output.
945
958
  - Subnode factories follow the same pattern as `languageModel()` and `tool()`:
@@ -982,10 +995,21 @@ store its own public endpoint.
982
995
 
983
996
  ## Completion
984
997
 
998
+ Do not report a build as done until you have made the grouping decision described in
999
+ [Node Groups](#node-groups) and checked what the build did with it. A dropped-group warning
1000
+ names what was invalid — a duplicate name, a member that does not exist, a boundary the rules
1001
+ reject: fix what the warning reports and build again. A `GROUPING_DECISION_MISSING` error means
1002
+ the build was refused: fix the source, or pass the opt-out with a reason. A
1003
+ `GROUP_DROPPED_OVER_CEILING` error also refuses the build: a declared group was invalid and the
1004
+ canvas is still over the ceiling. Fix the boundary the message names — the opt-out does not
1005
+ apply. If the top level is still above
1006
+ {{TOP_LEVEL_ITEM_CEILING_PLACEHOLDER}} items with groups in place, name each remaining item and
1007
+ why it cannot join a group.
1008
+
985
1009
  For a successful build, finish with one concise sentence naming the workflow and
986
1010
  what changed. Include the workflow ID when it is available. If setup is
987
1011
  required, say plainly that setup is needed; do not tell the user to open a setup
988
- wizard or navigate away from the AI Assistant panel. When the workflow exposes
1012
+ wizard or navigate away from the n8n Assistant panel. When the workflow exposes
989
1013
  a Webhook, Form, or Chat Trigger, follow [Trigger URL Sharing](#trigger-url-sharing)
990
1014
  and include the correct end-user URL (or in-editor chat guidance) in that
991
1015
  summary.
@@ -1,20 +0,0 @@
1
- import { type IterationLog } from '../storage/iteration-log';
2
- export interface RunningTaskSummary {
3
- taskId: string;
4
- role: string;
5
- goal?: string;
6
- }
7
- export interface SubAgentBriefingInput {
8
- task: string;
9
- conversationContext?: string;
10
- artifacts?: Record<string, unknown>;
11
- additionalContext?: string;
12
- requirements?: string;
13
- iteration?: {
14
- log: IterationLog;
15
- threadId: string;
16
- taskKey: string;
17
- };
18
- runningTasks?: RunningTaskSummary[];
19
- }
20
- export declare function buildSubAgentBriefing(input: SubAgentBriefingInput): Promise<string>;
@@ -1,39 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.buildSubAgentBriefing = buildSubAgentBriefing;
4
- const iteration_log_1 = require("../storage/iteration-log");
5
- async function buildSubAgentBriefing(input) {
6
- const parts = [];
7
- parts.push(`<task>\n${input.task}\n</task>`);
8
- if (input.conversationContext) {
9
- parts.push(`<conversation-context>\n${input.conversationContext}\n</conversation-context>`);
10
- }
11
- if (input.artifacts && Object.keys(input.artifacts).length > 0) {
12
- parts.push(`<artifacts>\n${JSON.stringify(input.artifacts)}\n</artifacts>`);
13
- }
14
- if (input.additionalContext) {
15
- parts.push(input.additionalContext);
16
- }
17
- if (input.requirements) {
18
- parts.push(input.requirements);
19
- }
20
- if (input.runningTasks && input.runningTasks.length > 0) {
21
- const taskLines = input.runningTasks
22
- .map((t) => ` <running-task taskId="${t.taskId}" role="${t.role}">${t.goal ?? ''}</running-task>`)
23
- .join('\n');
24
- parts.push(`<thread-state>\n${taskLines}\n</thread-state>`);
25
- }
26
- if (input.iteration) {
27
- try {
28
- const entries = await input.iteration.log.getForTask(input.iteration.threadId, input.iteration.taskKey);
29
- const formatted = (0, iteration_log_1.formatPreviousAttempts)(entries);
30
- if (formatted) {
31
- parts.push(formatted);
32
- }
33
- }
34
- catch {
35
- }
36
- }
37
- return parts.join('\n\n');
38
- }
39
- //# sourceMappingURL=sub-agent-briefing.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sub-agent-briefing.js","sourceRoot":"","sources":["../../src/agent/sub-agent-briefing.ts"],"names":[],"mappings":";;;AAAA,4DAAqF;AAwC9E,KAAK,gCAAgC,KAA4B;IACvE,MAAM,KAAK,GAAa,EAAE,CAAC;IAG3B,KAAK,CAAC,IAAI,CAAC,WAAW,KAAK,CAAC,IAAI,WAAW,CAAC,CAAC;IAG7C,IAAI,KAAK,CAAC,mBAAmB,EAAE,CAAC;QAC/B,KAAK,CAAC,IAAI,CAAC,2BAA2B,KAAK,CAAC,mBAAmB,2BAA2B,CAAC,CAAC;IAC7F,CAAC;IAGD,IAAI,KAAK,CAAC,SAAS,IAAI,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAChE,KAAK,CAAC,IAAI,CAAC,gBAAgB,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,SAAS,CAAC,gBAAgB,CAAC,CAAC;IAC7E,CAAC;IAGD,IAAI,KAAK,CAAC,iBAAiB,EAAE,CAAC;QAC7B,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC;IACrC,CAAC;IAGD,IAAI,KAAK,CAAC,YAAY,EAAE,CAAC;QACxB,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;IAChC,CAAC;IAGD,IAAI,KAAK,CAAC,YAAY,IAAI,KAAK,CAAC,YAAY,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACzD,MAAM,SAAS,GAAG,KAAK,CAAC,YAAY;aAClC,GAAG,CACH,CAAC,CAAC,EAAE,EAAE,CACL,2BAA2B,CAAC,CAAC,MAAM,WAAW,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,IAAI,IAAI,EAAE,iBAAiB,CACvF;aACA,IAAI,CAAC,IAAI,CAAC,CAAC;QACb,KAAK,CAAC,IAAI,CAAC,mBAAmB,SAAS,mBAAmB,CAAC,CAAC;IAC7D,CAAC;IAGD,IAAI,KAAK,CAAC,SAAS,EAAE,CAAC;QACrB,IAAI,CAAC;YACJ,MAAM,OAAO,GAAG,MAAM,KAAK,CAAC,SAAS,CAAC,GAAG,CAAC,UAAU,CACnD,KAAK,CAAC,SAAS,CAAC,QAAQ,EACxB,KAAK,CAAC,SAAS,CAAC,OAAO,CACvB,CAAC;YACF,MAAM,SAAS,GAAG,IAAA,sCAAsB,EAAC,OAAO,CAAC,CAAC;YAClD,IAAI,SAAS,EAAE,CAAC;gBACf,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;YACvB,CAAC;QACF,CAAC;QAAC,MAAM,CAAC;QAET,CAAC;IACF,CAAC;IAED,OAAO,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AAC3B,CAAC"}
@@ -1,6 +0,0 @@
1
- import type { WorkflowJSON } from '@n8n/workflow-sdk';
2
- export interface AgentInputColumns {
3
- agentNodeName: string;
4
- inputColumns: string[];
5
- }
6
- export declare function analyzeAgentInputColumns(workflow: WorkflowJSON, agentNodeName: string): AgentInputColumns;
@@ -1,17 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.analyzeAgentInputColumns = analyzeAgentInputColumns;
4
- const column_ref_utils_1 = require("./column-ref-utils");
5
- const FALLBACK_COLUMN = 'input';
6
- function analyzeAgentInputColumns(workflow, agentNodeName) {
7
- const node = (workflow.nodes ?? []).find((n) => (0, column_ref_utils_1.nodeHasName)(n) && n.name === agentNodeName);
8
- if (!node) {
9
- throw new Error(`Agent node "${agentNodeName}" not found in workflow`);
10
- }
11
- const refs = (0, column_ref_utils_1.unique)((0, column_ref_utils_1.collectStrings)(node.parameters).flatMap((text) => (0, column_ref_utils_1.extractJsonColumnRefs)(text)));
12
- if (refs.length === 0) {
13
- return { agentNodeName, inputColumns: [FALLBACK_COLUMN] };
14
- }
15
- return { agentNodeName, inputColumns: refs };
16
- }
17
- //# sourceMappingURL=analyze-agent-input-columns.service.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"analyze-agent-input-columns.service.js","sourceRoot":"","sources":["../../../src/tools/evals/analyze-agent-input-columns.service.ts"],"names":[],"mappings":";;;AAEA,yDAAgG;AAOhG,MAAM,eAAe,GAAG,OAAO,CAAC;AAEhC,kCACC,QAAsB,EACtB,aAAqB;IAErB,MAAM,IAAI,GAAG,CAAC,QAAQ,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAA,8BAAW,EAAC,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,KAAK,aAAa,CAAC,CAAC;IAC5F,IAAI,CAAC,IAAI,EAAE,CAAC;QACX,MAAM,IAAI,KAAK,CAAC,eAAe,aAAa,yBAAyB,CAAC,CAAC;IACxE,CAAC;IAED,MAAM,IAAI,GAAG,IAAA,yBAAM,EAClB,IAAA,iCAAc,EAAC,IAAI,CAAC,UAAU,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAA,wCAAqB,EAAC,IAAI,CAAC,CAAC,CAC9E,CAAC;IAEF,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACvB,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,CAAC,eAAe,CAAC,EAAE,CAAC;IAC3D,CAAC;IACD,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,IAAI,EAAE,CAAC;AAC9C,CAAC"}
@@ -1,3 +0,0 @@
1
- import type { WorkflowJSON } from '@n8n/workflow-sdk';
2
- import type { ToolRefPinData } from './generate-tool-ref-pin-data.service';
3
- export declare function applyPinData(workflow: WorkflowJSON, generated: ToolRefPinData): WorkflowJSON;
@@ -1,19 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.applyPinData = applyPinData;
4
- function applyPinData(workflow, generated) {
5
- const existing = workflow.pinData ?? {};
6
- const additions = {};
7
- for (const [nodeName, items] of Object.entries(generated)) {
8
- if (nodeName in existing)
9
- continue;
10
- additions[nodeName] = items;
11
- }
12
- if (Object.keys(additions).length === 0)
13
- return workflow;
14
- return {
15
- ...workflow,
16
- pinData: { ...existing, ...additions },
17
- };
18
- }
19
- //# sourceMappingURL=apply-pin-data.service.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"apply-pin-data.service.js","sourceRoot":"","sources":["../../../src/tools/evals/apply-pin-data.service.ts"],"names":[],"mappings":";;;AAaA,sBAA6B,QAAsB,EAAE,SAAyB;IAC7E,MAAM,QAAQ,GAAG,QAAQ,CAAC,OAAO,IAAI,EAAE,CAAC;IACxC,MAAM,SAAS,GAA6D,EAAE,CAAC;IAC/E,KAAK,MAAM,CAAC,QAAQ,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,CAAC;QAC3D,IAAI,QAAQ,IAAI,QAAQ;YAAE,SAAS;QACnC,SAAS,CAAC,QAAQ,CAAC,GAAG,KAAK,CAAC;IAC7B,CAAC;IACD,IAAI,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,QAAQ,CAAC;IACzD,OAAO;QACN,GAAG,QAAQ;QACX,OAAO,EAAE,EAAE,GAAG,QAAQ,EAAE,GAAG,SAAS,EAAE;KACtC,CAAC;AACH,CAAC"}
@@ -1,20 +0,0 @@
1
- import type { WorkflowJSON } from '@n8n/workflow-sdk';
2
- export type WorkflowNode = WorkflowJSON['nodes'][number];
3
- export declare function unique(values: string[]): string[];
4
- export declare function nodeTypeEndsWith(node: WorkflowNode, suffix: string): boolean;
5
- export declare function nodeHasName(node: WorkflowNode): node is WorkflowNode & {
6
- name: string;
7
- };
8
- export declare function collectStrings(value: unknown): string[];
9
- export declare function jsonFieldAccessor(field: string): string;
10
- export declare function currentJsonExpression(field: string): string;
11
- export declare function nodeItemJsonExpression(nodeName: string, field: string): string;
12
- export declare function extractJsonColumnRefs(text: string): string[];
13
- export interface NamedRefMatch {
14
- nodeName: string;
15
- field: string;
16
- originalExpression: string;
17
- }
18
- export declare function extractNamedRefMatches(text: string): NamedRefMatch[];
19
- export declare function connectionSlotTargetsNode(slot: unknown, targetNodeName: string): boolean;
20
- export declare function findAgentSubComponents(workflow: WorkflowJSON, agentNodeName: string): string[];