Combine results from several runs into 1 single result

Hello,

I hope someone can help me …
I have this workflow

It runs perfectly and gives me all the results, if there is a ‘newpagetoken’, it starts a new run …

But the issue is, that I want the results from all runs combined in one single result.
Ok, let me explain a bit more, each http-request gives me ‘resultSizeEstimate’.
I want this workflow to output one single number: the sum of all resultSizeEstimate’s of each run.
I can’t set a variable inside the loop because at each new run, it resets itself. How do I solve this?

thx,
Peter

Information on your n8n setup

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

I hope this helps.
btw. I am pretty sure, that this can also be done with a single HTTP Node and using the Pagination feature of it.

1 Like

Hi Peter, if I understood well your problem i don’t think you need the loop, getting all results on a batch and then using summarize node with the sum function indexing the result of the http request well.
Hope it helps
Àlex

Setting the initial value as first node in the loop solved the issue.

Thanks a lot, I’ve spent hours on this (I always decalred that initial value outside of the loop)

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