<@ULVA73B9P> How do I access deployment parameters...
# ask-marvin
a
@Marvin How do I access deployment parameters to send in a Slack notification?
m
To access deployment parameters to send in a Slack notification, you can provide default parameter values in the
deployment.yaml
configuration. These parameters will be used for flow runs based on the deployment. Add them under the
parameters: {}
line in your
deployment.yaml
file as JSON key-value pairs, like so:
Copy code
yaml
parameters: {"name": "Marvin", "num": 42, "url": "<https://catfact.ninja/fact>"}
To use these parameters in notifications, you would need to pass them into the task or function where you configure your notification logic. If you have set up a Slack notification, you will require webhook credentials for your Slack and specify the channel to which the message will be sent. Configure notifications by going to the Notifications page in the Prefect UI and selecting Create Notification. Notifications can be triggered for specific run states and can be filtered by tags that apply to the flow runs. For more details, take a look at the documentation pages about Parameters in deployments and Setting up notifications.