Apache Airflow How to xcom_pull() value into a DAG?
You can't access the XCOM variable in your dag, it is only available in operators by supplying the provide_context=True
argument to the operators constructor.
In the case where you want to use data from an operator in your DAG structure itself, you would need to perform the actual task your operator is performing outisde of an operator.
def get_file_list():
hook = SomeHook()
hook.run('something to get file list')
dag = DAG('tutorial', default_args=default_args)
for file in get_file_list():
task = SomeOperator(params={'file': file}) # Do something with the file passed as a parameter