🐛 Fix bug that trigger nodes always needed first output to be set

This commit is contained in:
Jan Oberhauser 2020-12-03 00:23:49 +01:00
parent e770fa37ad
commit 5d7840b1f6

View file

@ -916,6 +916,11 @@ export class Workflow {
} }
let connectionInputData: INodeExecutionData[] = []; let connectionInputData: INodeExecutionData[] = [];
if (nodeType.execute || nodeType.executeSingle) {
// Only stop if first input is empty for execute & executeSingle runs. For all others run anyways
// because then it is a trigger node. As they only pass data through and so the input-data
// becomes output-data it has to be possible.
if (inputData.hasOwnProperty('main') && inputData.main.length > 0) { if (inputData.hasOwnProperty('main') && inputData.main.length > 0) {
// We always use the data of main input and the first input for executeSingle // We always use the data of main input and the first input for executeSingle
connectionInputData = (inputData.main[0] as INodeExecutionData[]); connectionInputData = (inputData.main[0] as INodeExecutionData[]);
@ -925,6 +930,7 @@ export class Workflow {
// No data for node so return // No data for node so return
return undefined; return undefined;
} }
}
if (runExecutionData.resultData.lastNodeExecuted === node.name && runExecutionData.resultData.error !== undefined) { if (runExecutionData.resultData.lastNodeExecuted === node.name && runExecutionData.resultData.error !== undefined) {
// The node did already fail. So throw an error here that it displays and logs it correctly. // The node did already fail. So throw an error here that it displays and logs it correctly.
@ -936,7 +942,7 @@ export class Workflow {
} }
if (node.executeOnce === true) { if (node.executeOnce === true) {
// If node should be executed only use only the first input item // If node should be executed only once so use only the first input item
connectionInputData = connectionInputData.slice(0, 1); connectionInputData = connectionInputData.slice(0, 1);
const newInputData: ITaskDataConnections = {}; const newInputData: ITaskDataConnections = {};
for (const inputName of Object.keys(inputData)) { for (const inputName of Object.keys(inputData)) {