Back to Templates
Ever had binary data (like images, PDFs, or files) disappear in your n8n workflow after an intermediate node processed it? This workflow provides a powerful solution by demonstrating how to re-access and re-attach binary data from any previous node, even if it was dropped along the way. Think of it like having a reliable backup copy of your file always available, no matter what happens to the original as it moves through your workflow.
Here's how this template works step-by-step:
HTTP Request
node. This is our original binary data.Set
node then processes this data. Crucially, by default, Set
nodes (and many others) do not pass binary data to subsequent nodes. This step intentionally simulates a common scenario where your binary data might seem to "disappear" from the workflow's output.Code
node. It uses a specific n8n expression ($(nodeName).item
) to reach back to the original node that produced the binary data (Get n8n Logo (Binary)
). It then retrieves that binary data and uses this.helpers.prepareBinaryData()
to correctly re-attach it to the current item, making it available for all subsequent nodes.Setup time: 0 minutes!
This is a self-contained tutorial workflow, so no external accounts or credentials are required.
Re-Access Binary Data from Previous Node
to see the binary data successfully re-attached.previousNodeName
variable within the Re-Access Binary Data from Previous Node
(Code node) to match the exact name of the node that originally produced the binary data you wish to retrieve.