Hey Team, I have a query, I am running flow.regist...
# prefect-server
v
Hey Team, I have a query, I am running flow.register() from within the Flask app and I could see as many time Flask app is run, I could see new version from UI. How do I avoid re-registering of the flow? Thanks
n
Hi @Vipul - the most straightforward way to handle this would be to either register the flow elsewhere (maybe as part of a manual command that can be run at will), or by querying the API to see if the flow has already been registered with a query like this:
Copy code
query {
  flow(where: { name: { _eq: "My Flow" } }) {
    id
  }
}
v
Thanks @nicholas The problem would be the Flask app should know the flow id so that it can trigger this flow based on the Flask end points are hit. Thanks for pointing me to those query but I am not sure how do I put that to code in the Flask app
n
You can use the result of that^ to set the flow id in your app as you expect
v
Cool, thanks for the pointer, I will check
👍 1
Thanks @nicholas it stopped re-registering of task
*flow
n
Fantastic!