mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-16 17:46:45 +00:00
fix(core): Show correct error messages when nodes can't be used in an expression (#16549)
This commit is contained in:
@@ -519,7 +519,7 @@ describe('WorkflowExecute', () => {
|
||||
// ┌───────┐1 ┌─────┐1 ┌─────┐
|
||||
// │trigger├──────►node1├──────►node2│
|
||||
// └───────┘ └─────┘ └─────┘
|
||||
test('removes disabled nodes from the workflow', async () => {
|
||||
test('removes disabled nodes from the runNodeFilter, but not the graph', async () => {
|
||||
// ARRANGE
|
||||
const waitPromise = createDeferredPromise<IRun>();
|
||||
const additionalData = Helpers.WorkflowExecuteAdditionalData(waitPromise);
|
||||
@@ -555,11 +555,17 @@ describe('WorkflowExecute', () => {
|
||||
);
|
||||
|
||||
// ASSERT
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
const runNodeFilter: string[] = (workflowExecute as any).runExecutionData.startData
|
||||
?.runNodeFilter;
|
||||
expect(runNodeFilter).toContain(trigger.name);
|
||||
expect(runNodeFilter).toContain(node2.name);
|
||||
expect(runNodeFilter).not.toContain(node1.name);
|
||||
expect(processRunExecutionDataSpy).toHaveBeenCalledTimes(1);
|
||||
const nodes = Object.keys(processRunExecutionDataSpy.mock.calls[0][0].nodes);
|
||||
expect(nodes).toContain(trigger.name);
|
||||
expect(nodes).toContain(node2.name);
|
||||
expect(nodes).not.toContain(node1.name);
|
||||
expect(nodes).toContain(node1.name);
|
||||
});
|
||||
|
||||
// ►►
|
||||
|
||||
@@ -473,7 +473,11 @@ export class WorkflowExecute {
|
||||
},
|
||||
};
|
||||
|
||||
return this.processRunExecutionData(graph.toWorkflow({ ...workflow }));
|
||||
// Still passing the original workflow here, because the WorkflowDataProxy
|
||||
// needs it to create more useful error messages, e.g. differentiate
|
||||
// between a node not being connected to the node referencing it or a node
|
||||
// not existing in the workflow.
|
||||
return this.processRunExecutionData(workflow);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user