Hello,
I’m new to n8n so this may be something I’m just overlooking. I’m trying to build a workflow that will use an API call to get information about documents attached to a case. I then want to loop through the information that comes back and download each document. I can succesfully download the first document but anything after that does not work. Here is the layout that I have so far:
I can see the individual items in the Item Lists node and they look right. In the Download Docs (http node) I have it setup with a response format of File, I set the url to https://siteurl/{{$json[“files”][“url”]}}. This should dynamically set the url to the download url for each document (at least that is what I think it should do).
In the Binary Property field I have something similar. The value is {{$json[“files”][“name”]}} which I think should dynamically set the name of the file as well. When I run the process and look at the binary files in the final step there are two files created, the first one is named properly and the file is what I’m expecting. The second document is named the same as the first and the data is not correct.
The incoming data has JSON that looks like this
[
{
"files": {
"name": "Squirrel-UpdateSelf.log",
"size": 264,
"url": "/...url/Download?data={'CaRelDocsId':10715}",
"deleteUrl": "/...url/Delete?data={'CaRelDocId':10715}",
"deleteType": "GET",
"reldocsId": "10715",
"date": "2021-10-18T13:28:39",
"attachedBy": "KYLER",
"thumbnailUrl": "...url/DownloadCaRelDocs?data={'CaRelDocsId':10715}",
"taskCode": null,
"taskDesc": null,
"caReceiptId": null,
"caTaskId": null,
"caObjectId": 576,
"LabelText": null,
"Title": null,
"Description": null,
"Tags": []
}
},
{
"files": {
"name": "Squirrel-UpdateSelf - Copy.log",
"size": 274,
"url": "...url/Download?data={'CaRelDocsId':10717}",
"deleteUrl": "...url/Delete?data={'CaRelDocId':10717}",
"deleteType": "GET",
"reldocsId": "10717",
"date": "2021-10-18T14:09:02",
"attachedBy": "KYLER",
"thumbnailUrl": "...url/DownloadCaRelDocs?data={'CaRelDocsId':10717}",
"taskCode": null,
"taskDesc": null,
"caReceiptId": null,
"caTaskId": null,
"caObjectId": 576,
"LabelText": null,
"Title": null,
"Description": null,
"Tags": []
}
}
]
Is there a trick to get the http node to download multiple files like this? Do I need to use a Split In Batches node?
Thanks for your help,
Kyle