Trigger an Airflow DAG in Google Cloud Composer using gcloud command line tool

A code snippet showing how to trigger a DAG in Cloud Composer (managed Airflow) using the gcloud command line tool.

PROJECT="gcp-project-name"
LOCATION="us-central1"
ENVIRONMENT="composer-environment-name"

gcloud composer environments run $ENVIRONMENT \
    --location $LOCATION \
    --project $PROJECT \
    dags trigger -- dag_name \
    # if passing in custom json data to dag
    #--conf '{"process_date": "2025-04-24"}'

Send a Comment

Your email address will not be published.