Hey all, in Prefect 2, is there a way to figure ou...
# ask-community
j
Hey all, in Prefect 2, is there a way to figure out if I’m running locally or with a remote? From my understanding, in Prefect 1 there was
prefect.context.get("running_with_backend")
a
check if the deployment ID is set, if not, then it's ad-hoc run:
Copy code
from prefect import flow, context


@flow
def xxx():
    x = context.get_run_context()
    print(x.flow_run.deployment_id)
j
Nice, thank you!
🙌 1