Attaching spreadsheets an email using SendGrid

I want to attach one or several files using SendGrid but if I no conect the SendGrid node with nothing then the email is sent:

But if I connect SendGrid node with one or several SpreadSheet nodes then the email is not sent:

But the succesfull message appears:

This is the workflow:

I am using the desktop version of n8n: 0.160.0
Thank you very much for your time and support

Hey @franchogarcia, it seems your Spreadsheet File nodes don’t return any data. When a node does not output an item, the execution would stop.

Could this be a simple mix up of the operation used in your Spreadsheet File node? It seems like you are reading from a file, but I reckon you wanted to write a spreadsheet file?

1 Like

Hello @MutedJam, you are right, sorry. I have changed “read from file” to “write to file” but still is not running. I have revised again the workflow:

Set node (id=1) return values:

Set node (id=2) return values:

Set node (other ids) return values:

But Spreadsheet (Spreadsheet with list of id = 1) says “Entries exist but they do not contain any JSON data.”

and the same with Spreadsheets:

Besides SendGrid node has not input values:

and for the rest of nodes for Spreadsheets only one has output data:

What am I doing wrong?
Thank you very much for your time and help.

So I gave this a go and when running the full workflow, the Sendgrid node was executed as expected:

It would, however, run into an error as it would be executed a total of three times. The first time it would run with the data from the first Spreadsheet File node, but hit this error:

That’s because the first Spreadsheet File node only passes on a single item named dataClient1:

So you’d need to change your workflow a little bit. If you want to send three emails in total, simply make sure all of your Spreadsheet File nodes use the same name for their binary property, for example data. Then, configure this name in the Sendgrid node as well and all three emails would be sent:

Example Workflow (3 Mails)

If instead of three separate messages you want to send a single message with three attachments, you’d need to merge all three items into one first.

Example Workflow (1 Mail)

Hope this helps!

:warning: Note: While testing this I discovered a bug when using filesystem-based binary data handling which I’ve added to our internal bug tracker for a proper investigation and fix. This data handling is not enabled by default, so unless you have done so manually this should not affect you (but I wanted to point it out anyway in case someone stumbles across this).

1 Like

Hello @MutedJam,
Thank you a lot for your answer!! I am gonna try it but while I have been trying other solutions with the next workflow:

At the end, the goal that I trying to resolve is to read an external excel file, extract info from it and put this info in 3 different sheets in a new excel file. And after to send the new excel as attachment in an email.

The above workflow runs, but SendGrid is sending as many emails as items returned by the Google Drive node. :smiling_face_with_tear:

I am gonna try with your solution
Thank you very much you are the best!

Your solution with SpreadSheets runs!! thank you very much!!
I have tried to send an email with 3 attachments and SendGrid sent them.
Thank you very much!
You are the best!

1 Like

Awesome, glad to hear this works for you! Thanks a lot for confirming :slight_smile:

1 Like

The issue got fixed. It will be available in the next release.


Got released with [email protected]

1 Like