<@ULVA73B9P> How do I get prefect flow cloud url i...
# ask-marvin
m
@Marvin How do I get prefect flow cloud url in python code?
n
👀 looking into what happened with marvin here to be clear, do you want to construct the url of the flow run from within the flow run itself programmatically?
m
Yes. That's right
n
in the most recent release
2.10.11
we now display the flow run url by default
but if you want to do it yourself, you can
Copy code
from prefect.context import get_run_context
from prefect.settings import PREFECT_UI_URL

@flow(log_prints=True)
def foo():
   print(f"{PREFECT_UI_URL.value()}/flow-runs/flow-run/{get_run_context().flow_run.id}")
m
Oh cool. This helps! Thank you!
n
sure np!