apache / apache/airflow

Improve default task failure email template for readability and operational clarity

Open
#61,667 6 comments 0 reactions 0 assignees View on GitHub
area:providers good first issue kind:feature provider:smtp
Dominant language
Python
Stars
46.9k
Forks
17.8k
Avg merge
2d 9h
Merged PRs (30d)
472

Description

### 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

Image

This is noisy and not human-friendly for production operations.

### What is proposed

Image

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)

Contributor guide

Open the contributing guide

Research direction

The issue names no implementation files or tests; start by locating the current default task failure email template and its rendering entry point. Compare the attached layouts with the existing output and verify that the result presents the requested task details and log link in both HTML and text forms while preserving template overrides.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend, content
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.