@n8n/instance-ai 1.21.2 → 1.22.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 (108) hide show
  1. package/dist/agent/computer-use-prompt.js +2 -5
  2. package/dist/agent/computer-use-prompt.js.map +1 -1
  3. package/dist/agent/instance-agent.js +1 -0
  4. package/dist/agent/instance-agent.js.map +1 -1
  5. package/dist/agent/sanitize-mcp-descriptions.d.ts +17 -0
  6. package/dist/agent/sanitize-mcp-descriptions.js +52 -0
  7. package/dist/agent/sanitize-mcp-descriptions.js.map +1 -0
  8. package/dist/agent/sanitize-mcp-schemas.d.ts +7 -1
  9. package/dist/agent/sanitize-mcp-schemas.js +79 -6
  10. package/dist/agent/sanitize-mcp-schemas.js.map +1 -1
  11. package/dist/agent/shared-prompts.d.ts +1 -1
  12. package/dist/agent/shared-prompts.js +1 -1
  13. package/dist/agent/shared-prompts.js.map +1 -1
  14. package/dist/agent/sub-agent-factory.d.ts +1 -1
  15. package/dist/agent/sub-agent-factory.js +1 -0
  16. package/dist/agent/sub-agent-factory.js.map +1 -1
  17. package/dist/agent/system-prompt.js +4 -1
  18. package/dist/agent/system-prompt.js.map +1 -1
  19. package/dist/build.tsbuildinfo +1 -1
  20. package/dist/index.d.ts +2 -2
  21. package/dist/index.js.map +1 -1
  22. package/dist/mcp/mcp-client-manager.js +12 -0
  23. package/dist/mcp/mcp-client-manager.js.map +1 -1
  24. package/dist/runtime/confirmation-payload.d.ts +4 -0
  25. package/dist/runtime/confirmation-payload.js +65 -0
  26. package/dist/runtime/confirmation-payload.js.map +1 -0
  27. package/dist/runtime/resumable-stream-executor.d.ts +2 -1
  28. package/dist/runtime/resumable-stream-executor.js +9 -0
  29. package/dist/runtime/resumable-stream-executor.js.map +1 -1
  30. package/dist/stream/map-chunk.js +2 -0
  31. package/dist/stream/map-chunk.js.map +1 -1
  32. package/dist/tools/credentials.tool.d.ts +36 -0
  33. package/dist/tools/credentials.tool.js +76 -5
  34. package/dist/tools/credentials.tool.js.map +1 -1
  35. package/dist/tools/evals/evals.tool.d.ts +43 -0
  36. package/dist/tools/evals/evals.tool.js +3 -2
  37. package/dist/tools/evals/evals.tool.js.map +1 -1
  38. package/dist/tools/executions.tool.js +1 -1
  39. package/dist/tools/executions.tool.js.map +1 -1
  40. package/dist/tools/filesystem/create-tools-from-mcp-server.d.ts +11 -0
  41. package/dist/tools/filesystem/create-tools-from-mcp-server.js +15 -2
  42. package/dist/tools/filesystem/create-tools-from-mcp-server.js.map +1 -1
  43. package/dist/tools/mcp-servers.tool.js +2 -2
  44. package/dist/tools/n8n-docs/schemas.js +1 -1
  45. package/dist/tools/n8n-docs/schemas.js.map +1 -1
  46. package/dist/tools/nodes/preferred-chat-model.d.ts +9 -0
  47. package/dist/tools/nodes/preferred-chat-model.js +45 -11
  48. package/dist/tools/nodes/preferred-chat-model.js.map +1 -1
  49. package/dist/tools/orchestration/build-agent.tool.js +2 -0
  50. package/dist/tools/orchestration/build-agent.tool.js.map +1 -1
  51. package/dist/tools/orchestration/tracing-utils.js +12 -0
  52. package/dist/tools/orchestration/tracing-utils.js.map +1 -1
  53. package/dist/tools/orchestration/verification/analyze-result.d.ts +4 -0
  54. package/dist/tools/orchestration/verification/analyze-result.js +70 -5
  55. package/dist/tools/orchestration/verification/analyze-result.js.map +1 -1
  56. package/dist/tools/orchestration/verification/scripted-gate-run.d.ts +3 -1
  57. package/dist/tools/orchestration/verification/scripted-gate-run.js +3 -1
  58. package/dist/tools/orchestration/verification/scripted-gate-run.js.map +1 -1
  59. package/dist/tools/orchestration/verify-built-workflow.tool.js +10 -0
  60. package/dist/tools/orchestration/verify-built-workflow.tool.js.map +1 -1
  61. package/dist/tools/web-research/sanitize-web-content.d.ts +1 -0
  62. package/dist/tools/web-research/sanitize-web-content.js +14 -1
  63. package/dist/tools/web-research/sanitize-web-content.js.map +1 -1
  64. package/dist/tools/workflows/build-workflow.tool.d.ts +3 -0
  65. package/dist/tools/workflows/build-workflow.tool.js +117 -37
  66. package/dist/tools/workflows/build-workflow.tool.js.map +1 -1
  67. package/dist/tools/workflows/chat-model-validation.d.ts +36 -0
  68. package/dist/tools/workflows/chat-model-validation.js +322 -0
  69. package/dist/tools/workflows/chat-model-validation.js.map +1 -0
  70. package/dist/tools/workflows/generate-simulation-fixtures.service.js +1 -1
  71. package/dist/tools/workflows/generate-simulation-fixtures.service.js.map +1 -1
  72. package/dist/tools/workflows/resolve-credentials.d.ts +3 -2
  73. package/dist/tools/workflows/resolve-credentials.js +34 -5
  74. package/dist/tools/workflows/resolve-credentials.js.map +1 -1
  75. package/dist/tools/workflows/setup-workflow.schema.d.ts +5 -0
  76. package/dist/tools/workflows/setup-workflow.service.d.ts +2 -1
  77. package/dist/tools/workflows/setup-workflow.service.js +25 -32
  78. package/dist/tools/workflows/setup-workflow.service.js.map +1 -1
  79. package/dist/tools/workflows/summarize-workflow.d.ts +1 -1
  80. package/dist/tools/workflows/summarize-workflow.js +1 -1
  81. package/dist/tools/workflows/summarize-workflow.js.map +1 -1
  82. package/dist/tools/workflows/validate-workflow.service.js +16 -2
  83. package/dist/tools/workflows/validate-workflow.service.js.map +1 -1
  84. package/dist/tools/workflows/workflow-build-telemetry.d.ts +1 -0
  85. package/dist/tools/workflows/workflow-build-telemetry.js +1 -0
  86. package/dist/tools/workflows/workflow-build-telemetry.js.map +1 -1
  87. package/dist/tools/workflows/workflow-node-diff.js +19 -5
  88. package/dist/tools/workflows/workflow-node-diff.js.map +1 -1
  89. package/dist/tools/workflows/workflow-validation-warnings.d.ts +3 -0
  90. package/dist/tools/workflows/workflow-validation-warnings.js +32 -0
  91. package/dist/tools/workflows/workflow-validation-warnings.js.map +1 -1
  92. package/dist/tools/workflows.tool.d.ts +27 -0
  93. package/dist/tools/workflows.tool.js +93 -17
  94. package/dist/tools/workflows.tool.js.map +1 -1
  95. package/dist/tools/workspace.tool.js +9 -1
  96. package/dist/tools/workspace.tool.js.map +1 -1
  97. package/dist/tracing/langsmith-tracing.d.ts +5 -0
  98. package/dist/tracing/langsmith-tracing.js +8 -0
  99. package/dist/tracing/langsmith-tracing.js.map +1 -1
  100. package/dist/types.d.ts +18 -1
  101. package/dist/types.js.map +1 -1
  102. package/dist/workspace/sandbox-setup.js +1 -1
  103. package/dist/workspace/sandbox-setup.js.map +1 -1
  104. package/package.json +30 -26
  105. package/skills/agent-builder/SKILL.md +20 -0
  106. package/skills/one-off-operations/SKILL.md +7 -4
  107. package/skills/post-build-flow/SKILL.md +107 -40
  108. package/skills/workflow-builder/SKILL.md +13 -2
@@ -68,7 +68,7 @@ Pick in this order:
68
68
  2. **Simplified Custom Auth** (`httpTemplatedCustomAuth`) for any service
69
69
  without a dedicated type whose auth is expressible as header/query/body
70
70
  values — which covers API keys and bearer tokens (`Authorization: Bearer
71
- <token>` becomes `{"headers":{"Authorization":"Bearer {{api_key}}"}}`, not
71
+ <token>` becomes `{"headers":{"Authorization":"Bearer {{api_key}}"}}`, not
72
72
  `httpBearerAuth`). Always provide a recipe (below) so the user only pastes
73
73
  their secret.
74
74
  3. **Plain generic types** (`httpBasicAuth`, `httpDigestAuth`, `oAuth2Api`, …)
@@ -121,26 +121,26 @@ key-check endpoint):
121
121
 
122
122
  ```json
123
123
  {
124
- "action": "setup",
125
- "workflowId": "...",
126
- "credentialHints": [
127
- {
128
- "suggestedName": "fal.ai API Key",
129
- "template": {
130
- "headers": { "Authorization": "Key {{api_key}}" }
131
- },
132
- "placeholders": [
133
- {
134
- "name": "api_key",
135
- "title": "fal.ai API key",
136
- "info": "Key ID and secret, separated by a colon",
137
- "type": "password"
138
- }
139
- ],
140
- "docsUrl": "https://fal.ai/dashboard/keys",
141
- "testUrl": "https://api.fal.ai/v1/models/usage"
142
- }
143
- ]
124
+ "action": "setup",
125
+ "workflowId": "...",
126
+ "credentialHints": [
127
+ {
128
+ "suggestedName": "fal.ai API Key",
129
+ "template": {
130
+ "headers": { "Authorization": "Key {{api_key}}" }
131
+ },
132
+ "placeholders": [
133
+ {
134
+ "name": "api_key",
135
+ "title": "fal.ai API key",
136
+ "info": "Key ID and secret, separated by a colon",
137
+ "type": "password"
138
+ }
139
+ ],
140
+ "docsUrl": "https://fal.ai/dashboard/keys",
141
+ "testUrl": "https://api.fal.ai/v1/models/usage"
142
+ }
143
+ ]
144
144
  }
145
145
  ```
146
146
 
@@ -265,16 +265,18 @@ For a workflow with more than one trigger (`triggerNodes` has multiple entries):
265
265
  again.
266
266
  - If `verificationReadiness.status === "already_verified"`, treat the
267
267
  workflow as verified and do **not** call `verify-built-workflow` again.
268
- - If `verificationReadiness.status === "ready"`, call
269
- `verify-built-workflow` with the `workflowId`, the `workItemId` when you
270
- have it, and the trigger-appropriate `inputData` shape.
271
- - If `verificationReadiness.status === "needs_setup"`, call
272
- `workflows(action="setup")` with the workflowId so the user can configure it
273
- through the inline setup card in the AI Assistant panel.
274
- - If `verificationReadiness.status === "not_verifiable"`, do not infer
275
- lower-level verification conditions; use the readiness guidance to give a
276
- clear warning or manual-test note. This is a warning completion state, not
277
- a verified state and not an infinite blocker.
268
+
269
+ - If `verificationReadiness.status === "ready"`, call
270
+ `verify-built-workflow` with the `workflowId`, the `workItemId` when you
271
+ have it, and the trigger-appropriate `inputData` shape.
272
+ - If `verificationReadiness.status === "needs_setup"`, call
273
+ `workflows(action="setup")` with the workflowId so the user can configure it
274
+ through the inline setup card in the AI Assistant panel.
275
+ - If `verificationReadiness.status === "not_verifiable"`, do not infer
276
+ lower-level verification conditions; use the readiness guidance to give a
277
+ clear warning or manual-test note. This is a warning completion state, not
278
+ a verified state and not an infinite blocker.
279
+
278
280
  2. Judge coverage, not just status. A `verify-built-workflow` result with
279
281
  `success: true` but a non-empty `nodesNotReached` is **partial** evidence:
280
282
  the execution ended early (see `lastNodeExecuted` and `coverageNote`) and
@@ -282,7 +284,9 @@ For a workflow with more than one trigger (`triggerNodes` has multiple entries):
282
284
  - Most common cause: a lookup/query node returned zero items (n8n stops
283
285
  downstream nodes on empty item lists). If the dead-end is a Data Table
284
286
  lookup, insert a matching test row with `data-tables(action="insert-rows")`,
285
- re-run `verify-built-workflow`, and delete the test row afterwards.
287
+ re-run `verify-built-workflow`, and delete the test row afterwards. The same
288
+ holds for data you seed anywhere else to unblock a run — it is yours to
289
+ remove once the run is done (see "Cleaning up after a live test").
286
290
  - If you cannot seed the data source, report honestly: name which nodes
287
291
  were verified and which were not, and tell the user the unreached part
288
292
  needs a manual test. Do not start a live `executions(action="run")`
@@ -315,16 +319,24 @@ For a workflow with more than one trigger (`triggerNodes` has multiple entries):
315
319
  when the latest verification evidence used mocks or simulations. If this
316
320
  follow-up is due, ask only whether the user wants the live test. Do not
317
321
  mention publishing or ask about the error workflow in the same response.
318
- 7. If testing has not already been offered or completed, ask whether the user
322
+ 7. Before your final summary, scan the **whole conversation** for live runs that
323
+ already wrote test data into an external system — earlier turns included, not
324
+ just this one. For each such record still sitting there, follow
325
+ [Cleaning up after a live test](#cleaning-up-after-a-live-test): name it and
326
+ offer to remove it. This is about data that **already exists** — a promise to
327
+ clean up after some future run does not discharge it, and neither does the
328
+ user's silence. If a later run failed, that says nothing about records an
329
+ earlier successful run left behind; they are still there.
330
+ 8. If testing has not already been offered or completed, ask whether the user
319
331
  wants to test the workflow. Skip this if `verify-built-workflow` already
320
332
  proved it works end-to-end with full coverage.
321
- 8. Only call `workflows(action="publish")` when the user explicitly asks to
333
+ 9. Only call `workflows(action="publish")` when the user explicitly asks to
322
334
  publish. Never publish automatically or proactively offer publishing before
323
335
  the publish-readiness requirement above is met.
324
- 9. After a direct new primary workflow is successfully published, follow
325
- [Error workflow follow-up](#error-workflow-follow-up).
326
- Do not replace this explicit opt-in with a generic "add
327
- anything else?", publish, or test question.
336
+ 10. After a direct new primary workflow is successfully published, follow
337
+ [Error workflow follow-up](#error-workflow-follow-up).
338
+ Do not replace this explicit opt-in with a generic "add
339
+ anything else?", publish, or test question.
328
340
 
329
341
  ## Error workflow follow-up
330
342
 
@@ -397,6 +409,49 @@ not offer publishing. If the user declines or defers, state what remains
397
409
  untested, do not claim live end-to-end verification, and do not offer
398
410
  publishing.
399
411
 
412
+ ## Cleaning up after a live test
413
+
414
+ A live run against real credentials leaves **real artifacts** — a row in their
415
+ sheet, a message in their channel, a block on their page. Test data you created
416
+ is your mess, not theirs.
417
+
418
+ This applies to any live run in the conversation, **not only one from this
419
+ turn**. A test record written three turns ago is still on the user's page now,
420
+ and the debt is still yours — carry it forward until it is cleared or the user
421
+ declines. Undertaking to clean up after some _future_ run does not settle a
422
+ record that already exists, and a run that failed afterwards does not remove
423
+ what an earlier successful run wrote.
424
+
425
+ When a live test, or a verification you seeded data for, wrote/sent/changed
426
+ anything in an external system:
427
+
428
+ 1. **Name what it left behind**, in the message that reports the run — or, for a
429
+ record from an earlier turn, in your next response: which record, where, and
430
+ how to recognise it ("a `[Test] …` to-do at the bottom of
431
+ the toggle"). Read it back from the effect node's output rather than guessing.
432
+ 2. **Offer to remove it yourself.** You can delete it the same way you wrote it —
433
+ the target has an API and you can reach it with a workflow. When no node or
434
+ tool does it directly, build a **one-off cleanup workflow**; that is exactly
435
+ what `one-off-operations` is for. Never present manual deletion as how this
436
+ gets resolved, and never claim you have no way to delete it — "I don't have a
437
+ delete tool for X" is false whenever X has a write API you just used. Noting
438
+ that the user _could_ also remove it by hand is fine only alongside your own
439
+ offer.
440
+ 3. **Ask before deleting.** Removal is destructive, so it goes through the usual
441
+ approval gate. Never clean up silently — something labelled "test" may still
442
+ be data the user wants.
443
+ 4. **Don't stack test data.** Do not offer another live run against the same
444
+ target while an earlier test artifact is still sitting there. Clear it first,
445
+ or say plainly that the next run will add a second one.
446
+
447
+ If the user declines, note that the item is still there and move on — don't
448
+ re-ask.
449
+
450
+ **Not every write is test data.** When the live run _was_ the point — a one-off
451
+ operation whose whole purpose is the effect (see `one-off-operations`) — what it
452
+ wrote is the deliverable. There you offer to clean up the _workflow_, never the
453
+ result.
454
+
400
455
  ## Claiming success
401
456
 
402
457
  Do not tell the user a workflow is "fixed", "verified", "tested", "working", or
@@ -411,8 +466,8 @@ complete; do not infer correctness from the fact that a node ran. The same
411
466
  applies to rows or records written to an external system: never make quantitative
412
467
  claims ("22 rows written", "columns matched") that you did not read back from
413
468
  the effect node's actual output (`executions(action="get-node-output")`) or from
414
- the target system itself — a successful run status does not prove the *right
415
- data* was written, only that nodes ran. If you could not run the
469
+ the target system itself — a successful run status does not prove the _right
470
+ data_ was written, only that nodes ran. If you could not run the
416
471
  failing path or inspect the artifact, say so plainly — "I couldn't verify X
417
472
  because Y" — and name what is unconfirmed. An honest "could not verify" beats an
418
473
  unverified success claim.
@@ -444,6 +499,18 @@ building, and use the chosen credential name in the workflow code. Exception: th
444
499
  user already named the credential in their message — use it directly. With a
445
500
  single candidate, auto-apply and do not ask.
446
501
 
502
+ **Honor an explicit "create a new credential" request.** When the user asks for a
503
+ new credential of a type, never pick an existing one for them and never ask them
504
+ to choose among existing ones — not even when exactly one exists (the build would
505
+ otherwise attach it silently and skip setup entirely). Pass the credential type in
506
+ `preferNewCredentials` on both `build-workflow` and `workflows(action="setup")`
507
+ (or `preferNew: true` on the `credentials(action="setup")` entry). Setup then
508
+ opens on credential creation while still listing the existing credentials, so the
509
+ user can change their mind — say so in one short sentence rather than
510
+ re-litigating the choice. If they had skipped that card earlier, pass
511
+ `reopenSkipped` alongside it: `preferNewCredentials` decides what the card offers,
512
+ `reopenSkipped` decides whether the card comes back at all.
513
+
447
514
  **Ask which auth type to use when a service supports more than one.**
448
515
  `credentials(action="setup")` opens a picker locked to a single `credentialType`
449
516
  — the user cannot switch auth types from there. So when
@@ -325,6 +325,16 @@ decision after testing.
325
325
  workflow already had it. Otherwise use `newCredential('Suggested Credential
326
326
  Name')` — build tools mock unresolved credentials for verification and setup
327
327
  collects real ones later.
328
+ - When the user explicitly asks for a **new** credential ("create a new Slack
329
+ credential"), the unresolved `newCredential('Name')` is not enough on its own —
330
+ the build would still attach their sole existing credential of that type, and
331
+ setup would preselect their most recent one. Pass the credential type in
332
+ `preferNewCredentials` on `build-workflow` **and** on
333
+ `workflows(action="setup")` (or `preferNew: true` on the entry of
334
+ `credentials(action="setup")`). The slot then stays unresolved through the build
335
+ and the card opens on credential creation, with existing credentials still
336
+ listed in case the user changes their mind. Pass it only on an explicit request,
337
+ never by default — reuse is the right behavior everywhere else.
328
338
  - When `build-workflow` returns `resolvedCredentialsByNode`, the build already
329
339
  attached a credential to those nodes — either an existing stored credential or
330
340
  an n8n credits–managed one (entries with `id: null` and `__aiGatewayManaged:
@@ -593,8 +603,9 @@ first.
593
603
 
594
604
  `.group(name, members, { description })` on the workflow builder; members are the node handles.
595
605
  Read `knowledge-base/reference/node-groups.md` for the exact rules (trigger nodes excluded,
596
- one connected section, AI sub-nodes stay with their Agent) before creating groups an invalid
597
- group is rejected on save. When editing an existing workflow, keep existing `.group(...)` calls
606
+ one connected section, AI sub-nodes stay with their Agent) before creating groups. Agent save
607
+ tools drop an invalid group from the saved workflow and report a warning, so fix the source
608
+ instead of re-emitting it. When editing an existing workflow, keep existing `.group(...)` calls
598
609
  and their descriptions intact unless the change is about grouping.
599
610
 
600
611
  ## Workflow Rules