@n8n/n8n-nodes-langchain 1.73.0 → 1.74.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 (96) hide show
  1. package/LICENSE.md +5 -3
  2. package/dist/build.tsbuildinfo +1 -1
  3. package/dist/nodes/chains/ChainLLM/ChainLlm.node.js +1 -0
  4. package/dist/nodes/chains/ChainLLM/ChainLlm.node.js.map +1 -1
  5. package/dist/nodes/chains/ChainRetrievalQA/ChainRetrievalQa.node.js +1 -0
  6. package/dist/nodes/chains/ChainRetrievalQA/ChainRetrievalQa.node.js.map +1 -1
  7. package/dist/nodes/chains/ChainSummarization/ChainSummarization.node.js +1 -0
  8. package/dist/nodes/chains/ChainSummarization/ChainSummarization.node.js.map +1 -1
  9. package/dist/nodes/document_loaders/DocumentDefaultDataLoader/DocumentDefaultDataLoader.node.js +1 -1
  10. package/dist/nodes/document_loaders/DocumentDefaultDataLoader/DocumentDefaultDataLoader.node.js.map +1 -1
  11. package/dist/nodes/llms/LmChatGoogleVertex/LmChatGoogleVertex.node.js +2 -0
  12. package/dist/nodes/llms/LmChatGoogleVertex/LmChatGoogleVertex.node.js.map +1 -1
  13. package/dist/nodes/memory/MemoryBufferWindow/MemoryBufferWindow.node.js +1 -0
  14. package/dist/nodes/memory/MemoryBufferWindow/MemoryBufferWindow.node.js.map +1 -1
  15. package/dist/nodes/memory/MemoryChatRetriever/MemoryChatRetriever.node.js +1 -0
  16. package/dist/nodes/memory/MemoryChatRetriever/MemoryChatRetriever.node.js.map +1 -1
  17. package/dist/nodes/memory/MemoryMotorhead/MemoryMotorhead.node.js +1 -0
  18. package/dist/nodes/memory/MemoryMotorhead/MemoryMotorhead.node.js.map +1 -1
  19. package/dist/nodes/output_parser/OutputParserAutofixing/OutputParserAutofixing.node.js +1 -0
  20. package/dist/nodes/output_parser/OutputParserAutofixing/OutputParserAutofixing.node.js.map +1 -1
  21. package/dist/nodes/output_parser/OutputParserItemList/OutputParserItemList.node.js +1 -0
  22. package/dist/nodes/output_parser/OutputParserItemList/OutputParserItemList.node.js.map +1 -1
  23. package/dist/nodes/output_parser/OutputParserStructured/OutputParserStructured.node.js +1 -0
  24. package/dist/nodes/output_parser/OutputParserStructured/OutputParserStructured.node.js.map +1 -1
  25. package/dist/nodes/retrievers/RetrieverContextualCompression/RetrieverContextualCompression.node.js +1 -0
  26. package/dist/nodes/retrievers/RetrieverContextualCompression/RetrieverContextualCompression.node.js.map +1 -1
  27. package/dist/nodes/retrievers/RetrieverMultiQuery/RetrieverMultiQuery.node.js +1 -0
  28. package/dist/nodes/retrievers/RetrieverMultiQuery/RetrieverMultiQuery.node.js.map +1 -1
  29. package/dist/nodes/retrievers/RetrieverVectorStore/RetrieverVectorStore.node.js +1 -0
  30. package/dist/nodes/retrievers/RetrieverVectorStore/RetrieverVectorStore.node.js.map +1 -1
  31. package/dist/nodes/retrievers/RetrieverWorkflow/RetrieverWorkflow.node.js +1 -0
  32. package/dist/nodes/retrievers/RetrieverWorkflow/RetrieverWorkflow.node.js.map +1 -1
  33. package/dist/nodes/text_splitters/TextSplitterCharacterTextSplitter/TextSplitterCharacterTextSplitter.node.js +1 -0
  34. package/dist/nodes/text_splitters/TextSplitterCharacterTextSplitter/TextSplitterCharacterTextSplitter.node.js.map +1 -1
  35. package/dist/nodes/text_splitters/TextSplitterRecursiveCharacterTextSplitter/TextSplitterRecursiveCharacterTextSplitter.node.js +1 -0
  36. package/dist/nodes/text_splitters/TextSplitterRecursiveCharacterTextSplitter/TextSplitterRecursiveCharacterTextSplitter.node.js.map +1 -1
  37. package/dist/nodes/text_splitters/TextSplitterTokenSplitter/TextSplitterTokenSplitter.node.js +1 -0
  38. package/dist/nodes/text_splitters/TextSplitterTokenSplitter/TextSplitterTokenSplitter.node.js.map +1 -1
  39. package/dist/nodes/tools/ToolCalculator/ToolCalculator.node.js +1 -0
  40. package/dist/nodes/tools/ToolCalculator/ToolCalculator.node.js.map +1 -1
  41. package/dist/nodes/tools/ToolCode/ToolCode.node.js +1 -0
  42. package/dist/nodes/tools/ToolCode/ToolCode.node.js.map +1 -1
  43. package/dist/nodes/tools/ToolVectorStore/ToolVectorStore.node.js +10 -8
  44. package/dist/nodes/tools/ToolVectorStore/ToolVectorStore.node.js.map +1 -1
  45. package/dist/nodes/tools/ToolWorkflow/ToolWorkflow.node.d.ts +3 -4
  46. package/dist/nodes/tools/ToolWorkflow/ToolWorkflow.node.js +13 -466
  47. package/dist/nodes/tools/ToolWorkflow/ToolWorkflow.node.js.map +1 -1
  48. package/dist/nodes/tools/ToolWorkflow/v1/ToolWorkflowV1.node.d.ts +6 -0
  49. package/dist/nodes/tools/ToolWorkflow/v1/ToolWorkflowV1.node.js +194 -0
  50. package/dist/nodes/tools/ToolWorkflow/v1/ToolWorkflowV1.node.js.map +1 -0
  51. package/dist/nodes/tools/ToolWorkflow/v1/versionDescription.d.ts +2 -0
  52. package/dist/nodes/tools/ToolWorkflow/v1/versionDescription.js +311 -0
  53. package/dist/nodes/tools/ToolWorkflow/v1/versionDescription.js.map +1 -0
  54. package/dist/nodes/tools/ToolWorkflow/v2/ToolWorkflowV2.node.d.ts +12 -0
  55. package/dist/nodes/tools/ToolWorkflow/v2/ToolWorkflowV2.node.js +32 -0
  56. package/dist/nodes/tools/ToolWorkflow/v2/ToolWorkflowV2.node.js.map +1 -0
  57. package/dist/nodes/tools/ToolWorkflow/v2/utils/FromAIParser.d.ts +19 -0
  58. package/dist/nodes/tools/ToolWorkflow/v2/utils/FromAIParser.js +192 -0
  59. package/dist/nodes/tools/ToolWorkflow/v2/utils/FromAIParser.js.map +1 -0
  60. package/dist/nodes/tools/ToolWorkflow/v2/utils/WorkflowToolService.d.ts +23 -0
  61. package/dist/nodes/tools/ToolWorkflow/v2/utils/WorkflowToolService.js +202 -0
  62. package/dist/nodes/tools/ToolWorkflow/v2/utils/WorkflowToolService.js.map +1 -0
  63. package/dist/nodes/tools/ToolWorkflow/v2/versionDescription.d.ts +2 -0
  64. package/dist/nodes/tools/ToolWorkflow/v2/versionDescription.js +134 -0
  65. package/dist/nodes/tools/ToolWorkflow/v2/versionDescription.js.map +1 -0
  66. package/dist/nodes/vector_store/VectorStoreInMemory/VectorStoreInMemory.node.js +1 -0
  67. package/dist/nodes/vector_store/VectorStoreInMemory/VectorStoreInMemory.node.js.map +1 -1
  68. package/dist/nodes/vector_store/VectorStorePGVector/VectorStorePGVector.node.js +1 -1
  69. package/dist/nodes/vector_store/VectorStorePGVector/VectorStorePGVector.node.js.map +1 -1
  70. package/dist/nodes/vector_store/VectorStorePinecone/VectorStorePinecone.node.js +2 -2
  71. package/dist/nodes/vector_store/VectorStorePinecone/VectorStorePinecone.node.js.map +1 -1
  72. package/dist/nodes/vector_store/VectorStorePinecone/pinecone.dark.svg +21 -0
  73. package/dist/nodes/vector_store/VectorStorePinecone/pinecone.svg +21 -1
  74. package/dist/nodes/vector_store/VectorStoreSupabase/VectorStoreSupabase.node.js +1 -1
  75. package/dist/nodes/vector_store/VectorStoreSupabase/VectorStoreSupabase.node.js.map +1 -1
  76. package/dist/nodes/vector_store/VectorStoreZep/VectorStoreZep.node.js +16 -4
  77. package/dist/nodes/vector_store/VectorStoreZep/VectorStoreZep.node.js.map +1 -1
  78. package/dist/nodes/vector_store/shared/MemoryVectorStoreManager.js.map +1 -1
  79. package/dist/nodes/vector_store/shared/createVectorStoreNode.d.ts +4 -3
  80. package/dist/nodes/vector_store/shared/createVectorStoreNode.js +111 -11
  81. package/dist/nodes/vector_store/shared/createVectorStoreNode.js.map +1 -1
  82. package/dist/nodes/vendors/OpenAi/transport/index.js +7 -2
  83. package/dist/nodes/vendors/OpenAi/transport/index.js.map +1 -1
  84. package/dist/types/credentials.json +2 -2
  85. package/dist/types/nodes.json +30 -29
  86. package/dist/utils/N8nBinaryLoader.d.ts +2 -2
  87. package/dist/utils/N8nBinaryLoader.js +5 -5
  88. package/dist/utils/N8nBinaryLoader.js.map +1 -1
  89. package/dist/utils/N8nJsonLoader.d.ts +2 -2
  90. package/dist/utils/N8nJsonLoader.js +1 -1
  91. package/dist/utils/N8nJsonLoader.js.map +1 -1
  92. package/dist/utils/N8nTool.js +1 -1
  93. package/dist/utils/N8nTool.js.map +1 -1
  94. package/dist/utils/descriptions.js +2 -2
  95. package/dist/utils/descriptions.js.map +1 -1
  96. package/package.json +7 -7
@@ -0,0 +1,194 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ var __importDefault = (this && this.__importDefault) || function (mod) {
36
+ return (mod && mod.__esModule) ? mod : { "default": mod };
37
+ };
38
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ exports.ToolWorkflowV1 = void 0;
40
+ const tools_1 = require("@langchain/core/tools");
41
+ const get_1 = __importDefault(require("lodash/get"));
42
+ const isObject_1 = __importDefault(require("lodash/isObject"));
43
+ const manual = __importStar(require("n8n-nodes-base/dist/nodes/Set/v2/manual.mode"));
44
+ const n8n_workflow_1 = require("n8n-workflow");
45
+ const versionDescription_1 = require("./versionDescription");
46
+ const schemaParsing_1 = require("../../../../utils/schemaParsing");
47
+ class ToolWorkflowV1 {
48
+ constructor(baseDescription) {
49
+ this.description = {
50
+ ...baseDescription,
51
+ ...versionDescription_1.versionDescription,
52
+ };
53
+ }
54
+ async supplyData(itemIndex) {
55
+ const workflowProxy = this.getWorkflowDataProxy(0);
56
+ const name = this.getNodeParameter('name', itemIndex);
57
+ const description = this.getNodeParameter('description', itemIndex);
58
+ let subExecutionId;
59
+ let subWorkflowId;
60
+ const useSchema = this.getNodeParameter('specifyInputSchema', itemIndex);
61
+ let tool = undefined;
62
+ const runFunction = async (query, runManager) => {
63
+ const source = this.getNodeParameter('source', itemIndex);
64
+ const workflowInfo = {};
65
+ if (source === 'database') {
66
+ const nodeVersion = this.getNode().typeVersion;
67
+ if (nodeVersion <= 1.1) {
68
+ workflowInfo.id = this.getNodeParameter('workflowId', itemIndex);
69
+ }
70
+ else {
71
+ const { value } = this.getNodeParameter('workflowId', itemIndex, {});
72
+ workflowInfo.id = value;
73
+ }
74
+ subWorkflowId = workflowInfo.id;
75
+ }
76
+ else if (source === 'parameter') {
77
+ const workflowJson = this.getNodeParameter('workflowJson', itemIndex);
78
+ try {
79
+ workflowInfo.code = JSON.parse(workflowJson);
80
+ subWorkflowId = workflowProxy.$workflow.id;
81
+ }
82
+ catch (error) {
83
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), `The provided workflow is not valid JSON: "${error.message}"`, {
84
+ itemIndex,
85
+ });
86
+ }
87
+ }
88
+ const rawData = { query };
89
+ const workflowFieldsJson = this.getNodeParameter('fields.values', itemIndex, [], {
90
+ rawExpressions: true,
91
+ });
92
+ for (const entry of workflowFieldsJson) {
93
+ if (entry.type === 'objectValue' && entry.objectValue.startsWith('=')) {
94
+ rawData[entry.name] = entry.objectValue.replace(/^=+/, '');
95
+ }
96
+ }
97
+ const options = {
98
+ include: 'all',
99
+ };
100
+ const newItem = await manual.execute.call(this, { json: { query } }, itemIndex, options, rawData, this.getNode());
101
+ const items = [newItem];
102
+ let receivedData;
103
+ try {
104
+ receivedData = await this.executeWorkflow(workflowInfo, items, runManager?.getChild(), {
105
+ parentExecution: {
106
+ executionId: workflowProxy.$execution.id,
107
+ workflowId: workflowProxy.$workflow.id,
108
+ },
109
+ });
110
+ subExecutionId = receivedData.executionId;
111
+ }
112
+ catch (error) {
113
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), error);
114
+ }
115
+ const response = (0, get_1.default)(receivedData, 'data[0][0].json');
116
+ if (response === undefined) {
117
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'There was an error: "The workflow did not return a response"');
118
+ }
119
+ return response;
120
+ };
121
+ const toolHandler = async (query, runManager) => {
122
+ const { index } = this.addInputData("ai_tool", [[{ json: { query } }]]);
123
+ let response = '';
124
+ let executionError;
125
+ try {
126
+ response = await runFunction(query, runManager);
127
+ }
128
+ catch (error) {
129
+ executionError = error;
130
+ response = `There was an error: "${error.message}"`;
131
+ }
132
+ if (typeof response === 'number') {
133
+ response = response.toString();
134
+ }
135
+ if ((0, isObject_1.default)(response)) {
136
+ response = JSON.stringify(response, null, 2);
137
+ }
138
+ if (typeof response !== 'string') {
139
+ executionError = new n8n_workflow_1.NodeOperationError(this.getNode(), 'Wrong output type returned', {
140
+ description: `The response property should be a string, but it is an ${typeof response}`,
141
+ });
142
+ response = `There was an error: "${executionError.message}"`;
143
+ }
144
+ let metadata;
145
+ if (subExecutionId && subWorkflowId) {
146
+ metadata = {
147
+ subExecution: {
148
+ executionId: subExecutionId,
149
+ workflowId: subWorkflowId,
150
+ },
151
+ };
152
+ }
153
+ if (executionError) {
154
+ void this.addOutputData("ai_tool", index, executionError, metadata);
155
+ }
156
+ else {
157
+ const json = (0, n8n_workflow_1.jsonParse)(response, { fallbackValue: { response } });
158
+ void this.addOutputData("ai_tool", index, [[{ json }]], metadata);
159
+ }
160
+ return response;
161
+ };
162
+ const functionBase = {
163
+ name,
164
+ description,
165
+ func: toolHandler,
166
+ };
167
+ if (useSchema) {
168
+ try {
169
+ const jsonExample = this.getNodeParameter('jsonSchemaExample', itemIndex, '');
170
+ const inputSchema = this.getNodeParameter('inputSchema', itemIndex, '');
171
+ const schemaType = this.getNodeParameter('schemaType', itemIndex);
172
+ const jsonSchema = schemaType === 'fromJson'
173
+ ? (0, schemaParsing_1.generateSchema)(jsonExample)
174
+ : (0, n8n_workflow_1.jsonParse)(inputSchema);
175
+ const zodSchema = (0, schemaParsing_1.convertJsonSchemaToZod)(jsonSchema);
176
+ tool = new tools_1.DynamicStructuredTool({
177
+ schema: zodSchema,
178
+ ...functionBase,
179
+ });
180
+ }
181
+ catch (error) {
182
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Error during parsing of JSON Schema. \n ' + error);
183
+ }
184
+ }
185
+ else {
186
+ tool = new tools_1.DynamicTool(functionBase);
187
+ }
188
+ return {
189
+ response: tool,
190
+ };
191
+ }
192
+ }
193
+ exports.ToolWorkflowV1 = ToolWorkflowV1;
194
+ //# sourceMappingURL=ToolWorkflowV1.node.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ToolWorkflowV1.node.js","sourceRoot":"","sources":["../../../../../nodes/tools/ToolWorkflow/v1/ToolWorkflowV1.node.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,iDAA2E;AAE3E,qDAA6B;AAC7B,+DAAuC;AAEvC,qFAAuE;AAgBvE,+CAAiF;AAEjF,6DAA0D;AAE1D,mEAAyF;AAEzF,MAAa,cAAc;IAG1B,YAAY,eAAyC;QACpD,IAAI,CAAC,WAAW,GAAG;YAClB,GAAG,eAAe;YAClB,GAAG,uCAAkB;SACrB,CAAC;IACH,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WAAW,GAAG,IAAI,CAAC,gBAAgB,CAAC,mBAAmB,EAAE,SAAS,EAAE,EAAE,CAAW,CAAC;gBACxF,MAAM,WAAW,GAAG,IAAI,CAAC,gBAAgB,CAAC,aAAa,EAAE,SAAS,EAAE,EAAE,CAAW,CAAC;gBAElF,MAAM,UAAU,GAAG,IAAI,CAAC,gBAAgB,CAAC,YAAY,EAAE,SAAS,CAA0B,CAAC;gBAC3F,MAAM,UAAU,GACf,UAAU,KAAK,UAAU;oBACxB,CAAC,CAAC,IAAA,8BAAc,EAAC,WAAW,CAAC;oBAC7B,CAAC,CAAC,IAAA,wBAAS,EAAc,WAAW,CAAC,CAAC;gBAExC,MAAM,SAAS,GAAG,IAAA,sCAAsB,EAAmB,UAAU,CAAC,CAAC;gBAEvE,IAAI,GAAG,IAAI,6BAAqB,CAAC;oBAChC,MAAM,EAAE,SAAS;oBACjB,GAAG,YAAY;iBACf,CAAC,CAAC;YACJ,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBAChB,MAAM,IAAI,iCAAkB,CAC3B,IAAI,CAAC,OAAO,EAAE,EACd,0CAA0C,GAAG,KAAK,CAClD,CAAC;YACH,CAAC;QACF,CAAC;aAAM,CAAC;YACP,IAAI,GAAG,IAAI,mBAAW,CAAC,YAAY,CAAC,CAAC;QACtC,CAAC;QAED,OAAO;YACN,QAAQ,EAAE,IAAI;SACd,CAAC;IACH,CAAC;CACD;AApND,wCAoNC"}
@@ -0,0 +1,2 @@
1
+ import type { INodeTypeDescription } from 'n8n-workflow';
2
+ export declare const versionDescription: INodeTypeDescription;
@@ -0,0 +1,311 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.versionDescription = void 0;
4
+ const descriptions_1 = require("../../../../utils/descriptions");
5
+ const sharedFields_1 = require("../../../../utils/sharedFields");
6
+ exports.versionDescription = {
7
+ displayName: 'Call n8n Workflow Tool',
8
+ name: 'toolWorkflow',
9
+ icon: 'fa:network-wired',
10
+ iconColor: 'black',
11
+ group: ['transform'],
12
+ version: [1, 1.1, 1.2, 1.3],
13
+ description: 'Uses another n8n workflow as a tool. Allows packaging any n8n node(s) as a tool.',
14
+ defaults: {
15
+ name: 'Call n8n Workflow Tool',
16
+ },
17
+ codex: {
18
+ categories: ['AI'],
19
+ subcategories: {
20
+ AI: ['Tools'],
21
+ Tools: ['Recommended Tools'],
22
+ },
23
+ resources: {
24
+ primaryDocumentation: [
25
+ {
26
+ url: 'https://docs.n8n.io/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.toolworkflow/',
27
+ },
28
+ ],
29
+ },
30
+ },
31
+ inputs: [],
32
+ outputs: ["ai_tool"],
33
+ outputNames: ['Tool'],
34
+ properties: [
35
+ (0, sharedFields_1.getConnectionHintNoticeField)(["ai_agent"]),
36
+ {
37
+ displayName: 'See an example of a workflow to suggest meeting slots using AI <a href="/templates/1953" target="_blank">here</a>.',
38
+ name: 'noticeTemplateExample',
39
+ type: 'notice',
40
+ default: '',
41
+ },
42
+ {
43
+ displayName: 'Name',
44
+ name: 'name',
45
+ type: 'string',
46
+ default: '',
47
+ placeholder: 'My_Color_Tool',
48
+ displayOptions: {
49
+ show: {
50
+ '@version': [1],
51
+ },
52
+ },
53
+ },
54
+ {
55
+ displayName: 'Name',
56
+ name: 'name',
57
+ type: 'string',
58
+ default: '',
59
+ placeholder: 'e.g. My_Color_Tool',
60
+ validateType: 'string-alphanumeric',
61
+ description: 'The name of the function to be called, could contain letters, numbers, and underscores only',
62
+ displayOptions: {
63
+ show: {
64
+ '@version': [{ _cnd: { gte: 1.1 } }],
65
+ },
66
+ },
67
+ },
68
+ {
69
+ displayName: 'Description',
70
+ name: 'description',
71
+ type: 'string',
72
+ default: '',
73
+ placeholder: 'Call this tool to get a random color. The input should be a string with comma separted names of colors to exclude.',
74
+ typeOptions: {
75
+ rows: 3,
76
+ },
77
+ },
78
+ {
79
+ displayName: 'This tool will call the workflow you define below, and look in the last node for the response. The workflow needs to start with an Execute Workflow trigger',
80
+ name: 'executeNotice',
81
+ type: 'notice',
82
+ default: '',
83
+ },
84
+ {
85
+ displayName: 'Source',
86
+ name: 'source',
87
+ type: 'options',
88
+ options: [
89
+ {
90
+ name: 'Database',
91
+ value: 'database',
92
+ description: 'Load the workflow from the database by ID',
93
+ },
94
+ {
95
+ name: 'Define Below',
96
+ value: 'parameter',
97
+ description: 'Pass the JSON code of a workflow',
98
+ },
99
+ ],
100
+ default: 'database',
101
+ description: 'Where to get the workflow to execute from',
102
+ },
103
+ {
104
+ displayName: 'Workflow ID',
105
+ name: 'workflowId',
106
+ type: 'string',
107
+ displayOptions: {
108
+ show: {
109
+ source: ['database'],
110
+ '@version': [{ _cnd: { lte: 1.1 } }],
111
+ },
112
+ },
113
+ default: '',
114
+ required: true,
115
+ description: 'The workflow to execute',
116
+ hint: 'Can be found in the URL of the workflow',
117
+ },
118
+ {
119
+ displayName: 'Workflow',
120
+ name: 'workflowId',
121
+ type: 'workflowSelector',
122
+ displayOptions: {
123
+ show: {
124
+ source: ['database'],
125
+ '@version': [{ _cnd: { gte: 1.2 } }],
126
+ },
127
+ },
128
+ default: '',
129
+ required: true,
130
+ },
131
+ {
132
+ displayName: 'Workflow JSON',
133
+ name: 'workflowJson',
134
+ type: 'json',
135
+ typeOptions: {
136
+ rows: 10,
137
+ },
138
+ displayOptions: {
139
+ show: {
140
+ source: ['parameter'],
141
+ },
142
+ },
143
+ default: '\n\n\n\n\n\n\n\n\n',
144
+ required: true,
145
+ description: 'The workflow JSON code to execute',
146
+ },
147
+ {
148
+ displayName: 'Field to Return',
149
+ name: 'responsePropertyName',
150
+ type: 'string',
151
+ default: 'response',
152
+ required: true,
153
+ hint: 'The field in the last-executed node of the workflow that contains the response',
154
+ description: 'Where to find the data that this tool should return. n8n will look in the output of the last-executed node of the workflow for a field with this name, and return its value.',
155
+ displayOptions: {
156
+ show: {
157
+ '@version': [{ _cnd: { lt: 1.3 } }],
158
+ },
159
+ },
160
+ },
161
+ {
162
+ displayName: 'Extra Workflow Inputs',
163
+ name: 'fields',
164
+ placeholder: 'Add Value',
165
+ type: 'fixedCollection',
166
+ description: "These will be output by the 'execute workflow' trigger of the workflow being called",
167
+ typeOptions: {
168
+ multipleValues: true,
169
+ sortable: true,
170
+ },
171
+ default: {},
172
+ options: [
173
+ {
174
+ name: 'values',
175
+ displayName: 'Values',
176
+ values: [
177
+ {
178
+ displayName: 'Name',
179
+ name: 'name',
180
+ type: 'string',
181
+ default: '',
182
+ placeholder: 'e.g. fieldName',
183
+ description: 'Name of the field to set the value of. Supports dot-notation. Example: data.person[0].name.',
184
+ requiresDataPath: 'single',
185
+ },
186
+ {
187
+ displayName: 'Type',
188
+ name: 'type',
189
+ type: 'options',
190
+ description: 'The field value type',
191
+ options: [
192
+ {
193
+ name: 'String',
194
+ value: 'stringValue',
195
+ },
196
+ {
197
+ name: 'Number',
198
+ value: 'numberValue',
199
+ },
200
+ {
201
+ name: 'Boolean',
202
+ value: 'booleanValue',
203
+ },
204
+ {
205
+ name: 'Array',
206
+ value: 'arrayValue',
207
+ },
208
+ {
209
+ name: 'Object',
210
+ value: 'objectValue',
211
+ },
212
+ ],
213
+ default: 'stringValue',
214
+ },
215
+ {
216
+ displayName: 'Value',
217
+ name: 'stringValue',
218
+ type: 'string',
219
+ default: '',
220
+ displayOptions: {
221
+ show: {
222
+ type: ['stringValue'],
223
+ },
224
+ },
225
+ validateType: 'string',
226
+ ignoreValidationDuringExecution: true,
227
+ },
228
+ {
229
+ displayName: 'Value',
230
+ name: 'numberValue',
231
+ type: 'string',
232
+ default: '',
233
+ displayOptions: {
234
+ show: {
235
+ type: ['numberValue'],
236
+ },
237
+ },
238
+ validateType: 'number',
239
+ ignoreValidationDuringExecution: true,
240
+ },
241
+ {
242
+ displayName: 'Value',
243
+ name: 'booleanValue',
244
+ type: 'options',
245
+ default: 'true',
246
+ options: [
247
+ {
248
+ name: 'True',
249
+ value: 'true',
250
+ },
251
+ {
252
+ name: 'False',
253
+ value: 'false',
254
+ },
255
+ ],
256
+ displayOptions: {
257
+ show: {
258
+ type: ['booleanValue'],
259
+ },
260
+ },
261
+ validateType: 'boolean',
262
+ ignoreValidationDuringExecution: true,
263
+ },
264
+ {
265
+ displayName: 'Value',
266
+ name: 'arrayValue',
267
+ type: 'string',
268
+ default: '',
269
+ placeholder: 'e.g. [ arrayItem1, arrayItem2, arrayItem3 ]',
270
+ displayOptions: {
271
+ show: {
272
+ type: ['arrayValue'],
273
+ },
274
+ },
275
+ validateType: 'array',
276
+ ignoreValidationDuringExecution: true,
277
+ },
278
+ {
279
+ displayName: 'Value',
280
+ name: 'objectValue',
281
+ type: 'json',
282
+ default: '={}',
283
+ typeOptions: {
284
+ rows: 2,
285
+ },
286
+ displayOptions: {
287
+ show: {
288
+ type: ['objectValue'],
289
+ },
290
+ },
291
+ validateType: 'object',
292
+ ignoreValidationDuringExecution: true,
293
+ },
294
+ ],
295
+ },
296
+ ],
297
+ },
298
+ {
299
+ displayName: 'Specify Input Schema',
300
+ name: 'specifyInputSchema',
301
+ type: 'boolean',
302
+ description: 'Whether to specify the schema for the function. This would require the LLM to provide the input in the correct format and would validate it against the schema.',
303
+ noDataExpression: true,
304
+ default: false,
305
+ },
306
+ { ...descriptions_1.schemaTypeField, displayOptions: { show: { specifyInputSchema: [true] } } },
307
+ descriptions_1.jsonSchemaExampleField,
308
+ descriptions_1.inputSchemaField,
309
+ ],
310
+ };
311
+ //# sourceMappingURL=versionDescription.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"versionDescription.js","sourceRoot":"","sources":["../../../../../nodes/tools/ToolWorkflow/v1/versionDescription.ts"],"names":[],"mappings":";;;AAKA,iEAIwC;AACxC,iEAA8E;AAEjE,QAAA,kBAAkB,GAAyB;IACvD,WAAW,EAAE,wBAAwB;IACrC,IAAI,EAAE,cAAc;IACpB,IAAI,EAAE,kBAAkB;IACxB,SAAS,EAAE,OAAO;IAClB,KAAK,EAAE,CAAC,WAAW,CAAC;IACpB,OAAO,EAAE,C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ACrC;wBACD;4BACC,WAAW,EAAE,OAAO;4BACpB,IAAI,EAAE,YAAY;4BAClB,IAAI,EAAE,QAAQ;4BACd,OAAO,EAAE,EAAE;4BACX,WAAW,EAAE,6CAA6C;4BAC1D,cAAc,EAAE;gCACf,IAAI,EAAE;oCACL,IAAI,EAAE,CAAC,YAAY,CAAC;iCACpB;6BACD;4BACD,YAAY,EAAE,OAAO;4BACrB,+BAA+B,EAAE,IAAI;yBACrC;wBACD;4BACC,WAAW,EAAE,OAAO;4BACpB,IAAI,EAAE,aAAa;4BACnB,IAAI,EAAE,MAAM;4BACZ,OAAO,EAAE,KAAK;4BACd,WAAW,EAAE;gCACZ,IAAI,EAAE,CAAC;6BACP;4BACD,cAAc,EAAE;gCACf,IAAI,EAAE;oCACL,IAAI,EAAE,CAAC,aAAa,CAAC;iCACrB;6BACD;4BACD,YAAY,EAAE,QAAQ;4BACtB,+BAA+B,EAAE,IAAI;yBACrC;qBACD;iBACD;aACD;SACD;QAID;YACC,WAAW,EAAE,sBAAsB;YACnC,IAAI,EAAE,oBAAoB;YAC1B,IAAI,EAAE,SAAS;YACf,WAAW,EACV,iKAAiK;YAClK,gBAAgB,EAAE,IAAI;YACtB,OAAO,EAAE,KAAK;SACd;QACD,EAAE,GAAG,8BAAe,EAAE,cAAc,EAAE,EAAE,IAAI,EAAE,EAAE,kBAAkB,EAAE,CAAC,IAAI,CAAC,EAAE,EAAE,EAAE;QAChF,qCAAsB;QACtB,+BAAgB;KAChB;CACD,CAAC"}
@@ -0,0 +1,12 @@
1
+ import { loadWorkflowInputMappings } from 'n8n-nodes-base/dist/utils/workflowInputsResourceMapping/GenericFunctions';
2
+ import type { INodeTypeBaseDescription, ISupplyDataFunctions, SupplyData, INodeType, INodeTypeDescription } from 'n8n-workflow';
3
+ export declare class ToolWorkflowV2 implements INodeType {
4
+ description: INodeTypeDescription;
5
+ constructor(baseDescription: INodeTypeBaseDescription);
6
+ methods: {
7
+ localResourceMapping: {
8
+ loadWorkflowInputMappings: typeof loadWorkflowInputMappings;
9
+ };
10
+ };
11
+ supplyData(this: ISupplyDataFunctions, itemIndex: number): Promise<SupplyData>;
12
+ }
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ToolWorkflowV2 = void 0;
4
+ const GenericFunctions_1 = require("n8n-nodes-base/dist/utils/workflowInputsResourceMapping/GenericFunctions");
5
+ const WorkflowToolService_1 = require("./utils/WorkflowToolService");
6
+ const versionDescription_1 = require("./versionDescription");
7
+ class ToolWorkflowV2 {
8
+ constructor(baseDescription) {
9
+ this.methods = {
10
+ localResourceMapping: {
11
+ loadWorkflowInputMappings: GenericFunctions_1.loadWorkflowInputMappings,
12
+ },
13
+ };
14
+ this.description = {
15
+ ...baseDescription,
16
+ ...versionDescription_1.versionDescription,
17
+ };
18
+ }
19
+ async supplyData(itemIndex) {
20
+ const workflowToolService = new WorkflowToolService_1.WorkflowToolService(this);
21
+ const name = this.getNodeParameter('name', itemIndex);
22
+ const description = this.getNodeParameter('description', itemIndex);
23
+ const tool = await workflowToolService.createTool({
24
+ name,
25
+ description,
26
+ itemIndex,
27
+ });
28
+ return { response: tool };
29
+ }
30
+ }
31
+ exports.ToolWorkflowV2 = ToolWorkflowV2;
32
+ //# sourceMappingURL=ToolWorkflowV2.node.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ToolWorkflowV2.node.js","sourceRoot":"","sources":["../../../../../nodes/tools/ToolWorkflow/v2/ToolWorkflowV2.node.ts"],"names":[],"mappings":";;;AAAA,+GAAqH;AASrH,qEAAkE;AAClE,6DAA0D;AAE1D,MAAa,cAAc;IAG1B,YAAY,eAAyC;QAOrD,YAAO,GAAG;YACT,oBAAoB,EAAE;gBACrB,yBAAyB,EAAzB,4CAAyB;aACzB;SACD,CAAC;QAVD,IAAI,CAAC,WAAW,GAAG;YAClB,GAAG,eAAe;YAClB,GAAG,uCAAkB;SACrB,CAAC;IACH,CAAC;IAQD,KAAK,CAAC,UAAU,CAA6B,SAAiB;QAC7D,MAAM,mBAAmB,GAAG,IAAI,yCAAmB,CAAC,IAAI,CAAC,CAAC;QAC1D,MAAM,IAAI,GAAG,IAAI,CAAC,gBAAgB,CAAC,MAAM,EAAE,SAAS,CAAW,CAAC;QAChE,MAAM,WAAW,GAAG,IAAI,CAAC,gBAAgB,CAAC,aAAa,EAAE,SAAS,CAAW,CAAC;QAE9E,MAAM,IAAI,GAAG,MAAM,mBAAmB,CAAC,UAAU,CAAC;YACjD,IAAI;YACJ,WAAW;YACX,SAAS;SACT,CAAC,CAAC;QAEH,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAC3B,CAAC;CACD;AA7BD,wCA6BC"}
@@ -0,0 +1,19 @@
1
+ import type { ISupplyDataFunctions } from 'n8n-workflow';
2
+ import { z } from 'zod';
3
+ type AllowedTypes = 'string' | 'number' | 'boolean' | 'json';
4
+ export interface FromAIArgument {
5
+ key: string;
6
+ description?: string;
7
+ type?: AllowedTypes;
8
+ defaultValue?: string | number | boolean | Record<string, unknown>;
9
+ }
10
+ export declare class AIParametersParser {
11
+ private ctx;
12
+ constructor(ctx: ISupplyDataFunctions);
13
+ generateZodSchema(placeholder: FromAIArgument): z.ZodTypeAny;
14
+ traverseNodeParameters(payload: unknown, collectedArgs: FromAIArgument[]): void;
15
+ extractFromAICalls(str: string): FromAIArgument[];
16
+ parseArguments(argsString: string): FromAIArgument;
17
+ parseDefaultValue(value: string | undefined): string | number | boolean | Record<string, unknown> | undefined;
18
+ }
19
+ export {};