feat(Custom n8n Workflow Tool Node): Add support for tool input schema (#9470)

Signed-off-by: Oleg Ivaniv <me@olegivaniv.com>
This commit is contained in:
oleg
2024-05-22 14:29:32 +02:00
committed by GitHub
parent ef9d4aba90
commit 2fa46b6faa
14 changed files with 373 additions and 108 deletions

View File

@@ -13,6 +13,7 @@ import {
getConnectedTools,
} from '../../../../../utils/helpers';
import { getTracingConfig } from '../../../../../utils/tracing';
import { throwIfToolSchema } from '../../../../../utils/schemaParsing';
export async function conversationalAgentExecute(
this: IExecuteFunctions,
@@ -111,6 +112,8 @@ export async function conversationalAgentExecute(
returnData.push({ json: response });
} catch (error) {
throwIfToolSchema(this, error);
if (this.continueOnFail()) {
returnData.push({ json: { error: error.message }, pairedItem: { item: itemIndex } });
continue;

View File

@@ -16,6 +16,7 @@ import {
getPromptInputByType,
} from '../../../../../utils/helpers';
import { getTracingConfig } from '../../../../../utils/tracing';
import { throwIfToolSchema } from '../../../../../utils/schemaParsing';
export async function planAndExecuteAgentExecute(
this: IExecuteFunctions,
@@ -91,6 +92,7 @@ export async function planAndExecuteAgentExecute(
returnData.push({ json: response });
} catch (error) {
throwIfToolSchema(this, error);
if (this.continueOnFail()) {
returnData.push({ json: { error: error.message }, pairedItem: { item: itemIndex } });
continue;

View File

@@ -18,6 +18,7 @@ import {
isChatInstance,
} from '../../../../../utils/helpers';
import { getTracingConfig } from '../../../../../utils/tracing';
import { throwIfToolSchema } from '../../../../../utils/schemaParsing';
export async function reActAgentAgentExecute(
this: IExecuteFunctions,
@@ -112,6 +113,7 @@ export async function reActAgentAgentExecute(
returnData.push({ json: response });
} catch (error) {
throwIfToolSchema(this, error);
if (this.continueOnFail()) {
returnData.push({ json: { error: error.message }, pairedItem: { item: itemIndex } });
continue;