Jason Wiener
12/28/2023, 4:34 PMMarvin
12/28/2023, 4:35 PMyaml
triggers:
- enabled: true
match:
prefect.resource.id: prefect.flow-run.*
expect:
- prefect.flow-run.Completed
match_related:
prefect.resource.name: prefect.flow.etl-flow
prefect.resource.role: flow
parameters:
param_1: "{{ event }}"
In this example, the trigger is enabled, and it is looking for a completed flow run (prefect.flow-run.Completed
) that is related to the specific flow resource by name and role. When this condition is met, the trigger initiates the subsequent deployment.
Please note that the specifics of how to configure the trigger could vary depending on the properties of the flow runs and the exact way you want to set up the triggering mechanism. It might involve details such as resource IDs, names, roles, and how to pass parameters.
Keep in mind that Automations and detailed trigger specifications as mentioned are available only in Prefect Cloud. If you have further specific questions about the setup or execution, feel free to ask!Jason Wiener
12/28/2023, 4:38 PMMarvin
12/28/2023, 4:39 PMmatch_related
values with a specific deployment in Prefect Automations. To do so, you should include the deployment's ID as part of the match_related
condition. Here's an example of what the syntax might look like when matching on specific deployments:
yaml
"match_related": {
"prefect.resource.id": [
"prefect.deployment.70cb25fe-e33d-4f96-b1bc-74aa4e50b761",
"prefect.deployment.c33b8eaa-1ba7-43c4-ac43-7904a9550611"
],
"prefect.resource.role": "deployment"
}
This configuration is used to match events related to particular deployments, as identified by their respective deployment IDs. Each key in match
and match_related
can accept a list of multiple values that are OR'd together, meaning the trigger will activate if any of the specified conditions are met.
Regarding the use of parameters for matching, it seems that parameters can be employed to pass event data into the subsequent action or deployment run, potentially for further decision-making or processing. For instance, parameters could be used to customize the behavior of the triggered deployment based on the attributes of the triggering event. Here's an excerpt of syntax that shows how parameters might be specified using the event data:
yaml
parameters: {
param_1: "{{ event }}"
}
In this case, param_1
is a parameter for the deployment action, and {{ event }}
represents the data from the triggering event that you would use within your deployment. The exact structure of the event and how its data is mapped to the parameters would depend on the specifics of the Automations being set up.
Please remember that these features are available only within Prefect Cloud, and the implementation details would vary based on your deployments and workflows. If you need more concrete examples or further assistance with setting up these Automations, I recommend referring to the official Prefect documentation or seeking assistance from their support community.