Lorenzo Gentile
12/22/2025, 2:00 PMMarvin
12/22/2025, 2:00 PMMarvin
12/22/2025, 2:01 PMfrom prefect import flow, task, get_run_logger
@task
def say_hi(name):
logger = get_run_logger()
<http://logger.info|logger.info>(f"Hi, {name}!")
@flow
def my_flow(name: str = "world"):
say_hi(name)
if __name__ == "__main__":
my_flow("Marvin") # no deployment needed
Notes:
- If your environment is connected to Prefect Cloud/Server (via PREFECT_API_URL and PREFECT_API_KEY), this ad‑hoc run will be tracked in the UI even without a deployment.
- If not connected, it will run locally with Prefect orchestration features (retries, caching, logging) but won’t appear in a UI.
Do you want it tracked in Cloud/Server or just run locally?