https://prefect.io logo
Title
v

Vitor Avancini

04/23/2020, 4:19 PM
Question about flow versions, Is a flow execution always tied to the flow version when it was registered? If I run a flow and it fails due to some buggy code, fix the code and rerun this failed flow, will it run the version with the bug again or the latest registered version? I have tried this process but after hitting the retry button, it stucked at a pending state. I have the agent running this time.
👀 1
d

Dylan

04/23/2020, 4:26 PM
Hi @Vitor Avancini! Flows registered with an instance of Prefect Server or Prefect Cloud can only have one active version at a time. “Active” meaning “able to be scheduled”. Further, a flow run is tied to a particular version of a flow. So, in your example, what would happen is your flow run would fail to start because the version of the flow that’s associated with that flow run is no longer the active version of your flow. Once you re-register a flow, you’ll need to schedule a new run of that flow version to make sure it’s working as expected.
You can run your flow on your local machine at any time with
flow.run()
of course =]
v

Vitor Avancini

04/23/2020, 4:27 PM
yeah and thats really great
:marvin: 1
d

Dylan

04/23/2020, 4:27 PM
Great, let us know if you have any other questions 😄
v

Vitor Avancini

04/23/2020, 4:29 PM
the case im thinking about its something like this: I have a daily job, and for some reason it fails every weekend, but im a lazy worker that do not look at weekend executions. Eventually I discover that this flow has been failing weekend for a long time. So i fix the code, register it again. Now I have to rerun for every weekend that faield
d

Dylan

04/23/2020, 4:29 PM
ahh I see
Since the date for your flow is important, I might suggest adding the date as an optional Parameter for your flow
v

Vitor Avancini

04/23/2020, 4:30 PM
I use airflow alot, so If this would happen in the airflow world, I would fix the code and clear failed tasks
d

Dylan

04/23/2020, 4:30 PM
That way, you can run it for any arbitrary date
v

Vitor Avancini

04/23/2020, 4:30 PM
alright
d

Dylan

04/23/2020, 4:30 PM
and then you can kick off runs from the UI with the dates that need to be re-run
v

Vitor Avancini

04/23/2020, 4:30 PM
and any suggestion on finding this failed tasks?
graphql query maybe?
d

Dylan

04/23/2020, 4:31 PM
Are you interested in the individual failed tasks from the weekend runs or the flow runs that failed?
v

Vitor Avancini

04/23/2020, 4:31 PM
the flows that failed for that specific flow
and version
in this case, the weekends executions that failed
d

Dylan

04/23/2020, 4:33 PM
You can check out archived versions of your flow in the UI
If you’re using cloud, the URL would be: https://cloud.prefect.io/{your_tenant_slug}?flows=&archived=true
It’s located at Dashboard -> Flows
and then there’s a switch at the bottom of the page to show archived versions
You’ll be able to look at all of your runs for the past month there
If you’re looking for more detail or for runs from a longer period, then I’d suggest checking out the Interactive API: https://cloud.prefect.io/{your_tenant_slug}/api
and making a graphql query
v

Vitor Avancini

04/23/2020, 4:36 PM
Allright, thanks Dylan
Ill try using the graphql api
d

Dylan

04/23/2020, 4:36 PM
Great!
@Chris White we might want to archive this flow with “Are Flow Runs tied to a particular version of a Flow?”
Marvin won’t listen to me ☹️
👍 1
😂 1
c

Chris White

04/23/2020, 4:50 PM
@Marvin archive “Are Flow Runs tied to a particular version of a Flow?”