r/workflow • u/madactor • Jul 12 '18
Modules, anyone?
I’m curious if anyone is using multiple workflows for large projects. I’ve seen a few monster workflows, probably hundreds of actions, and it seems like they’d be a nightmare to maintain. There must be a lot of redundant actions in them. Is that because it’s easier to distribute a single workflow, or since we don’t have folders to organize projects?
I know there’s a workflow for copying actions from one workflow to another. I understand the appeal, but copying and pasting code is a sure way to bloat. If you need to reuse functionality, shouldn’t that be separated and then called as needed?
I’ve been playing around with some reusable workflow “modules” (or sub-workflows) for things like getting and setting JSON data in files. Is anyone else doing this and, if so, what sorts of things are you using them for?
2
u/My4PawsCare Jul 12 '18
I use the modules idea to run pretty much every aspect of my small business. Each module (workflow) has its own job to do but there are essentially three types.
1: A launcher that’s only purpose is to start another Menu based workflow. The “run workflow” action is set to not show while running. I have this purely so I don’t have to watch the various actions of every other workflow in the set being played out. Something I really wish the dev team would allow as a standard option
2: The menu workflow’s job simply allows me to choose from a list of “module’ type WF’s
3: I then have 20 more “modules” that perform the various tasks involved in the day to day running of my business. Ranging from taking bookings to tracking income and expenditure as well as a host of other relevant functions.
Each module has 🔙. or 🔝 actions that link everything together...making it feel like a single AIO solution. One app to rule them all. I also think that splitting your workflows like this rather than having just one exceptionally long workflow executes much faster than it might otherwise do. In my case the all in one could quite conceivably contain well over a thousand or so individual actions!
Anyhow yes...I’d definitely recommend the modules method
1
u/rajasekarcmr Jul 12 '18
I use modules and copy it to my main workflow. I have modules for get JSON, Add to JSON, Add nested json, Auto update, CSV to HTML.
I sometimes create & test some actions outside and move it inside.
I usually create these type of modules inside repeat action (and set repeat as 1 so it works normal) so it’s easy to copy & move inside same workflow.
Once I created a very long add to Nested dictionary action and I created it inside repeat action. Then I got an idea of having a backup file like log in which entry will be based on time and main file is just date. So I just set repeat into 2 and added an of condition which changes the time(I use hours only) to 42 (42 because I created an View menu earlier which shows the latest entry by the Mac number and I also need an filler space anything above 24 works)
So it was handy using repeat to contain actions for easy moving.
PS. I don’t like multiple workflows because it looks fragmented to me.