{ "nodes": [ { "id": "merge-downloaded-files-into-one-item-0", "name": "When clicking \"Execute Workflow\"", "type": "n8n-nodes-base.manualTrigger", "position": [ 400, 460 ], "parameters": {}, "typeVersion": 1 }, { "id": "merge-downloaded-files-into-one-item-1", "name": "Set URLs", "type": "n8n-nodes-base.code", "position": [ 620, 460 ], "parameters": { "jsCode": "return [{\n json: {\n url: \"https://static.thomasmartens.eu/n8n/file01.jpg\"\n }\n}, {\n json: {\n url: \"https://static.thomasmartens.eu/n8n/file02.jpg\"\n }\n}, {\n json: {\n url: \"https://static.thomasmartens.eu/n8n/file03.jpg\"\n }\n}]" }, "typeVersion": 1 }, { "id": "merge-downloaded-files-into-one-item-2", "name": "HTTP Request", "type": "n8n-nodes-base.httpRequest", "position": [ 840, 460 ], "parameters": { "url": "={{ $json.url }}", "options": { "response": { "response": { "responseFormat": "file" } } } }, "typeVersion": 4 }, { "id": "merge-downloaded-files-into-one-item-3", "name": "Merge items", "type": "n8n-nodes-base.code", "position": [ 1060, 460 ], "parameters": { "jsCode": "let binaries = {}, binary_keys = [];\n\nfor (const [index, inputItem] of Object.entries($input.all())) {\n binaries[`data_${index}`] = inputItem.binary.data;\n binary_keys.push(`data_${index}`);\n}\n\nreturn [{\n json: {\n binary_keys: binary_keys.join(',')\n },\n binary: binaries\n}];\n" }, "typeVersion": 1 } ], "connections": { "Set URLs": { "main": [ [ { "node": "HTTP Request", "type": "main", "index": 0 } ] ] }, "HTTP Request": { "main": [ [ { "node": "Merge items", "type": "main", "index": 0 } ] ] }, "When clicking \"Execute Workflow\"": { "main": [ [ { "node": "Set URLs", "type": "main", "index": 0 } ] ] } }, "name": "Merge Downloaded Files into One Item", "active": false, "pinData": {} }