v

    Vitor Avancini

    2 years ago
    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.
    Dylan

    Dylan

    2 years ago
    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

    2 years ago
    yeah and thats really great
    Dylan

    Dylan

    2 years ago
    Great, let us know if you have any other questions 😄
    v

    Vitor Avancini

    2 years ago
    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
    Dylan

    Dylan

    2 years ago
    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

    2 years ago
    I use airflow alot, so If this would happen in the airflow world, I would fix the code and clear failed tasks
    Dylan

    Dylan

    2 years ago
    That way, you can run it for any arbitrary date
    v

    Vitor Avancini

    2 years ago
    alright
    Dylan

    Dylan

    2 years ago
    and then you can kick off runs from the UI with the dates that need to be re-run
    v

    Vitor Avancini

    2 years ago
    and any suggestion on finding this failed tasks?
    graphql query maybe?
    Dylan

    Dylan

    2 years ago
    Are you interested in the individual failed tasks from the weekend runs or the flow runs that failed?
    v

    Vitor Avancini

    2 years ago
    the flows that failed for that specific flow
    and version
    in this case, the weekends executions that failed
    Dylan

    Dylan

    2 years ago
    You can check out archived versions of your flow in the UI
    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

    2 years ago
    Allright, thanks Dylan
    Ill try using the graphql api
    Dylan

    Dylan

    2 years ago
    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 ☹️
    Chris White

    Chris White

    2 years ago
    @Marvin archive “Are Flow Runs tied to a particular version of a Flow?”
    Marvin

    Marvin

    2 years ago