Bryan
03/13/2024, 12:54 AMMarvin
03/13/2024, 12:54 AMuserid
from the event payload, you could use the following syntax in your automation configuration:
jinja
{{ event.payload.userid }}
This Jinja templating tells Prefect to take the userid
from the captured event and use it as a parameter value for the flow run. You can apply this method to any other values present in the JSON parseable payload of the event.
For more information on how to use payload values in triggers and set up automations using Prefect, you can refer to the following resources:
- Orchestrating Event-Driven Serverless Data Pipelines with Prefect, Pulumi & AWS
- Event-Driven Flows with PrefectBryan
03/13/2024, 12:58 AMMarvin
03/13/2024, 12:59 AM{{ event.payload.userid }}
in the "match" attribute directly. Instead, the "match" attribute of a trigger is used to define conditions which, when met, will cause the automation to fire. The conditions are based on the properties of the event or the state of the system.
However, you can use templating with event payload attributes in the actions of the automation to pass dynamic information to the flow run or other automation actions after the match conditions have triggered the automation. Templating allows you to access various properties, such as flow run tags, deployment name, or trigger event details, as documented in the Automations section of Prefect's documentation.
If you want to match against a specific payload attribute, you would define conditions within the "match" attribute based on the event's properties that Prefect provides. For dynamic templating and passing the payload values, you would use expressions like {{ event.payload.userid }}
in the action parameters that are configured to run once the automation is triggered.
For detailed instructions on setting up automations and using templating within Prefect, you may refer to Prefect's Automations documentation. Unfortunately, direct references to the exact usage of payload values in the "match" attribute of automation triggers are not provided in the documentation excerpts. However, the templating syntax provided could be similar for defining dynamic matches based on the payload. You might need to experiment or seek further clarification from Prefect's support or community forums.