You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "laurentpellegrino (via GitHub)" <gi...@apache.org> on 2026/02/09 11:28:22 UTC

[I] Improve default task failure email template for readability and operational clarity [airflow]

laurentpellegrino opened a new issue, #61667:
URL: https://github.com/apache/airflow/issues/61667

   ### Description
   
   The default Airflow task failure email is difficult to read and not optimized for operators.
   
   Currently the subject and body contain a raw Python object dump (UUIDs, repr(), internal fields), which makes it hard to quickly understand:
   
   - which DAG failed
   - which task failed
   - when it failed
   - where to click for logs
   
   <img width="1196" height="581" alt="Image" src="https://github.com/user-attachments/assets/827493f3-a812-4b0d-910f-10a1a64b13b4" />
   
   This is noisy and not human-friendly for production operations.
   
   # What is proposed
   
   <img width="1194" height="966" alt="Image" src="https://github.com/user-attachments/assets/b6e77ff8-cb17-4565-bbf5-cc68e4786196" />
   
   Replace the current default task failure email with a cleaner, human-readable template.
   
   Instead of exposing a raw Python object dump (UUIDs, internal fields, repr()), the email should present structured, actionable information: DAG, task, run ID, attempt, timestamps, host, and a direct link to logs.
   
   Provide a simple, modern HTML + text layout optimized for quick scanning and mobile readability, while keeping advanced/debug details optional.
   
   This change improves the out-of-the-box operator experience without requiring users to create custom templates, and remains fully backward compatible since templates can still be overridden.
   
   I’ve attached the template files I created. Feel free to reuse or adapt them if helpful.
   
   ### Use case/motivation
   
   In real deployments:
   
   - alerts are read quickly on mobile
   - operators need key info at a glance
   - long debug metadata is rarely useful in email
   - links to logs are more important than internal fields
   
   Today this requires fully custom templates to get a usable format.
   
   A better default template would improve UX out-of-the-box and reduce customization overhead.
   
   ### Related issues
   
   _No response_
   
   ### Are you willing to submit a PR?
   
   - [ ] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [x] I agree to follow this project's [Code of Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Improve default task failure email template for readability and operational clarity [airflow]

Posted by "jroachgolf84 (via GitHub)" <gi...@apache.org>.
jroachgolf84 commented on issue #61667:
URL: https://github.com/apache/airflow/issues/61667#issuecomment-3872356975

   @sarth-akvaish - feel free to create a PR for this issue!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Improve default task failure email template for readability and operational clarity [airflow]

Posted by "laurentpellegrino (via GitHub)" <gi...@apache.org>.
laurentpellegrino commented on issue #61667:
URL: https://github.com/apache/airflow/issues/61667#issuecomment-3871171229

   I’ve attached the template files I created. Feel free to reuse or adapt them if helpful.
   
   [email-html-content-template.html](https://github.com/user-attachments/files/25181699/email-html-content-template.html)
   [email-subject-template.txt](https://github.com/user-attachments/files/25181700/email-subject-template.txt)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Improve default task failure email template for readability and operational clarity [airflow]

Posted by "vaishn4vi (via GitHub)" <gi...@apache.org>.
vaishn4vi commented on issue #61667:
URL: https://github.com/apache/airflow/issues/61667#issuecomment-5296783388

   Hi! I'd like to pick this up as a contribution. From the issue, my understanding is
   the goal is to replace the raw object dump in the default failure email
   (subject + body) with something readable — clearly showing which DAG, which task,
   the failure time, and a direct link to the logs.
   
   A couple of scoping questions before I start:
   - Should this stay as the existing Jinja template (just rewritten for readability),
     or are you open to adding new template variables/context if the current ones
     aren't enough to build a clean message?
   - Is there a specific format/example you'd like the final email to roughly follow,
     or is this open-ended as long as it drops the raw repr() dump?
   
   Happy to open a PR once I'm clear on scope. Could I get assigned to this?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Improve default task failure email template for readability and operational clarity [airflow]

Posted by "eladkal (via GitHub)" <gi...@apache.org>.
eladkal commented on issue #61667:
URL: https://github.com/apache/airflow/issues/61667#issuecomment-4150564873

   Just to clarify for annyone who come across this issue. You can use any template you'd like with `SmtpNotifier(html_content=...)` regardless if Airflow changes the default template.
   It's very hard to find template that works for everyone.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Improve default task failure email template for readability and operational clarity [airflow]

Posted by "sarth-akvaish (via GitHub)" <gi...@apache.org>.
sarth-akvaish commented on issue #61667:
URL: https://github.com/apache/airflow/issues/61667#issuecomment-3871308907

   Hi, I like to work on this. Thanks


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Improve default task failure email template for readability and operational clarity [airflow]

Posted by "ayushupadhyay22 (via GitHub)" <gi...@apache.org>.
ayushupadhyay22 commented on issue #61667:
URL: https://github.com/apache/airflow/issues/61667#issuecomment-5001646645

   Hi maintainers, I would like to work on this cleaner default task failure email template layout.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org