Jason Motley
03/22/2022, 2:30 PMKevin Kho
03/22/2022, 2:33 PMcreate_flow_run
with the same idempotency key just returns the result of what was already run. So you need to restart the Flow in the UI on the subflow, and then restart the main Flow. We don’t have restart through the API, only the UI has it.
What you can do though is create a new flow run with a new idempotency key and then rely on caching so that you don’t repeat work that is already doneJason Motley
03/22/2022, 2:36 PMKevin Kho
03/22/2022, 2:39 PMwith Flow(..) as flow:
create_flow_run(..., idempotency_key=datetime.datetime.now())
Second is that you actually want this value to change from run to run instead of being fixed at build time so you need script-based storage (Github, etc).
and then on the subflow side, apply cache_for
and cache_validator
to the expensive tasks so they don’t rerun
@task(cache_for=...)
def myfunc(x):
return x + 1
Jason Motley
03/22/2022, 2:41 PMKevin Kho
03/22/2022, 2:42 PMJason Motley
03/22/2022, 2:43 PMKevin Kho
03/22/2022, 2:43 PMJason Motley
03/22/2022, 2:44 PMKevin Kho
03/22/2022, 2:45 PMJason Motley
03/22/2022, 2:45 PM