mirror of
https://github.com/n8n-io/n8n.git
synced 2025-02-21 02:56:40 -08:00
🐛 Fix bug that trigger nodes always needed first output to be set
This commit is contained in:
parent
e770fa37ad
commit
5d7840b1f6
|
@ -916,14 +916,20 @@ export class Workflow {
|
||||||
}
|
}
|
||||||
|
|
||||||
let connectionInputData: INodeExecutionData[] = [];
|
let connectionInputData: INodeExecutionData[] = [];
|
||||||
if (inputData.hasOwnProperty('main') && inputData.main.length > 0) {
|
if (nodeType.execute || nodeType.executeSingle) {
|
||||||
// We always use the data of main input and the first input for executeSingle
|
// Only stop if first input is empty for execute & executeSingle runs. For all others run anyways
|
||||||
connectionInputData = (inputData.main[0] as INodeExecutionData[]);
|
// 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 (connectionInputData.length === 0) {
|
if (inputData.hasOwnProperty('main') && inputData.main.length > 0) {
|
||||||
// No data for node so return
|
// We always use the data of main input and the first input for executeSingle
|
||||||
return undefined;
|
connectionInputData = (inputData.main[0] as INodeExecutionData[]);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (connectionInputData.length === 0) {
|
||||||
|
// No data for node so return
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (runExecutionData.resultData.lastNodeExecuted === node.name && runExecutionData.resultData.error !== undefined) {
|
if (runExecutionData.resultData.lastNodeExecuted === node.name && runExecutionData.resultData.error !== undefined) {
|
||||||
|
@ -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)) {
|
||||||
|
|
Loading…
Reference in a new issue