Method for sorting uploaded Files by their extension?

I am trying to create a Flow that will make it so uploaded files are automatically moved into folders based on their extension. I looked at the options currently available in Nextcloud though, and couldn’t find any easy way to do so. Is such an action possible? Will I have to use an external Script?