gcloud alpha composer environments run Stay organized with collections Save and categorize content based on your preferences.
- NAME
- gcloud alpha composer environments run - run an Airflow sub-command remotely in a Cloud Composer environment
- SYNOPSIS
gcloud alpha composer environments run(ENVIRONMENT:--location=LOCATION)SUBCOMMAND[SUBCOMMAND_NESTED][GCLOUD_WIDE_FLAG …][--CMD_ARGS…]
- DESCRIPTION
(ALPHA)Executes an Airflow CLI sub-command remotely in anenvironment. If the sub-command takes flags, separate the environment name fromthe sub-command and its flags with ``--´´. This command waits forthe sub-command to complete; its exit code will match the sub-command's exitcode.Note: Airflow CLI sub-command syntax differs between Airflow 1 and Airflow 2.Refer to the Airflow CLI reference documentation for more details.
- EXAMPLES
- The following command in environments with Airflow 2:
gcloudalphacomposerenvironmentsrunmyenvdagstrigger--some_dag--run_id=foois equivalent to running the following command from a shell inside the
my-environmentenvironment:airflowdagstrigger--run_id=foosome_dagThe same command, but for environments with Airflow 1.10.14+:
gcloudalphacomposerenvironmentsrunmyenvtrigger_dag--some_dag--run_id=foois equivalent to running the following command from a shell inside the
my-environmentenvironment:airflowtrigger_dagsome_dag--run_id=fooThe following command (for environments with Airflow 1.10.14+):
gcloudalphacomposerenvironmentsrunmyenvdagslist
is equivalent to running the following command from a shell inside the
my-environmentenvironment:airflowdagslist
- POSITIONAL ARGUMENTS
- Environment resource - The environment in which to run an Airflow command. Thearguments in this group can be used to specify the attributes of this resource.(NOTE) Some attributes are not given arguments in this group but can be set inother ways.
To set the
projectattribute:- provide the argument
environmenton the command line with a fullyspecified name; - provide the argument
--projecton the command line; - set the property
core/project.
This must be specified.
ENVIRONMENT- ID of the environment or fully qualified identifier for the environment.
To set the
environmentattribute:- provide the argument
environmenton the command line.
This positional argument must be specified if any of the other arguments in thisgroup are specified.
- provide the argument
--location=LOCATION- Region where Composer environment runs or in which to create the environment.
To set the
locationattribute:- provide the argument
environmenton the command line with a fullyspecified name; - provide the argument
--locationon the command line; - set the property
composer/location.
- provide the argument
- provide the argument
SUBCOMMAND- The Airflow CLI subcommand to run. Available subcommands include (listed withAirflow versions that support): backfill [**, 2.0.0), clear [**, 2.0.0),connections [**, 3.2.0), dag_state [**, 2.0.0), dags [1.10.14, 3.2.0), db[2.3.0, 3.0.0), delete_dag [1.10.1, 2.0.0), kerberos [**, 3.2.0), kubernetes[2.1.4, 3.2.0), list-import-errors [**, 3.0.0), list_dag_runs [1.10.2, 2.0.0),list_dags [**, 2.0.0), list_tasks [**, 2.0.0), next_execution [1.10.2, 2.0.0),pause [**, 2.0.0), pool [**, 2.0.0), pools [1.10.14, 3.2.0), render [**, 2.0.0),roles [2.0.0, 3.2.0), run [**, 2.0.0), sync-perm [1.10.14, 3.2.0), sync_perm[1.10.2, 2.0.0), task_failed_deps [**, 2.0.0), task_state [**, 2.0.0), tasks[1.10.14, 3.2.0), test [**, 2.0.0), trigger_dag [**, 2.0.0), unpause [**,2.0.0), upgrade_check [1.10.15, 2.0.0), users [1.10.14, 3.2.0), variables [**,3.2.0), version [**, 3.2.0) (seehttps://airflow.apache.org/docs/apache-airflow/stable/cli-and-env-variables-ref.htmlfor more info).
- [
SUBCOMMAND_NESTED] - Additional subcommand in case it is nested. The following is a list of allowednested subcommands:
- db: check, trim
- all other subcommands: all nested subcommands are allowed
- [--
CMD_ARGS…] - Command line arguments to the subcommand.
The '--' argument must be specified between gcloud specific args on the left andCMD_ARGS on the right. Example:
gcloud alpha composer environments run myenv trigger_dag -- some_dag--run_id=foo
- Environment resource - The environment in which to run an Airflow command. Thearguments in this group can be used to specify the attributes of this resource.(NOTE) Some attributes are not given arguments in this group but can be set inother ways.
- GCLOUD WIDE FLAGS
- These flags are available to all commands:
--access-token-file,--account,--billing-project,--configuration,--flags-file,--flatten,--format,--help,--impersonate-service-account,--log-http,--project,--quiet,--trace-token,--user-output-enabled,--verbosity.Run
$gcloud helpfor details. - NOTES
- This command is currently in alpha and might change without notice. If thiscommand fails with API permission errors despite specifying the correct project,you might be trying to access an API with an invitation-only early accessallowlist. These variants are also available:
gcloudcomposerenvironmentsrungcloudbetacomposerenvironmentsrun
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-10-21 UTC.