Xinglin Qiang
11/30/2025, 1:53 AMMarvin
11/30/2025, 1:53 AMMarvin
11/30/2025, 1:55 AMprefect.toml does not support environment variable placeholders or interpolation.
Here are the supported ways to use environment-specific values:
- Use environment variables directly (they take precedence over prefect.toml):
# shell
export PREFECT_API_URL="<https://my-api.example.com/api>"
export PREFECT_LOGGING_LEVEL="DEBUG"
Then keep plain values (or defaults) in `prefect.toml`:
[logging]
level = "INFO" # overridden by PREFECT_LOGGING_LEVEL if set
- For deployments, use environment variables in prefect.yaml with templating:
deployments:
- name: my-deployment
tags:
- "{{ $MY_DEPLOYMENT_TAG }}" # reads the MY_DEPLOYMENT_TAG env var
work_pool:
name: "my-pool"
The {{ $ENV_VAR_NAME }} syntax is supported in prefect.yaml only (not in prefect.toml).
- If you need different settings per environment, consider multiple profiles (no placeholders in profiles.toml either) and switch with prefect profile use <name>.
If you can share which setting you’re trying to parameterize in prefect.toml, I can suggest the cleanest pattern for your setup.Bring your towel and join one of the fastest growing data communities. Welcome to our second-generation open source orchestration platform, a completely rethought approach to dataflow automation.
Powered by