PrefectHQ / prefect

Prefect is a workflow orchestration framework for building resilient data pipelines in Python.
https://prefect.io
Apache License 2.0
16.02k stars 1.57k forks source link

Adding Workspace and Account information to Jinja templating for Automations Notifications #8739

Open robfreedy opened 1 year ago

robfreedy commented 1 year ago

First check

Prefect Version

2.x

Describe the current behavior

According to the docs, there are currently four top level objects for the Jinja templating in Notifications: flow run flow deployment work queue

Describe the proposed behavior

Adding a top level object for workspace and account to be included in the Jinja templating for the body of notifications

Example Use

Something like this in the templating would be cool: Flow run {{ flow.name }}/{{ flow_run.name }} observed in state {{ flow_run.state.name }} at {{ flow_run.state.timestamp }} from {{workspace.slug_name}}

Additional context

Prefect Community thread for context:

https://prefect-community.slack.com/archives/CL09KU1K7/p1678206334118419

Thank you for raising @redsquare!!

bunchesofdonald commented 1 year ago

We do currently support account and workspace objects in the notification templates. Looks like we just need to update the documentation here.