My use-case is as follows:
Task A
is generatingdataset
using some input raw dataTask B
is running some code usingdataset
as inputTask C
is running some other code usingdataset
as input
The three tasks are scheduled to run daily, and Task B
and Task C
are scheduled to run enough time after Task A
, and simply fail if the input dataset has not been generated for some reason.
As a first improvement I added an ExternalTaskSensor
in both Task B
and Task C
, but this just avoids to run them if Task A
did not yet finished or failed.
However, ExternalTaskSensor
seems not to be working fine with backfilling (it is pretty fragile as it relies on execution date only, plus if Task A
is run again, Task B
and Task C
won't know).
Solution 1 (not applicable): I have seen this SO's question: In airflow, is there a good way to call another dag's task?
This is not ideal for me because I'd like to keep Task A
unaware of the dependent tasks, and handle the logic in Task B
and Task C
(or externally). Reason is that other tasks consuming the output of Task A
will be added in the future (from different teams across the organization), and it's not desirable to update Task A
each time.
Summary
I'd like to trigger Task B
and Task C
if and only if Task A
has been executed with success (independently if it has been scheduled or triggered manually), without modifying Task A
to achieve that.