https://prefect.io logo
Title
m

Mohit Singhal

11/17/2022, 8:41 AM
Hi team, I am new to prefect and I have a question. If I am running a flow daily and it failed for yesterday and now when I will be retrying it today, is there any date parameter which gives me yesterday's date instead of today's date as I will be fetching some values based on date from the api in my flow.
1
r

redsquare

11/17/2022, 8:42 AM
I use a json block to store the last successful run time as a checkpoint which then allows me to make decisions on the next run
:gratitude-thank-you: 1
m

Mohit Singhal

11/17/2022, 8:43 AM
what if I want to retry a task after two days or three days how can I do that as I need the past date only? For example If I want to retry a task of 14th Nov on 17th nov and I want the date as 14th in my code
where can I get that date
r

redsquare

11/17/2022, 8:45 AM
well the flow picks up the checkpoint and does what it needs to do
m

Mohit Singhal

11/17/2022, 8:45 AM
can you please share a dummy code?
r

redsquare

11/17/2022, 8:47 AM
on successful completion the last thing we do is store some checkpoint datetime/id....the next run uses that date to add a where > clause
I wouldn't rely on a last flow run date for a few reasons
m

Mohit Singhal

11/17/2022, 9:01 AM
Thank you so much!!
👍 1