From e39928dde8913794f6629c153978686033975167 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E0=A4=95=E0=A4=BE=E0=A4=B0=E0=A4=A4=E0=A5=8B=E0=A4=AB?= =?UTF-8?q?=E0=A5=8D=E0=A4=AB=E0=A5=87=E0=A4=B2=E0=A4=B8=E0=A5=8D=E0=A4=95?= =?UTF-8?q?=E0=A5=8D=E0=A4=B0=E0=A4=BF=E0=A4=AA=E0=A5=8D=E0=A4=9F=E2=84=A2?= Date: Mon, 3 Feb 2025 15:04:03 +0100 Subject: [PATCH] ci: Fix tests for declarative nodes (no-changelog) (#13013) --- .../src/execution-engine/workflow-execute.ts | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/packages/core/src/execution-engine/workflow-execute.ts b/packages/core/src/execution-engine/workflow-execute.ts index 9b20a7bd2a..2e0e89f26a 100644 --- a/packages/core/src/execution-engine/workflow-execute.ts +++ b/packages/core/src/execution-engine/workflow-execute.ts @@ -69,6 +69,7 @@ import { handleCycles, filterDisabledNodes, } from './partial-execution-utils'; +import { RoutingNode } from './routing-node'; import { TriggersAndPollers } from './triggers-and-pollers'; export class WorkflowExecute { @@ -1170,7 +1171,23 @@ export class WorkflowExecute { // For webhook nodes always simply pass the data through return { data: inputData.main as INodeExecutionData[][] }; } else { - throw new ApplicationError('Declarative nodes should been handled as regular nodes'); + // NOTE: This block is only called by nodes tests. + // In the application, declarative nodes get assigned a `.execute` method in NodeTypes. + const context = new ExecuteContext( + workflow, + node, + additionalData, + mode, + runExecutionData, + runIndex, + connectionInputData, + inputData, + executionData, + [], + ); + const routingNode = new RoutingNode(context, nodeType); + const data = await routingNode.runNode(); + return { data }; } }