Search code examples
airflowairflow-schedulergoogle-cloud-composerairflow-2.xairflow-api

How to get the list of DAGS and their scheduled time from cloud composer (airflow environment) in GCP?


I believe there can be a log for this, which stores all the dags and their respective data.
I need to have a list of dags with their schedule time, the expected code can be in any format, python or shell command.

Thanks.


Solution

  • To manually check the status of dags. You can follow these ways:

    1. To get the status of Dags from GCP you can use gcloud composer environments run command.

      Example:

      gcloud composer environments run environment_name --location 'location_name' dags state -- dag_id -- execution_date
      
    2. To get the status of Dags from Airflow CLI you can use dag state or dag list-runs command.

    3. You can get the current status of the dags from the Airflow UI:

      You can go to Browse -> Task Instances and apply “state” filter to get the status of the DAGS, you can also include filters like DAG ID.