You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Improve default task failure email template for readability and operational clarity #61667
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
This is noisy and not human-friendly for production operations.
What is proposed
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.
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.
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?
Activity
laurentpellegrino commentedon Feb 9, 2026
I’ve attached the template files I created. Feel free to reuse or adapt them if helpful.
email-html-content-template.html
email-subject-template.txt
sarth-akvaish commentedon Feb 9, 2026
Hi, I like to work on this. Thanks
jroachgolf84 commentedon Feb 9, 2026
@sarth-akvaish - feel free to create a PR for this issue!
Improve default task failure email template for readability
Improve default task failure email template for readability
Improve default task failure email template for readability
eladkal commentedon Mar 29, 2026
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.
Improve default task failure email template for readability
Improve default task failure email template for readability
Improve default task failure email template for readability
Improve SmtpNotifier default email templates for readability
ayushupadhyay22 commentedon Jul 17, 2026
Hi maintainers, I would like to work on this cleaner default task failure email template layout.
vaishn4vi commentedon Aug 14, 2026
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:
or are you open to adding new template variables/context if the current ones
aren't enough to build a clean message?
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?