Reputation: 517
I have one control dag which triggers two other dags. The two dags should run sequentially and not in parallel. I tried solving the problem like this:
TriggerDag (using BashOp) -> ExternalDagSensor -> TriggerDag (using BashOp) -> ExternalDagSensor.
My problem is that the triggered DAG does get a specific execution_date
(specific down to the seconds, not 00:00 for minutes and seconds). The DagSensor now uses the execution_time
of the control dag to poke for the dependent dag and so the sensor never gets triggered, as the dependent dag has a different execution_time
.
My questions:
Trigger->Sensor->Trigger->Sensor
pattern the right way to trigger DAGs sequentially?If yes: How do I get
a) either the execution_date
of the dependent DAG after it has been triggered by the controller DAG (can then be passed to the sensor as argument)
or
b) the execution_date
of the dependent DAG to be the same as the control DAG
If possible I do not want to query the metadata database to get the execution_time of the dependent DAG run.
Upvotes: 1
Views: 1683
Reputation: 614
There are a couple options that might be a bit simpler.
Upvotes: 2