The HTTP returns a JSON with an items list and other things. I want to have all the items in the same object at the end of the workflow. I’ve asked ChatGPT and the better i came up with is the following snippet from “Update vars” node:
Ensure to copy your n8n workflow and paste it in the code block, that is in between the pairs of triple backticks, which also could be achieved by clicking </> (preformatted text) in the editor and pasting in your workflow.
```
<your workflow>
```
That implies to any JSON output you would like to share with us.
Make sure that you have removed any sensitive information from your workflow and include dummy or pinned data with it!
I would advise engaging Loop node. The last node in the loop (the one that loops back to the Loop node) could bt Set node that contains only the data you need. Then once the loop iteration is completed, its “done” branch will have all the items created by the mentioned Set accumulated.
Also, you migth scrap that whole thing and utilise the built-in pagination feature of HTTP Request node if that is what you are trying to do with that loop in your screenshot. With pagination enabled you also end up with accumulated output of responses.
Running n8n via (Docker, npm, n8n cloud, desktop app): npm
Operating system: MacOS Seq
WORKFLOW
I’ve tried the loop but since there was a message saying that probably i wont need it, and i as able to achieve the loop without it so i’ve removed it.
I saw that there is a pagination feature after the post, I’ll try it later.
Anyway, is there a way to store variables in the worklow scope instead of node scope?