How to upload first file after sorted ascending order?

Describe the problem/error/question

In my workflow I made it to extract a zip file and then sort filename in alphabetical order. How do I upload the first file after it’s been sorted cause file_0 is no longer the first file so I don’t know which file_x is the the first file.

What is the error message (if any)?

Please share your workflow

Share the output returned by the last node

Information on your n8n setup

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

Hi @Ruriko, welcome!

You can use the Limit node to keep only the first item,

FYI, the Decompress node always outputs an additional file, which I think you’ll need to ignore it,

BTW, I redesigned the workflow without using a Code node, in case this is what you were looking for:

Feel free to edit it to suit your needs, or just use your own workflow if you get the idea.

1 Like

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