0

We have a DAG, call it A, which runs. When this DAG is finished we would like to have another DAG, call it B, triggered. We have gotten that to work with ExternalTaskSensor, but is there a way for B to read any of the xcom values from A?

I have tried to use

{{ task_instance.xcom_pull(dag_id='a dag_id', task_ids='a task_id', key='a key') }}

but that returns None, so I guess that is only meant to be used between tasks in the same DAG.

Tomas Jansson
  • 22,767
  • 13
  • 83
  • 137
  • With `TriggerDagRunOperator` you could *provide* your own context as seen here: https://stackoverflow.com/questions/50611039/scheduling-dag-runs-in-airflow – tobi6 May 31 '18 at 08:08
  • @tobi6 I noticed that, but then the dependencies would be in the opposite direction of what I would like. I don't want the upstream DAGs to know about the downstream DAGs. – Tomas Jansson May 31 '18 at 20:32
  • Is the `execution_date` the same for both the "A" and "B" processes? – joebeeson Jun 05 '18 at 14:20
  • Yes they were @joeb. I’ll give it another go to see if I did something wrong. – Tomas Jansson Jun 06 '18 at 12:07

0 Answers0