https://flyte.org logo
#ask-the-community
Title
# ask-the-community
n

Nizar Hattab

11/28/2023, 12:53 PM
greetings all, I am trying to use reference workflow/launchplan, wonder if it is possible to get the latest version automatically of the referenced lp
y

Yee

11/28/2023, 1:25 PM
not directly - you just have to search for it.
it’s a worthy addition to the api though
n

Nizar Hattab

11/28/2023, 1:46 PM
thank you i managed to do it like this
Copy code
from flytekit.remote import FlyteRemote
from flytekit.configuration import Config

# FlyteRemote object is the main entrypoint to API
remote = FlyteRemote(
    config=Config.for_endpoint(endpoint=endpoint),
    default_project=project_name,
    default_domain=domain,
)

wf = remote.fetch_workflow(name=wf_name)

latest_version = wf.id.version
but yes, it would be better if it is a built in feature