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

   ### Description
   
   We propose an enhancement to TriggerDagRunOperator that would allow 
automatic clearing of failed task instances in a triggered DAG run if that DAG 
run previously failed.### 
   
   ### Use case/motivation
   
   ### Motivation
   When using TriggerDagRunOperator in synchronous mode (i.e., 
wait_for_completion=True), if the triggered child DAG fails (due to a failed 
task), the parent task also fails. However, when the operator is cleared in the 
UI (e.g., to retry), the associated failed child DAG run remains unchanged.
   
   As a result:
   - The retried TriggerDagRunOperator reuses the same failed DAG run,
   - The child DAG run is still in failed state → the operator fails again,
   - The user must manually clear failed tasks or the entire child DAG run.
   
   This creates unnecessary friction when using DAG chaining.
   
   
   ### Proposed solution:
   
   Introduce a new optional parameter:
   ```
   TriggerDagRunOperator(
       ...,
       auto_clear_failed_tasks=True
   )
   ```
   When set:
   - Upon execution (or possibly in the clear() method logic),
   - If a matching child DAG run exists and is in failed state,
   - All failed task instances (and optionally downstreams) in that DAG run are 
automatically cleared.
   
   This enables retrying the parent task to also retry the corresponding child 
DAG.
   
   ### Benefits
   - Smoother reprocessing of chained DAGs
   - Reduces manual intervention
   - Fits naturally with Airflow's existing retry model
   
   ### 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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to