You’re basically asking about running a server. You can do that locally and on your own hardware as you’re considering, or you can host that on your organization’s servers, or host it on services such as Amazon EC2 Mac, or MacStadium.
Running stuff locally and uploading results files to iCloud Files is trivial.
The biggest hassle with running stuff locally is remote access, maintenance, and security; of opening the necessary ports for submitting requests remotely, of potentially setting up Dynamic DNS or maybe static IP from your ISP, and of keeping the server secure including maybe (probably, preferably) setting up a DMZ to better network-isolate the “exposed” Mac in the event of a breach, among other details. The riffraff like finding and poking at open ports and servers, and will scan for and poke incessantly. Basically, you’re becoming your own server IT, and your own network security team, and your own breach mitigation and recovery team if and as needed.
If you want this to run like batch, you can entirely avoid opening ports and the associated issues and hassles, set up a few areas in iCloud Files where you can leave scripts, and can run a script periodically in the server that scans those areas, renames the script job files from the submission directory into a working directory, invokes the scripts, and then uploads the results and the scripts job files into a different directory when completed. A hack version of this is a few simple shell scripts and a launchd file or two (Lingon app is handy for using launchd) to check for and run the scripts periodically; say every five minutes or so. To “submit” a job, load a script into the iCloud submission directory, wait for it to move to the working directory (which means the server has captured it) and Bob’s your uncle. Ugly, not entirely stable around things like power outages and restarts, but workable. And all comms and all files and all networking are secured via Apple ID and iCloud.
Apple used to have something similar to this distributed processing with Xgrid, but that was deprecated an aeon or two ago. This whole grid or cluster computing area has largely died out.
There are vendors still selling distributed job schedulers, and that link is to an intro and that intro is provided by one of the entities offering a scheduler. That’s probably more than you want to pay.
Hosting on macOS at Amazon or MacStadium means you connect into the server there and set up and run your jobs there. It’s like the local option, but with somewhat less IT and networking and security, as you don’t need to establish and maintain access into the server.