Description
Airflow currently sends notifications on DAG failures. This feature request is to apply the same behavior to DAG successes as well, as an option. The default could be set to False.
Use case / motivation
To ensure that the DAGs run as scheduled.
Related Issues
Thanks for opening your first issue here! Be sure to follow the issue template!
Users can use custom on_success_callback to achieve this behaviour:
from airflow.utils.email import send_email
def on_success_callback(context):
ti: TaskInstance = context["ti"]
dag_id = ti.dag_id
task_id = ti.task_id
msg = "DAG succeeded"
subject = f"Success {dag_id}.{task_id}"
send_email(to=EMAIL_LIST, subject=subject, html_content=msg)
Personally I prefer this generic approach - users can customise the subject, title and what ever they want to fit their needs.
Most helpful comment
Users can use custom
on_success_callbackto achieve this behaviour:Personally I prefer this generic approach - users can customise the subject, title and what ever they want to fit their needs.