Return binary data from a node a few nodes back (within a loop)

I am trying to access the binary data of a node in a loop over items. I do require the loop over items (my actual workflow is more complicated), I have just provided below as a MWE.

What is the error message (if any)?

No error, but binary data is not outputted. See output of last node below.

Please share your workflow

Share the output returned by the last node

As above, not as the not as the n8n binary data output

Information on your n8n setup

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

Hey @pb84,

Looking at your workflow code why not just return results which will give you the binary data?

I may well be missing something but actual use case is more complicated as nodes required between loop and then the code node at the end (can update above if needed). Essentially probably with results is it necessarily requires the binary data node to be before which in this case isn’t possible

Hey @pb84,

We should probably put more examples together on referencing binary data in a code node, I am sure there are some examples here on the forum but I can’t find any. If I get some time I will see if I can put something together.

1 Like

That’d be great Jon – any update here re how we can access earlier binary data later into the workflow. Perhaps @jan might have an answer?

Not totally sure I understand the problem but is that what you need?

3 Likes

Thats perfect :slight_smile:

Glad to hear. Have fun!

1 Like

Side question - are we able to access binary data from a node way back in a js expression in another later node. Currently, I am familiar with just using ‘data’ and having binary data available in the prior node, but would save a step if we could do something like $(‘HTTP Request’).first().binary.data

Is that possible?

No sorry, that is sadly currently not possible.

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