Variable Attachments in Outlook Node

I have done my workflow from a webhook (data from a form) with data and files. I send a confirm to the customer and one to our sales team. The data is in the html and the files should be attached. attachments can be zero to five files. And that is my problem. I build it with ai support and the n8n.ai says my workflow is correct. But: I always have a binary error: No binary data property “data,data_1” does not exists on item! - Is there anything wrong in the outlook node. i tested it with the smtp node. In the smtp there are no attached files with the right configuration.

Can anyone help?

Here is my workflow:

Try adding a Code node (set to “Run Once for All Items”) between your Aggregate node and Outlook node with this code:

const items = $input.all();
const flattenedBinaries = items.reduce((acc, item) => {
return { …acc, …item.binary };
}, {});

return [{ binary: flattenedBinaries }];

Thanks for your solution. It doesn’t work.