Sebastian Janisch
12/04/2025, 4:42 PMMarvin
12/04/2025, 4:42 PMMarvin
12/04/2025, 4:46 PMprefect version
# or
prefect --version
- Inside your flow (logs it to the run logs):
from prefect import flow, get_run_logger
import prefect
@flow
def my_flow():
get_run_logger().info(f"Prefect version: {prefect.__version__}")
- If you want it visible per run in Cloud without reading logs, add it as a tag:
import prefect
from prefect import flow
@flow(tags=[f"prefect:{prefect.__version__}"])
def my_flow():
...
Note: Prefect 3.x does not store prefect_version on the Flow Run object, so you can’t retrieve it for past runs unless you logged or tagged it.
Do you need this for a specific historical run, or just to confirm what your workers are currently using?Sebastian Janisch
12/04/2025, 4:49 PMMarvin
12/04/2025, 4:49 PMMarvin
12/04/2025, 4:53 PMcurl -s <https://api.prefect.cloud/api/version>
This returns something like "0.8.x" which is the server API protocol version.
- Local/client version: On your worker/CI/dev machine:
prefect version
# or
prefect --version
Note: The “API version” shown by prefect version is the client’s supported protocol version, not fetched from Cloud. When talking to Prefect Cloud, the client intentionally skips strict server-version checks because Cloud is maintained for compatibility.
If you specifically need the exact Prefect package version running in Cloud’s backend (for audit/compliance), that’s not surfaced via the public API. Let me know if you need that for a formal record and I can point you to the best path (usually a support request).