*Prefect 2.3.1 - CI/CD*: I run a freshly deployed ...
# prefect-community
d
Prefect 2.3.1 - CI/CD: I run a freshly deployed flow at the end of my CI/CD pipeline, and would like to know whether or not the run was successful. My current idea is to poll the API for the state of the submitted run until it reaches a terminal state. Has anyone implemented a solution like this, or do you have another idea on how to solve this? 🙏
1
s
@Dominik Wagner Hey! You are on the right track, in 2.0 you are looking for the `Completed`state, so you could use this in your conditional. https://discourse.prefect.io/t/what-is-the-final-state-of-a-successful-flow-run/59
d
Yep, was more a question about whether polling an API like this is a good idea in a CI/CD workflow
r
Typically you wouldn't use a CI/CD pipeline to do long polling like this. You should probably re-think your design. It is easier setup a system that is designed for long polling (web server) and then have that callback your CI/CD pipeline to finish processing. A really hacky solution would be to have your CI/CD pipeline wait for some kind of notification. For instance in prefect you can send notifications when the task is complete via email or slack. I am pretty sure you can modify a slack bot so that it has the ability to forward the received request to your CI/CD pipeline.
d
Thanks for the input, Rajvir, much appreciated! I think that's what I intuitively felt (hence the question), but I still can't quite articulate why - I'll take this to our DevOps team 😉