ci: Fix tests for declarative nodes (no-changelog) (#13013)

This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™ 2025-02-03 15:04:03 +01:00 committed by GitHub
parent b2a5f9ca05
commit e39928dde8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -69,6 +69,7 @@ import {
handleCycles, handleCycles,
filterDisabledNodes, filterDisabledNodes,
} from './partial-execution-utils'; } from './partial-execution-utils';
import { RoutingNode } from './routing-node';
import { TriggersAndPollers } from './triggers-and-pollers'; import { TriggersAndPollers } from './triggers-and-pollers';
export class WorkflowExecute { export class WorkflowExecute {
@ -1170,7 +1171,23 @@ export class WorkflowExecute {
// For webhook nodes always simply pass the data through // For webhook nodes always simply pass the data through
return { data: inputData.main as INodeExecutionData[][] }; return { data: inputData.main as INodeExecutionData[][] };
} else { } 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 };
} }
} }