Janet Carson
11/13/2025, 8:54 PMMarvin
11/13/2025, 8:54 PMMarvin
11/13/2025, 9:02 PMprefect variable set DB_URL "postgres://..." --tag project:myproj --tag env:prod
- Python
from prefect.variables import Variable
Variable.set(
"DB_URL",
"postgres://...",
tags=["project:myproj", "env:prod"],
overwrite=True,
)
- You can use these tags to filter/search on the Variables page.
- Work pools: no tags, but you can add a description and use naming conventions
- CLI
prefect work-pool update myproj-k8s-pool --description "project:myproj env:prod"
- Consider prefixing the name with your project/team, e.g., myproj-k8s-pool.
- Blocks (block documents): no tags, but naming conventions help
- Give block documents a consistent name prefix/suffix, e.g., myproj-aws-credentials, myproj-s3-storage.
- This makes them easy to find via the UI search and prefect block ls.
Recommended patterns for grouping
- Consistent naming: prefix everything with your project/team/environment, e.g., myproj-..., team-foo-..., prod-....
- Blocks: myproj-aws-creds, myproj-gcp-creds
- Variables: myproj-DB_URL, myproj-SLACK_WEBHOOK
- Work pool: myproj-k8s, myproj-docker
- Use variable tags to convey project and environment since that’s the one place tags are first-class. I like project:<name> and env:<name>.
- Add keywords to work-pool descriptions to make UI search more effective.
- If you need stronger isolation, consider separate workspaces per project (this cleanly separates blocks, variables, and work pools).
If you share the names of your two blocks, four variables, and the work pool, I can propose concrete names/tags you can apply right away.