close

How to add new DAGs to Airflow?

Hello Guys, How are you all? Hope You all Are Fine. Today We Are Going To learn about How to add new DAGs to Airflow in Python. So Here I am Explain to you all the possible Methods here.

Without wasting your time, Let’s start This Article.

Table of Contents

How to add new DAGs to Airflow?

  1. How to add new DAGs to Airflow?

    In my understanding, AIRFLOW_HOME should link to the directory where airflow.cfg is stored. Then, airflow.cfg can apply and set the dag directory to the value you put in it.

  2. add new DAGs to Airflow

    In my understanding, AIRFLOW_HOME should link to the directory where airflow.cfg is stored. Then, airflow.cfg can apply and set the dag directory to the value you put in it.

Method 1

I think the reason for this is because you haven’t exported AIRFLOW_HOME. Try doing: AIRFLOW_HOME="/home/alex/airflow/dags" airflow list_dags. If that’s not working than do two steps  export AIRFLOW_HOME="/home/alex/airflow/dags" airflow list_dags I believe this should work. Give it a go?

Method 2

In my understanding, AIRFLOW_HOME should link to the directory where airflow.cfg is stored. Then, airflow.cfg can apply and set the dag directory to the value you put in it.

The important point is : airflow.cfg is useless if your AIRFLOW_HOME is not set

Summery

It’s all About this issue. Hope all Methods helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which Method worked for you? Thank You.

Also, Read