Theom
10/17/2025, 7:31 AMMarvin
10/17/2025, 7:31 AMMarvin
10/17/2025, 7:35 AMPREFECT_RESULTS_LOCAL_STORAGE_PATH (preferred/explicit)
- PREFECT_LOCAL_STORAGE_PATH (legacy alias)
- You can also persist it in the active profile with:
- prefect config set results.local_storage_path=/path/on/this/machine
- or prefect config set PREFECT_RESULTS_LOCAL_STORAGE_PATH=/path/on/this/machine
- Precedence: environment variables > profile config. Set it where the flow code actually runs.
Common ways to apply per-machine paths:
- Process worker (runs flows on the same host)
- Shell/systemd:
export PREFECT_RESULTS_LOCAL_STORAGE_PATH=/var/prefect/results
prefect worker start -p my-process-pool
- Or persist it on that host:
prefect config set results.local_storage_path=/var/prefect/results
- Docker/Kubernetes workers (flows run in new containers/pods)
- Put the env var into the job template or deployment job_variables so it’s present in the flow-run container/pod, for example in your prefect.yaml:
deployments:
- name: my-deploy
entrypoint: flows/my_flow.py:my_flow
work_pool:
name: my-docker-pool
type: docker
job_variables:
env:
PREFECT_RESULTS_LOCAL_STORAGE_PATH: /data/prefect/results
- For Kubernetes, add it to the base job template or job_variables env so each created pod sees it.
Notes:
- Setting this on the Prefect Server (or Prefect Cloud) won’t affect where results are written; only the execution environment matters.
- If you want one consistent location across all machines, consider shared storage (NFS/SMB) or a remote storage block (e.g., S3/GCS) as your default result storage. Otherwise, per-machine env vars are the simplest way to diverge paths.
Docs for reference:
- Results (3.x)
- Settings and profiles
- Settings reference