1

So assume I have 2 SimpleHttpOperator tasks in my DAG. I need to get a response from the 1st task and use that response data to create params for the second task. Both are GET APIs.

How to get response data from simpleHttpOperator, I tried XCOM as true, but how to get data from XCOM into the second operator?

1 Answers1

0

If you take a look at the code for the SimpleHttpOperator on Github, you can see that the fields 'endpoint', 'data' and 'headers' are template_fields, so you can use Jinja templating.

There is an example of how to use xcoms in templating here and a description of Jinja templating here

I think this question has already been answered in Airflow - How to pass xcom variable into Python function

Christopher Beck
  • 735
  • 8
  • 19