Already registered for dag errors

Hi. I keep getting the already registered for DAG error in Airflow. Possible reason for this I think that I pass the value returned from task1 to other tasks as output, as in the code below.

Since there are 9 tasks in a dag and it is constantly triggered, my log records are growing a lot. I need suggestions for this error or for using output. Thanks in advance.

Dag’s working logic is to run task1 once and use the returned values ​​in other tasks.

   task1 = PythonOperator(
        task_id="exampletask",
        provide_context = True,
        python_callable=python_fonk1()
    )

    task2 = PythonOperator(
        task_id="exampletask2",
        provide_context = True,
        op_args=[task1.output],
        python_callable=python_fonk2()
    )

Hi @mvltyldrm -

You’ll need to remove the () from your python_callable function name - only the name of the function is required, and if you need to pass arguments you can use the op_args field as you are doing here.

Take a look at our guide on the subject of passing data between tasks. You can utilize xcoms to pass data between tasks within the same DAG run.