Suppose I have a flow that consists of 4 tasks tha...
# ask-community
t
Suppose I have a flow that consists of 4 tasks that run run one after the other, e.g.,
A -> B -> C -> D
. Now suppose I run the flow and tasks
A
and
B
complete, but
C
fails because of a bug. I therefore want to fix the code in task C and redeploy the flow.
k
So the checkpointing behavior to be specific to a flow and not apply when you re-register. You can still do this though if you use
caching
or
targets
. Docs are here . These are persistence mechanisms that work across Flow runs.
t
Hi
thanks for the response.
So the checkpointing behavior to be specific to a flow and not apply when you re-register.
-> Sorry, I am not sure I understand your first sentence.
k
Oh sorry I had a couple of typos there. The default checkpoint is from flow run to flow run. If you restart the flow from failure, they will be loaded but if you create a new flow run, it doesn’t. In order for the changes in task C to take effect though, it implies you registered and re-ran the flow
t
ah, ok. cool, makes sense.
Thanks
Yeah, persistence looks like what I was after
k
So you can have it work by either setting an explicit cache valid for a given duration or something. Or you can create a filename to persist the output. If any future flow runs find the file exists, then it will just be loaded in. You can create filenames with timestamps by rounding the time (to nearest day or hour or example), and then they future flow runs will pull that file if it exists, otherwise it will re-run the task
t
Does it depend on parameters I pass to the task too?
k
It can. For caching, you can validate/invalidate the cache based on inputs. For targets, you can maybe template them into the file name
t
ok, cool
k
Target is file based persistence. Caches are time based of validation based (like the inputs)
t
I think I have everything I need now. Thanks a lot!
k
Of course!
t
yep, got it