How to access the 'run' for multi-input nodes

I sort of just asked this but I think this is a better/more general form of the question.

When feeding data into any node that only has 1 input, that causes an interation and presents as a ‘run’ in the output. ie, 2 input nodes shows run 1 of 2 and 2 of 2.

I cannot get google or the forums search to handle the search term ‘run’ with any success… to ambiguous.

So, is there a function done that can handle these separate runs?

Hi @syadnom, in many n8n expressions you can specify an optional runIndex to access a specific run. So if you want to access the first item from the first run of the HTTP Request node in the below example workflow you could use an expression like {{ $('HTTP Request').first(0, 0).json... }}:

If you want to access all runs from a previous loop you could use the Code approach from this example workflow instead. It’d simply increase the runIndex one by one until there are no more results.

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