🛠️ Re-Access Binary Data from Any Previous Node
$20/month : Unlimited workflows
2500 executions/month
THE #1 IN WEB SCRAPING
Scrape any website without limits
HOSTINGER 🎉 Early Black Friday Deal
DISCOUNT 20% Try free
DISCOUNT 20%
Self-hosted n8n
Unlimited workflows - from $4.99/mo
#1 hub for scraping, AI & automation
6000+ actors - $5 credits/mo
How it works
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:
- Initial Binary Fetch: The workflow starts by fetching a binary image (the n8n logo) from a URL using an
HTTP Requestnode. This is our original binary data. - Simulated Data Loss: A
Setnode then processes this data. Crucially, by default,Setnodes (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. - Re-Access and Re-Attach: The core of the solution is a
Codenode. 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 usesthis.helpers.prepareBinaryData()to correctly re-attach it to the current item, making it available for all subsequent nodes.
Set up steps
Setup time: 0 minutes!
This is a self-contained tutorial workflow, so no external accounts or credentials are required.
- Simply click the "Execute Workflow" button to run it.
- Observe the output of the
Re-Access Binary Data from Previous Nodeto see the binary data successfully re-attached. - Important for Customization: If you adapt this technique to your own workflows, remember to update the
previousNodeNamevariable within theRe-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.