Download multiple files with http-request node

Describe the problem/error/question

I’m new to n8n and I’m trying out a very simple workflow: URLs to files from a webhook should be downloaded and saved on my Nextcloud. I also use the “Split Out Items” node at the beginning to only extract certain URLs from the json file of the webhook.
But I have 2 problems:

  1. How do I define the “HTTP Request” node to download all URLs from the output of the “Split Out Items” node?

  2. How do I define the Nextcloud node so that it saves the downloaded files under their original name?

Please share your workflow

It looks like your topic is missing some important information. Could you provide the following if applicable.

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

Ok, I missed some information about the system, hope this helps:

  • n8n version: 1.18.2
  • Database (default: SQLite): Postgress 11
  • n8n EXECUTIONS_PROCESS setting (default: own, main): ?
  • Running n8n via (Docker, npm, n8n cloud, desktop app): docker
  • Operating system: Debian 11

OK, I will answer to myself, i figured it out:
/Filepath/{{ $('HTTP Request') }}

But my initial problem remains, how to download multiple files??

The webhook-json-file looks like this:

    "headers": {
      "host": "",
      "content-length": "280",
      "accept": "application/json",
      "accept-encoding": "deflate, gzip, br",
      "content-type": "application/json",
      "x-forwarded-for": "X.X.X.X",
      "x-forwarded-host": "",
      "x-forwarded-port": "443",
      "x-forwarded-proto": "https",
      "x-forwarded-server": "traefik",
      "x-real-ip": "X.X.X.X"
    "params": {},
    "query": {},
    "body": {
      "Upload 1": "",
      "Upload 2": "",
      "Upload 3": "",
      "Upload 4": ""

I want to download the files from the url “Upload 1” to “Upload 4”. How to define Http Request Node to loop?

OK, I’m answering myself again.
I figured out that the “Http Request”-Node works correct with internal looping when the output from the previous node looks like this (I changed the output manually, it shows up as 4 items):

    "url": ""
    "url": ""
    "url": ""
    "url": ""

Then a simple

{{ $json.url }}

in the “HTTP Request” URL-Field and it works as it should.

But, how can n8n convert the following output from the “Split out items”-node (1 item) to look like above (4 items)? This is the JSON that needs to be converted:

    "body['Upload 1']": "",
    "body['Upload 2']": "",
    "body['Upload 3']": "",
    "body['Upload 4']": ""

Would be nice if someone has a solution!

And once again I have to answer myself. To perform the array conversion mentioned above, I had to write some code, the “Edit Field” node was unable to do this.

And this is the final working workflow:


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