ignacioparicio opened a new issue, #72514: URL: https://github.com/apache/airflow/issues/72514
### Under which category would you file this issue? Providers ### Apache Airflow version `main` at `b3b62fa8cf`; the problem affects Airflow 3. ### What happened and how to reproduce it? On Airflow 3, `ExternalTaskSensor(check_existence=True)` cannot check whether an external task or task group exists. For example, if `external_task_id` contains a typo, the sensor keeps waiting until its timeout instead of reporting that the task does not exist. The same happens with a missing `external_task_group_id`. This can be reproduced by creating an `ExternalTaskSensor` with: - `check_existence=True` - a valid `external_dag_id` - an `external_task_id` that does not exist The sensor waits instead of raising `ExternalTaskNotFoundError`. Airflow 3 workers cannot read the metadata database or load Dag files directly. They ask the Execution API for task states instead. A response containing no task instances is ambiguous: the task might not exist, or the expected Dag run might not have been created yet. The related Dag-level fix checks only whether the external Dag exists and warns that individual tasks and task groups were not checked. ### What do you think should happen instead? `check_existence=True` should report a missing external task or task group without mistaking a missing Dag run for a missing task. The check also needs to use the Dag version associated with the run being awaited. If that run does not exist yet, the sensor should continue waiting rather than assume that the task is missing. The expected behavior should work both when the sensor waits itself and when it hands the wait to the triggerer. ### Apache Airflow Provider(s) standard ### Versions of Apache Airflow Providers `main` (`apache-airflow-providers-standard==1.17.0` at the time of reporting) ### Official Helm Chart version Not Applicable ### Anything else? #67832 explored separate task and task-group existence endpoints. It was closed after the problem of choosing the correct Dag version was raised. Acceptance criteria: - Missing external tasks and task groups can be distinguished from missing Dag runs. - The relevant Dag version is used. - Both ways of running the sensor are covered by tests. ### 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). --- Drafted-by: Codex (GPT-5); reviewed by @ignacioparicio before posting -- 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]
