<@ULVA73B9P> create a sample automation json to ma...
# ask-marvin
k
@Marvin create a sample automation json to match tag "a" OR any of tags "b", "c", "d"
m
To create an automation configuration that matches tag "a" OR any of tags "b", "c", "d", you need to define a trigger and action in Prefect Cloud. Below is a sample JSON configuration for such automation: { "name": "Automation for tags", "description": "Triggered for tag 'a' or any of tags 'b', 'c', 'd'", "triggers": [ { "type": "flow_run_state", "tags": ["a"] }, { "type": "flow_run_state", "tags": ["b", "c", "d"] } ], "actions": [ { "type": "start_flow_run", "flow_id": "your-flow-id" } ] } This sample JSON defines an automation that triggers when either tag "a" or any of the tags "b", "c", or "d" are present and starts a flow run. Adjust the
flow_id
and other parameters according to your actual requirements. For more details, you can refer to the Prefect documentation on automations: https://docs.prefect.io/latest/concepts/automations/
k
@Marvin change it so trigger is failed flow and the match related uses the tag conditions I specified
m
Here's the modified JSON configuration for an automation that triggers on a failed flow run and uses the tag conditions you specified: { "name": "Automation for Failed Flows with Tags", "description": "Triggered for failed flow runs with tag 'a' or any of tags 'b', 'c', 'd'", "triggers": [ { "type": "event", "match": { "prefect.flow-run.tag": ["a", "b", "c", "d"] }, "expect": ["prefect.flow-run.Failed"] } ], "actions": [ { "type": "start_flow_run", "flow_id": "your-flow-id" } ] } This configuration specifies an event trigger that watches for failed flow runs and matches flows that have any of the tags "a", "b", "c", or "d". Adjust the
flow_id
and other parameters to suit your specific needs. For further details, refer to the Prefect Automations documentation: https://docs.prefect.io/latest/concepts/automations/