@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
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.buildCredentialMap = buildCredentialMap;
4
4
  exports.buildCredentialResolutionNote = buildCredentialResolutionNote;
5
5
  exports.resolveCredentials = resolveCredentials;
6
+ const api_types_1 = require("@n8n/api-types");
6
7
  const credential_utils_1 = require("./credential-utils");
7
8
  const setup_workflow_service_1 = require("./setup-workflow.service");
8
9
  async function buildCredentialMap(credentialService) {
@@ -95,6 +96,29 @@ async function resolveCredentials(json, workflowId, ctx, availableCredentials) {
95
96
  catch {
96
97
  }
97
98
  }
99
+ const siblingBindingsByType = new Map();
100
+ const registerSiblingBinding = (credentialType, value) => {
101
+ if (credential_utils_1.GENERIC_AUTH_CREDENTIAL_TYPES.has(credentialType))
102
+ return;
103
+ if (siblingBindingsByType.has(credentialType))
104
+ return;
105
+ const id = getCredentialId(value);
106
+ if (!id)
107
+ return;
108
+ if (!isKnownCredentialForType(value, credentialType, availableCredentials))
109
+ return;
110
+ siblingBindingsByType.set(credentialType, { id, name: getCredentialName(value) ?? id });
111
+ };
112
+ for (const node of json.nodes ?? []) {
113
+ for (const [credentialType, value] of Object.entries(node.credentials ?? {})) {
114
+ registerSiblingBinding(credentialType, value);
115
+ }
116
+ }
117
+ for (const savedCreds of existingCredsByNode.values()) {
118
+ for (const [credentialType, value] of Object.entries(savedCreds)) {
119
+ registerSiblingBinding(credentialType, value);
120
+ }
121
+ }
98
122
  for (const node of json.nodes ?? []) {
99
123
  if (!node.credentials)
100
124
  continue;
@@ -120,6 +144,15 @@ async function resolveCredentials(json, workflowId, ctx, availableCredentials) {
120
144
  cleanupMockPinData(json, node.name);
121
145
  return true;
122
146
  };
147
+ const reuseSiblingNodeCredential = () => {
148
+ const sibling = siblingBindingsByType.get(key);
149
+ if (!sibling)
150
+ return false;
151
+ creds[key] = { id: sibling.id, name: sibling.name };
152
+ recordResolvedCredential(sibling.id, sibling.name);
153
+ cleanupMockPinData(json, node.name);
154
+ return true;
155
+ };
123
156
  const mockCredential = () => {
124
157
  const nodeName = node.name ?? '';
125
158
  delete creds[key];
@@ -163,6 +196,19 @@ async function resolveCredentials(json, workflowId, ctx, availableCredentials) {
163
196
  mockCredential();
164
197
  };
165
198
  if (value !== undefined && value !== null) {
199
+ if (key === api_types_1.TEMPLATED_CUSTOM_AUTH_CREDENTIAL_TYPE) {
200
+ const suppliedId = getCredentialId(value);
201
+ const priorId = getCredentialId(existingCreds?.[key]);
202
+ if (suppliedId !== undefined && suppliedId === priorId) {
203
+ cleanupMockPinData(json, node.name);
204
+ continue;
205
+ }
206
+ if (restoreExistingCredential()) {
207
+ continue;
208
+ }
209
+ await mockOrAttachGateway();
210
+ continue;
211
+ }
166
212
  if (isKnownCredentialForType(value, key, availableCredentials)) {
167
213
  cleanupMockPinData(json, node.name);
168
214
  continue;
@@ -170,16 +216,23 @@ async function resolveCredentials(json, workflowId, ctx, availableCredentials) {
170
216
  if (restoreExistingCredential()) {
171
217
  continue;
172
218
  }
219
+ if (reuseSiblingNodeCredential()) {
220
+ continue;
221
+ }
173
222
  await mockOrAttachGateway();
174
223
  continue;
175
224
  }
176
225
  if (restoreExistingCredential()) {
177
226
  continue;
178
227
  }
228
+ if (reuseSiblingNodeCredential()) {
229
+ continue;
230
+ }
179
231
  const credentialsForType = availableCredentials?.get(key);
180
- if (credentialsForType?.length === 1) {
232
+ if (credentialsForType?.length === 1 && key !== api_types_1.TEMPLATED_CUSTOM_AUTH_CREDENTIAL_TYPE) {
181
233
  const [credential] = credentialsForType;
182
234
  creds[key] = { id: credential.id, name: credential.name };
235
+ registerSiblingBinding(key, creds[key]);
183
236
  recordResolvedCredential(credential.id, credential.name);
184
237
  cleanupMockPinData(json, node.name);
185
238
  continue;
@@ -1 +1 @@
1
- {"version":3,"file":"resolve-credentials.js","sourceRoot":"","sources":["../../../src/tools/workflows/resolve-credentials.ts"],"names":[],"mappings":";;;;;AAWA,yDAAqF;AAErF,qEAKkC;AAsB3B,KAAK,6BACX,iBAAuE;IAEvE,MA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M,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IACrC,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,IAAI,mBAAmB,IAAI,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;QAC3D,OAAO,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IAC/B,CAAC;AACF,CAAC"}
@@ -77,6 +77,81 @@ export declare const setupSuspendSchema: z.ZodObject<{
77
77
  id: string;
78
78
  name: string;
79
79
  }>, "many">>;
80
+ setupHint: z.ZodOptional<z.ZodObject<{
81
+ template: z.ZodObject<{
82
+ headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
83
+ qs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
84
+ body: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
85
+ }, "strip", z.ZodTypeAny, {
86
+ headers?: Record<string, string> | undefined;
87
+ qs?: Record<string, string> | undefined;
88
+ body?: Record<string, unknown> | undefined;
89
+ }, {
90
+ headers?: Record<string, string> | undefined;
91
+ qs?: Record<string, string> | undefined;
92
+ body?: Record<string, unknown> | undefined;
93
+ }>;
94
+ placeholders: z.ZodArray<z.ZodObject<{
95
+ name: z.ZodString;
96
+ title: z.ZodString;
97
+ info: z.ZodOptional<z.ZodString>;
98
+ type: z.ZodOptional<z.ZodEnum<["password", "plain"]>>;
99
+ optional: z.ZodOptional<z.ZodBoolean>;
100
+ }, "strip", z.ZodTypeAny, {
101
+ name: string;
102
+ title: string;
103
+ info?: string | undefined;
104
+ type?: "password" | "plain" | undefined;
105
+ optional?: boolean | undefined;
106
+ }, {
107
+ name: string;
108
+ title: string;
109
+ info?: string | undefined;
110
+ type?: "password" | "plain" | undefined;
111
+ optional?: boolean | undefined;
112
+ }>, "many">;
113
+ docsUrl: z.ZodOptional<z.ZodString>;
114
+ suggestedName: z.ZodOptional<z.ZodString>;
115
+ testUrl: z.ZodOptional<z.ZodString>;
116
+ acceptedStatusCodes: z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>;
117
+ serviceHost: z.ZodOptional<z.ZodString>;
118
+ }, "strip", z.ZodTypeAny, {
119
+ template: {
120
+ headers?: Record<string, string> | undefined;
121
+ qs?: Record<string, string> | undefined;
122
+ body?: Record<string, unknown> | undefined;
123
+ };
124
+ placeholders: {
125
+ name: string;
126
+ title: string;
127
+ info?: string | undefined;
128
+ type?: "password" | "plain" | undefined;
129
+ optional?: boolean | undefined;
130
+ }[];
131
+ docsUrl?: string | undefined;
132
+ suggestedName?: string | undefined;
133
+ testUrl?: string | undefined;
134
+ acceptedStatusCodes?: number[] | undefined;
135
+ serviceHost?: string | undefined;
136
+ }, {
137
+ template: {
138
+ headers?: Record<string, string> | undefined;
139
+ qs?: Record<string, string> | undefined;
140
+ body?: Record<string, unknown> | undefined;
141
+ };
142
+ placeholders: {
143
+ name: string;
144
+ title: string;
145
+ info?: string | undefined;
146
+ type?: "password" | "plain" | undefined;
147
+ optional?: boolean | undefined;
148
+ }[];
149
+ docsUrl?: string | undefined;
150
+ suggestedName?: string | undefined;
151
+ testUrl?: string | undefined;
152
+ acceptedStatusCodes?: number[] | undefined;
153
+ serviceHost?: string | undefined;
154
+ }>>;
80
155
  isTrigger: z.ZodBoolean;
81
156
  isFirstTrigger: z.ZodOptional<z.ZodBoolean>;
82
157
  isTestable: z.ZodOptional<z.ZodBoolean>;
@@ -178,6 +253,25 @@ export declare const setupSuspendSchema: z.ZodObject<{
178
253
  id: string;
179
254
  name: string;
180
255
  }[] | undefined;
256
+ setupHint?: {
257
+ template: {
258
+ headers?: Record<string, string> | undefined;
259
+ qs?: Record<string, string> | undefined;
260
+ body?: Record<string, unknown> | undefined;
261
+ };
262
+ placeholders: {
263
+ name: string;
264
+ title: string;
265
+ info?: string | undefined;
266
+ type?: "password" | "plain" | undefined;
267
+ optional?: boolean | undefined;
268
+ }[];
269
+ docsUrl?: string | undefined;
270
+ suggestedName?: string | undefined;
271
+ testUrl?: string | undefined;
272
+ acceptedStatusCodes?: number[] | undefined;
273
+ serviceHost?: string | undefined;
274
+ } | undefined;
181
275
  isTrigger: boolean;
182
276
  isFirstTrigger?: boolean | undefined;
183
277
  isTestable?: boolean | undefined;
@@ -231,6 +325,25 @@ export declare const setupSuspendSchema: z.ZodObject<{
231
325
  id: string;
232
326
  name: string;
233
327
  }[] | undefined;
328
+ setupHint?: {
329
+ template: {
330
+ headers?: Record<string, string> | undefined;
331
+ qs?: Record<string, string> | undefined;
332
+ body?: Record<string, unknown> | undefined;
333
+ };
334
+ placeholders: {
335
+ name: string;
336
+ title: string;
337
+ info?: string | undefined;
338
+ type?: "password" | "plain" | undefined;
339
+ optional?: boolean | undefined;
340
+ }[];
341
+ docsUrl?: string | undefined;
342
+ suggestedName?: string | undefined;
343
+ testUrl?: string | undefined;
344
+ acceptedStatusCodes?: number[] | undefined;
345
+ serviceHost?: string | undefined;
346
+ } | undefined;
234
347
  isTrigger: boolean;
235
348
  isFirstTrigger?: boolean | undefined;
236
349
  isTestable?: boolean | undefined;
@@ -291,6 +404,25 @@ export declare const setupSuspendSchema: z.ZodObject<{
291
404
  id: string;
292
405
  name: string;
293
406
  }[] | undefined;
407
+ setupHint?: {
408
+ template: {
409
+ headers?: Record<string, string> | undefined;
410
+ qs?: Record<string, string> | undefined;
411
+ body?: Record<string, unknown> | undefined;
412
+ };
413
+ placeholders: {
414
+ name: string;
415
+ title: string;
416
+ info?: string | undefined;
417
+ type?: "password" | "plain" | undefined;
418
+ optional?: boolean | undefined;
419
+ }[];
420
+ docsUrl?: string | undefined;
421
+ suggestedName?: string | undefined;
422
+ testUrl?: string | undefined;
423
+ acceptedStatusCodes?: number[] | undefined;
424
+ serviceHost?: string | undefined;
425
+ } | undefined;
294
426
  isTrigger: boolean;
295
427
  isFirstTrigger?: boolean | undefined;
296
428
  isTestable?: boolean | undefined;
@@ -351,6 +483,25 @@ export declare const setupSuspendSchema: z.ZodObject<{
351
483
  id: string;
352
484
  name: string;
353
485
  }[] | undefined;
486
+ setupHint?: {
487
+ template: {
488
+ headers?: Record<string, string> | undefined;
489
+ qs?: Record<string, string> | undefined;
490
+ body?: Record<string, unknown> | undefined;
491
+ };
492
+ placeholders: {
493
+ name: string;
494
+ title: string;
495
+ info?: string | undefined;
496
+ type?: "password" | "plain" | undefined;
497
+ optional?: boolean | undefined;
498
+ }[];
499
+ docsUrl?: string | undefined;
500
+ suggestedName?: string | undefined;
501
+ testUrl?: string | undefined;
502
+ acceptedStatusCodes?: number[] | undefined;
503
+ serviceHost?: string | undefined;
504
+ } | undefined;
354
505
  isTrigger: boolean;
355
506
  isFirstTrigger?: boolean | undefined;
356
507
  isTestable?: boolean | undefined;
@@ -1,3 +1,4 @@
1
+ import { type InstanceAiCredentialSetupHint } from '@n8n/api-types';
1
2
  import type { IDataObject, NodeJSON, WorkflowJSON } from '@n8n/workflow-sdk';
2
3
  import type { IConnections, INode } from 'n8n-workflow';
3
4
  import type { SetupRequest } from './setup-workflow.schema';
@@ -12,6 +13,7 @@ export interface CredentialCache {
12
13
  success: boolean;
13
14
  message?: string;
14
15
  }>>;
16
+ templatedHosts: Map<string, Promise<Record<string, string | null>>>;
15
17
  }
16
18
  export declare function createCredentialCache(): CredentialCache;
17
19
  export declare function getValidCredentialTypes(context: InstanceAiContext, node: NodeJSON): Promise<Set<string>>;
@@ -27,6 +29,10 @@ export declare function buildSetupRequests(context: InstanceAiContext, node: Nod
27
29
  status: 'success' | 'error' | 'listening';
28
30
  error?: string;
29
31
  }, cache?: CredentialCache, workflowId?: string): Promise<SetupRequest[]>;
32
+ export type CredentialHintInput = InstanceAiCredentialSetupHint & {
33
+ nodeName?: string;
34
+ };
35
+ export declare function applyCredentialHints(requests: SetupRequest[], hints: CredentialHintInput[] | undefined): void;
30
36
  export declare function sortByExecutionOrder(requests: SetupRequest[], connections: Record<string, unknown>): void;
31
37
  export interface ApplyResult {
32
38
  applied: string[];
@@ -8,6 +8,7 @@ exports.resolveSupportedSiblingCredentialType = resolveSupportedSiblingCredentia
8
8
  exports.stripStaleCredentialsFromNode = stripStaleCredentialsFromNode;
9
9
  exports.stripStaleCredentialsFromWorkflow = stripStaleCredentialsFromWorkflow;
10
10
  exports.buildSetupRequests = buildSetupRequests;
11
+ exports.applyCredentialHints = applyCredentialHints;
11
12
  exports.sortByExecutionOrder = sortByExecutionOrder;
12
13
  exports.applyNodeCredentials = applyNodeCredentials;
13
14
  exports.applyNodeParameters = applyNodeParameters;
@@ -15,6 +16,7 @@ exports.applyNodeChanges = applyNodeChanges;
15
16
  exports.buildCompletedReport = buildCompletedReport;
16
17
  exports.buildSubnodeToRootNodeMap = buildSubnodeToRootNodeMap;
17
18
  exports.analyzeWorkflow = analyzeWorkflow;
19
+ const api_types_1 = require("@n8n/api-types");
18
20
  const placeholder_1 = require("@n8n/utils/placeholder");
19
21
  const workflow_sdk_1 = require("@n8n/workflow-sdk");
20
22
  const n8n_workflow_1 = require("n8n-workflow");
@@ -23,7 +25,7 @@ const credential_utils_1 = require("./credential-utils");
23
25
  const detect_wrong_kind_locator_1 = require("./detect-wrong-kind-locator");
24
26
  const workflow_file_bindings_1 = require("./workflow-file-bindings");
25
27
  function createCredentialCache() {
26
- return { lists: new Map(), testability: new Map(), tests: new Map() };
28
+ return { lists: new Map(), testability: new Map(), tests: new Map(), templatedHosts: new Map() };
27
29
  }
28
30
  function listCacheKey(workflowId, credentialType) {
29
31
  return `${workflowId ?? ''}|${credentialType}`;
@@ -179,6 +181,27 @@ function buildEditableParameters(parameterIssues, nodeDesc) {
179
181
  }
180
182
  return editableParameters;
181
183
  }
184
+ async function computeUnavailableLocatorIssues(context, node, parameters, typeVersion, credentialType, credential) {
185
+ if (!context.nodeService.findUnavailableLocatorValues)
186
+ return {};
187
+ const unavailable = await context.nodeService
188
+ .findUnavailableLocatorValues({
189
+ nodeType: node.type,
190
+ version: typeVersion,
191
+ credentialType,
192
+ credentialId: credential.id,
193
+ parameters,
194
+ })
195
+ .catch(() => []);
196
+ const issues = {};
197
+ for (const entry of unavailable) {
198
+ issues[entry.name] = [
199
+ `"${entry.currentValue}" isn't available with the connected credential "${credential.name}". ` +
200
+ 'Pick a value the credential offers instead.',
201
+ ];
202
+ }
203
+ return issues;
204
+ }
182
205
  async function resolveCredentialTypes(context, node, parameters, typeVersion, nodeDesc) {
183
206
  let credentialTypes = [];
184
207
  if (context.nodeService.getNodeCredentialTypes) {
@@ -209,6 +232,27 @@ async function resolveCredentialTypes(context, node, parameters, typeVersion, no
209
232
  }
210
233
  return credentialTypes;
211
234
  }
235
+ async function filterTemplatedCredentialsByServiceHost(context, node, candidates, cache) {
236
+ if (candidates.length === 0)
237
+ return candidates;
238
+ const parameters = node.parameters;
239
+ const nodeHost = (0, credential_utils_1.extractServiceHost)(parameters?.url);
240
+ const getHosts = context.credentialService.getTemplatedCredentialHosts?.bind(context.credentialService);
241
+ if (!nodeHost || !getHosts)
242
+ return [];
243
+ const ids = candidates.map((c) => c.id);
244
+ const cacheKey = [...ids].sort().join(',');
245
+ let hostsPromise = cache?.templatedHosts.get(cacheKey);
246
+ if (!hostsPromise) {
247
+ hostsPromise = getHosts(ids).catch(() => ({}));
248
+ cache?.templatedHosts.set(cacheKey, hostsPromise);
249
+ }
250
+ const hosts = await hostsPromise;
251
+ return candidates.filter((candidate) => {
252
+ const host = hosts[candidate.id];
253
+ return typeof host === 'string' && host !== '' && (0, credential_utils_1.serviceHostsMatch)(host, nodeHost);
254
+ });
255
+ }
212
256
  async function resolveCredentialState(context, node, credentialType, cache, workflowId) {
213
257
  const cacheKey = listCacheKey(workflowId, credentialType);
214
258
  let listPromise = cache?.lists.get(cacheKey);
@@ -219,7 +263,10 @@ async function resolveCredentialState(context, node, credentialType, cache, work
219
263
  cache?.lists.set(cacheKey, listPromise);
220
264
  }
221
265
  const sortedCreds = await listPromise;
222
- const existingCredentials = sortedCreds.map((c) => ({ id: c.id, name: c.name }));
266
+ let existingCredentials = sortedCreds.map((c) => ({ id: c.id, name: c.name }));
267
+ if (credentialType === api_types_1.TEMPLATED_CUSTOM_AUTH_CREDENTIAL_TYPE) {
268
+ existingCredentials = await filterTemplatedCredentialsByServiceHost(context, node, existingCredentials, cache);
269
+ }
223
270
  const existingOnNode = node.credentials?.[credentialType];
224
271
  const existingCredentialId = typeof existingOnNode?.id === 'string' && existingOnNode.id ? existingOnNode.id : undefined;
225
272
  const hasExistingOnNode = existingCredentialId !== undefined || (0, credential_utils_1.isAiGatewayManagedCredential)(existingOnNode);
@@ -236,7 +283,7 @@ async function resolveCredentialState(context, node, credentialType, cache, work
236
283
  autoAppliedGateway = true;
237
284
  }
238
285
  }
239
- if (!isAutoApplied) {
286
+ if (!isAutoApplied && credentialType !== api_types_1.TEMPLATED_CUSTOM_AUTH_CREDENTIAL_TYPE) {
240
287
  isAutoApplied = !hasExistingOnNode && existingCredentials.length === 1;
241
288
  }
242
289
  const credToTest = existingCredentialId ??
@@ -248,6 +295,8 @@ async function resolveCredentialState(context, node, credentialType, cache, work
248
295
  ...(autoAppliedGateway ? { autoAppliedGateway } : {}),
249
296
  };
250
297
  }
298
+ const resolvedCredential = sortedCreds.find((c) => c.id === credToTest);
299
+ const effectiveCredential = resolvedCredential ? { effectiveCredential: resolvedCredential } : {};
251
300
  let testabilityPromise = cache?.testability.get(credentialType);
252
301
  if (!testabilityPromise) {
253
302
  testabilityPromise = context.credentialService.isTestable
@@ -257,7 +306,7 @@ async function resolveCredentialState(context, node, credentialType, cache, work
257
306
  }
258
307
  const canTest = await testabilityPromise;
259
308
  if (!canTest)
260
- return { existingCredentials, isAutoApplied };
309
+ return { existingCredentials, isAutoApplied, ...effectiveCredential };
261
310
  let testPromise = cache?.tests.get(credToTest);
262
311
  if (!testPromise) {
263
312
  testPromise = context.credentialService.test(credToTest).catch((testError) => ({
@@ -267,7 +316,7 @@ async function resolveCredentialState(context, node, credentialType, cache, work
267
316
  cache?.tests.set(credToTest, testPromise);
268
317
  }
269
318
  const credentialTestResult = await testPromise;
270
- return { existingCredentials, isAutoApplied, credentialTestResult };
319
+ return { existingCredentials, isAutoApplied, credentialTestResult, ...effectiveCredential };
271
320
  }
272
321
  function buildRequestCredentials(nodeCredentials, isAutoApplied, credentialType, existingCredentials, autoAppliedGateway) {
273
322
  let autoCredential;
@@ -322,8 +371,13 @@ async function buildRequestForCredentialType(context, node, credentialType, cach
322
371
  .map(([key, value]) => [key, (0, credential_utils_1.toSetupNodeCredential)(value)])
323
372
  .filter((entry) => entry[1] !== undefined))
324
373
  : undefined;
325
- const { existingCredentials, isAutoApplied, credentialTestResult, autoAppliedGateway } = await resolveAppliedCredentialState(context, node, credentialType, cache, workflowId, nodeCredentials);
326
- const { isTrigger, isTestable, hasParamIssues } = nodeCtx;
374
+ const { existingCredentials, isAutoApplied, credentialTestResult, autoAppliedGateway, effectiveCredential, } = await resolveAppliedCredentialState(context, node, credentialType, cache, workflowId, nodeCredentials);
375
+ const unavailableIssues = credentialType && effectiveCredential
376
+ ? await computeUnavailableLocatorIssues(context, node, nodeCtx.parameters, nodeCtx.typeVersion, credentialType, effectiveCredential)
377
+ : {};
378
+ const parameterIssues = { ...nodeCtx.parameterIssues, ...unavailableIssues };
379
+ const { isTrigger, isTestable } = nodeCtx;
380
+ const hasParamIssues = Object.keys(parameterIssues).length > 0;
327
381
  if (!credentialType && !isTrigger && !hasParamIssues)
328
382
  return null;
329
383
  if (!credentialType && isTrigger && !isTestable && !hasParamIssues)
@@ -359,7 +413,7 @@ async function buildRequestForCredentialType(context, node, credentialType, cach
359
413
  ...(isAutoApplied ? { isAutoApplied } : {}),
360
414
  ...(credentialTestResult ? { credentialTestResult } : {}),
361
415
  ...(nodeCtx.triggerTestResult ? { triggerTestResult: nodeCtx.triggerTestResult } : {}),
362
- ...(hasParamIssues ? { parameterIssues: nodeCtx.parameterIssues } : {}),
416
+ ...(hasParamIssues ? { parameterIssues } : {}),
363
417
  ...(nodeCtx.editableParameters && nodeCtx.editableParameters.length > 0
364
418
  ? { editableParameters: nodeCtx.editableParameters }
365
419
  : {}),
@@ -386,14 +440,12 @@ async function buildSetupRequests(context, node, triggerTestResult, cache, workf
386
440
  const credentialTypes = await resolveCredentialTypes(context, node, parameters, typeVersion, nodeDesc);
387
441
  const nodeId = node.id ?? (0, nanoid_1.nanoid)();
388
442
  const nodePosition = node.position ?? [0, 0];
389
- const hasParamIssues = Object.keys(parameterIssues).length > 0;
390
443
  const requests = [];
391
444
  const processedCredTypes = credentialTypes.length > 0 ? credentialTypes : [undefined];
392
445
  const nodeCtx = {
393
446
  nodeName: node.name,
394
447
  isTrigger,
395
448
  isTestable,
396
- hasParamIssues,
397
449
  parameterIssues,
398
450
  editableParameters,
399
451
  triggerTestResult,
@@ -409,6 +461,20 @@ async function buildSetupRequests(context, node, triggerTestResult, cache, workf
409
461
  }
410
462
  return requests;
411
463
  }
464
+ function applyCredentialHints(requests, hints) {
465
+ if (!hints?.length)
466
+ return;
467
+ for (const request of requests) {
468
+ if (request.credentialType !== api_types_1.TEMPLATED_CUSTOM_AUTH_CREDENTIAL_TYPE)
469
+ continue;
470
+ const hint = hints.find((h) => h.nodeName === request.node.name) ?? hints.find((h) => !h.nodeName);
471
+ if (!hint)
472
+ continue;
473
+ const { nodeName: _nodeName, ...setupHint } = hint;
474
+ const serviceHost = (0, credential_utils_1.extractServiceHost)(request.node.parameters?.url) ?? (0, credential_utils_1.extractServiceHost)(setupHint.testUrl);
475
+ request.setupHint = { ...setupHint, ...(serviceHost ? { serviceHost } : {}) };
476
+ }
477
+ }
412
478
  function addConnectionEdge(mainOutgoing, nonMainIncoming, sourceName, connType, conn) {
413
479
  if (typeof conn !== 'object' || conn === null || !('node' in conn))
414
480
  return;
@@ -804,9 +870,7 @@ async function analyzeWorkflow(context, workflowId, triggerResults, options) {
804
870
  .filter((req) => req.credentialType !== undefined ||
805
871
  req.isTrigger ||
806
872
  (req.parameterIssues && Object.keys(req.parameterIssues).length > 0))
807
- .filter((req) => options?.includeSettled === true ||
808
- !!req.needsAction ||
809
- (req.isTrigger && !!req.isTestable));
873
+ .filter((req) => options?.includeSettled === true || !!req.needsAction);
810
874
  sortByExecutionOrder(setupRequests, workflowJson.connections);
811
875
  const subnodeToRootNode = buildSubnodeToRootNodeMap(workflowJson.nodes, workflowJson.connections, setupRequests.map((req) => req.node.name));
812
876
  if (subnodeToRootNode.size > 0) {