Hey there! 👋 I’ve looked in the documentation and did some google-searching but to no avail... so I’m trying my luck here 🙂
How would you go if you wanted to check a condition based on the date of the last successful run of a flow? For instance: if the data I work with wasn’t updated since the last successful run, I can skip it.
My ugly simple solution at the moment is to dump a timestamp in a file somewhere.
It seems that I should be able to build that using either Result or Cache, but I can’t really figure out a way to do it. I was hoping to find this information (date of last successful run of the flow) populated in
prefect.context
.
Pointers and suggestions welcome! 🙏
j
Jim Crist-Harif
02/23/2021, 10:04 PM
Are you asking how to find the date of the last successful flow run for a flow? This should be available via the graphql api.
In general, any state about prior flow runs either needs to be part of our database (so info about a flow/flow run like the date) or held externally somewhere on your infrastructure.
c
Clément Chastagnol
02/24/2021, 3:48 PM
After fumbling a bit around, I managed to get the info I was looking for in the GraphQL API. Thanks for the pointer! 🙂