n8n-core 1.71.3 → 1.72.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.
- package/bin/{generate-ui-types → generate-metadata} +7 -37
- package/dist/CreateNodeAsTool.d.ts +8 -2
- package/dist/CreateNodeAsTool.js +25 -25
- package/dist/CreateNodeAsTool.js.map +1 -1
- package/dist/DirectoryLoader.d.ts +11 -4
- package/dist/DirectoryLoader.js +142 -81
- package/dist/DirectoryLoader.js.map +1 -1
- package/dist/NodeExecuteFunctions.d.ts +5 -5
- package/dist/NodeExecuteFunctions.js +75 -174
- package/dist/NodeExecuteFunctions.js.map +1 -1
- package/dist/PartialExecutionUtils/DirectedGraph.d.ts +1 -0
- package/dist/PartialExecutionUtils/DirectedGraph.js +3 -0
- package/dist/PartialExecutionUtils/DirectedGraph.js.map +1 -1
- package/dist/PartialExecutionUtils/cleanRunData.js +5 -0
- package/dist/PartialExecutionUtils/cleanRunData.js.map +1 -1
- package/dist/PartialExecutionUtils/findStartNodes.d.ts +1 -1
- package/dist/PartialExecutionUtils/findStartNodes.js +9 -2
- package/dist/PartialExecutionUtils/findStartNodes.js.map +1 -1
- package/dist/PartialExecutionUtils/getIncomingData.d.ts +1 -1
- package/dist/PartialExecutionUtils/getIncomingData.js +1 -38
- package/dist/PartialExecutionUtils/getIncomingData.js.map +1 -1
- package/dist/WorkflowExecute.js +10 -10
- package/dist/WorkflowExecute.js.map +1 -1
- package/dist/build.tsbuildinfo +1 -1
- package/dist/errors/index.d.ts +2 -0
- package/dist/errors/index.js +5 -1
- package/dist/errors/index.js.map +1 -1
- package/dist/errors/unrecognized-credential-type.error.d.ts +5 -0
- package/dist/errors/unrecognized-credential-type.error.js +12 -0
- package/dist/errors/unrecognized-credential-type.error.js.map +1 -0
- package/dist/errors/unrecognized-node-type.error.d.ts +5 -0
- package/dist/errors/unrecognized-node-type.error.js +12 -0
- package/dist/errors/unrecognized-node-type.error.js.map +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/node-execution-context/base-execute-context.d.ts +4 -1
- package/dist/node-execution-context/base-execute-context.js +30 -9
- package/dist/node-execution-context/base-execute-context.js.map +1 -1
- package/dist/node-execution-context/execute-context.d.ts +7 -7
- package/dist/node-execution-context/execute-context.js +12 -39
- package/dist/node-execution-context/execute-context.js.map +1 -1
- package/dist/node-execution-context/execute-single-context.d.ts +2 -1
- package/dist/node-execution-context/execute-single-context.js +6 -16
- package/dist/node-execution-context/execute-single-context.js.map +1 -1
- package/dist/node-execution-context/node-execution-context.js +2 -0
- package/dist/node-execution-context/node-execution-context.js.map +1 -1
- package/dist/node-execution-context/supply-data-context.d.ts +7 -4
- package/dist/node-execution-context/supply-data-context.js +95 -18
- package/dist/node-execution-context/supply-data-context.js.map +1 -1
- package/dist/node-execution-context/webhook-context.d.ts +1 -1
- package/dist/node-execution-context/webhook-context.js +2 -2
- package/dist/node-execution-context/webhook-context.js.map +1 -1
- package/package.json +7 -8
- package/bin/generate-known +0 -99
- package/dist/Agent/index.d.ts +0 -2
- package/dist/Agent/index.js +0 -11
- package/dist/Agent/index.js.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
const { LoggerProxy
|
|
3
|
+
const { LoggerProxy } = require('n8n-workflow');
|
|
4
4
|
const { PackageDirectoryLoader } = require('../dist/DirectoryLoader');
|
|
5
5
|
const { packageDir, writeJSON } = require('./common');
|
|
6
6
|
|
|
@@ -33,7 +33,7 @@ function findReferencedMethods(obj, refs = {}, latestName = '') {
|
|
|
33
33
|
const loaderNodeTypes = Object.values(loader.nodeTypes);
|
|
34
34
|
|
|
35
35
|
const definedMethods = loaderNodeTypes.reduce((acc, cur) => {
|
|
36
|
-
|
|
36
|
+
loader.getVersionedNodeTypeAll(cur.type).forEach((type) => {
|
|
37
37
|
const methods = type.description?.__loadOptionsMethods;
|
|
38
38
|
|
|
39
39
|
if (!methods) return;
|
|
@@ -52,51 +52,21 @@ function findReferencedMethods(obj, refs = {}, latestName = '') {
|
|
|
52
52
|
}, {});
|
|
53
53
|
|
|
54
54
|
const nodeTypes = loaderNodeTypes
|
|
55
|
-
.map((
|
|
56
|
-
const nodeType = NodeHelpers.getVersionedNodeType(data.type);
|
|
57
|
-
NodeHelpers.applySpecialNodeParameters(nodeType);
|
|
58
|
-
return data.type;
|
|
59
|
-
})
|
|
55
|
+
.map(({ type }) => type)
|
|
60
56
|
.flatMap((nodeType) =>
|
|
61
|
-
|
|
57
|
+
loader.getVersionedNodeTypeAll(nodeType).map((item) => {
|
|
62
58
|
const { __loadOptionsMethods, ...rest } = item.description;
|
|
63
59
|
return rest;
|
|
64
60
|
}),
|
|
65
61
|
);
|
|
66
62
|
|
|
67
63
|
const knownCredentials = loader.known.credentials;
|
|
68
|
-
const credentialTypes = Object.values(loader.credentialTypes).map((
|
|
69
|
-
const credentialType = data.type;
|
|
70
|
-
const supportedNodes = knownCredentials[credentialType.name].supportedNodes ?? [];
|
|
71
|
-
if (supportedNodes.length > 0 && credentialType.httpRequestNode) {
|
|
72
|
-
credentialType.httpRequestNode.hidden = true;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
credentialType.supportedNodes = supportedNodes;
|
|
76
|
-
|
|
77
|
-
if (!credentialType.iconUrl && !credentialType.icon) {
|
|
78
|
-
for (const supportedNode of supportedNodes) {
|
|
79
|
-
const nodeType = loader.nodeTypes[supportedNode]?.type.description;
|
|
80
|
-
|
|
81
|
-
if (!nodeType) continue;
|
|
82
|
-
if (nodeType.icon) {
|
|
83
|
-
credentialType.icon = nodeType.icon;
|
|
84
|
-
credentialType.iconColor = nodeType.iconColor;
|
|
85
|
-
break;
|
|
86
|
-
}
|
|
87
|
-
if (nodeType.iconUrl) {
|
|
88
|
-
credentialType.iconUrl = nodeType.iconUrl;
|
|
89
|
-
break;
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
return credentialType;
|
|
95
|
-
});
|
|
96
|
-
|
|
64
|
+
const credentialTypes = Object.values(loader.credentialTypes).map(({ type }) => type);
|
|
97
65
|
const referencedMethods = findReferencedMethods(nodeTypes);
|
|
98
66
|
|
|
99
67
|
await Promise.all([
|
|
68
|
+
writeJSON('known/nodes.json', loader.known.nodes),
|
|
69
|
+
writeJSON('known/credentials.json', loader.known.credentials),
|
|
100
70
|
writeJSON('types/credentials.json', credentialTypes),
|
|
101
71
|
writeJSON('types/nodes.json', nodeTypes),
|
|
102
72
|
writeJSON('methods/defined.json', definedMethods),
|
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
import { DynamicStructuredTool } from '@langchain/core/tools';
|
|
2
|
-
import type {
|
|
2
|
+
import type { INode, INodeType, ISupplyDataFunctions, ITaskDataConnections } from 'n8n-workflow';
|
|
3
3
|
import { z } from 'zod';
|
|
4
|
-
|
|
4
|
+
type ParserOptions = {
|
|
5
|
+
node: INode;
|
|
6
|
+
nodeType: INodeType;
|
|
7
|
+
contextFactory: (runIndex: number, inputData: ITaskDataConnections) => ISupplyDataFunctions;
|
|
8
|
+
};
|
|
9
|
+
export declare function createNodeAsTool(options: ParserOptions): {
|
|
5
10
|
response: DynamicStructuredTool<z.ZodObject<any, any, any, any, {
|
|
6
11
|
[x: string]: any;
|
|
7
12
|
}>>;
|
|
8
13
|
};
|
|
14
|
+
export {};
|
package/dist/CreateNodeAsTool.js
CHANGED
|
@@ -5,8 +5,9 @@ const tools_1 = require("@langchain/core/tools");
|
|
|
5
5
|
const n8n_workflow_1 = require("n8n-workflow");
|
|
6
6
|
const zod_1 = require("zod");
|
|
7
7
|
class AIParametersParser {
|
|
8
|
-
constructor(
|
|
9
|
-
this.
|
|
8
|
+
constructor(options) {
|
|
9
|
+
this.options = options;
|
|
10
|
+
this.runIndex = 0;
|
|
10
11
|
}
|
|
11
12
|
generateZodSchema(placeholder) {
|
|
12
13
|
let schema;
|
|
@@ -94,11 +95,11 @@ class AIParametersParser {
|
|
|
94
95
|
args.push(parsedArgs);
|
|
95
96
|
}
|
|
96
97
|
catch (error) {
|
|
97
|
-
throw new n8n_workflow_1.NodeOperationError(this.
|
|
98
|
+
throw new n8n_workflow_1.NodeOperationError(this.options.node, `Failed to parse $fromAI arguments: ${argsString}: ${error}`);
|
|
98
99
|
}
|
|
99
100
|
}
|
|
100
101
|
else {
|
|
101
|
-
throw new n8n_workflow_1.NodeOperationError(this.
|
|
102
|
+
throw new n8n_workflow_1.NodeOperationError(this.options.node, `Unbalanced parentheses while parsing $fromAI call: ${str.slice(startIndex)}`);
|
|
102
103
|
}
|
|
103
104
|
}
|
|
104
105
|
return args;
|
|
@@ -162,7 +163,7 @@ class AIParametersParser {
|
|
|
162
163
|
});
|
|
163
164
|
const type = cleanArgs?.[2] || 'string';
|
|
164
165
|
if (!['string', 'number', 'boolean', 'json'].includes(type.toLowerCase())) {
|
|
165
|
-
throw new n8n_workflow_1.NodeOperationError(this.
|
|
166
|
+
throw new n8n_workflow_1.NodeOperationError(this.options.node, `Invalid type: ${type}`);
|
|
166
167
|
}
|
|
167
168
|
return {
|
|
168
169
|
key: cleanArgs[0] || '',
|
|
@@ -207,9 +208,10 @@ class AIParametersParser {
|
|
|
207
208
|
}
|
|
208
209
|
return node.description.description;
|
|
209
210
|
}
|
|
210
|
-
createTool(
|
|
211
|
+
createTool() {
|
|
212
|
+
const { node, nodeType } = this.options;
|
|
211
213
|
const collectedArguments = [];
|
|
212
|
-
this.traverseNodeParameters(
|
|
214
|
+
this.traverseNodeParameters(node.parameters, collectedArguments);
|
|
213
215
|
const nameValidationRegex = /^[a-zA-Z0-9_-]{1,64}$/;
|
|
214
216
|
const keyMap = new Map();
|
|
215
217
|
for (const argument of collectedArguments) {
|
|
@@ -217,7 +219,7 @@ class AIParametersParser {
|
|
|
217
219
|
const isEmptyError = 'You must specify a key when using $fromAI()';
|
|
218
220
|
const isInvalidError = `Parameter key \`${argument.key}\` is invalid`;
|
|
219
221
|
const error = new Error(argument.key.length === 0 ? isEmptyError : isInvalidError);
|
|
220
|
-
throw new n8n_workflow_1.NodeOperationError(
|
|
222
|
+
throw new n8n_workflow_1.NodeOperationError(node, error, {
|
|
221
223
|
description: 'Invalid parameter key, must be between 1 and 64 characters long and only contain letters, numbers, underscores, and hyphens',
|
|
222
224
|
});
|
|
223
225
|
}
|
|
@@ -225,7 +227,7 @@ class AIParametersParser {
|
|
|
225
227
|
const existingArg = keyMap.get(argument.key);
|
|
226
228
|
if (existingArg.description !== argument.description ||
|
|
227
229
|
existingArg.type !== argument.type) {
|
|
228
|
-
throw new n8n_workflow_1.NodeOperationError(
|
|
230
|
+
throw new n8n_workflow_1.NodeOperationError(node, `Duplicate key '${argument.key}' found with different description or type`, {
|
|
229
231
|
description: 'Ensure all $fromAI() calls with the same key have consistent descriptions and types',
|
|
230
232
|
});
|
|
231
233
|
}
|
|
@@ -244,28 +246,28 @@ class AIParametersParser {
|
|
|
244
246
|
return acc;
|
|
245
247
|
}, {});
|
|
246
248
|
const schema = zod_1.z.object(schemaObj).required();
|
|
247
|
-
const description = this.getDescription(
|
|
248
|
-
const nodeName =
|
|
249
|
-
const name = nodeName ||
|
|
249
|
+
const description = this.getDescription(nodeType, node.parameters);
|
|
250
|
+
const nodeName = node.name.replace(/ /g, '_');
|
|
251
|
+
const name = nodeName || nodeType.description.name;
|
|
250
252
|
const tool = new tools_1.DynamicStructuredTool({
|
|
251
253
|
name,
|
|
252
254
|
description,
|
|
253
255
|
schema,
|
|
254
|
-
func: async (
|
|
255
|
-
const
|
|
256
|
-
|
|
257
|
-
]);
|
|
256
|
+
func: async (toolArgs) => {
|
|
257
|
+
const currentRunIndex = this.runIndex++;
|
|
258
|
+
const context = this.options.contextFactory(currentRunIndex, {});
|
|
259
|
+
context.addInputData("ai_tool", [[{ json: toolArgs }]]);
|
|
258
260
|
try {
|
|
259
|
-
const result = await
|
|
261
|
+
const result = await nodeType.execute?.call(context);
|
|
260
262
|
const mappedResults = result?.[0]?.flatMap((item) => item.json);
|
|
261
|
-
|
|
263
|
+
context.addOutputData("ai_tool", currentRunIndex, [
|
|
262
264
|
[{ json: { response: mappedResults } }],
|
|
263
265
|
]);
|
|
264
266
|
return JSON.stringify(mappedResults);
|
|
265
267
|
}
|
|
266
268
|
catch (error) {
|
|
267
|
-
const nodeError = new n8n_workflow_1.NodeOperationError(this.
|
|
268
|
-
|
|
269
|
+
const nodeError = new n8n_workflow_1.NodeOperationError(this.options.node, error);
|
|
270
|
+
context.addOutputData("ai_tool", currentRunIndex, nodeError);
|
|
269
271
|
return 'Error during node execution: ' + nodeError.description;
|
|
270
272
|
}
|
|
271
273
|
},
|
|
@@ -273,10 +275,8 @@ class AIParametersParser {
|
|
|
273
275
|
return tool;
|
|
274
276
|
}
|
|
275
277
|
}
|
|
276
|
-
function createNodeAsTool(
|
|
277
|
-
const parser = new AIParametersParser(
|
|
278
|
-
return {
|
|
279
|
-
response: parser.createTool(node, nodeParameters),
|
|
280
|
-
};
|
|
278
|
+
function createNodeAsTool(options) {
|
|
279
|
+
const parser = new AIParametersParser(options);
|
|
280
|
+
return { response: parser.createTool() };
|
|
281
281
|
}
|
|
282
282
|
//# sourceMappingURL=CreateNodeAsTool.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CreateNodeAsTool.js","sourceRoot":"","sources":["../src/CreateNodeAsTool.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"CreateNodeAsTool.js","sourceRoot":"","sources":["../src/CreateNodeAsTool.ts"],"names":[],"mappings":";;AA4aA,4CAGC;AA/aD,iDAA8D;AAS9D,+CAAiF;AACjF,6BAAwB;AAsBxB,MAAM,kBAAkB;IAMvB,YAA6B,OAAsB;QAAtB,YAAO,GAAP,OAAO,CAAe;QAL3C,aAAQ,GAAG,CAAC,CAAC;IAKiC,CAAC;IAO/C,iBAAiB,CAAC,WAA2B;QACpD,IAAI,MAAoB,CAAC;QAEzB,QAAQ,WAAW,CAAC,IAA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,IAAI,CAAC;IACb,CAAC;CACD;AAOD,SAAgB,gBAAgB,CAAC,OAAsB;IACtD,MAAM,MAAM,GAAG,IAAI,kBAAkB,CAAC,OAAO,CAAC,CAAC;IAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,CAAC,UAAU,EAAE,EAAE,CAAC;AAC1C,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ICredentialType, ICredentialTypeData, INodeTypeBaseDescription, INodeTypeData, INodeTypeNameVersion, KnownNodesAndCredentials } from 'n8n-workflow';
|
|
1
|
+
import type { ICredentialType, ICredentialTypeData, INodeCredentialDescription, INodeType, INodeTypeBaseDescription, INodeTypeData, INodeTypeNameVersion, IVersionedNodeType, KnownNodesAndCredentials } from 'n8n-workflow';
|
|
2
2
|
import type { n8n } from './Interfaces';
|
|
3
3
|
export type Types = {
|
|
4
4
|
nodes: INodeTypeBaseDescription[];
|
|
@@ -14,14 +14,19 @@ export declare abstract class DirectoryLoader {
|
|
|
14
14
|
credentialTypes: ICredentialTypeData;
|
|
15
15
|
known: KnownNodesAndCredentials;
|
|
16
16
|
types: Types;
|
|
17
|
-
|
|
17
|
+
readonly nodesByCredential: Record<string, string[]>;
|
|
18
18
|
constructor(directory: string, excludeNodes?: string[], includeNodes?: string[]);
|
|
19
19
|
abstract packageName: string;
|
|
20
20
|
abstract loadAll(): Promise<void>;
|
|
21
21
|
reset(): void;
|
|
22
22
|
protected resolvePath(file: string): string;
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
private loadClass;
|
|
24
|
+
loadNodeFromFile(filePath: string): void;
|
|
25
|
+
getNode(nodeType: string): import("n8n-workflow").LoadedClass<INodeType | IVersionedNodeType>;
|
|
26
|
+
loadCredentialFromFile(filePath: string): void;
|
|
27
|
+
getCredential(credentialType: string): import("n8n-workflow").LoadedClass<ICredentialType>;
|
|
28
|
+
getCredentialsForNode(object: IVersionedNodeType | INodeType): INodeCredentialDescription[];
|
|
29
|
+
getVersionedNodeTypeAll(object: IVersionedNodeType | INodeType): INodeType[];
|
|
25
30
|
private getCodex;
|
|
26
31
|
private addCodex;
|
|
27
32
|
private addLoadOptionsMethods;
|
|
@@ -36,6 +41,8 @@ export declare class PackageDirectoryLoader extends DirectoryLoader {
|
|
|
36
41
|
packageJson: n8n.PackageJson;
|
|
37
42
|
packageName: string;
|
|
38
43
|
loadAll(): Promise<void>;
|
|
44
|
+
private inferSupportedNodes;
|
|
45
|
+
private parseJSON;
|
|
39
46
|
protected readJSONSync<T>(file: string): T;
|
|
40
47
|
protected readJSON<T>(file: string): Promise<T>;
|
|
41
48
|
}
|