The ZIP activity has a little weird parameter configuration. They stopped using the ZIP file parameter, the only way the Java action works is to use the return value, like you did.
However, that means you cannot choose the entity it creates. System.FileDocument has no entity access so your download will fail.
- Create your own entity, must be specialization of System.FileDocument
- To make this easier to read, lets call it MyZipFile, but you're free to name it as you like it.
- In your microflow, create and commit an object of MyZipFile
- Use CommunityCommons.DuplicateFileDocument to duplicate the System.FileDocument you got from the ZIP activity to your new MyZipFile object
- Delete the FileDocument object, you don't need it anymore as you just copied the contents to your new MyZipFile object
- Set a meaningful file Name on the MyZipFile object, like download.zip
- Set DeleteAfterDownload to true if you want the file to be deleted as soon as the user has finished downloading it.
- Use your MyZipFile object in the Download File activity
- Unless there is another flow where the object gets deleted: You may want to create a little cleanup scheduled event to delete old MyZipFile objects. The user may cancel the download, the download could get interrupted etc. That could leave a MyZipFile object and file behind, causing clutter in your database and file storage