Apache Airflow · Arazzo Workflow
Apache Airflow Diagnose a Failed DAG Run
Version 1.0.0
Isolate the failed task in a DAG run, pull its logs for the last attempt, and record the diagnosis as a note.
View Spec
View on GitHub
ApacheDAGData PipelineETLOpen SourceOrchestrationPythonSchedulingWorkflowArazzoWorkflows
Provider
Workflows
diagnose-failed-dag-run
Find the failed task in a DAG run, retrieve its log, and annotate the finding.
Confirms the run failed, lists failed task instances, reads the target task to resolve its latest try number, fetches the full log for that attempt, and writes a note onto the task instance and the DAG run.
1
confirmRunFailed
get_dag_run
Read the DAG run and require the failed state so the workflow is not run against a healthy pipeline.
2
listFailedTasks
get_task_instances
Filter the run's task instances to the failed and upstream_failed states. The state filter repeats to express an OR condition, so both the task that actually broke and the tasks blocked behind it come back in one call.
3
readFailedTaskInstance
get_task_instance
Read the target task instance to resolve the try_number of its most recent attempt, which the log endpoint requires as a path parameter.
4
fetchTaskLog
get_log
Pull the complete log for the failing attempt. full_content returns the whole log body rather than a paginated slice, which is what a diagnosis needs.
5
annotateTaskInstance
set_task_instance_note
Record the diagnosis on the task instance so it surfaces in the Airflow UI next to the failure itself.
6
annotateDagRun
set_dag_run_note
Record the same diagnosis on the DAG run so anyone scanning the run list sees why this run failed without drilling into a task.