Access task result outside operator with airflow 2 taskflow api

Viewed 150

Is it possible to access a task result, which is a XCOM value, outside of an operator with the airflow 2 taskflow API? Example:

with airflow.DAG('plot_dag', schedule_interval=None, default_args=default_args) as dag:
    # collect a list of string with file paths
    file_list = collect_files()

    # now iterate over the cf list
    for cur_path file_list:
        plot_files(cur_path)

The collect_files task is the main entry task and builds the file list. The plot_files task shall run in parallel. I cannot access the real python list of the return value of collect_files(). It is of type XComArg. Is it possible to access the value at this point which is outside of an operator?

Regards Oli

0 Answers
Related