How to merge Files from Split-in-Batches Node into One to send in a Mail?

Hey @BramKn ,

This one didn’t solve my issue with files. It collects the data correct but not the binary files.

Then I tried this algorithm to collect all files into one but this algorithm cannot see both files, can only see a file from one cycle;

let results = [];

for (const item of $input.all()) {
    for (key of Object.keys(item.binary)) {
        results.push({
            json: {
                fileName: item.binary[key].fileName
            },
            binary: {
                data: item.binary[key],
            }
        });
    }
}

return results;