hello. I developed a function to notify Slack when...
# prefect-ui
r
hello. I developed a function to notify Slack when a flow is completed. In doing so, I would like to include a link to the perfect cloud log page. What can I do? Thank you.
1
a
try this:
Copy code
from prefect.settings import PREFECT_UI_URL


def get_ui_flowrun_url() -> str:
    id_ = get_run_context().flow_run.dict().get('id')
    ui_url = PREFECT_UI_URL.value() or "<http://ephemeral-orion/api>"
    return f"{ui_url}/flow-runs/flow-run/{id_}"
r
Thank you. Successful!
from prefect.context import get_run_context
need this too.
🙌 1