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