pseco
12/16/2025, 12:57 PMMarvin
12/16/2025, 12:57 PMMarvin
12/16/2025, 1:02 PMfrom prefect import flow
@flow
def my_flow():
...
my_flow.deploy(
name="my-deployment",
work_pool_name="my-pool",
tags=["production", "etl", "team-data"]
)
- If you deploy from source:
from prefect import flow
my_flow = flow.from_source(
source="<https://github.com/org/repo>",
entrypoint="flows.py:my_flow",
)
my_flow.deploy(
name="my-deployment",
work_pool_name="my-pool",
tags=["production", "etl", "team-data"]
)
CLI
- With the prefect deploy command, pass --tag (repeatable):
prefect deploy ./flows.py:my_flow -n my-deployment \
--tag production \
--tag etl \
--tag team-data
Notes
- Tags are for organization and filtering; they do not route work. Use work pools/queues for routing.
- Deployment tags are merged into each flow run’s tags.
- You can also add run-level tags dynamically with the context manager:
from prefect import flow, tags
@flow
def my_flow():
with tags("urgent"):
...
Want me to tailor this to your setup? Are you deploying via Python or the CLI, and what tags do you want to use? If you’re on Prefect 2.x, I can share the equivalent approach there too.