fix(core): Make node execution order configurable, and backward-compatible (#6507)

* fix(core): Make node execution order configurable, and backward-compatible

*  Also add new Merge-Node behaviour

*  Fix typo

* Fix lint issue

* update labels

* rename legacy to v0

* remove the unnecessary log

* default all new workflows to use v1 execution-order

* remove the controller changes

* clone default settings to avoid it getting modified

---------

Co-authored-by: Jan Oberhauser <jan.oberhauser@gmail.com>
This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™
2023-07-05 18:47:34 +02:00
committed by GitHub
parent f0dfc3cf4e
commit d97edbcffa
18 changed files with 2156 additions and 1042 deletions

View File

@@ -24,8 +24,7 @@ export class CompareDatasets implements INodeType {
// eslint-disable-next-line n8n-nodes-base/node-class-description-inputs-wrong-regular-node
inputs: ['main', 'main'],
inputNames: ['Input A', 'Input B'],
forceInputNodeExecution: '={{ $version < 2.3 }}',
requiredInputs: '={{ $version < 2.3 ? undefined : 1 }}',
requiredInputs: 1,
// eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong
outputs: ['main', 'main', 'main', 'main'],
outputNames: ['In A only', 'Same', 'Different', 'In B only'],

View File

@@ -1,23 +1,23 @@
{
"name": "Compare Datasets Node Test",
"name": "My workflow",
"nodes": [
{
"parameters": {},
"id": "0312bddf-aae0-423c-9041-d54fb124934f",
"id": "4013708d-2460-44b7-923d-e3cd36eb9287",
"name": "When clicking \"Execute Workflow\"",
"type": "n8n-nodes-base.manualTrigger",
"typeVersion": 1,
"position": [480, 720]
"position": [-6660, 8040]
},
{
"parameters": {
"jsCode": "return [\n {\n json: {\n number: 0\n }\n },\n {\n json: {\n number: 1\n }\n },\n {\n json: {\n number: 2\n }\n }\n];"
},
"id": "0542886d-6ab2-4695-b686-2cd60729ba9a",
"id": "be417cbe-7a4f-40eb-8a26-fca253a01882",
"name": "Code",
"type": "n8n-nodes-base.code",
"typeVersion": 1,
"position": [900, 640]
"position": [-6240, 8040]
},
{
"parameters": {
@@ -31,173 +31,53 @@
},
"options": {}
},
"id": "f3e5e43b-a3bf-46c7-acd7-ae3d7d19d9f9",
"id": "97d65223-16c9-4d26-b31e-d818e1adbc8a",
"name": "Compare Datasets 2.2 - Old",
"type": "n8n-nodes-base.compareDatasets",
"typeVersion": 2.2,
"position": [1260, 40]
"position": [-5800, 8140]
},
{
"parameters": {
"jsCode": "return [\n {\n json: {\n number: 0\n }\n },\n {\n json: {\n number: 1,\n k: 2,\n }\n },\n {\n json: {\n number: 10\n }\n },\n {\n json: {\n number: 11\n }\n },\n {\n json: {\n number: 12\n }\n }\n];"
},
"id": "c62e90b3-f84a-48a5-94bf-3267a4c8b69e",
"id": "94580b8b-b698-4c49-98b6-12973b6f4220",
"name": "Code1",
"type": "n8n-nodes-base.code",
"typeVersion": 1,
"position": [900, 60]
},
{
"parameters": {
"jsCode": "return [\n {\n json: {\n number: 0\n }\n },\n {\n json: {\n number: 1,\n k: 2,\n }\n },\n {\n json: {\n number: 10\n }\n },\n {\n json: {\n number: 11\n }\n },\n {\n json: {\n number: 12\n }\n }\n];"
},
"id": "46320ca2-8e8e-4ecf-b4f6-5899807c1500",
"name": "Code2",
"type": "n8n-nodes-base.code",
"typeVersion": 1,
"position": [900, 840]
"position": [-6240, 8260]
},
{
"parameters": {},
"id": "4ae12a83-5d3f-4d5b-845b-65c930d8ef5a",
"id": "78ec40a4-775d-467b-bacb-805658190b29",
"name": "Old - A only",
"type": "n8n-nodes-base.noOp",
"typeVersion": 1,
"position": [1520, -180]
"position": [-5540, 7920]
},
{
"parameters": {},
"id": "d4f5fd94-4b46-4b8c-8b8a-073e8c32ad85",
"name": "New - A only",
"type": "n8n-nodes-base.noOp",
"typeVersion": 1,
"position": [1520, 440]
},
{
"parameters": {},
"id": "0939f79b-fd75-4d2f-b40b-50780114c3f2",
"id": "eaa4cc93-53c6-4d00-9407-bd5da23e868e",
"name": "Old - Same",
"type": "n8n-nodes-base.noOp",
"typeVersion": 1,
"position": [1520, -40]
"position": [-5540, 8060]
},
{
"parameters": {},
"id": "199ea52c-b30a-401d-a920-9db5c8e10d38",
"id": "d073db39-1902-411d-80dd-6ea8f42ac33b",
"name": "Old - Different",
"type": "n8n-nodes-base.noOp",
"typeVersion": 1,
"position": [1520, 100]
"position": [-5540, 8200]
},
{
"parameters": {},
"id": "1ebcb5bb-3061-47ef-8c79-847ae8bdb568",
"id": "29f92258-4869-43c1-9cef-9c281397ccc8",
"name": "Old - B only",
"type": "n8n-nodes-base.noOp",
"typeVersion": 1,
"position": [1520, 240]
},
{
"parameters": {},
"id": "38689dbf-49f2-4f3b-855b-abd821ec316f",
"name": "New - B only",
"type": "n8n-nodes-base.noOp",
"typeVersion": 1,
"position": [1520, 860]
},
{
"parameters": {},
"id": "dfcac903-95dc-4519-b49f-a6a65bf8fdb8",
"name": "New - Different",
"type": "n8n-nodes-base.noOp",
"typeVersion": 1,
"position": [1520, 720]
},
{
"parameters": {},
"id": "b8588ebc-4dc8-41f5-9a0a-64d151d7122e",
"name": "New - Same",
"type": "n8n-nodes-base.noOp",
"typeVersion": 1,
"position": [1520, 580]
},
{
"parameters": {
"jsCode": "return [\n {\n json: {\n number: 0\n }\n },\n {\n json: {\n number: 1,\n k: 2,\n }\n },\n {\n json: {\n number: 10\n }\n },\n {\n json: {\n number: 11\n }\n },\n {\n json: {\n number: 12\n }\n }\n];"
},
"id": "d35f3f52-c967-46e8-be3a-0bf709b20ef8",
"name": "Code3",
"type": "n8n-nodes-base.code",
"typeVersion": 1,
"position": [880, 1340]
},
{
"parameters": {},
"id": "75690ad6-c870-4950-9085-12fdd9c12ddd",
"name": "New - A only1",
"type": "n8n-nodes-base.noOp",
"typeVersion": 1,
"position": [1520, 1100]
},
{
"parameters": {},
"id": "9abb523f-349c-48b0-b36b-0c74064a6219",
"name": "New - B only1",
"type": "n8n-nodes-base.noOp",
"typeVersion": 1,
"position": [1520, 1520]
},
{
"parameters": {},
"id": "c4230d94-eaa6-420d-baff-288463722a03",
"name": "New - Different1",
"type": "n8n-nodes-base.noOp",
"typeVersion": 1,
"position": [1520, 1380]
},
{
"parameters": {},
"id": "58287181-dc90-4806-a053-83b3ef36e673",
"name": "New - Same1",
"type": "n8n-nodes-base.noOp",
"typeVersion": 1,
"position": [1520, 1240]
},
{
"parameters": {
"mergeByFields": {
"values": [
{
"field1": "number",
"field2": "number"
}
]
},
"options": {}
},
"id": "5514c636-ee64-45f3-8832-77ad6652cc08",
"name": "Compare Datasets 2.3 - New - Connected",
"type": "n8n-nodes-base.compareDatasets",
"typeVersion": 2.3,
"position": [1260, 1320]
},
{
"parameters": {
"mergeByFields": {
"values": [
{
"field1": "number",
"field2": "number"
}
]
},
"options": {}
},
"id": "a25f4766-9bb4-40a0-9ae2-ef0004f5938a",
"name": "Compare Datasets 2.3 - New - Not Connected",
"type": "n8n-nodes-base.compareDatasets",
"typeVersion": 2.3,
"position": [1260, 660]
"position": [-5540, 8340]
}
],
"pinData": {
@@ -249,72 +129,6 @@
"number": 12
}
}
],
"New - A only": [
{
"json": {
"number": 0
}
},
{
"json": {
"number": 1
}
},
{
"json": {
"number": 2
}
}
],
"New - A only1": [
{
"json": {
"number": 2
}
}
],
"New - Same1": [
{
"json": {
"number": 0
}
}
],
"New - Different1": [
{
"json": {
"keys": {
"number": 1
},
"same": {
"number": 1
},
"different": {
"k": {
"inputA": null,
"inputB": 2
}
}
}
}
],
"New - B only1": [
{
"json": {
"number": 10
}
},
{
"json": {
"number": 11
}
},
{
"json": {
"number": 12
}
}
]
},
"connections": {
@@ -325,11 +139,6 @@
"node": "Code",
"type": "main",
"index": 0
},
{
"node": "Code3",
"type": "main",
"index": 0
}
]
]
@@ -337,20 +146,10 @@
"Code": {
"main": [
[
{
"node": "Compare Datasets 2.3 - New - Not Connected",
"type": "main",
"index": 0
},
{
"node": "Compare Datasets 2.2 - Old",
"type": "main",
"index": 0
},
{
"node": "Compare Datasets 2.3 - New - Connected",
"type": "main",
"index": 0
}
]
]
@@ -366,17 +165,6 @@
]
]
},
"Code2": {
"main": [
[
{
"node": "Compare Datasets 2.3 - New - Not Connected",
"type": "main",
"index": 1
}
]
]
},
"Compare Datasets 2.2 - Old": {
"main": [
[
@@ -408,87 +196,14 @@
}
]
]
},
"Code3": {
"main": [
[
{
"node": "Compare Datasets 2.3 - New - Connected",
"type": "main",
"index": 1
}
]
]
},
"Compare Datasets 2.3 - New - Connected": {
"main": [
[
{
"node": "New - A only1",
"type": "main",
"index": 0
}
],
[
{
"node": "New - Same1",
"type": "main",
"index": 0
}
],
[
{
"node": "New - Different1",
"type": "main",
"index": 0
}
],
[
{
"node": "New - B only1",
"type": "main",
"index": 0
}
]
]
},
"Compare Datasets 2.3 - New - Not Connected": {
"main": [
[
{
"node": "New - A only",
"type": "main",
"index": 0
}
],
[
{
"node": "New - Same",
"type": "main",
"index": 0
}
],
[
{
"node": "New - Different",
"type": "main",
"index": 0
}
],
[
{
"node": "New - B only",
"type": "main",
"index": 0
}
]
]
}
},
"active": false,
"settings": {},
"versionId": "d5c0f040-7406-4e69-bd5d-a362a739c8d8",
"id": "1114",
"settings": {
"executionOrder": "v0"
},
"versionId": "49a52ed2-ec4b-44b1-9dbd-c13fac4144f2",
"id": "ZpXvXjaKKZihfA2x",
"meta": {
"instanceId": "021d3c82ba2d3bc090cbf4fc81c9312668bcc34297e022bb3438c5c88a43a5ff"
},