https://prefect.io logo
v

Vipul

01/20/2021, 4:32 PM
I am planning to run large Flow with the caching that seems to be working fine But lately I found out that if the same flow is started at almost similar time then the caching might not work as they both are running at the same time. Want to understand if there is a way to control this by not triggering the second flow when the first run is already in running state (with the same Parameter) using Prefect API or GraphQL query API
m

Mariia Kerimova

01/20/2021, 5:04 PM
Hello Vipul! Before I suggest any options, could you please provide more information about your flows. Is there a specific reason for having the same flow running at the same time? Could you take advantage of using different schedule?
v

Vipul

01/20/2021, 5:19 PM
Hey, there are being triggered using Flask API and I don’t have much control over that
m

Mariia Kerimova

01/20/2021, 5:29 PM
I see. You can pass an 
idempotency_key
 to
create_flow_run
that includes, for example, your parameter values as a string, or a timestamp to prevent multiple duplicate runs from being scheduled.
v

Vipul

01/20/2021, 5:42 PM
aha
That is very nice
Thanks, I would look
👍 1