Trouble working with Binary

Hi n8n community,

Short post as its mostly a question as I’m new with binary : Is it normal that I cannot access / transform the csv “attachment_1” you can see in the screenshot ?

Using {{$binary}} I see the object is empty so would love to get your insight or valuable documentation to work with this.

Cheers

It looks like your topic is missing some important information. Could you provide the following if applicable.

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

Hi @Vincent_Bonjean! Thanks for reaching out here and I hope you’re doing well! Do you mind sharing the settings you’ve applied to the Gmail node? Also, could you try another pair of attachments to a newly sent email?

I did try to replicate this but did not have any luck, so I’m very interested to see what might be causing this here.

HI Ludwig,

Thanks for your answer - I did retry with newly sent email and I’m now able to read correctly the binary inputs but I still can’t transform the attachment into json output using the Extract from File node.

Happy to get your thoughts on this one :slight_smile:

[EDIT] : I see the first node is not correctly displayed on the shared workflow but this is the native Gmail Trigger on Email Received used as input to get the message content and attachment in the second node using Message ID.

As you requested I retried with a newly sent email, and I see can now read the binary input but still can’t transform it using the Extract file node as you can see in the screenshot below.

Hi @Vincent_Bonjean, you are correct, and the error is actually being informative here. You are trying to specify the binary field with the file name, but the binary fields are named attachment_0, attachment_1, etc. You can overwrite that prefix in the options at the bottom of the Gmail node, but that’s another matter.

You can specify the csv in your screenshot by replacing {{ $binary.attachment_1.filename }} with attachment_1

If you run into a case where you have to access multiple csv files that are attached to the same email, you would need to split out the binary data, which you can see an example of in this template: Split Out Binary Data | n8n workflow template

1 Like

Thanks Ludwig, it’s working well now :slight_smile:

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.