@n8n/instance-ai 1.19.3 → 1.20.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 (70) hide show
  1. package/dist/agent/instance-agent.js +1 -0
  2. package/dist/agent/instance-agent.js.map +1 -1
  3. package/dist/agent/system-prompt.d.ts +1 -0
  4. package/dist/agent/system-prompt.js +18 -4
  5. package/dist/agent/system-prompt.js.map +1 -1
  6. package/dist/build.tsbuildinfo +1 -1
  7. package/dist/index.d.ts +5 -2
  8. package/dist/index.js +8 -2
  9. package/dist/index.js.map +1 -1
  10. package/dist/knowledge-base/materialize-knowledge-base.js +12 -1
  11. package/dist/knowledge-base/materialize-knowledge-base.js.map +1 -1
  12. package/dist/skills/runtime-skills.js +1 -1
  13. package/dist/skills/runtime-skills.js.map +1 -1
  14. package/dist/stream/map-chunk.js +22 -0
  15. package/dist/stream/map-chunk.js.map +1 -1
  16. package/dist/stream/output-redaction.js +30 -0
  17. package/dist/stream/output-redaction.js.map +1 -1
  18. package/dist/tools/credentials.tool.d.ts +212 -0
  19. package/dist/tools/credentials.tool.js +155 -21
  20. package/dist/tools/credentials.tool.js.map +1 -1
  21. package/dist/tools/data-tables.tool.js +31 -8
  22. package/dist/tools/data-tables.tool.js.map +1 -1
  23. package/dist/tools/index.js +4 -0
  24. package/dist/tools/index.js.map +1 -1
  25. package/dist/tools/mcp-servers.tool.d.ts +2 -0
  26. package/dist/tools/mcp-servers.tool.js +56 -0
  27. package/dist/tools/mcp-servers.tool.js.map +1 -0
  28. package/dist/tools/orchestration/agent-target-binding.d.ts +3 -0
  29. package/dist/tools/orchestration/agent-target-binding.js +64 -0
  30. package/dist/tools/orchestration/agent-target-binding.js.map +1 -1
  31. package/dist/tools/orchestration/build-agent.tool.js +57 -30
  32. package/dist/tools/orchestration/build-agent.tool.js.map +1 -1
  33. package/dist/tools/tool-ids.d.ts +2 -0
  34. package/dist/tools/tool-ids.js +5 -1
  35. package/dist/tools/tool-ids.js.map +1 -1
  36. package/dist/tools/workflows/build-workflow.tool.js +41 -12
  37. package/dist/tools/workflows/build-workflow.tool.js.map +1 -1
  38. package/dist/tools/workflows/credential-utils.d.ts +3 -0
  39. package/dist/tools/workflows/credential-utils.js +31 -1
  40. package/dist/tools/workflows/credential-utils.js.map +1 -1
  41. package/dist/tools/workflows/resolve-credentials.js +54 -1
  42. package/dist/tools/workflows/resolve-credentials.js.map +1 -1
  43. package/dist/tools/workflows/setup-workflow.schema.d.ts +151 -0
  44. package/dist/tools/workflows/setup-workflow.service.d.ts +6 -0
  45. package/dist/tools/workflows/setup-workflow.service.js +77 -13
  46. package/dist/tools/workflows/setup-workflow.service.js.map +1 -1
  47. package/dist/tools/workflows/workflow-file-bindings.d.ts +3 -1
  48. package/dist/tools/workflows/workflow-file-bindings.js +5 -2
  49. package/dist/tools/workflows/workflow-file-bindings.js.map +1 -1
  50. package/dist/tools/workflows.tool.js +44 -0
  51. package/dist/tools/workflows.tool.js.map +1 -1
  52. package/dist/tracing/agent-snapshot-event.d.ts +17 -0
  53. package/dist/tracing/agent-snapshot-event.js +56 -0
  54. package/dist/tracing/agent-snapshot-event.js.map +1 -0
  55. package/dist/types.d.ts +30 -1
  56. package/dist/types.js.map +1 -1
  57. package/dist/workspace/workspace-paths.d.ts +4 -2
  58. package/dist/workspace/workspace-paths.js +15 -2
  59. package/dist/workspace/workspace-paths.js.map +1 -1
  60. package/knowledge-base/reference/anthropic-output-shape.md +72 -0
  61. package/knowledge-base/reference/open-ai-output-shape.md +3 -0
  62. package/package.json +12 -12
  63. package/skills/agent-builder/SKILL.md +94 -0
  64. package/skills/credential-recipe-research/SKILL.md +88 -0
  65. package/skills/debugging-executions/SKILL.md +2 -1
  66. package/skills/intent-recognition/SKILL.md +23 -30
  67. package/skills/planning/SKILL.md +7 -5
  68. package/skills/post-build-flow/SKILL.md +111 -28
  69. package/skills/workflow-builder/SKILL.md +68 -23
  70. package/skills/workflow-builder/references/error-workflows.md +2 -2
package/dist/types.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":";;;AAomCa,QAAA,kBAAkB,GAAG,CAAC,gBAAgB,EAAE,YAAY,CAAU,CAAC;AAE/D,QAAA,yBAAyB,GAAG,CAAC,UAAU,CAAU,CAAC;AAClD,QAAA,yBAAyB,GAAG;IACxC,GAAG,QAAA,kBAAkB;IACrB,GAAG,QAAA,yBAAyB;CACnB,CAAC"}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":";;;AAiqCa,QAAA,kBAAkB,GAAG,CAAC,gBAAgB,EAAE,YAAY,CAAU,CAAC;AAE/D,QAAA,yBAAyB,GAAG,CAAC,UAAU,CAAU,CAAC;AAClD,QAAA,yBAAyB,GAAG;IACxC,GAAG,QAAA,kBAAkB;IACrB,GAAG,QAAA,yBAAyB;CACnB,CAAC"}
@@ -1,4 +1,6 @@
1
- export declare function normalizeWorkspaceRelativePath(path: string, options?: {
1
+ export interface NormalizeWorkspaceRelativePathOptions {
2
2
  resourceLabel?: string;
3
- }): string;
3
+ workspaceRoot?: string;
4
+ }
5
+ export declare function normalizeWorkspaceRelativePath(path: string, options?: NormalizeWorkspaceRelativePathOptions): string;
4
6
  export declare function joinWorkspacePath(root: string, path: string): string;
@@ -2,9 +2,21 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.normalizeWorkspaceRelativePath = normalizeWorkspaceRelativePath;
4
4
  exports.joinWorkspacePath = joinWorkspacePath;
5
+ function stripWorkspaceRootPrefix(path, workspaceRoot) {
6
+ const root = workspaceRoot.replace(/\/+$/, '');
7
+ if (root.length === 0)
8
+ return path;
9
+ const collapsed = path.replace(/\/{2,}/g, '/');
10
+ if (collapsed === root)
11
+ return '';
12
+ return collapsed.startsWith(`${root}/`) ? collapsed.slice(root.length + 1) : path;
13
+ }
5
14
  function normalizeWorkspaceRelativePath(path, options = {}) {
6
15
  const label = options.resourceLabel ?? 'Workspace';
7
- const trimmed = path.trim().replace(/^\.\/+/, '');
16
+ let trimmed = path.trim().replace(/^\.\/+/, '');
17
+ if (options.workspaceRoot && trimmed.startsWith('/')) {
18
+ trimmed = stripWorkspaceRootPrefix(trimmed, options.workspaceRoot);
19
+ }
8
20
  const segments = trimmed.split('/');
9
21
  const normalized = segments.filter((segment) => segment.length > 0 && segment !== '.').join('/');
10
22
  if (normalized.length === 0 ||
@@ -13,7 +25,8 @@ function normalizeWorkspaceRelativePath(path, options = {}) {
13
25
  trimmed.includes('\\') ||
14
26
  trimmed.includes('\0') ||
15
27
  segments.some((segment) => segment === '..')) {
16
- throw new Error(`${label} path must stay within the workspace root: ${path}`);
28
+ throw new Error(`${label} path must stay within the workspace root: ${path}. ` +
29
+ 'Pass a workspace-relative path like src/workflows/my-workflow.workflow.ts.');
17
30
  }
18
31
  return normalized;
19
32
  }
@@ -1 +1 @@
1
- {"version":3,"file":"workspace-paths.js","sourceRoot":"","sources":["../../src/workspace/workspace-paths.ts"],"names":[],"mappings":";;;;AAAA,wCACC,IAAY,EACZ,OAAO,GAA+B,EAAE;IAExC,MAAM,KAAK,GAAG,OAAO,CAAC,aAAa,IAAI,WAAW,CAAC;IACnD,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;IAClD,MAAM,QAAQ,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACpC,MAAM,UAAU,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,IAAI,OAAO,KAAK,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAEjG,IACC,UAAU,CAAC,MAAM,KAAK,CAAC;QACvB,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC;QACvB,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC;QACx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Ac,KAAK,GAAG,CAAC,CAAC,CAAC,IAAI,cAAc,EAAE,CAAC,CAAC,CAAC,GAAG,cAAc,IAAI,cAAc,EAAE,CAAC;AAC9F,CAAC"}
@@ -0,0 +1,72 @@
1
+ # Anthropic node output shape
2
+
3
+ Node type: `@n8n/n8n-nodes-langchain.anthropic`
4
+
5
+ Use this when mapping downstream fields from an Anthropic node with
6
+ `$json.<field>` or `$('NodeName').item.json.<field>`, or when parsing its
7
+ output in a Code node.
8
+
9
+ ## Text → Message (`resource: text`, `operation: message`)
10
+
11
+ With **Simplify Output** enabled (default), the node emits:
12
+
13
+ ```json
14
+ {
15
+ "content": [
16
+ { "type": "text", "text": "..." }
17
+ ],
18
+ "merged_response": "..."
19
+ }
20
+ ```
21
+
22
+ **`$json.content` is an ARRAY of content blocks, not a string.** Never treat
23
+ `$json.content` itself as the reply string.
24
+
25
+ **`content[0]` is not guaranteed to be a text block.** The array is passed
26
+ through from the Messages API unfiltered: with **Web Search** or **Code
27
+ Execution** enabled it also contains `server_tool_use` and
28
+ `*_tool_result` blocks, and citations can split the answer across multiple
29
+ `text` blocks. Read the assistant text with one of:
30
+
31
+ - **`$json.merged_response`** — all `text` blocks joined into one string; the
32
+ simplest field to consume downstream. Only present when the node option
33
+ **Include Merged Response** is enabled, so prefer enabling it.
34
+ - **`$json.content.find(c => c.type === 'text')?.text`** — the first text
35
+ block, safe regardless of node options. Keep the `?.`: a turn can end with
36
+ no text block at all (e.g. cut off mid-tool-use by the iteration cap or
37
+ `max_tokens`).
38
+ - `$json.content[0].text` — only safe in the plain default configuration
39
+ (no web search / code execution).
40
+
41
+ ### Parsing model-generated JSON in a Code node
42
+
43
+ When you ask the model to reply with JSON, the JSON string lives inside a
44
+ text block. Parse the text block's `text`, not `content`:
45
+
46
+ ```javascript
47
+ // Correct
48
+ const text = $json.content.find((c) => c.type === 'text')?.text;
49
+ if (!text) throw new Error('Model returned no text block');
50
+ const parsed = JSON.parse(text);
51
+
52
+ // Wrong — content is an array of blocks, JSON.parse will throw
53
+ const parsed = JSON.parse($json.content);
54
+ ```
55
+
56
+ Models often wrap JSON in markdown fences even when told not to; strip them
57
+ defensively before parsing:
58
+
59
+ ```javascript
60
+ const text = $json.content.find((c) => c.type === 'text')?.text ?? '';
61
+ const raw = text.trim().replace(/^```(?:json)?\s*/, '').replace(/\s*```$/, '');
62
+ const parsed = JSON.parse(raw);
63
+ ```
64
+
65
+ ### Caveats
66
+
67
+ - **`simplify: false`**: `$json` is the full Messages API response (`id`,
68
+ `role`, `model`, `content`, `stop_reason`, `usage`, …). The `content` array
69
+ has the same shape and the same non-text-block caveats as above.
70
+ - **No response-format option.** Unlike the OpenAI node, the Anthropic node
71
+ has no `json_object`/`json_schema` output mode — JSON replies always arrive
72
+ as a string inside a text block and must be parsed by you.
@@ -52,6 +52,9 @@ reference:
52
52
  Pick the index that matches the text you need.
53
53
  - **Structured / JSON output** (`text.format.type` of `json_object` or
54
54
  `json_schema`): `content[].text` is parsed into an **object**, not a string.
55
+ In a Code node, use it directly (`$json.output[0].content[0].text.someField`)
56
+ — calling `JSON.parse`, `.slice`, `.trim`, or other string methods on it will
57
+ throw or misbehave.
55
58
  - **`simplify: false`**: `$json` is the full Responses API payload (`id`, `status`,
56
59
  `output`, `usage`, …). Message text is still under `output`, but `output` may
57
60
  also include non-message items (reasoning, tool calls, etc.).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@n8n/instance-ai",
3
- "version": "1.19.3",
3
+ "version": "1.20.1",
4
4
  "main": "dist/index.js",
5
5
  "module": "src/index.ts",
6
6
  "types": "dist/index.d.ts",
@@ -38,7 +38,7 @@
38
38
  "@mozilla/readability": "^0.6.0",
39
39
  "@opentelemetry/api": "1.9.1",
40
40
  "@thednp/dommatrix": "^2.0.12",
41
- "ai": "^7.0.37",
41
+ "ai": "^7.0.48",
42
42
  "csv-parse": "6.2.1",
43
43
  "fast-glob": "3.3.3",
44
44
  "flatted": "3.4.2",
@@ -52,20 +52,20 @@
52
52
  "psl": "1.9.0",
53
53
  "source-map-support": "0.5.21",
54
54
  "turndown": "^7.2.2",
55
- "undici": "^7.28.0",
55
+ "undici": "^7.29.0",
56
56
  "@e965/xlsx": "0.20.3",
57
57
  "zod": "3.25.76",
58
58
  "zod-from-json-schema-v3": "npm:zod-from-json-schema@^0.0.5",
59
- "@n8n/agents": "0.19.3",
60
- "@n8n/ai-utilities": "0.27.2",
61
- "@n8n/api-types": "1.34.2",
62
- "@n8n/utils": "1.42.0",
63
- "@n8n/mcp-browser": "0.16.0",
64
- "@n8n/workflow-sdk": "0.27.2",
65
- "n8n-workflow": "2.34.2"
59
+ "@n8n/agents": "0.20.1",
60
+ "@n8n/ai-utilities": "0.28.1",
61
+ "@n8n/api-types": "1.35.1",
62
+ "@n8n/mcp-browser": "0.17.0",
63
+ "@n8n/utils": "1.43.0",
64
+ "@n8n/workflow-sdk": "0.28.0",
65
+ "n8n-workflow": "2.35.0"
66
66
  },
67
67
  "devDependencies": {
68
- "@ai-sdk/anthropic": "^4.0.20",
68
+ "@ai-sdk/anthropic": "^4.0.27",
69
69
  "@langchain/core": "1.2.0",
70
70
  "@types/luxon": "3.2.0",
71
71
  "@types/psl": "1.1.3",
@@ -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.19.0"
80
+ "@n8n/vitest-config": "1.20.0"
81
81
  },
82
82
  "license": "SEE LICENSE IN LICENSE.md",
83
83
  "homepage": "https://n8n.io",
@@ -0,0 +1,94 @@
1
+ ---
2
+ name: agent-builder
3
+ description: >-
4
+ Load before calling build-agent for a new or existing n8n Agent. Governs
5
+ prerequisite creation, faithful handoff of the user's request, agent
6
+ targeting across turns, builder questions, testing, and publishing. Use
7
+ directly for routine follow-ups when the conversation already targets an
8
+ Agent; rerun intent-recognition only when the requested artifact is no
9
+ longer clear.
10
+ recommended_tools:
11
+ - build-agent
12
+ - build-workflow
13
+ - data-tables
14
+ ---
15
+
16
+ # Agent Builder
17
+
18
+ ## Routing
19
+
20
+ Use this skill after `intent-recognition` chooses an agent-anchored design, or
21
+ when the conversation already targets an Agent and the user is continuing that
22
+ build. Do not rerun intent recognition for routine Agent edits or extensions.
23
+ Use `build-agent` only for Agent artifacts.
24
+
25
+ ## Faithful handoff
26
+
27
+ Treat `message` as a faithful handoff of the user's request, not an Agent build
28
+ specification authored by you. Forward the user's wording as close to verbatim
29
+ as possible. Include only:
30
+
31
+ - Requirements, constraints, and implementation choices the user explicitly
32
+ stated.
33
+ - Explicit answers or decisions from earlier turns that are necessary for the
34
+ current request.
35
+ - Prerequisite workflows or data tables you created for this Agent.
36
+
37
+ Never infer, invent, expand, recommend, or prescribe implementation details the
38
+ user did not request, and never present your assumptions as user requirements.
39
+ In particular, do not choose or tell the builder which model, instructions,
40
+ tools, tool types, integrations, channels, MCP servers, workflows, skills,
41
+ tasks, memory, credentials, triggers, schedules, approvals, or test strategy to
42
+ use.
43
+
44
+ Do not translate an outcome or named service into a specific implementation.
45
+ For example, forward "a Slack agent that says hello to me" without turning it
46
+ into a request for a Slack node tool. Preserve unspecified and ambiguous
47
+ implementation details so the builder can resolve them with its own guidance
48
+ and interactive tools.
49
+
50
+ ## Prerequisites
51
+
52
+ Before the first `build-agent` call, create every prerequisite the builder
53
+ cannot create:
54
+
55
+ - Create a workflow tool only when one Agent tool call must run an ordered
56
+ multi-node procedure, or when the user explicitly needs that workflow to be
57
+ reusable, manually callable, or usable outside the Agent. Follow
58
+ `workflow-builder`, then pass the built workflow in `workflowContext`.
59
+ - When the Agent will store or query tabular data, follow `data-table-manager`
60
+ and create the required tables via `data-tables`. The builder cannot create
61
+ tables.
62
+
63
+ List prerequisite names and schemas in `message`. Let the builder gather the
64
+ remaining Agent-specific requirements, including model, credentials,
65
+ integrations, and direct tools.
66
+
67
+ If a `builderReply` lists missing workflows or tables, create them and call
68
+ `build-agent` again. Never ask the user to create them manually.
69
+
70
+ ## Targeting across turns
71
+
72
+ Address Agents in this conversation with `agentRef`, a short stable key similar
73
+ to a workflow `filePath`.
74
+
75
+ - For the first Agent, pass a fresh `agentRef` and `name`.
76
+ - Reuse that `agentRef` on later calls. Calls with neither `agentRef` nor
77
+ `agentId` continue editing the current Agent.
78
+ - To build an additional Agent, pass `createNew: true` with a different
79
+ `agentRef` and `name`.
80
+ - To edit an Agent not built in this conversation, pass its `agentId` once,
81
+ optionally with an `agentRef`, then prefer the returned `agentRef`.
82
+
83
+ Naming or renaming the current Agent never silently creates another one.
84
+
85
+ ## Builder-owned interactions
86
+
87
+ When the user asks to test, run, publish, activate, make usable, unpublish, or
88
+ otherwise change the Agent, forward that intent in `message`. The builder owns
89
+ its internal testing tools; do not conclude testing is unavailable because
90
+ those tools do not appear in your toolset.
91
+
92
+ When the builder needs a user choice, credential, chat channel, or approval, it
93
+ surfaces an interactive card in this chat. Do not relay the question yourself;
94
+ the `build-agent` call resumes with the user's answer.
@@ -0,0 +1,88 @@
1
+ ---
2
+ name: credential-recipe-research
3
+ description: >-
4
+ Lookup procedure for Simplified Custom Auth recipe fields — sources the auth
5
+ template, the key-issuing docsUrl and an auth-rejecting testUrl from the
6
+ provider's real documentation instead of memory. Load before composing
7
+ credentialHints for a service without a dedicated credential type (the
8
+ post-build-flow setup step), or when asked to fix a recipe whose template,
9
+ key page or test endpoint is wrong.
10
+ recommended_tools:
11
+ - research
12
+ - workflows
13
+ ---
14
+
15
+ # Credential Recipe Research
16
+
17
+ A recipe is only as good as the documentation it came from. This is a
18
+ procedure, not guidance: execute every step with the `research` tool and keep
19
+ only findings you can point to on a fetched page. Guessed URLs are how users
20
+ end up on the wrong page with a key that can't be verified.
21
+
22
+ Inputs: the service name and the API host(s) the workflow's nodes call.
23
+
24
+ ## 1. Auth scheme (template)
25
+
26
+ Fetch the provider's authentication docs — `research(action="web-search")`
27
+ with `"<service> API authentication"`, then `fetch-url` the best docs hit.
28
+ Record the scheme EXACTLY as documented: header name, prefix word, casing
29
+ (`Authorization: Key {{api_key}}` vs `Bearer {{api_key}}` vs a custom header
30
+ like `xi-api-key`). If the documented auth is basic, digest, or OAuth, stop:
31
+ that is not expressible as a template — use the matching generic type instead
32
+ (see the workflow-builder skill's credential ladder).
33
+
34
+ ## 2. Key page (docsUrl)
35
+
36
+ Find where a logged-in user CREATES or COPIES the key. The URL is not shown
37
+ in the form — the AI Assistant help thread presents it as THE place to get
38
+ the value, so a wrong URL sends the user to a dead end with full confidence:
39
+
40
+ - Search `"<service> dashboard API keys"`, and scan the fetched auth docs for
41
+ phrases like "get your key from", "Dashboard → API Keys", "console",
42
+ "settings".
43
+ - The answer normally lives on an app/console/dashboard host —
44
+ `console.apify.com/settings/integrations`,
45
+ `elevenlabs.io/app/settings/api-keys`, `replicate.com/account/api-tokens`,
46
+ `app.tavily.com/home` — not under `/docs`, `/reference`, or
47
+ `/documentation`.
48
+ - Accept a docs-domain URL only when the fetched page shows keys are actually
49
+ issued there (some ReadMe-style logged-in portals do).
50
+ - NEVER construct a dashboard path by analogy (`/account/api-keys`,
51
+ `/dashboard/keys`, …). Dashboards are apps behind a login: a fetch answers
52
+ 200 for any invented route, so the path cannot be verified by fetching.
53
+ Emit a deep dashboard URL only when it appears VERBATIM on a page you
54
+ fetched; when the docs only describe navigation ("Dashboard → API Keys")
55
+ without a literal URL, use the dashboard/app root they reference — a
56
+ shallower real page beats a deeper invented one.
57
+ - Nothing conclusive after both steps → omit docsUrl. Never pass off the API
58
+ reference as the key page.
59
+
60
+ ## 3. Verification endpoint (testUrl)
61
+
62
+ Find a documented, side-effect-free GET that rejects a bad key with 401/403.
63
+ Check the API reference in this order and stop at the first qualifying hit:
64
+
65
+ 1. Account/profile/me endpoints — `/v1/account`, `/v2/users/me`, `/v1/user`.
66
+ 2. Usage/quota endpoints — e.g. fal's `/v1/models/usage`, Tavily's `/usage`.
67
+ 3. List/discovery endpoints — `/v1/templates`, `/v1/models`, `/v1/voices`.
68
+
69
+ Rules, all mandatory:
70
+
71
+ - The endpoint must appear on a page you fetched — never construct a path by
72
+ analogy with other APIs.
73
+ - Never one of the workflow's own endpoints, never a resource or action URL,
74
+ never anything that can trigger billable work. Setup rejects workflow-URL
75
+ collisions, and the probe reports unexpected statuses as "could not be
76
+ verified" — an invented URL only costs the user trust.
77
+ - Skip endpoints that answer 2xx regardless of the key: auth-optional
78
+ endpoints (Pexels search) or services that signal auth errors in the
79
+ response body (Apollo's `auth/health`, TikTok) — a status probe cannot
80
+ verify through them.
81
+ - Nothing qualifies → omit testUrl. The credential saves fine and the card
82
+ honestly reports it could not be verified, which beats a false green.
83
+
84
+ ## 4. Compose
85
+
86
+ Fill `credentialHints` (field list and example in the post-build-flow skill)
87
+ from the findings above only. `suggestedName` names the service ("Apify API
88
+ Token"); never include a real secret.
@@ -31,7 +31,8 @@ name what is unconfirmed instead of repeating a success claim.
31
31
 
32
32
  Use `executions(action="run")` with `inputData` matching the trigger's output
33
33
  shape — do not rebuild the workflow with a Manual Trigger. For trigger
34
- `inputData` shapes, read `knowledge-base/reference/trigger-input-data-shapes.md`
34
+ `inputData` shapes, read
35
+ `${N8N_WORKSPACE_DIR}/knowledge-base/reference/trigger-input-data-shapes.md`
35
36
  when a sandbox workspace is available.
36
37
 
37
38
  ## Failed execution
@@ -5,24 +5,25 @@ description: >-
5
5
  owns the top-level control flow — workflow-anchored, agent-anchored,
6
6
  needs-clarification, or out-of-scope) and embeds_other (whether the other
7
7
  primitive appears embedded inside — an agent step inside a workflow, or a
8
- workflow invoked as an agent tool). Must be used before deciding the intent
9
- of any automation request, including compound requests with multiple
10
- independent automations, mid-build extensions to an existing workflow or
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.
8
+ workflow invoked as an agent tool). Must be used whenever the current turn
9
+ requires choosing or reconsidering the intent of an automation request,
10
+ including compound requests, independent automations introduced mid-build,
11
+ one-off questions or reports that need external systems you cannot query
12
+ directly, and requests that need clarification before an anchor can be
13
+ chosen. Do not load for routine edits or extensions when the conversation
14
+ already targets a workflow or Agent.
15
15
  ---
16
16
 
17
17
  # Intent recognition
18
18
 
19
19
  ## Purpose
20
20
 
21
- Use this skill to classify an automation request before designing or building
22
- it. This skill must be used before deciding whether a request is
23
- workflow-anchored, agent-anchored, needs clarification, or out of scope, and
24
- before deciding whether the other primitive is embedded inside it. The
25
- deciding question is not a single "workflow or agent" label it is two
21
+ Use this skill when an automation request still needs to be classified before
22
+ designing or building it, or when a new turn may require reconsidering the
23
+ current artifact. Do not load it again for a routine edit or extension when the
24
+ conversation already targets a workflow or Agent, unless the user introduces
25
+ an independent automation or the new request carries its own anchor signal.
26
+ The deciding question is not a single "workflow or agent" label — it is two
26
27
  questions: who owns the top-level control flow, and does the other primitive
27
28
  show up inside that flow.
28
29
 
@@ -76,8 +77,8 @@ Two orthogonal decisions per request, or per part for compound requests:
76
77
 
77
78
  - workflow-anchored + `true`: an agent embedded as a workflow step (e.g. a
78
79
  scheduled pipeline whose middle step is open-ended investigation).
79
- - agent-anchored + `true`: workflows invoked as tools of the agent; see Adding
80
- tools to an agent to distinguish them from direct tools.
80
+ - agent-anchored + `true`: workflows invoked as tools of the agent; see Agent
81
+ tool shape to distinguish them from direct tools.
81
82
  - `n/a` for needs-clarification and out-of-scope.
82
83
 
83
84
  **Migration from the old taxonomy**: old **hybrid** → workflow-anchored,
@@ -87,37 +88,29 @@ only when the user wants a persistent, triggerable automation. Old
87
88
  **ambiguous** → needs-clarification. Old **workflow** and **agent** map
88
89
  directly onto the matching anchor value.
89
90
 
90
- ## Adding tools to an agent
91
+ ## Agent tool shape
91
92
 
92
93
  After choosing an agent-anchored design, decide whether each capability should
93
94
  be a direct agent tool or a workflow tool:
94
95
 
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
96
+ - **Direct agent tools are the default.** One node-backed capability or multiple
97
+ independent node tools stay on the Agent build path with
99
98
  `embeds_other: false`.
100
99
  - Use a **workflow tool** only when one agent tool call must run an ordered
101
100
  multi-node procedure, or when the user explicitly needs that workflow
102
101
  reusable, manually callable, or usable outside the agent. Build the workflow
103
102
  first, pass it to `build-agent` via `workflowContext`, and set
104
103
  `embeds_other: true`.
105
- - Create required **data tables** via `data-table-manager` → `data-tables`
106
- before `build-agent` when the agent will store or query tabular data — the
107
- builder cannot create tables.
108
- - Before the first `build-agent` call, create every prerequisite the builder
109
- cannot: required data tables and any workflow tools the agent will invoke.
110
- Pass built workflows in `workflowContext` and list every prerequisite
111
- name/schema in `message`. Then let the builder gather remaining agent-specific
112
- requirements (model, credentials, integrations).
113
- - If a `builderReply` lists missing workflows or tables, create them and call
114
- `build-agent` again — never ask the user to create them manually.
115
104
 
116
105
  Count the nodes required inside one tool invocation, not the total number of
117
106
  tools on the agent. For example, looking up and inserting Data Table rows are
118
107
  two direct node tools; an atomic lookup-transform-write procedure is one
119
108
  workflow tool.
120
109
 
110
+ After choosing an agent-anchored design, load `agent-builder` before calling
111
+ `build-agent`. It owns prerequisite creation and the handoff to the delegated
112
+ builder.
113
+
121
114
  ## Decision Steps
122
115
 
123
116
  0. If the user is mid-build on an existing workflow or agent, apply context
@@ -224,7 +217,7 @@ that agent, never a spawned workflow.
224
217
  that drafts a tailored renewal pitch for each account from its usage
225
218
  history embeds an agent; a nightly job that condenses each ticket into a
226
219
  two-sentence summary does not.
227
- - For an agent with workflow tools, apply Adding tools to an agent.
220
+ - For an agent with workflow tools, apply Agent tool shape.
228
221
 
229
222
  **Context continuity** (step 0): inside a workflow build, a request to insert
230
223
  a scoring step stays a bounded LLM step, not a new agent. Inside an agent
@@ -58,11 +58,13 @@ with direct `data-tables` and `parse-file` calls.
58
58
 
59
59
  ## Knowledge Base
60
60
 
61
- **Consult the knowledge base before planning.** Read the relevant `.md` guides
62
- and templates for each technique the request involves (`knowledge-base/index.json`,
63
- `knowledge-base/best-practices/index.json`, and linked files). Use
64
- `workspace_execute_command` with `rg` or `find` under `knowledge-base/templates/`
65
- to locate matching SDK examples never load `templates/index.json` wholesale.
61
+ **Consult the knowledge base before planning.** It lives at the workspace root.
62
+ Read the relevant `.md` guides and templates for each technique the request
63
+ involves (`${N8N_WORKSPACE_DIR}/knowledge-base/index.json`,
64
+ `${N8N_WORKSPACE_DIR}/knowledge-base/best-practices/index.json`, and linked
65
+ files). Use `workspace_execute_command` with `rg` or `find` under
66
+ `${N8N_WORKSPACE_DIR}/knowledge-base/templates/` to locate matching SDK
67
+ examples — never load `templates/index.json` wholesale.
66
68
  Skip only for trivial mechanical edits you have already reviewed in this thread.
67
69
 
68
70
  ## Method