0

I have 3 tasks, A, B and C. I want to run task A only once, and then run task B monthly until end_date, then run task C only once to clean up.

This is similar to this question, but not applicable. How to handle different task intervals on a single Dag in airflow?

Thanks for your help

Dai Dao
  • 327
  • 1
  • 2
  • 8

1 Answers1

1

For task A that is supposed to run only once, you can take inspiration from here


As far as tasks B & C are concerned, they can be tied up with A using a ShortCircuitOperator (as already told in the link you cited)

                   -> B
                 /
A -> ShortCircuit
                 \
                   -> C

Alternatively, you could skip B and C internally using an AirflowSkipException

y2k-shubham
  • 10,183
  • 11
  • 55
  • 131
  • Much appreciated, this solves the problem quite beautifully. I had considered to break it into 2 independent DAGs and use Sensors to trigger a DAG when the other DAG is finished, but this solution is not as elegant. – Dai Dao Jul 17 '19 at 20:12