🐛 Execute node also if it is a sibling but does not receive data

from parent
This commit is contained in:
Jan Oberhauser
2021-02-17 00:16:10 +01:00
parent caad6d1c8d
commit c811294612
2 changed files with 203 additions and 4 deletions

View File

@@ -986,6 +986,172 @@ describe('WorkflowExecute', () => {
},
},
},
{
description: 'should use empty data if input of sibling does not receive any data from parent',
input: {
// Leave the workflowData in regular JSON to be able to easily
// copy it from/in the UI
workflowData: {
"nodes": [
{
"parameters": {},
"name": "Start",
"type": "n8n-nodes-base.start",
"typeVersion": 1,
"position": [
250,
300,
],
},
{
"parameters": {
"conditions": {
"number": [
{
"value1": "={{$json[\"value1\"]}}",
"operation": "equal",
"value2": 1,
},
],
},
},
"name": "IF",
"type": "n8n-nodes-base.if",
"typeVersion": 1,
"position": [
650,
300,
],
},
{
"parameters": {
"values": {
"string": [],
"number": [
{
"name": "value2",
"value": 2,
},
],
},
"options": {},
},
"name": "Set2",
"type": "n8n-nodes-base.set",
"typeVersion": 1,
"position": [
850,
450,
],
},
{
"parameters": {
"values": {
"number": [
{
"name": "value1",
"value": 1,
},
],
},
"options": {},
},
"name": "Set1",
"type": "n8n-nodes-base.set",
"typeVersion": 1,
"position": [
450,
300,
],
},
{
"parameters": {},
"name": "Merge",
"type": "n8n-nodes-base.merge",
"typeVersion": 1,
"position": [
1050,
300,
],
},
],
"connections": {
"Start": {
"main": [
[
{
"node": "Set1",
"type": "main",
"index": 0,
},
],
],
},
"IF": {
"main": [
[
{
"node": "Merge",
"type": "main",
"index": 0,
},
],
[
{
"node": "Set2",
"type": "main",
"index": 0,
},
],
],
},
"Set2": {
"main": [
[
{
"node": "Merge",
"type": "main",
"index": 1,
},
],
],
},
"Set1": {
"main": [
[
{
"node": "IF",
"type": "main",
"index": 0,
},
],
],
},
},
},
},
output: {
nodeExecutionOrder: [
'Start',
'Set1',
'IF',
'Set2',
'Merge',
],
nodeData: {
Merge: [
[
{
value1: 1,
},
{
value2: 2,
},
],
],
},
},
},
];