Olve Heitmann
10/24/2025, 9:41 PMMarvin
10/24/2025, 9:41 PMMarvin
10/24/2025, 9:52 PMproduction. You can verify with:
prefect deployment inspect <FLOW_NAME>/<DEPLOYMENT_NAME>
- Pre-created scheduled runs: The scheduler creates runs ahead of time. If you changed tags after those runs were created, they’ll keep the old tags. Clear and regenerate upcoming scheduled runs:
prefect deployment schedule clear <FLOW_NAME>/<DEPLOYMENT_NAME>
then resume the schedule.
- Compare manual vs scheduled: Trigger a manual run and see if it inherits the tag:
prefect deployment run <FLOW_NAME>/<DEPLOYMENT_NAME>
If manual runs have the tag but scheduled ones don’t, it’s almost certainly a “pre-created runs” or “wrong deployment version” situation.
- Other triggers: If you have automations/webhooks calling the API or run_deployment and explicitly passing tags=[...], those tags will be used instead of the deployment’s. Make sure nothing is overriding tags for those runs.
How to ensure tags are set on the deployment:
- In code (3.x):
from prefect import flow
@flow
def my_flow():
...
if __name__ == "__main__":
my_flow.from_source(".").deploy(
name="my-deploy",
tags=["production"]
)
- In the UI: Edit the deployment, add the tag, and save (this creates a new version with the updated tags).
Docs for reference:
- Deployments and tags: Deployments (Prefect 3)
- Schedules: Schedules
- API note: creating runs from deployments uses the deployment’s tags when tags aren’t provided explicitly: Create flow run from deployment
If you can share:
- Your Prefect version
- How you set the tag (UI, code, or prefect.yaml)
- Whether manual runs inherit the tag while scheduled runs don’t
- A recent run id that’s missing the tag
…I can help pinpoint the exact cause and the quickest fix.Olve Heitmann
10/24/2025, 9:53 PMMarvin
10/24/2025, 9:53 PMMarvin
10/24/2025, 9:54 PMproduction tag will keep their old (tagless) state.
- As new runs are generated by the scheduler, they’ll inherit the deployment’s current tags automatically. If you’re okay with a few tagless runs, you don’t need to do anything.
If you want to fix it immediately, clear and regenerate upcoming runs:
prefect deployment schedule clear <FLOW_NAME>/<DEPLOYMENT_NAME>
Then the scheduler will create new future runs with the updated tags. You can also verify by triggering a manual run:
prefect deployment run <FLOW_NAME>/<DEPLOYMENT_NAME>
Refs:
- Deployments and tags: Deployments (Prefect 3)
- Schedules: Schedules