<@ULVA73B9P> how can I add arbitrary variables to ...
# ask-marvin
k
@Marvin how can I add arbitrary variables to a flow deployment? For example, adding a link to a webpage with a runbook on what to do when the flow fails
m
To add arbitrary variables, such as a link to a webpage with a runbook, to a flow deployment in Prefect, you can make use of the parameters feature. Do the following: 1. Navigate to the details page for your deployment. 2. Select "Edit" from the commands menu. 3. Under the Parameters section, select "Custom" and provide the custom values for any editable deployment fields. This would let you include any necessary information or variables you want to be accessible during flow runs. Note that once you set a parameter value, it will be used for all future flow runs based on that deployment. For more detailed information, refer to the Prefect documentation on block-based deployments. Regarding handling flow failures: - Prefect Cloud has a feature called error summaries powered by Marvin AI to help you triage your failed runs quickly. To add a link to a runbook as a parameter or within your flow's logging mechanism, you could include the URL as a flow or task parameter, and ensure your flow's failure handling logic includes a task to log this parameter, making it visible for users to access when investigating a failed flow run. For a more detailed guide on handling failures, visit Prefect's blog on introducing error summaries.
k
For Parameters, can I add these during the Deployment.build_from_flow method instead of the UI
@Marvin For Parameters, can I add these during the Deployment.build_from_flow method instead of the UI
n
i think you could use the
description
field on deployments here - UI will render as markdown
k
Good note @Nate! I think I'm going to subclass Flow so we can auto add tags. Thinking we want some metadata {owner, priority}, and then a small hander that adds tags to the deployment based on the metadata