1

i have some dependent dags (parent and child dags). How to i identify those dags are dependent , How to classify whether dag is dependent or not.

im using airflow version 2.4.0 How to get dependent dags details through airflow rest api.

Ref : How to Trigger a DAG on the success of a another DAG in Airflow using Python?

  • by depending you mean that you call "TriggerDagRunOperator" ? – ozs May 24 '23 at 07:46
  • yes im using TriggerDagRunOperator . – vbala vbala May 26 '23 at 10:16
  • from what i saw in the api, you can find dag that are calling other dags (without knowing the target dag_id), does it help ? i guess you are looking the info like about dag dependencies (like in the ui), but i counldn't find it in the api – ozs May 26 '23 at 11:27
  • yes . also if im having target dag id , how can i able to know dependency through rest api. – vbala vbala May 29 '23 at 07:22
  • "api/v1/dags/{dag_id}/tasks" and under "tasks" you can see "operator_name": "TriggerDagRunOperator" – ozs May 29 '23 at 07:44
  • yeah. Suppose if im having dag details , that dag was triggered by child Dag, how can i able to know that it was triggered by child dag through rest api . Through rest api , how can able to know that particular dag was triggered by some other dag . – vbala vbala May 29 '23 at 12:03
  • when you trigger the DAG using TriggerDagRunOperator you can set them both same run_id by: trigger_run_id="{{ run_id }}" , this way once you have the dag_run_id and dag candidate you can check via api/v1/dags/{dag_id}/dagRuns/{run_id} – ozs May 29 '23 at 20:30

0 Answers0