Merge with Binary

Really struggling here. I feel like this has been done before, but I can’t for the life of me get it to work. Here is my flow. The http request downloads a pdf file. I simply want to rename it and then upload it to google drive. Every bit of this works except I’m unable to take the output of the merge properly. It says that there is no binary file data, but if I remove the merge, and just take the http request directly, there is no issue at all (but I can’t rename the file. Please help!! :sob:


For what its worth:
n8n version: 1.76.1
Running n8n via Docker

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:

I figured it out by piecing together some other code snippets. I must be missing something, but this seems like a straight forward thing to be able to do in a node. Yet I just couldn’t work it out.

items[0].binary.data.fileExtension = ‘pdf’;
items[0].binary.data.fileName = $(‘Information Extractor’).first().json.output.document_name
items[0].binary.data.mimeType = ‘application/pdf’;
return items;

There is a way to passthrough (rather than merge) a binary file using the “Edit Fields” node and its “Include other input fields” option. Maybe this was what you were thinking of?

1 Like

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