@n8n/instance-ai 1.16.2 → 1.17.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 (140) hide show
  1. package/dist/agent/instance-agent.js +7 -1
  2. package/dist/agent/instance-agent.js.map +1 -1
  3. package/dist/agent/system-prompt.js +3 -3
  4. package/dist/agent/system-prompt.js.map +1 -1
  5. package/dist/build.tsbuildinfo +1 -1
  6. package/dist/event-bus/event-bus.interface.d.ts +1 -1
  7. package/dist/index.d.ts +10 -1
  8. package/dist/index.js +17 -2
  9. package/dist/index.js.map +1 -1
  10. package/dist/parsers/xlsx-parser.js +1 -1
  11. package/dist/parsers/xlsx-parser.js.map +1 -1
  12. package/dist/runtime/terminal-response-guard.js +2 -1
  13. package/dist/runtime/terminal-response-guard.js.map +1 -1
  14. package/dist/skills/skill-gates.d.ts +5 -0
  15. package/dist/skills/skill-gates.js +12 -0
  16. package/dist/skills/skill-gates.js.map +1 -0
  17. package/dist/storage/workflow-loop-storage.d.ts +7 -7
  18. package/dist/stream/consume-with-hitl.d.ts +3 -0
  19. package/dist/stream/consume-with-hitl.js +2 -0
  20. package/dist/stream/consume-with-hitl.js.map +1 -1
  21. package/dist/stream/map-chunk.js +7 -0
  22. package/dist/stream/map-chunk.js.map +1 -1
  23. package/dist/stream/usage-accumulator.d.ts +2 -0
  24. package/dist/stream/usage-accumulator.js +13 -3
  25. package/dist/stream/usage-accumulator.js.map +1 -1
  26. package/dist/tool-registry.js +5 -1
  27. package/dist/tool-registry.js.map +1 -1
  28. package/dist/tools/agents.tool.d.ts +2 -0
  29. package/dist/tools/agents.tool.js +40 -0
  30. package/dist/tools/agents.tool.js.map +1 -0
  31. package/dist/tools/credentials.tool.js +8 -3
  32. package/dist/tools/credentials.tool.js.map +1 -1
  33. package/dist/tools/evals/eval-config.tool.js +10 -2
  34. package/dist/tools/evals/eval-config.tool.js.map +1 -1
  35. package/dist/tools/executions.tool.js +3 -2
  36. package/dist/tools/executions.tool.js.map +1 -1
  37. package/dist/tools/filesystem/create-tools-from-mcp-server.js +2 -2
  38. package/dist/tools/filesystem/create-tools-from-mcp-server.js.map +1 -1
  39. package/dist/tools/index.js +15 -2
  40. package/dist/tools/index.js.map +1 -1
  41. package/dist/tools/n8n-docs/registry.d.ts +2 -2
  42. package/dist/tools/n8n-docs/registry.js +20 -8
  43. package/dist/tools/n8n-docs/registry.js.map +1 -1
  44. package/dist/tools/n8n-docs.tool.js +18 -12
  45. package/dist/tools/n8n-docs.tool.js.map +1 -1
  46. package/dist/tools/nodes.tool.js +1 -1
  47. package/dist/tools/orchestration/agent-preview-session-binding.d.ts +20 -0
  48. package/dist/tools/orchestration/agent-preview-session-binding.js +47 -0
  49. package/dist/tools/orchestration/agent-preview-session-binding.js.map +1 -0
  50. package/dist/tools/orchestration/agent-target-binding.d.ts +6 -1
  51. package/dist/tools/orchestration/agent-target-binding.js +43 -4
  52. package/dist/tools/orchestration/agent-target-binding.js.map +1 -1
  53. package/dist/tools/orchestration/build-agent.tool.js +365 -71
  54. package/dist/tools/orchestration/build-agent.tool.js.map +1 -1
  55. package/dist/tools/orchestration/builder-thread-id.d.ts +1 -0
  56. package/dist/tools/orchestration/builder-thread-id.js +7 -0
  57. package/dist/tools/orchestration/builder-thread-id.js.map +1 -0
  58. package/dist/tools/orchestration/get-session.tool.d.ts +2 -0
  59. package/dist/tools/orchestration/get-session.tool.js +49 -0
  60. package/dist/tools/orchestration/get-session.tool.js.map +1 -0
  61. package/dist/tools/orchestration/verification/reconcile-plan.js +4 -1
  62. package/dist/tools/orchestration/verification/reconcile-plan.js.map +1 -1
  63. package/dist/tools/orchestration/verify-built-workflow.tool.js +1 -0
  64. package/dist/tools/orchestration/verify-built-workflow.tool.js.map +1 -1
  65. package/dist/tools/research.tool.js +2 -0
  66. package/dist/tools/research.tool.js.map +1 -1
  67. package/dist/tools/tool-ids.d.ts +2 -0
  68. package/dist/tools/tool-ids.js +3 -0
  69. package/dist/tools/tool-ids.js.map +1 -1
  70. package/dist/tools/workflows/build-workflow.tool.js +12 -4
  71. package/dist/tools/workflows/build-workflow.tool.js.map +1 -1
  72. package/dist/tools/workflows/classify-node-destructiveness.service.d.ts +1 -1
  73. package/dist/tools/workflows/classify-node-destructiveness.service.js +5 -7
  74. package/dist/tools/workflows/classify-node-destructiveness.service.js.map +1 -1
  75. package/dist/tools/workflows/credential-utils.d.ts +1 -1
  76. package/dist/tools/workflows/credential-utils.js +2 -2
  77. package/dist/tools/workflows/credential-utils.js.map +1 -1
  78. package/dist/tools/workflows/detect-unparseable-openai-schema.d.ts +3 -0
  79. package/dist/tools/workflows/detect-unparseable-openai-schema.js +85 -0
  80. package/dist/tools/workflows/detect-unparseable-openai-schema.js.map +1 -0
  81. package/dist/tools/workflows/generate-simulation-fixtures.service.d.ts +2 -1
  82. package/dist/tools/workflows/generate-simulation-fixtures.service.js +27 -5
  83. package/dist/tools/workflows/generate-simulation-fixtures.service.js.map +1 -1
  84. package/dist/tools/workflows/materialize-node-type.tool.js +4 -2
  85. package/dist/tools/workflows/materialize-node-type.tool.js.map +1 -1
  86. package/dist/tools/workflows/plan-verification-simulation.d.ts +5 -2
  87. package/dist/tools/workflows/plan-verification-simulation.js +117 -2
  88. package/dist/tools/workflows/plan-verification-simulation.js.map +1 -1
  89. package/dist/tools/workflows/reconcile-simulation-plan.js +48 -17
  90. package/dist/tools/workflows/reconcile-simulation-plan.js.map +1 -1
  91. package/dist/tools/workflows/resolve-credentials.js +35 -1
  92. package/dist/tools/workflows/resolve-credentials.js.map +1 -1
  93. package/dist/tools/workflows/setup-workflow.schema.d.ts +66 -66
  94. package/dist/tools/workflows/validate-workflow.service.js +4 -4
  95. package/dist/tools/workflows/workflow-build-routing.js +3 -3
  96. package/dist/tools/workflows/workflow-build-routing.js.map +1 -1
  97. package/dist/tools/workflows/workflow-file-bindings.d.ts +1 -1
  98. package/dist/tools/workflows/workflow-file-bindings.js +2 -1
  99. package/dist/tools/workflows/workflow-file-bindings.js.map +1 -1
  100. package/dist/tools/workflows/workflow-json-utils.js +11 -12
  101. package/dist/tools/workflows/workflow-json-utils.js.map +1 -1
  102. package/dist/tools/workflows/workflow-source-compiler.d.ts +1 -1
  103. package/dist/tools/workflows/workflow-source-compiler.js +11 -4
  104. package/dist/tools/workflows/workflow-source-compiler.js.map +1 -1
  105. package/dist/tools/workflows/write-sandbox-file.tool.js +4 -2
  106. package/dist/tools/workflows/write-sandbox-file.tool.js.map +1 -1
  107. package/dist/tracing/langsmith-tracing.d.ts +1 -0
  108. package/dist/tracing/langsmith-tracing.js +69 -9
  109. package/dist/tracing/langsmith-tracing.js.map +1 -1
  110. package/dist/tracing/trace-payloads.js +8 -0
  111. package/dist/tracing/trace-payloads.js.map +1 -1
  112. package/dist/types.d.ts +52 -5
  113. package/dist/types.js.map +1 -1
  114. package/dist/utils/stream-helpers.d.ts +1 -0
  115. package/dist/utils/stream-helpers.js +2 -1
  116. package/dist/utils/stream-helpers.js.map +1 -1
  117. package/dist/workflow-loop/workflow-loop-state.d.ts +13 -13
  118. package/dist/workflow-loop/workflow-loop-state.js +6 -1
  119. package/dist/workflow-loop/workflow-loop-state.js.map +1 -1
  120. package/dist/workspace/create-workspace.js +24 -1
  121. package/dist/workspace/create-workspace.js.map +1 -1
  122. package/dist/workspace/lazy-runtime-workspace.js +19 -19
  123. package/dist/workspace/lazy-runtime-workspace.js.map +1 -1
  124. package/dist/workspace/sandbox-fs.d.ts +16 -4
  125. package/dist/workspace/sandbox-fs.js +80 -25
  126. package/dist/workspace/sandbox-fs.js.map +1 -1
  127. package/dist/workspace/scoped-workspace.js +6 -6
  128. package/dist/workspace/scoped-workspace.js.map +1 -1
  129. package/dist/workspace/snapshot-manager.d.ts +1 -0
  130. package/dist/workspace/snapshot-manager.js +37 -5
  131. package/dist/workspace/snapshot-manager.js.map +1 -1
  132. package/dist/workspace/workspace-files.d.ts +4 -0
  133. package/dist/workspace/workspace-files.js +21 -7
  134. package/dist/workspace/workspace-files.js.map +1 -1
  135. package/knowledge-base/reference/workflow-builder-guardrails.md +3 -0
  136. package/package.json +12 -12
  137. package/skills/config-evals/SKILL.md +96 -0
  138. package/skills/config-evals/references/config-eval-playbook.md +109 -0
  139. package/skills/intent-recognition/SKILL.md +145 -34
  140. package/skills/workflow-builder/SKILL.md +25 -17
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@n8n/instance-ai",
3
- "version": "1.16.2",
3
+ "version": "1.17.0",
4
4
  "main": "dist/index.js",
5
5
  "module": "src/index.ts",
6
6
  "types": "dist/index.d.ts",
@@ -13,9 +13,9 @@
13
13
  ],
14
14
  "exports": {
15
15
  ".": {
16
+ "types": "./dist/index.d.ts",
16
17
  "require": "./dist/index.js",
17
- "import": "./src/index.ts",
18
- "types": "./dist/index.d.ts"
18
+ "import": "./dist/index.js"
19
19
  },
20
20
  "./parsers": {
21
21
  "require": "./dist/parsers/index.js",
@@ -53,16 +53,16 @@
53
53
  "source-map-support": "0.5.21",
54
54
  "turndown": "^7.2.2",
55
55
  "undici": "^7.28.0",
56
- "xlsx": "https://cdn.sheetjs.com/xlsx-0.20.2/xlsx-0.20.2.tgz",
56
+ "@e965/xlsx": "0.20.3",
57
57
  "zod": "3.25.67",
58
58
  "zod-from-json-schema-v3": "npm:zod-from-json-schema@^0.0.5",
59
- "@n8n/api-types": "1.31.2",
60
- "@n8n/agents": "0.16.2",
61
- "@n8n/ai-utilities": "0.24.2",
62
- "@n8n/mcp-browser": "0.14.0",
63
- "n8n-workflow": "2.31.2",
64
- "@n8n/utils": "1.39.0",
65
- "@n8n/workflow-sdk": "0.24.2"
59
+ "@n8n/agents": "0.17.0",
60
+ "@n8n/ai-utilities": "0.25.0",
61
+ "@n8n/mcp-browser": "0.15.0",
62
+ "@n8n/api-types": "1.32.0",
63
+ "n8n-workflow": "2.32.0",
64
+ "@n8n/workflow-sdk": "0.25.0",
65
+ "@n8n/utils": "1.40.0"
66
66
  },
67
67
  "devDependencies": {
68
68
  "@ai-sdk/anthropic": "^3.0.81",
@@ -77,7 +77,7 @@
77
77
  "vitest": "^4.1.9",
78
78
  "vitest-mock-extended": "^3.1.0",
79
79
  "@n8n/typescript-config": "1.9.0",
80
- "@n8n/vitest-config": "1.18.0"
80
+ "@n8n/vitest-config": "1.19.0"
81
81
  },
82
82
  "license": "SEE LICENSE IN LICENSE.md",
83
83
  "homepage": "https://n8n.io",
@@ -0,0 +1,96 @@
1
+ ---
2
+ name: config-evals
3
+ description: >-
4
+ Builds and maintains configuration-based evaluations on a workflow with the
5
+ eval-config tool. Use when the user asks to set up, add, view, change, or
6
+ remove an evaluation, score, grade, or judge a workflow's output, or measure
7
+ answer quality against a test dataset. This is the only eval form Instance AI
8
+ handles — it does not touch on-canvas evaluation nodes.
9
+ recommended_tools:
10
+ - eval-config
11
+ - data-tables
12
+ platforms:
13
+ - daytona
14
+ ---
15
+
16
+ # Config-based Evaluations
17
+
18
+ Use this skill to attach a configuration-based evaluation to a workflow with the
19
+ `eval-config` tool. A config eval pairs a workflow with a name, a start node, an
20
+ end node, one or more judged metrics, and a Data Table dataset. Nothing is added
21
+ to the canvas — the config lives off-canvas via the evaluation-config API.
22
+
23
+ Config evals are the only evaluation form you work with. Do not add, read,
24
+ rewire, or reason about on-canvas evaluation nodes (EvaluationTrigger,
25
+ Evaluation/checkIfEvaluating/setOutputs/setMetrics). If the user asks for those,
26
+ build a config eval instead and briefly say that is how you set up evaluations.
27
+
28
+ ## What a Config Eval Needs
29
+
30
+ - `name` — a human-readable evaluation name.
31
+ - `startNodeName` — the node where a run begins; it is fed one test-input row.
32
+ - `endNodeName` — the node whose output is judged.
33
+ - `dataTableId` — a Data Table holding the test dataset. Create and populate it
34
+ with the `data-tables` tool first, then link it here by id.
35
+ - `metrics` — one or more judged metrics (see below).
36
+
37
+ ## Default Procedure
38
+
39
+ 1. Identify the target workflow and read it. Trace the main path from trigger to
40
+ the node that produces the answer.
41
+ 2. Pick the nodes:
42
+ - `startNodeName` is normally the node that receives the input the dataset
43
+ varies (often the trigger or the first node after it).
44
+ - `endNodeName` is the node whose output you want scored (usually the AI agent
45
+ or the final response node).
46
+ 3. Resolve the dataset. Call `data-tables(action="list")` to find an existing
47
+ dataset, or create and seed one with `data-tables` before creating the config.
48
+ Never invent a `dataTableId`; use one returned by `data-tables`.
49
+ 4. Choose metrics and build the `actualAnswer` / `expectedAnswer` / `userQuery`
50
+ expressions (see Metrics).
51
+ 5. Call `eval-config` (`action="create"`), or `update` when changing an existing
52
+ config. The tool shows an approval card automatically — call it and respect
53
+ the result; do not ask for chat approval first.
54
+ 6. Close with facts: evaluation name, workflow, start/end nodes, dataset name and
55
+ id, and the metrics configured.
56
+
57
+ ## Metrics
58
+
59
+ Each metric is LLM-judged and needs a judge model: a `credentialId`, a `model`,
60
+ and an `outputType` (`numeric`, the default, or `boolean`). Reuse an LLM
61
+ credential the workflow already uses when one fits.
62
+
63
+ Do **not** set `provider` unless you know the exact chat-model node type — it is
64
+ derived automatically from the credential you pass (each credential type maps to
65
+ one provider). Just pick the credential and the model.
66
+
67
+ Two presets are available:
68
+
69
+ - **`correctness`** — compares the produced answer to a ground-truth answer.
70
+ Requires `expectedAnswer` (an n8n expression resolving to the ground-truth
71
+ value, typically a dataset column, e.g. `{{ $json.expected_output }}`).
72
+ - **`helpfulness`** — judges the produced answer against the user's query.
73
+ Requires `userQuery` (an n8n expression for the input the user asked, e.g.
74
+ `{{ $json.input }}`).
75
+
76
+ Every metric also needs `actualAnswer`: an n8n expression resolving to the
77
+ workflow's produced answer at the end node, e.g. `{{ $json.output }}`.
78
+
79
+ Pick `correctness` when the dataset has a known right answer to compare against;
80
+ pick `helpfulness` when there is no single ground truth and quality is judged
81
+ relative to the request. Use `prompt` only to override the default judge prompt.
82
+
83
+ ## Dataset Boundary
84
+
85
+ - Build the dataset with the `data-tables` tool: one column for each input the
86
+ evaluation varies, plus a ground-truth column when using `correctness`.
87
+ - The config only references the dataset by `dataTableId`; the `eval-config` tool
88
+ does not create or populate rows. If no suitable dataset exists, create one
89
+ first, then create the config.
90
+ - Do not weaken the evaluation to fit a thin dataset — seed the dataset to match
91
+ the metrics, or ask the user for the expected answers.
92
+
93
+ ## More Detail
94
+
95
+ Use [references/config-eval-playbook.md](references/config-eval-playbook.md) for
96
+ tool-call recipes, worked examples, and output shapes.
@@ -0,0 +1,109 @@
1
+ # Config Eval Playbook
2
+
3
+ Recipes and worked examples for the `eval-config` tool. All actions are
4
+ discriminated by `action` and always take a `workflowId`.
5
+
6
+ ## Actions
7
+
8
+ | Action | Purpose | Extra fields |
9
+ | -------- | ---------------------------------------- | ------------ |
10
+ | `list` | List config evals on a workflow | — |
11
+ | `get` | Read one config eval | `configId` |
12
+ | `create` | Attach a new config eval | config fields |
13
+ | `update` | Replace an existing config eval | `configId` + config fields |
14
+ | `delete` | Remove a config eval | `configId` |
15
+
16
+ Config fields (create/update): `name`, `startNodeName`, `endNodeName`,
17
+ `dataTableId`, `metrics`.
18
+
19
+ `create`, `update`, and `delete` show an approval card automatically. Call the
20
+ tool and act on the result; do not ask for chat approval beforehand.
21
+
22
+ ## Metric Fields
23
+
24
+ | Field | Required | Notes |
25
+ | -------------- | ----------------------- | ----- |
26
+ | `name` | always | e.g. `"Correctness"` |
27
+ | `preset` | always | `correctness` or `helpfulness` |
28
+ | `credentialId` | always | credential id for the judge model; also determines the provider |
29
+ | `model` | always | e.g. `gpt-4o` |
30
+ | `outputType` | defaults to `numeric` | `numeric` or `boolean` |
31
+ | `actualAnswer` | always | expression for the produced answer, e.g. `{{ $json.output }}` |
32
+ | `expectedAnswer` | `correctness` preset | expression for ground truth, e.g. `{{ $json.expected_output }}` |
33
+ | `userQuery` | `helpfulness` preset | expression for the user's query, e.g. `{{ $json.input }}` |
34
+ | `prompt` | optional | overrides the default judge prompt |
35
+ | `provider` | omit | chat-model node type; leave unset — derived from `credentialId`. Set only if you know it (e.g. `@n8n/n8n-nodes-langchain.lmChatOpenAi`) |
36
+
37
+ ## Worked Example — correctness eval on an agent workflow
38
+
39
+ 1. Ensure a dataset exists with an input column and a ground-truth column:
40
+
41
+ ```
42
+ data-tables(action="list")
43
+ // if none fits:
44
+ data-tables(action="create", name="Support agent eval dataset",
45
+ columns=[{ name: "input", type: "string" },
46
+ { name: "expected_output", type: "string" }])
47
+ // then seed rows with data-tables insert
48
+ ```
49
+
50
+ 2. Create the config eval, linking the dataset by id:
51
+
52
+ ```
53
+ eval-config(
54
+ action="create",
55
+ workflowId="<wf_id>",
56
+ name="Support agent correctness",
57
+ startNodeName="When chat message received",
58
+ endNodeName="AI Agent",
59
+ dataTableId="<dt_id>",
60
+ metrics=[{
61
+ name: "Correctness",
62
+ preset: "correctness",
63
+ credentialId: "<cred_id>", // provider is derived from this credential
64
+ model: "gpt-4o",
65
+ actualAnswer: "{{ $json.output }}",
66
+ expectedAnswer: "{{ $json.expected_output }}"
67
+ }]
68
+ )
69
+ ```
70
+
71
+ 3. Report: evaluation name, workflow, start/end nodes, dataset name + id, metric.
72
+
73
+ ## Worked Example — helpfulness eval (no ground truth)
74
+
75
+ Use `helpfulness` when there is no single correct answer. The dataset needs only
76
+ the input column; no ground-truth column is required.
77
+
78
+ ```
79
+ eval-config(
80
+ action="create",
81
+ workflowId="<wf_id>",
82
+ name="Assistant helpfulness",
83
+ startNodeName="When chat message received",
84
+ endNodeName="AI Agent",
85
+ dataTableId="<dt_id>",
86
+ metrics=[{
87
+ name: "Helpfulness",
88
+ preset: "helpfulness",
89
+ credentialId: "<cred_id>", // provider is derived from this credential
90
+ model: "claude-sonnet-4-5",
91
+ userQuery: "{{ $json.input }}",
92
+ actualAnswer: "{{ $json.output }}"
93
+ }]
94
+ )
95
+ ```
96
+
97
+ ## Changing or Removing
98
+
99
+ - To change metrics, nodes, or the dataset, use `update` with the `configId` from
100
+ `list`/`get`. `update` replaces the full config — resend every field you want
101
+ to keep, not only the changed ones.
102
+ - To read current state before editing, use `get` with the `configId`.
103
+ - To remove an eval, use `delete` with the `configId`.
104
+
105
+ ## Boundary Reminder
106
+
107
+ This tool never touches the canvas. Do not add EvaluationTrigger or Evaluation
108
+ nodes; config evals are attached through the evaluation-config API only. Build
109
+ and seed datasets exclusively through the `data-tables` tool.
@@ -8,8 +8,10 @@ description: >-
8
8
  workflow invoked as an agent tool). Must be used before deciding the intent
9
9
  of any automation request, including compound requests with multiple
10
10
  independent automations, mid-build extensions to an existing workflow or
11
- agent, and requests that need clarification before an anchor can be chosen,
12
- before choosing workflow-builder, planning, or an agent-oriented design.
11
+ agent, one-off questions or reports that need external systems you cannot
12
+ query directly, and requests that need clarification before an anchor can
13
+ be chosen, before choosing workflow-builder, planning, or an agent-oriented
14
+ design.
13
15
  ---
14
16
 
15
17
  # Intent recognition
@@ -27,9 +29,8 @@ show up inside that flow.
27
29
  If the user asked to build, route on the result: workflow-builder for
28
30
  workflow-anchored (a bounded LLM step is an AI node in the graph; an embedded
29
31
  agent is an AI Agent step inside it), an agent-oriented design for
30
- agent-anchored (a tool-use loop; build reusable actions as workflows the
31
- agent invokes), `ask-user` for needs-clarification, or answer directly for
32
- out-of-scope.
32
+ agent-anchored (a tool-use loop), `ask-user` for needs-clarification, or answer
33
+ directly for out-of-scope.
33
34
 
34
35
  ## Inputs
35
36
 
@@ -51,25 +52,32 @@ Two orthogonal decisions per request, or per part for compound requests:
51
52
  steps as bounded transformers (classify, extract, summarize, score, a
52
53
  single decision feeding fixed branches).
53
54
  - **agent-anchored**: an agent owns the flow; the LLM decides the next step
54
- at runtime.
55
+ at runtime. n8n Agents are not chat-only: besides chat sessions, they run
56
+ recurring objectives on a cron schedule (**tasks**) and keep memory across
57
+ sessions and runs — so recurring or scheduled duties do not disqualify this
58
+ anchor.
55
59
  - **needs-clarification**: the request is under-specified on an
56
60
  anchor-deciding axis.
57
61
  - **out-of-scope**: not a build intent at all. Covers meta or product
58
62
  questions (e.g. asking what the assistant is capable of building) and
59
63
  one-off content tasks with no trigger, no persistence, and no reuse intent
60
64
  (summarize, translate, or draft something once) — answer or do these
61
- directly instead of building an automation. Requests to operate on
62
- existing resources (debugging a failed execution, listing or managing
63
- workflows, querying data) are not classified by this skill at all — route
64
- them through their normal paths.
65
+ directly instead of building an automation. This bucket only applies when
66
+ you can actually do the task directly: a one-off question or report that
67
+ needs external systems you have no ad-hoc access to (a private issue
68
+ tracker, wiki, or CRM) is not out-of-scope — classify it, and when
69
+ answering requires judgment-driven navigation of those systems it is
70
+ agent-anchored (see Signals). Requests to operate on existing resources
71
+ (debugging a failed execution, listing or managing workflows or agents,
72
+ querying data) are not classified by this skill at all — route them
73
+ through their normal paths.
65
74
 
66
75
  **2. Embeds other** — whether the other primitive appears inside the anchor:
67
76
 
68
77
  - workflow-anchored + `true`: an agent embedded as a workflow step (e.g. a
69
78
  scheduled pipeline whose middle step is open-ended investigation).
70
- - agent-anchored + `true`: workflows invoked as tools of the agent
71
- especially when the user wants reusable or manually-triggerable actions, or
72
- an action is itself a deterministic multi-step procedure.
79
+ - agent-anchored + `true`: workflows invoked as tools of the agent; see Adding
80
+ tools to an agent to distinguish them from direct tools.
73
81
  - `n/a` for needs-clarification and out-of-scope.
74
82
 
75
83
  **Migration from the old taxonomy**: old **hybrid** → workflow-anchored,
@@ -79,47 +87,97 @@ only when the user wants a persistent, triggerable automation. Old
79
87
  **ambiguous** → needs-clarification. Old **workflow** and **agent** map
80
88
  directly onto the matching anchor value.
81
89
 
90
+ ## Adding tools to an agent
91
+
92
+ After choosing an agent-anchored design, decide whether each capability should
93
+ be a direct agent tool or a workflow tool:
94
+
95
+ - **Direct agent tools are the default.** Forward requests to add capabilities
96
+ to `build-agent` near-verbatim so the delegated builder can choose MCP,
97
+ node-backed, provider, or custom tools. One node-backed capability or
98
+ multiple independent node tools stay on the agent build path with
99
+ `embeds_other: false`.
100
+ - Use a **workflow tool** only when one agent tool call must run an ordered
101
+ multi-node procedure, or when the user explicitly needs that workflow
102
+ reusable, manually callable, or usable outside the agent. Build the workflow
103
+ first, pass it to `build-agent` via `workflowContext`, and set
104
+ `embeds_other: true`.
105
+
106
+ Count the nodes required inside one tool invocation, not the total number of
107
+ tools on the agent. For example, looking up and inserting Data Table rows are
108
+ two direct node tools; an atomic lookup-transform-write procedure is one
109
+ workflow tool.
110
+
82
111
  ## Decision Steps
83
112
 
84
113
  0. If the user is mid-build on an existing workflow or agent, apply context
85
114
  continuity (see Signals) before anything else — an incremental request
86
115
  normally extends the current primitive.
87
- 1. If the request is not a build intent a meta or product question, or a
116
+ 1. **Explicit artifact requests.** When the user names the deliverable
117
+ "build me an agent/assistant that…", "create a workflow that…" — the
118
+ named primitive is a routing instruction, not surface vocabulary.
119
+ Classify by it unless the described behavior is unambiguously the other
120
+ primitive's shape (e.g. "an agent" whose behavior is a fixed
121
+ schedule-fetch-notify pipeline). Even then, never switch silently:
122
+ propose the reclassified design and say you are deviating from the named
123
+ primitive, grounding the choice in the task's shape. The false-friends
124
+ rule applies to task descriptions, not to an explicitly requested
125
+ artifact.
126
+ 2. If the request is not a build intent — a meta or product question, or a
88
127
  one-off content task with no trigger or reuse — classify **out-of-scope**
89
128
  and answer or do it directly.
90
- 2. Split the request into parts only if it contains multiple independent
129
+ 3. Split the request into parts only if it contains multiple independent
91
130
  automations with separate lifecycles (unrelated triggers, audiences, or
92
131
  cadences). Markers like numbering or "and separately" are a giveaway but
93
132
  are not required — a single plain sentence can contain two automations.
94
133
  Do not split a single automation that merely enumerates many tools or
95
- steps. Run steps 3-7 on each part.
96
- 3. Test the agent signals. If any one holds, classify **agent-anchored**.
97
- 4. Otherwise, test the workflow conditions. If all of them hold, classify
134
+ steps. Run steps 4-9 on each part.
135
+ 4. Test the agent signals. If any one holds, classify **agent-anchored**.
136
+ 5. Otherwise, test the workflow conditions. If all of them hold, classify
98
137
  **workflow-anchored**.
99
- 5. Decide `embeds_other` in both directions: does an agent step appear inside
138
+ 6. Decide `embeds_other` in both directions: does an agent step appear inside
100
139
  this workflow, or does this agent invoke workflows as tools?
101
- 6. If the request is under-specified on an anchor-deciding axis (rule-based
140
+ 7. **Degenerate-shell check.** If a workflow-anchored design reduces to a
141
+ trigger plus a single open-ended agent step that does all the work — no
142
+ deterministic steps earning the shell — the anchor is wrong: reclassify
143
+ **agent-anchored** and build an n8n Agent (an on-demand duty becomes the
144
+ agent's chat use; a scheduled duty becomes a task on the agent). Re-run
145
+ this check while building: when fixed nodes prove unusable and the work
146
+ migrates into one embedded agent step, stop and re-anchor instead of
147
+ finishing the degenerate workflow.
148
+ 8. If the request is under-specified on an anchor-deciding axis (rule-based
102
149
  vs judgment-based, scope/autonomy, interaction mode), classify
103
150
  **needs-clarification** and name the missing axis instead of guessing.
104
- 7. If both anchors are genuinely defensible, apply the growth tiebreaker:
151
+ 9. If both anchors are genuinely defensible, apply the growth tiebreaker:
105
152
  prefer whichever primitive scales with likely complexity growth — usually
106
153
  agent-anchored when novel situations, longer horizons, or learning are
107
154
  implied. The tiebreaker applies only to genuine ties: when a bounded
108
155
  workflow reading fully satisfies the request, prefer it. If it is a real
109
156
  toss-up, say so and name both readings instead of feigning certainty.
157
+ The workflow preference applies to task-shaped requests; it never
158
+ overrides an explicitly requested agent artifact (step 1).
110
159
 
111
160
  ## Signals
112
161
 
113
162
  **Agent-anchored** (any one is enough):
114
163
 
115
164
  - Reasoning dominates the flow: investigate, decide, act, iterate.
165
+ - On-demand question or report that requires judgment-driven navigation of
166
+ external systems (which items matter, how they map to goals) and cannot be
167
+ answered directly with your own tools — the user is in effect already
168
+ chatting with the automation they need. The artifact is an agent with those
169
+ tools that can be asked again anytime, not a manually triggered workflow.
116
170
  - Multi-session or long-running: coordination across days, tracked open
117
171
  threads, daily check-ins.
118
- - Proactive or heartbeat-driven: wakes on its own, checks state, decides
119
- whether to intervene.
172
+ - Proactive or recurring on its own: wakes on a heartbeat or a scheduled
173
+ task, checks state, and decides what to do about it each run. The judgment
174
+ per run is the signal, not the cadence — a schedule alone is anchor-neutral
175
+ (see Scheduled judgment work).
120
176
  - Self-improving or skill accretion is first-class: learns from feedback
121
177
  over time, gets better at the task.
122
- - Chat or session-based interaction.
178
+ - Chat or session-based interaction. A workflow with a Chat Trigger is not
179
+ a substitute — this signal holds unless the chat merely triggers a fixed
180
+ pipeline (see Gotchas).
123
181
  - Cross-session memory.
124
182
 
125
183
  **Workflow-anchored** (all must hold):
@@ -127,10 +185,23 @@ directly onto the matching anchor value.
127
185
  - Structure is a graph of enumerable steps.
128
186
  - Any LLM use is a bounded transformer: fixed-label classify, extract,
129
187
  summarize, or a single decision.
130
- - Trigger and actions are deterministic.
188
+ - Trigger and actions are deterministic. A cron schedule satisfies this but
189
+ never decides the anchor by itself — agents run scheduled tasks too; what
190
+ must be deterministic is the body of each run.
131
191
  - Reproducibility or auditability is served by the same graph running every
132
192
  time.
133
193
 
194
+ **Scheduled judgment work** (recurring cadence + open-ended body): both
195
+ primitives can own it — a workflow shell with an embedded agent step, or an
196
+ agent with a scheduled task. Default to the workflow shell for a standalone,
197
+ single-duty job: a deterministic trigger and delivery around one open-ended
198
+ step keeps auditability and avoids unnecessary agency. Choose an agent with a
199
+ task instead when the duty belongs to an agent the user also interacts with
200
+ or that has other duties, when it needs memory across runs (tracking open
201
+ threads, "what did I flag last time"), or when the user explicitly asked for
202
+ an agent. A recurring duty added to an agent mid-build is always a task on
203
+ that agent, never a spawned workflow.
204
+
134
205
  **Embeds-other signals**:
135
206
 
136
207
  - Workflow with an embedded agent: a step in an otherwise fixed pipeline is
@@ -143,14 +214,14 @@ directly onto the matching anchor value.
143
214
  that drafts a tailored renewal pitch for each account from its usage
144
215
  history embeds an agent; a nightly job that condenses each ticket into a
145
216
  two-sentence summary does not.
146
- - Agent with workflow tools: the user asks for actions that should also be
147
- reusable, callable manually, or run outside the agent; or an action the
148
- agent invokes is itself a deterministic multi-step procedure.
217
+ - For an agent with workflow tools, apply Adding tools to an agent.
149
218
 
150
219
  **Context continuity** (step 0): inside a workflow build, a request to insert
151
220
  a scoring step stays a bounded LLM step, not a new agent. Inside an agent
152
221
  build, a request to post an update on completion is a new tool on that
153
- agent, not a spawned workflow. Only cross into the other primitive when the
222
+ agent, not a spawned workflow and a recurring duty ("also send me a Monday
223
+ summary") is a scheduled task on that agent, not a new scheduled workflow.
224
+ Only cross into the other primitive when the
154
225
  incremental request itself carries its own anchor signal — and even then,
155
226
  prefer asking before switching paradigm if it isn't clearly load-bearing.
156
227
 
@@ -162,8 +233,10 @@ instead.
162
233
 
163
234
  **False friends — not signals**:
164
235
 
165
- - Surface vocabulary: "agent", "assistant", "bot", "workflow", "automate" in
166
- the request text carry no weight. Classify the shape, not the words.
236
+ - Surface vocabulary: "agent", "assistant", "bot", "workflow", "automate"
237
+ in a *task description* carry no weight classify the shape, not the
238
+ words. An explicit artifact request ("build me an agent that…") is not a
239
+ false friend; see Decision Step 1.
167
240
  - Step count and tool count: long linear pipelines and high tool counts are
168
241
  not agentic. Seven deterministic steps with zero branches is still a
169
242
  workflow.
@@ -204,11 +277,22 @@ instead.
204
277
  `embeds_other: true`: long-running coordination invoking a workflow tool.
205
278
  - "Configure an AI agent to send me a nightly digest of new GitHub stars."
206
279
  -> **workflow-anchored**, `embeds_other: false`: fixed schedule and action
207
- despite the word "agent" — a false friend.
280
+ despite the word "agent" — a false friend. When the user instead
281
+ explicitly asks to *build an agent* around a fixed pipeline like this,
282
+ keep the workflow classification but say so rather than switching
283
+ silently (step 1).
208
284
  - "Spin up a lightweight workflow that talks to shoppers on our storefront
209
285
  and handles their product questions." -> **agent-anchored**: chat-based
210
286
  Q&A means the LLM owns turn-by-turn control despite the word "workflow" —
211
287
  a false friend in the other direction.
288
+ - "Build me an agent that answers customer questions from our docs." ->
289
+ **agent-anchored**, `embeds_other: false`: explicit agent artifact
290
+ request plus chat-shaped open-ended Q&A. The deliverable is an n8n Agent
291
+ — not a workflow with a Chat Trigger and an AI Agent node.
292
+ - "Give me a chat box where I paste a company name and it runs our
293
+ enrichment steps and replies with the result." -> **workflow-anchored**,
294
+ `embeds_other: false`: chat is merely the manual trigger for a fixed
295
+ graph — the one case where a Chat Trigger workflow is the right build.
212
296
  - "Post every new Airtable record to a Discord channel, and separately set up
213
297
  an agent that handles customer refund requests end-to-end." -> two parts,
214
298
  joined only by topic, not data or trigger: "Airtable-to-Discord posting"
@@ -224,6 +308,14 @@ instead.
224
308
  deck that summarizes the findings." -> one part, **agent-anchored**,
225
309
  `embeds_other: true`: many tools but one lifecycle — do not split on tool
226
310
  count.
311
+ - "Tell me how the platform team is progressing against their cycle goals —
312
+ current status is in our issue tracker, the goals are on our internal
313
+ wiki." -> **agent-anchored**, `embeds_other: false`: an on-demand judgment
314
+ report over external systems you cannot query directly. The artifact is an
315
+ agent with tracker and wiki tools the user can ask again anytime — not a
316
+ manual-trigger workflow whose only real step is an embedded agent with
317
+ those same tools. If the user later wants it every Friday, that becomes a
318
+ scheduled task on the same agent, not a conversion to a workflow.
227
319
  - "Tell me when something important happens with our shipments." ->
228
320
  **needs-clarification**: "important" is undefined; ask whether concrete
229
321
  rules exist or this needs judgment-based triage.
@@ -242,7 +334,26 @@ instead.
242
334
  - Never split a compound request on tool or step enumeration alone — split
243
335
  only on separate lifecycles.
244
336
  - Unnecessary agency adds latency, cost, and compounding error risk — do not
245
- reach for an agent when a bounded workflow fully satisfies the request.
337
+ reach for an agent when a bounded workflow fully satisfies a task-shaped
338
+ request. This is not a license to override an explicit agent request.
339
+ - Never satisfy an **agent-anchored** classification with a workflow
340
+ containing a Chat Trigger + AI Agent node. Agent-anchored requests
341
+ produce an n8n Agent artifact via the agent build path; the AI Agent
342
+ *node* exists only for `embeds_other: true` steps inside a genuinely
343
+ workflow-anchored pipeline. A Chat Trigger workflow is correct only when
344
+ chat is merely the manual trigger for a fixed graph.
345
+ - Do not demote an explicitly requested agent to an embedded AI Agent step
346
+ inside a workflow — workflow-anchored with `embeds_other: true` is for
347
+ agent steps inside a pipeline the user described as a pipeline.
348
+ - A workflow whose only real step is one embedded agent doing all the work
349
+ is an agent wearing a workflow costume — the mirror image of the Chat
350
+ Trigger gotcha above. Apply the degenerate-shell check (step 7) and
351
+ re-anchor instead of shipping trigger + AI Agent node.
352
+ - Do not treat a cron schedule as a workflow signal by itself — agents run
353
+ scheduled tasks. Classify by the body of each run, and when a one-off
354
+ question can't be answered directly, do not fall back to "build a workflow
355
+ or do it yourself": an agent with the right tools is usually the missing
356
+ option.
246
357
  - Do not use an agent when progress cannot be verified: if the path cannot
247
358
  be scripted and the result cannot be checked, the design is not ready.
248
359
  - Respect the current build context: an incremental request stays on the
@@ -258,7 +369,7 @@ Return a concise classification and reason:
258
369
  Anchor: workflow-anchored | agent-anchored | needs-clarification | out-of-scope
259
370
  Embeds other: true | false | n/a
260
371
  Reason: <one or two sentences citing the deciding signals>
261
- Next step: <build workflow / build workflow with embedded agent step / design agent (workflows as tools where actions should be reusable) / ask clarification / answer directly>
372
+ Next step: <build workflow / build workflow with embedded agent step / build n8n Agent artifact (agent build path; recurring duties as scheduled tasks on the agent) / ask clarification / answer directly>
262
373
  ```
263
374
 
264
375
  For build requests, do not expose this format unless the user asks for