I've been working on "Make" like flows. Task B o...
# prefect-community
n
I've been working on "Make" like flows. Task B only runs if its output file doesn't exist or if Task A updated its output file that B uses as input. Last week it was getting ugly with all the decision logic winding up in Task B. This week with a tip from @Laura Lorenz (she/her) I reworked this using the case statement in the Flow. This makes much more sense as it is a flow behavior and not a task behavior. It took a bit to get my head around merge() and where it fits in. Here is what I got working. I thought some of you might be working on similar flows and this was a good place to get some collaboration going. requires_rebuild() can be more sophisticated. I have one that takes a list of source and destination file paths, which is a more typical case. I can also break out the build tasks in to separate files and check them as source files. That way if you update the logic in a build task then the appropriate flow branches and tasks run.
👍 5