mirror of
https://github.com/n8n-io/n8n.git
synced 2025-01-11 12:57:29 -08:00
✨ Add "alwaysOutputData" option to nodes
This commit is contained in:
parent
dc10f52db3
commit
c7024ca454
|
@ -596,6 +596,17 @@ export class WorkflowExecute {
|
||||||
this.runExecutionData.resultData.lastNodeExecuted = executionData.node.name;
|
this.runExecutionData.resultData.lastNodeExecuted = executionData.node.name;
|
||||||
nodeSuccessData = await workflow.runNode(executionData.node, executionData.data, this.runExecutionData, runIndex, this.additionalData, NodeExecuteFunctions, this.mode);
|
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 (nodeSuccessData === null) {
|
||||||
// If null gets returned it means that the node did succeed
|
// If null gets returned it means that the node did succeed
|
||||||
// but did not have any data. So the branch should end
|
// but did not have any data. So the branch should end
|
||||||
|
|
|
@ -141,6 +141,7 @@ export default mixins(
|
||||||
nodeColor: null,
|
nodeColor: null,
|
||||||
nodeValues: {
|
nodeValues: {
|
||||||
color: '#ff0000',
|
color: '#ff0000',
|
||||||
|
alwaysOutputData: false,
|
||||||
continueOnFail: false,
|
continueOnFail: false,
|
||||||
retryOnFail: false,
|
retryOnFail: false,
|
||||||
maxTries: 3,
|
maxTries: 3,
|
||||||
|
@ -169,6 +170,14 @@ export default mixins(
|
||||||
noDataExpression: true,
|
noDataExpression: true,
|
||||||
description: 'The color of the node in the flow.',
|
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,<br />it returns an empty item anyway. Be careful setting this on<br />IF-Nodes as it could easily cause an infinite loop.',
|
||||||
|
},
|
||||||
{
|
{
|
||||||
displayName: 'Retry On Fail',
|
displayName: 'Retry On Fail',
|
||||||
name: 'retryOnFail',
|
name: 'retryOnFail',
|
||||||
|
@ -419,6 +428,11 @@ export default mixins(
|
||||||
Vue.set(this.nodeValues, 'notes', this.node.notes);
|
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) {
|
if (this.node.continueOnFail) {
|
||||||
foundNodeSettings.push('continueOnFail');
|
foundNodeSettings.push('continueOnFail');
|
||||||
Vue.set(this.nodeValues, 'continueOnFail', this.node.continueOnFail);
|
Vue.set(this.nodeValues, 'continueOnFail', this.node.continueOnFail);
|
||||||
|
|
|
@ -292,6 +292,7 @@ export interface INode {
|
||||||
retryOnFail?: boolean;
|
retryOnFail?: boolean;
|
||||||
maxTries?: number;
|
maxTries?: number;
|
||||||
waitBetweenTries?: number;
|
waitBetweenTries?: number;
|
||||||
|
alwaysOutputData?: boolean;
|
||||||
continueOnFail?: boolean;
|
continueOnFail?: boolean;
|
||||||
parameters: INodeParameters;
|
parameters: INodeParameters;
|
||||||
credentials?: INodeCredentials;
|
credentials?: INodeCredentials;
|
||||||
|
|
Loading…
Reference in a new issue