Couldn'd download the sftp subfolder

Hi Team, i can be download the files from sftp but if parent folder contains the subfolder, this sub folder is not downloading from sftp . xample- in sftp \Internal folder- this folder contains some excel files and text files then subfolder, i can download the files from this folder but sub folder is not downloading . could you please hel me?

Describe the problem/error/question

What is the error message (if any)?

Please share your workflow

(Select the nodes on your canvas and use the keyboard shortcuts CMD+C/CTRL+C and CMD+V/CTRL+V to copy and paste the workflow.)

Share the output returned by the last node

Information on your n8n setup

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

hi @Kaviya_V

From your screenshot, it looks like you are using SFTP list first and then SFTP download on the returned items. In that setup, I would expect n8n to download the files listed in that folder level, but not automatically recurse into subfolders. The FTP docs mention recursive behavior for delete/rename-related operations, but not for download, so I think subfolders would need to be handled separately. I’d try listing the subfolder path explicitly and looping over those results as a second step.

this is download the files from the subfolder and parentfolder, but i need to download the subfolder inthis case how to modify my workflow

I think you’re much closer now @Kaviya_V
I wouldn’t try to download the subfolder itself as if it were one file, because the SFTP node is really better at listing paths and then downloading the files it finds. So if your goal is to bring over everything inside the parent folder and its subfolders, I’d let the first SFTP list return all items, then use the IF node exactly the way you’re doing now to separate files from folders. The file branch can go straight to download, and the folder branch should go back into another list for that folder path so you can keep expanding it. In other words, I’d treat this like a small recursive loop: list a folder, download the files from that level, then list any subfolders and repeat. That’s the practical workaround here, because n8n doesn’t really have a “download this whole folder tree” operation in one step for SFTP.