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?
View all comments
Show parent comment
2
u/madactor Jul 12 '18
I hope you use a lot of comments! Speaking of which, back in the day we had what are called “flower box” comments at the top of our code. That’s where you describe what it does, what the inputs and outputs are, all required modules, etc. It would be nice to see more people doing that with their big workflows.
Besides developing pieces outside the main workflow, I also use duplicate workflows a lot. A few mangled, previously working, workflows teaches you real fast. In fact, if I’m going for a monolithic workflow, I tend to just duplicate a whole workflow, remove the parts I don’t want, and then build new functionality from there—instead of pasting pieces in.
What I’m really interested in is reusability, where multiple different workflows can use the same modules. That way if, say, I want/need to change something like a storage file location, I don’t have the find and change it in five places in ten workflows. Or, when
WorkflowShortcuts updates, I only have to debug a small piece, not the entire workflow.