<@ULVA73B9P> can you help detail what sort of sele...
# ask-marvin
n
@Marvin can you help detail what sort of selection options are possible with automations in
match_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',
m
thought for 153.8 seconds
Short answer: yes—use glob-style wildcards with full resource IDs. Not regex. In Prefect 3.x, both match and match_related accept resource patterns with the “*” wildcard. Key points - Use full resource IDs in filters, not bare names. For tags, that’s
prefect.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:
Copy code
match_related:
  prefect.resource.role: tag
  prefect.resource.id:
    - prefect.tag.tag-prefix:*
Examples seen in the wild - Matching all flow runs:
Copy code
match:
  prefect.resource.id: prefect.flow-run.*
- Matching related tags exactly:
Copy code
match_related:
  prefect.resource.role: tag
  prefect.resource.id:
    - prefect.tag.prod-test
    - prefect.tag.dev
- Matching related tags by prefix:
Copy code
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.