I think I would just do this with a function node. http-in -> function -> http-out
[{"id":"f6f2187d.f17ca8","type":"tab","label":"Flow 1","disabled":false,"info":""},{"id":"7ed6665d712a3ac0","type":"function","z":"f6f2187d.f17ca8","name":"","func":"function mockApiRequest(item) {\n // Don't `await` here\n // just return the Promise which will be resolved in Promise.all()\n return Promise.resolve(item * 2);\n}\n\nconst items = [1, 2];\n\nconst promises = items.map(mockApiRequest);\nconst values = await Promise.all(promises);\n\n// Do any extra stuff here like parsing the request to get the necessary data\n\nmsg.payload = values;\nreturn msg;\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":320,"y":140,"wires":[["5c65d35def1b8673"]]},{"id":"09fa8885926cd707","type":"inject","z":"f6f2187d.f17ca8","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":160,"y":140,"wires":[["7ed6665d712a3ac0"]]},{"id":"5c65d35def1b8673","type":"debug","z":"f6f2187d.f17ca8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":490,"y":140,"wires":[]}]
function mockApiRequest(item) {
// Don't `await` here
// just return the Promise which will be resolved in Promise.all()
return Promise.resolve(item * 2);
}
const items = [1, 2];
const promises = items.map(mockApiRequest);
const responses = await Promise.all(promises);
// Do any extra stuff here like parsing the responses to get the data in the format you need for http-out
msg.payload = responses;
return msg;