Skip to main content
Version: 0.18.9

Connect GX Cloud and Airflow

In this quickstart, you'll learn how to use GX Cloud with Apache Airflow. You'll create a simple DAG that runs a Checkpoint that you have already set up in GX Cloud, and then trigger it through a local installation of an Airflow server.

Apache Airflow is an orchestration tool that allows you to schedule and monitor your data pipelines. For more information about Apache Airflow, see the Apache Airflow documentation.


Create a local Airflow project and set dependencies

  1. Open a terminal, navigate to the directory where you want to create your Airflow project, and then run the following code:

    Terminal input
    mkdir gx-cloud-airflow && cd gx-cloud-airflow

    After running the CLI, a new directory is created and you're taken to that directory.

  2. Start the Airflow Scheduler and Web Server

    airflow scheduler
    airflow webserver

    The scheduler manages task scheduling and the web server starts the UI for Airflow.

  3. Access Airflow UI:

    Once the web server is running, open a web browser and go to http://localhost:8080 (by default) to access the Airflow UI.

Create a DAG file for your GX Cloud Checkpoint

  1. Open a terminal, browse to the dags folder of your Airflow project, and then run the following code to create a new DAG named

    Terminal input
  2. Open the DAG file and add the following code:

    import os
    import great_expectations as gx
    from airflow import DAG
    from airflow.operators.python import PythonOperator
    from datetime import datetime

    # Replace <YOUR_ACCESS_TOKEN> and <YOUR_CLOUD_ORGANIZATION_ID> with your credentials.



    def run_gx_airflow():

    context = gx.get_context()
    checkpoint = context.get_checkpoint(name = CHECKPOINT_NAME)

    default_args = {
    'owner': 'airflow',
    'depends_on_past': False,
    'start_date': datetime(2023, 8, 9),

    gx_dag = DAG(
    schedule_interval= '0 0 * * *', # This is set to run daily at midnight. Adjust as needed.

    run_gx_task = PythonOperator(

  3. Save your changes and close the DAG file.

Run the DAG (Manually)

  1. Sign in to Airflow. The default username and password are admin.

  2. In the Actions column, click Trigger DAG for gx_airflow and confirm your DAG runs as expected.