Merge multiple binaries with distinct names into one result to send multiple attachment

Hello, I would like to send a single email using basic Email Node but with multiple attachments I generate during the workflow with Spreadsheet Node. I can’t manage to do so and get all binaries merge into a single results (array first item).
Could you help me please ?
Best regards,
Antoine

Hello @mediana, welcome to the community.

Sorry, I do not understand exactly what you mean so I hope this example is helpful. I used now for simplicity reason HTTP Request nodes. All I did is to write each of the files to different binary properties and then set them it to the Send EMail node.

{
  "nodes": [
    {
      "parameters": {
        "url": "https://images.sftcdn.net/images/t_app-cover-l,f_auto/p/ce2ece60-9b32-11e6-95ab-00163ed833e7/260663710/the-test-fun-for-friends-screenshot.jpg",
        "responseFormat": "file",
        "dataPropertyName": "data1",
        "options": {}
      },
      "name": "HTTP Request",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 1,
      "position": [
        450,
        500
      ]
    },
    {
      "parameters": {
        "url": "https://www.outbrain.com/techblog/wp-content/uploads/2017/05/road-sign-361513_960_720.jpg",
        "responseFormat": "file",
        "dataPropertyName": "data2",
        "options": {}
      },
      "name": "HTTP Request1",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 1,
      "position": [
        650,
        500
      ]
    },
    {
      "parameters": {
        "attachments": "data1,data2",
        "options": {}
      },
      "name": "Send Email",
      "type": "n8n-nodes-base.emailSend",
      "typeVersion": 1,
      "position": [
        850,
        500
      ]
    }
  ],
  "connections": {
    "HTTP Request": {
      "main": [
        [
          {
            "node": "HTTP Request1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTTP Request1": {
      "main": [
        [
          {
            "node": "Send Email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}

If it is not helpful please supply a simple example workflow. I can then use that as a base and make it work. Thanks!

Hello Jan,
Thank you for your answer.
My need is a bit different.
Here is the example workflow.
At the end, I would like to send a single email with both files and therefore ‘merge’ the 2 binaries, without having them ‘inline’ like in your example.
Best regards,
Antoine

{
  "nodes": [
    {
      "parameters": {},
      "name": "Start",
      "type": "n8n-nodes-base.start",
      "typeVersion": 1,
      "position": [
        250,
        300
      ]
    },
    {
      "parameters": {
        "attachments": "[1]data,[2]data",
        "options": {}
      },
      "name": "Send Email",
      "type": "n8n-nodes-base.emailSend",
      "typeVersion": 1,
      "position": [
        800,
        300
      ],
      "disabled": true
    },
    {
      "parameters": {},
      "name": "Merge",
      "type": "n8n-nodes-base.merge",
      "typeVersion": 1,
      "position": [
        640,
        300
      ]
    },
    {
      "parameters": {
        "url": "https://via.placeholder.com/300",
        "responseFormat": "file",
        "options": {}
      },
      "name": "HTTP Request #1",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 1,
      "position": [
        460,
        220
      ]
    },
    {
      "parameters": {
        "url": "https://via.placeholder.com/400",
        "responseFormat": "file",
        "options": {}
      },
      "name": "HTTP Request #2",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 1,
      "position": [
        460,
        370
      ]
    }
  ],
  "connections": {
    "Start": {
      "main": [
        [
          {
            "node": "HTTP Request #1",
            "type": "main",
            "index": 0
          },
          {
            "node": "HTTP Request #2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge": {
      "main": [
        [
          {
            "node": "Send Email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTTP Request #1": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTTP Request #2": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 1
          }
        ]
      ]
    }
  }
}

Sorry but do not understand what you mean. My example above sends one email with both attachments.

And what do you mean with “without having them inline”? If your example would work, what would be different and what would not be “inline” anymore?

Also do not understand “merging” two binaries? The only thing I can think of there is to combine two images into one (to have one larger image) or combining multiple random files by making a zip file out of them.

Use a Merge with By Index.

Welcome to the community @GMoore!

Thanks a lot but that would not work as both binary properties have the same name and would so overwrite each other. Meaning one would get lost. So the binary property names would have to additionally be set to unique values. Also, would the value on the SendEmail-Node for Attachments still have to get fixed like in the example I posted above for it to work.

He was asking for two files to be attached. With separate binary property names he can accomplishment that.

Exactly, that is why I pointed it out in my clarification.
If he would only change the Merge-Node in his workflow to “Merge By Index” it would not work. For it to work he would have to give the binary properties different names.

We have to make sure that the answers we provide are complete. If multiple steps are required all of them should be mentioned. Like if somebody asks for the directions to the store. If we just say “Go down the road.” But we do then not mention that he then has to turn left and go also down that street, that person would be closer to its destination but he would still not be able to reach it.