How can I rename the email attachment using the original filename?

I’m working on extracting email attachments using the Email Trigger node. The goal is to save these attachments to Google Drive, and each file should be renamed using a combination of the email subject and the original filename of the attachment.


In the output, attachment keys appear as attachment_0, attachment_1, etc., but I’m unable to retrieve the original filenames of these attachments. How can I access the original filenames of the attachments to use them in the renaming process?

{{ $binary.data.fileName }}, or in your case {{ $binary.attachment_0.fileName }}

1 Like