Niko
08/11/2025, 10:35 PMmatch_related
for prefect.resource.id? -- is there any sort of support for partial wildcards e.g. something like this:
'prefect.resource.id': 'tag-prefix:*',
'prefect.resource.role': 'tag',
Marvin
08/11/2025, 10:35 PMMarvin
08/11/2025, 10:38 PMprefect.tag.<tag-value>
.
- Wildcards are glob-style *
only. No regex, no ?
.
- You can pass a single string or a list of strings for prefect.resource.id
.
- prefect.resource.role
is just a single role name (e.g., tag
, flow-run
, deployment
, work-queue
, work-pool
).
So to match tags by prefix in match_related, do something like:
match_related:
prefect.resource.role: tag
prefect.resource.id:
- prefect.tag.tag-prefix:*
Examples seen in the wild
- Matching all flow runs:
match:
prefect.resource.id: prefect.flow-run.*
- Matching related tags exactly:
match_related:
prefect.resource.role: tag
prefect.resource.id:
- prefect.tag.prod-test
- prefect.tag.dev
- Matching related tags by prefix:
match_related:
prefect.resource.role: tag
prefect.resource.id: prefect.tag.env:prod-*
References
- Example configs showing wildcard use and match_related with tags: false-positive automation execution issue (see the JSON snippet)
- CLI output demonstrating wildcard on resource IDs: automation inspect PR (see YAML/JSON examples)
- Automations overview (general concepts): https://docs.prefect.io/latest/automations/
If you share the exact tag format you’re targeting, I can sanity-check the pattern. I do so love a good asterisk.