fix(core): Add executionData to expressions in pagination code (#10926)

This commit is contained in:
Elias Meire 2024-09-23 15:14:53 +02:00 committed by GitHub
parent 5c171c4bf0
commit eac103e367
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 1911 additions and 1964 deletions

View file

@ -2995,6 +2995,8 @@ const getRequestHelperFunctions = (
workflow: Workflow, workflow: Workflow,
node: INode, node: INode,
additionalData: IWorkflowExecuteAdditionalData, additionalData: IWorkflowExecuteAdditionalData,
runExecutionData: IRunExecutionData | null = null,
connectionInputData: INodeExecutionData[] = [],
): RequestHelperFunctions => { ): RequestHelperFunctions => {
const getResolvedValue = ( const getResolvedValue = (
parameterValue: NodeParameterValueType, parameterValue: NodeParameterValueType,
@ -3004,8 +3006,6 @@ const getRequestHelperFunctions = (
additionalKeys?: IWorkflowDataProxyAdditionalKeys, additionalKeys?: IWorkflowDataProxyAdditionalKeys,
returnObjectAsString = false, returnObjectAsString = false,
): NodeParameterValueType => { ): NodeParameterValueType => {
const runExecutionData: IRunExecutionData | null = null;
const connectionInputData: INodeExecutionData[] = [];
const mode: WorkflowExecuteMode = 'internal'; const mode: WorkflowExecuteMode = 'internal';
if ( if (
@ -3874,7 +3874,13 @@ export function getExecuteFunctions(
helpers: { helpers: {
createDeferredPromise, createDeferredPromise,
copyInputItems, copyInputItems,
...getRequestHelperFunctions(workflow, node, additionalData), ...getRequestHelperFunctions(
workflow,
node,
additionalData,
runExecutionData,
connectionInputData,
),
...getSSHTunnelFunctions(), ...getSSHTunnelFunctions(),
...getFileSystemHelperFunctions(node), ...getFileSystemHelperFunctions(node),
...getBinaryHelperFunctions(additionalData, workflow.id), ...getBinaryHelperFunctions(additionalData, workflow.id),
@ -4031,7 +4037,13 @@ export function getExecuteSingleFunctions(
}, },
helpers: { helpers: {
createDeferredPromise, createDeferredPromise,
...getRequestHelperFunctions(workflow, node, additionalData), ...getRequestHelperFunctions(
workflow,
node,
additionalData,
runExecutionData,
connectionInputData,
),
...getBinaryHelperFunctions(additionalData, workflow.id), ...getBinaryHelperFunctions(additionalData, workflow.id),
assertBinaryData: (propertyName, inputIndex = 0) => assertBinaryData: (propertyName, inputIndex = 0) =>

View file

@ -35,14 +35,11 @@
} }
} }
}, },
"id": "47ce146a-3af0-4356-8316-86d8b0121344", "id": "363a12c4-5af8-411e-a0f9-071e07a8ec48",
"name": "Page Limit", "name": "Page Limit",
"type": "n8n-nodes-base.httpRequest", "type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.1, "typeVersion": 4.1,
"position": [ "position": [80, 1480]
-200,
1400
]
}, },
{ {
"parameters": { "parameters": {
@ -77,14 +74,11 @@
} }
} }
}, },
"id": "6d640013-5455-41af-a87f-ac0120e7fffb", "id": "834de1fa-7568-4f79-8ae5-a5241ed92876",
"name": "Response Empty", "name": "Response Empty",
"type": "n8n-nodes-base.httpRequest", "type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.1, "typeVersion": 4.1,
"position": [ "position": [80, 1820]
-200,
1740
]
}, },
{ {
"parameters": { "parameters": {
@ -121,14 +115,11 @@
} }
} }
}, },
"id": "9a185b8c-354d-49ed-96b3-98b83da384eb", "id": "97ba6e36-8fea-424d-a1a1-2c34dc573e65",
"name": "Receive Status Code", "name": "Receive Status Code",
"type": "n8n-nodes-base.httpRequest", "type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.1, "typeVersion": 4.1,
"position": [ "position": [80, 1980]
-200,
1900
]
}, },
{ {
"parameters": { "parameters": {
@ -165,14 +156,11 @@
} }
} }
}, },
"id": "361a0cbf-8376-48d6-b1a8-029216efcb53", "id": "446a7da0-8c23-4421-8bf4-0028d4c46919",
"name": "Complete Expression", "name": "Complete Expression",
"type": "n8n-nodes-base.httpRequest", "type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.1, "typeVersion": 4.1,
"position": [ "position": [80, 2160]
-200,
2080
]
}, },
{ {
"parameters": { "parameters": {
@ -180,14 +168,11 @@
"height": 223.6542431762359, "height": 223.6542431762359,
"width": 365.5274479049966 "width": 365.5274479049966
}, },
"id": "45257c19-8944-4baf-8fba-3f136aeb9d70", "id": "4277a919-66a0-4598-a51a-fb28be9838fe",
"name": "Sticky Note", "name": "Sticky Note",
"type": "n8n-nodes-base.stickyNote", "type": "n8n-nodes-base.stickyNote",
"typeVersion": 1, "typeVersion": 1,
"position": [ "position": [20, 2800]
-260,
2720
]
}, },
{ {
"parameters": { "parameters": {
@ -195,14 +180,11 @@
"height": 1360, "height": 1360,
"width": 354 "width": 354
}, },
"id": "2ccb057b-e9c2-46e9-a629-defccdc14764", "id": "14589c89-65e4-4ee3-bbbc-5112e9a247b5",
"name": "Sticky Note1", "name": "Sticky Note1",
"type": "n8n-nodes-base.stickyNote", "type": "n8n-nodes-base.stickyNote",
"typeVersion": 1, "typeVersion": 1,
"position": [ "position": [20, 1400]
-260,
1320
]
}, },
{ {
"parameters": { "parameters": {
@ -233,14 +215,11 @@
} }
} }
}, },
"id": "9e685749-432d-4982-a0c1-5f8f448d3afc", "id": "87dfc0aa-3cda-465e-9a89-4c78ba8dc91d",
"name": "Response Empty - Text", "name": "Response Empty - Text",
"type": "n8n-nodes-base.httpRequest", "type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.1, "typeVersion": 4.1,
"position": [ "position": [80, 3120]
-200,
3040
]
}, },
{ {
"parameters": { "parameters": {
@ -270,14 +249,11 @@
} }
} }
}, },
"id": "bb916cdd-b884-480a-b666-271be9d86940", "id": "1d5f7772-a646-4ce2-8e1d-10d14b66a4b1",
"name": "Response Empty Next with Max Pages", "name": "Response Empty Next with Max Pages",
"type": "n8n-nodes-base.httpRequest", "type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.1, "typeVersion": 4.1,
"position": [ "position": [80, 2860]
-200,
2780
]
}, },
{ {
"parameters": { "parameters": {
@ -285,14 +261,11 @@
"height": 388.6542431762359, "height": 388.6542431762359,
"width": 363.5274479049966 "width": 363.5274479049966
}, },
"id": "2168f813-29e6-4e1a-8f8a-88542855b485", "id": "f7f7affa-96dc-4845-856a-40842131cf1c",
"name": "Sticky Note2", "name": "Sticky Note2",
"type": "n8n-nodes-base.stickyNote", "type": "n8n-nodes-base.stickyNote",
"typeVersion": 1, "typeVersion": 1,
"position": [ "position": [20, 3060]
-260,
2980
]
}, },
{ {
"parameters": { "parameters": {
@ -329,14 +302,11 @@
} }
} }
}, },
"id": "88a55fa4-3f30-417c-9c53-c93051c0cb7e", "id": "40299b65-81a6-4a7a-b74f-5ba01f01cafc",
"name": "Complete Expression - JSON", "name": "Complete Expression - JSON",
"type": "n8n-nodes-base.httpRequest", "type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.1, "typeVersion": 4.1,
"position": [ "position": [80, 1200]
-200,
1120
]
}, },
{ {
"parameters": { "parameters": {
@ -344,14 +314,11 @@
"height": 232.15942469988397, "height": 232.15942469988397,
"width": 323.21100909416833 "width": 323.21100909416833
}, },
"id": "acab629f-49f8-40cc-a168-a647038b22b5", "id": "61d8b266-f399-4a3b-882d-90db2764833b",
"name": "Sticky Note3", "name": "Sticky Note3",
"type": "n8n-nodes-base.stickyNote", "type": "n8n-nodes-base.stickyNote",
"typeVersion": 1, "typeVersion": 1,
"position": [ "position": [20, 1140]
-260,
1060
]
}, },
{ {
"parameters": { "parameters": {
@ -383,14 +350,11 @@
} }
} }
}, },
"id": "bdcfffc2-4127-4da8-a715-b201accacf68", "id": "570660cc-5361-4b75-9222-08c006e83937",
"name": "Response Empty - Include Full Response", "name": "Response Empty - Include Full Response",
"type": "n8n-nodes-base.httpRequest", "type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.1, "typeVersion": 4.1,
"position": [ "position": [80, 3300]
-200,
3220
]
}, },
{ {
"parameters": { "parameters": {
@ -418,14 +382,11 @@
} }
} }
}, },
"id": "9b0db080-7414-4682-a7a8-5e419d61a0f3", "id": "6418e1dc-e637-47e5-8d40-51b74c618c5d",
"name": "Pagination Off", "name": "Pagination Off",
"type": "n8n-nodes-base.httpRequest", "type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.1, "typeVersion": 4.1,
"position": [ "position": [80, 3520]
-200,
3440
]
}, },
{ {
"parameters": { "parameters": {
@ -433,14 +394,11 @@
"height": 373, "height": 373,
"width": 363 "width": 363
}, },
"id": "116d5cdf-aa2e-4acb-93c1-80d76c349334", "id": "8144d108-1e1b-473c-bc69-ff233fc809ef",
"name": "Sticky Note4", "name": "Sticky Note4",
"type": "n8n-nodes-base.stickyNote", "type": "n8n-nodes-base.stickyNote",
"typeVersion": 1, "typeVersion": 1,
"position": [ "position": [20, 3480]
-260,
3400
]
}, },
{ {
"parameters": { "parameters": {
@ -463,14 +421,11 @@
} }
} }
}, },
"id": "2484f7fc-670d-4ba5-a991-344f794e3f53", "id": "f94a61b9-8bff-49d4-8007-30ba93cfa749",
"name": "Pagination Not Set", "name": "Pagination Not Set",
"type": "n8n-nodes-base.httpRequest", "type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.1, "typeVersion": 4.1,
"position": [ "position": [80, 3700]
-200,
3620
]
}, },
{ {
"parameters": { "parameters": {
@ -478,14 +433,11 @@
"height": 232.15942469988397, "height": 232.15942469988397,
"width": 394.89100909416834 "width": 394.89100909416834
}, },
"id": "52206538-3939-4938-8015-03c859b73108", "id": "74f93f2a-a399-46d6-a953-4de7751e3fcd",
"name": "Sticky Note5", "name": "Sticky Note5",
"type": "n8n-nodes-base.stickyNote", "type": "n8n-nodes-base.stickyNote",
"typeVersion": 1, "typeVersion": 1,
"position": [ "position": [20, 3920]
-260,
3840
]
}, },
{ {
"parameters": { "parameters": {
@ -500,14 +452,11 @@
"include": "none", "include": "none",
"options": {} "options": {}
}, },
"id": "f12a7aeb-60fc-49b3-b4b3-27f8ad35d7ed", "id": "53bfa924-95cd-40da-bd31-d4ed3669fedc",
"name": "Edit Fields", "name": "Edit Fields",
"type": "n8n-nodes-base.set", "type": "n8n-nodes-base.set",
"typeVersion": 3.2, "typeVersion": 3.2,
"position": [ "position": [260, 4000]
-20,
3920
]
}, },
{ {
"parameters": { "parameters": {
@ -541,14 +490,11 @@
} }
} }
}, },
"id": "4ed73314-825b-41cb-b228-d4cef067d422", "id": "be59f9c2-f2ad-4c68-b3c4-80038660ece7",
"name": "Loop", "name": "Loop",
"type": "n8n-nodes-base.httpRequest", "type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.1, "typeVersion": 4.1,
"position": [ "position": [80, 4000],
-200,
3920
],
"continueOnFail": true "continueOnFail": true
}, },
{ {
@ -557,42 +503,33 @@
"height": 650.4724697091658, "height": 650.4724697091658,
"width": 323.21100909416833 "width": 323.21100909416833
}, },
"id": "0545e04a-9c3f-4b21-a993-58754a0ddf50", "id": "46d75487-5549-4e98-bf7e-09c7805908af",
"name": "Sticky Note6", "name": "Sticky Note6",
"type": "n8n-nodes-base.stickyNote", "type": "n8n-nodes-base.stickyNote",
"typeVersion": 1, "typeVersion": 1,
"position": [ "position": [0, 0]
-280,
-80
]
}, },
{ {
"parameters": { "parameters": {
"content": "# Response Format: Autodetect\n", "content": "# Response Format: Autodetect\n",
"width": 545.8929725020898 "width": 545.8929725020898
}, },
"id": "72af3737-b12e-42cc-b779-59e93aca225b", "id": "1f16875c-f65b-4c00-9718-b0b44f9cf821",
"name": "Sticky Note7", "name": "Sticky Note7",
"type": "n8n-nodes-base.stickyNote", "type": "n8n-nodes-base.stickyNote",
"typeVersion": 1, "typeVersion": 1,
"position": [ "position": [-620, 220]
-900,
140
]
}, },
{ {
"parameters": { "parameters": {
"content": "# Response Format: set", "content": "# Response Format: set",
"width": 545.8929725020898 "width": 545.8929725020898
}, },
"id": "1a2b62f3-2fa2-41e9-9b2e-8590219a58d8", "id": "a609821f-3f0a-4718-a031-b6d2740e01bc",
"name": "Sticky Note8", "name": "Sticky Note8",
"type": "n8n-nodes-base.stickyNote", "type": "n8n-nodes-base.stickyNote",
"typeVersion": 1, "typeVersion": 1,
"position": [ "position": [-600, 1140]
-880,
1060
]
}, },
{ {
"parameters": { "parameters": {
@ -620,14 +557,11 @@
} }
} }
}, },
"id": "1c8eca03-b963-4228-9f9f-8b7c74dda79e", "id": "d8185b9f-a2ec-484e-b57c-6ac6b7ac9d57",
"name": "Complete Expression - JSON Autodetect set", "name": "Complete Expression - JSON Autodetect set",
"type": "n8n-nodes-base.httpRequest", "type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.1, "typeVersion": 4.1,
"position": [ "position": [60, 100]
-220,
20
]
}, },
{ {
"parameters": { "parameters": {
@ -652,47 +586,35 @@
} }
} }
}, },
"id": "c2fcf50b-2e02-48b9-8b3b-34bdd91c7c58", "id": "b29a2d0b-43aa-467e-a654-9716c445a6b0",
"name": "Complete Expression - JSON unset", "name": "Complete Expression - JSON unset",
"type": "n8n-nodes-base.httpRequest", "type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.1, "typeVersion": 4.1,
"position": [ "position": [60, 280]
-220,
200
]
}, },
{ {
"parameters": {}, "parameters": {},
"id": "3c83c1b5-63a5-48ee-8c44-5eb7e3fa1b22", "id": "08f83213-2e7e-487b-90af-f0acba0c5fc7",
"name": "No Operation, do nothing1", "name": "No Operation, do nothing1",
"type": "n8n-nodes-base.noOp", "type": "n8n-nodes-base.noOp",
"typeVersion": 1, "typeVersion": 1,
"position": [ "position": [-400, 2000]
-680,
1920
]
}, },
{ {
"parameters": {}, "parameters": {},
"id": "f2124260-f883-4f41-bd38-45952f038e02", "id": "a97d0a1b-2bce-42de-ada9-61eabee947dd",
"name": "Data 2", "name": "Data 2",
"type": "n8n-nodes-base.manualTrigger", "type": "n8n-nodes-base.manualTrigger",
"typeVersion": 1, "typeVersion": 1,
"position": [ "position": [-700, 1480]
-980,
1400
]
}, },
{ {
"parameters": {}, "parameters": {},
"id": "f4723b21-a0d6-4679-96d9-11e664e5a3bc", "id": "097086b0-6594-4a45-9bcf-0f8bcb61283a",
"name": "Data 1", "name": "Data 1",
"type": "n8n-nodes-base.noOp", "type": "n8n-nodes-base.noOp",
"typeVersion": 1, "typeVersion": 1,
"position": [ "position": [-380, 460]
-660,
380
]
}, },
{ {
"parameters": { "parameters": {
@ -731,14 +653,11 @@
} }
} }
}, },
"id": "7b6fcc37-5cc0-454a-a33d-a3624f8412bd", "id": "59015f28-eba8-483e-ab6b-64a0251c1146",
"name": "Response Empty - Text1", "name": "Response Empty - Text1",
"type": "n8n-nodes-base.httpRequest", "type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.1, "typeVersion": 4.1,
"position": [ "position": [60, 760]
-220,
680
]
}, },
{ {
"parameters": { "parameters": {
@ -746,14 +665,11 @@
"height": 437.60980047313967, "height": 437.60980047313967,
"width": 323.31395441111135 "width": 323.31395441111135
}, },
"id": "8c4febe5-b19e-4eb8-bc8f-c00cb5f68f86", "id": "065479b1-4da7-4704-81d2-d682aa4afc8f",
"name": "Sticky Note9", "name": "Sticky Note9",
"type": "n8n-nodes-base.stickyNote", "type": "n8n-nodes-base.stickyNote",
"typeVersion": 1, "typeVersion": 1,
"position": [ "position": [0, 680]
-280,
600
]
}, },
{ {
"parameters": { "parameters": {
@ -793,14 +709,11 @@
} }
} }
}, },
"id": "3367e7cb-2d1b-4398-901f-8e54e704f0aa", "id": "6788ee1a-0816-427e-aa65-c110ecae9500",
"name": "Response Empty - Include Full Response1", "name": "Response Empty - Include Full Response1",
"type": "n8n-nodes-base.httpRequest", "type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.1, "typeVersion": 4.1,
"position": [ "position": [60, 940]
-220,
860
]
}, },
{ {
"parameters": { "parameters": {
@ -843,14 +756,11 @@
} }
} }
}, },
"id": "f87c4844-24e5-4fdf-bcb0-ecd6351ddaa7", "id": "7c3ae844-8f2f-4e38-972f-54a56bc71b46",
"name": "POST Form Data", "name": "POST Form Data",
"type": "n8n-nodes-base.httpRequest", "type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.1, "typeVersion": 4.1,
"position": [ "position": [80, 2520]
-200,
2440
]
}, },
{ {
"parameters": { "parameters": {
@ -892,14 +802,11 @@
} }
} }
}, },
"id": "18abeae2-9f6d-4ee1-8f0b-494c7024657b", "id": "0e9bbc1b-902a-40ad-be73-709ce4917422",
"name": "POST JSON", "name": "POST JSON",
"type": "n8n-nodes-base.httpRequest", "type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.1, "typeVersion": 4.1,
"position": [ "position": [80, 2340]
-200,
2260
]
}, },
{ {
"parameters": { "parameters": {
@ -914,14 +821,11 @@
} }
} }
}, },
"id": "0d0d6db1-8002-4561-8633-2c4e4e2a99f3", "id": "c4d85fd5-09c4-4688-9e2d-c5711d5d5b59",
"name": "Complete Expression - JSON unset1", "name": "Complete Expression - JSON unset1",
"type": "n8n-nodes-base.httpRequest", "type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.1, "typeVersion": 4.1,
"position": [ "position": [60, 480],
-220,
400
],
"onError": "continueRegularOutput" "onError": "continueRegularOutput"
}, },
{ {
@ -958,14 +862,31 @@
} }
} }
}, },
"id": "8662f597-b750-4a36-945e-7f5a43ddd6a1", "id": "cd885033-15a6-4102-bcc6-f31555a86c34",
"name": "Page Limit Expression", "name": "Page Limit Expression",
"type": "n8n-nodes-base.httpRequest", "type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.1, "typeVersion": 4.1,
"position": [ "position": [240, 1660]
-200, },
1580 {
"parameters": {
"assignments": {
"assignments": [
{
"id": "d3f0ff85-a900-447e-bc50-1ed1d0277a59",
"name": "pageLimit",
"value": 3,
"type": "number"
}
] ]
},
"options": {}
},
"type": "n8n-nodes-base.set",
"typeVersion": 3.4,
"position": [80, 1660],
"id": "d5a16020-25e6-4756-be2e-0203345651b3",
"name": "Set Page Limit"
} }
], ],
"pinData": { "pinData": {
@ -1894,7 +1815,7 @@
"index": 0 "index": 0
}, },
{ {
"node": "Page Limit Expression", "node": "Set Page Limit",
"type": "main", "type": "main",
"index": 0 "index": 0
} }
@ -1947,16 +1868,30 @@
} }
] ]
] ]
},
"Page Limit Expression": {
"main": [[]]
},
"Set Page Limit": {
"main": [
[
{
"node": "Page Limit Expression",
"type": "main",
"index": 0
}
]
]
} }
}, },
"active": false, "active": false,
"settings": { "settings": {
"executionOrder": "v1" "executionOrder": "v1"
}, },
"versionId": "2b03c5d0-b0bf-4622-9e69-11365392e7e6", "versionId": "ced3a46e-5b98-4fe6-9050-25f2dbd11844",
"meta": { "meta": {
"instanceId": "27cc9b56542ad45b38725555722c50a1c3fee1670bbb67980558314ee08517c4" "instanceId": "27cc9b56542ad45b38725555722c50a1c3fee1670bbb67980558314ee08517c4"
}, },
"id": "VtkCgJEYesF8JTg8", "id": "DW81RnxFN27lqW8y",
"tags": [] "tags": []
} }