diff --git a/packages/core/src/WorkflowExecute.ts b/packages/core/src/WorkflowExecute.ts index 1dfb599083..1e8b8898a7 100644 --- a/packages/core/src/WorkflowExecute.ts +++ b/packages/core/src/WorkflowExecute.ts @@ -596,6 +596,17 @@ export class WorkflowExecute { this.runExecutionData.resultData.lastNodeExecuted = executionData.node.name; nodeSuccessData = await workflow.runNode(executionData.node, executionData.data, this.runExecutionData, runIndex, this.additionalData, NodeExecuteFunctions, this.mode); + if (nodeSuccessData === null || nodeSuccessData[0][0] === undefined) { + if (executionData.node.alwaysOutputData === true) { + nodeSuccessData = nodeSuccessData || []; + nodeSuccessData[0] = [ + { + json: {}, + } + ]; + } + } + if (nodeSuccessData === null) { // If null gets returned it means that the node did succeed // but did not have any data. So the branch should end diff --git a/packages/editor-ui/src/components/NodeSettings.vue b/packages/editor-ui/src/components/NodeSettings.vue index 98c4069e5c..515eeccce5 100644 --- a/packages/editor-ui/src/components/NodeSettings.vue +++ b/packages/editor-ui/src/components/NodeSettings.vue @@ -141,6 +141,7 @@ export default mixins( nodeColor: null, nodeValues: { color: '#ff0000', + alwaysOutputData: false, continueOnFail: false, retryOnFail: false, maxTries: 3, @@ -169,6 +170,14 @@ export default mixins( noDataExpression: true, description: 'The color of the node in the flow.', }, + { + displayName: 'Always Output Data', + name: 'alwaysOutputData', + type: 'boolean', + default: false, + noDataExpression: true, + description: 'If activated and the node does not have any data for the first output,
it returns an empty item anyway. Be careful setting this on
IF-Nodes as it could easily cause an infinite loop.', + }, { displayName: 'Retry On Fail', name: 'retryOnFail', @@ -419,6 +428,11 @@ export default mixins( Vue.set(this.nodeValues, 'notes', this.node.notes); } + if (this.node.alwaysOutputData) { + foundNodeSettings.push('alwaysOutputData'); + Vue.set(this.nodeValues, 'alwaysOutputData', this.node.alwaysOutputData); + } + if (this.node.continueOnFail) { foundNodeSettings.push('continueOnFail'); Vue.set(this.nodeValues, 'continueOnFail', this.node.continueOnFail); diff --git a/packages/workflow/src/Interfaces.ts b/packages/workflow/src/Interfaces.ts index 45769bb290..ad64dc160b 100644 --- a/packages/workflow/src/Interfaces.ts +++ b/packages/workflow/src/Interfaces.ts @@ -292,6 +292,7 @@ export interface INode { retryOnFail?: boolean; maxTries?: number; waitBetweenTries?: number; + alwaysOutputData?: boolean; continueOnFail?: boolean; parameters: INodeParameters; credentials?: INodeCredentials;