Mandatory Reference Routing
If relevant, call the associated reference file(s) before you take actions.
Refer to the table below to determine which reference file to retrieve in
different scenarios involving specific functions. [!IMPORTANT]: DO NOT GUESS
filenames. You MUST only use the exact paths provided below.
| Function/Use Case |
Required Reference File |
Capabilities & Intent Keywords |
| orchestration-pipelines schema |
references/orchestration-pipelines-schema.md |
orchestrate, generate, create, update |
How to use this skill
Orchestration pipelines require creating two files to ensure a complete and
deployable pipeline:
Orchestration File (e.g., orchestration-pipeline.yaml,
test-pipeline.yaml): Defines the pipeline's logic, tasks, and schedule.
IMPORTANT: Check if a deployment.yaml file exists and references an
existing orchestration file. If it does, you must update the existing
orchestration file (e.g.,test_pipeline.yaml) instead of creating a new
one. The filename can be customized but must be referenced in the
deployment.yaml file.
deployment.yaml: Defines the environment-specific configurations.(e.g.,
dev, prod). deployment.yamlshould only exists in the repository root
and must be named deployment.yaml
All files should always be maintained together. And all files should be
placed on the root of the workspace folder.
This skill is helpful to create or update configuration files to orchestrate
data pipelines.
How to use this skill
Step 1: Assess Orchestration Pipeline Status and Initialize if Necessary
Examine the repository's root directory for a deployment.yaml file.
Check for existing setup: The absence of deployment.yaml indicates
that orchestration has not been set up.
Determine if initialization is required: Initialization is required if
deployment.yaml is missing. you MUST run the init command in Step 3
to scaffold the project if deployment.yaml is missing. Do NOT create the
files manually.
Pipeline Name: If initialization is needed, ask the user for the
pipeline name. If user hasn't provided the orchestration pipeline name, name
should be "orchestration_pipeline"
Environment Name: If initialization is needed, you MUST ask the user for
the environment name. If the user does not provide it, use dev as the
default.
Execute Initialization: Once you have the pipeline name, run the
following command:
# Replace <ORCHESTRATION_PIPELINE_NAME> with the actual name
# Replace <ENV_NAME> with the actual environment name
gcloud beta orchestration-pipelines init <ORCHESTRATION_PIPELINE_NAME> --environment=<ENV_NAME>
Step 2: Review the orchestration pipeline code structure and syntax instruction
*** Pipeline Models (mapping to YAML)
[!IMPORTANT]
While the internal pipeline models are defined using protobuf (which typically
uses snake_case), the YAML configuration expects camelCase for almost
all field names.
Mapping Rule: Always convert snake_case proto fields (e.g.,
pipeline_id) to camelCase in YAML (e.g., pipelineId).
Orchestration-Pipelines yaml structure and syntax instruction
Reference to file references/orchestration-pipelines-schema.md.
Required Tags (Top-Level): You MUST add a tags field to the top-level
of the orchestration pipeline YAML definition. The value of this field depends
on the IDE environment:
- For Antigravity, use
["job:datacloud:antigravity"].
- For VS Code, use
["job:datacloud:vscode"].
- For Gemini CLI, use
["job:datacloud:gemini-cli"].
- For Claude Code, use
["job:datacloud:claude"].
- For Codex, use
["job:datacloud:codex"].
- For any other environment, use
["job:datacloud:other"].
Deployment yaml structure and syntax instruction.
Top-Level Structure: The root of the YAML should be an object with the
following fields:
environments (dictionary): A map where keys are environment names (e.g.,
'dev', 'prod', etc) and values are Environment objects.
Environment: Each environment object contains the following fields:
project (string): The Google Cloud Project ID.
region (string): The Google Cloud region (e.g., 'us-central1').
composer_environment (string): The Cloud Composer environment name.
artifact_storage
bucket (string): GCS bucket
path_prefix(string): prefix of path that we want to put in bucket
pipelines
- source (string): orchestration pipeline yaml file names. It can be
multiple
variables (dictionary, optional): Key-value pairs representing environment
variables. Values can be strings, numbers, or booleans.
[!TIP]
If the user doesn't provide specific paths for scripts, dbt projects, or GCP
details (Project ID, Region), use tools like find_by_name to search the
repository and gcloud commands (e.g., gcloud config get-value project) to
retrieve the necessary information.
Step 3: Generate the pipeline files
Before generating, check if an orchestration pipeline definition file and
deployment.yaml already exist in the current directory. If they do, inform
the user and ask if they want to update the existing files or create new
ones with different names. Do not overwrite without confirmation.
First, before creating the orchestration pipeline definition file, you
must first run the following command to get the list of available
dataproc environments for the user's project. This avoids using placeholder
values to run the jobs.
# Replace <PROJECT_ID> with the actual project_id
# Replace <REGION> with the actual region
gcloud dataproc clusters list \
--project <PROJECT_ID> \
--region <REGION> \
[!TIP]
Running the command without --format=yaml provides a clear, tabular
output that is easier to read.
Then use the returned dataproc list with details to create the orchestration
pipeline definition file based on the user's requirements for the pipeline's
logic and schedule. IMPORTANT: Every schedule must include an
endTime. Every schedule must use the current date as startTime if
the user hasn't specified.
[!IMPORTANT]
A Composer environment is not a Dataproc cluster. If no Dataproc clusters
are available, do not use a Composer environment for the
sparkHistoryServerConfig. It is better to omit this configuration if a
dedicated Spark History Server is not available.
If you want to schedule the python job, check the content of Python content
to determine if it's a spark job. If it is, use pyspark as type instead of
script as type.
Before creating or updating the deployment.yaml file, you must first
run the following command to get the list of available Composer environments
for the user's project.
# Replace <PROJECT_ID> with the actual project_id
# Replace <REGION> with the actual region
gcloud composer environments list \
--project <PROJECT_ID> \
--locations <REGION> \
After listing available Composer environments, you must check each
environment to ensure the composer is using the right image version or has
installed right PyPI packages. Run the following command for each
environment:
# Replace <ENVIRONMENT_NAME> with the Composer environment name
# Replace <REGION> with the region
gcloud composer environments describe <ENVIRONMENT_NAME> \
--location <REGION> \
--format="json(config.softwareConfig.imageVersion, config.softwareConfig.pypiPackages)"
From the output, select an environment where the imageVersion value is one
of is "composer-3-airflow-3.1.7-build.x, composer-3-airflow-2.11.1-build.x,
composer-3-airflow-2.10.5-build.x, composer-3-airflow-2.9.3-build.x,
composer-2.16.11-airflow-2.11.1, composer-2.16.11-airflow-2.10.5,
composer-2.16.11-airflow-2.9.3" or select an environment
whereorchestration-pipelines field is presented listed in the PyPI
packages. This ensures the selected environment is compatible with
orchestration pipelines.
Third, before generating the deployment.yaml file, you must ask the
user to provide the artifact_storage bucket name. Note that the
artifact_storage bucket is typically initialized as a placeholder (e.g.,
YOUR_BUCKET) by the init command in Step 1. You must identify any such
placeholders, ask the user for the actual bucket name, and then update the
deployment.yaml file with the provided value.
Use the returned composer list with details, along with the project ID,
region, and the bucket name provided by the user, to generate or update the
deployment.yaml file. When generating or updating the deployment.yaml
file, you must replace placeholders (e.g., "",
"", "", "") with the actual
retrieved and provided values. Additionally, you must remove any
associated # TODO: comments once the placeholders are replaced.
Ensure both files adhere to the code structures and syntax specified in this
document.
Renaming Pipelines: If requested to change the orchestration pipeline
name, you must rename the orchestration YAML file accordingly (e.g., from
dbt_clean_pipeline.yaml to new_name.yaml) and update the source field
within the pipelines list in deployment.yaml to match the new filename.
[!IMPORTANT]
Time Format: Do NOT include the Z suffix in startTime and endTime.
Use the format "YYYY-MM-DDTHH:MM:SS" (e.g., "2025-10-01T00:00:00").
Step 4: Validate the content (REQUIRED)
After creating or editing pipeline files, you MUST validate them using the
gcloud beta orchestration-pipelines validate command. you must: a. Read the
deployment.yaml file to identify all defined environments. b. Run the
validate command below for each environment found in deployment.yaml.
# Replace <ENV_NAME> with the identified environment name
gcloud beta orchestration-pipelines validate --environment=<ENV_NAME>
Step 5: Handle Validation Errors
Check the output of the validation command.
If the command returns an error or failure message:
- Read the error message carefully.
- Edit the orchestration and deployment files to fix the specific issue
mentioned.
Re-run the validation command to confirm the fix. Do not mark the task as
complete until the validation passes (exit code 0), and do not fall back to
create airflow dag in python if validation fails.
Declarative Pipeline Templates
When asked to generate or verify declarative pipeline files, ensure they follow
these compliant structures. Do not use the exact values below; adapt them to
the user's specific project, region, and environment details.
deployment.yaml Template - IMPORTANT FORMAT MUST MATCH-
environments:
<environment_name>: # e.g., dev, prod
project: <PROJECT_ID>
region: <REGION>
composer_environment: <COMPOSER_ENVIRONMENT_NAME>
gcs_bucket: "" # Optional
artifact_storage:
bucket: <ARTIFACT_BUCKET_NAME>
path_prefix: "<prefix>-" # e.g., namespace or username prefix
pipelines:
- source: '<orchestration-pipeline.yaml>' # e.g., list of pipeline yaml names
Step 6: Deploy the Orchestration Pipeline (Optional)
If requested to deploy the orchestration pipeline:
You MUST ask the user which environment to deploy to. If no environment name
is provided, list the available environments from deployment.yaml and ask
the user to choose one, defaulting to dev if it exists.
Read the orchestration YAML to extract the pipelineId.
Deploy with --local. This uploads the DAG without running it:
# Replace <ENV_NAME> with the target environment
# Replace <PIPELINE_SOURCE> with the orchestration YAML filename
gcloud beta orchestration-pipelines deploy \
--environment=<ENV_NAME> --local
Parse the deploy output to extract the bundle ID (version). The output
includes a line like: Pipeline deployment successful for version local-b32d15e307b5 The version string (e.g., local-b32d15e307b5) is the
bundle ID.
[!IMPORTANT]
--local deployments now default to --paused=true. The deployed DAG will be
visible in Airflow as a paused DAG without a schedule. It will not
auto-run. Use Step 7 to trigger it.
Step 7: Trigger the Orchestration Pipeline Run (Optional)
If requested to trigger/run the orchestration pipeline, you MUST follow the
Deploy → Poll → Trigger flow.
Ask for environment: You MUST ask the user which environment to use.
Default to dev if it exists in deployment.yaml.
Deploy first (Step 6): Always deploy before triggering to ensure the run
uses the latest code. Extract the bundle ID from deploy output and the
pipelineId from the orchestration YAML.
Poll for DAG readiness: Wait for the DAG to be registered in Composer.
# Initial delay: wait 30 seconds after deploy
sleep 30
# Poll every 15 seconds, up to 2 minutes total
# Replace <ENV_NAME>, <BUNDLE_ID> with actual values
gcloud beta orchestration-pipelines list \
--environment=<ENV_NAME> \
--bundle=<BUNDLE_ID>
The pipeline is ready when it appears in the list output. If it does not
appear after 2 minutes, report failure and advise the user to check YAML
validity.
Trigger the pipeline:
# Replace <ENV_NAME>, <BUNDLE_ID>, <PIPELINE_ID> with actual values
gcloud beta orchestration-pipelines trigger \
--environment=<ENV_NAME> \
--bundle=<BUNDLE_ID> \
--pipeline=<PIPELINE_ID>
Verify the run started:
gcloud beta orchestration-pipelines runs list \
--environment=<ENV_NAME> \
--bundle=<BUNDLE_ID> \
--pipeline=<PIPELINE_ID>
[!TIP]
Trigger-only (no deploy): If the user wants to trigger an already-deployed
pipeline, skip Step 6. Use gcloud beta orchestration-pipelines list --environment=<ENV_NAME> to find the bundle ID, then trigger directly with
Step 7.4.
[!IMPORTANT]
Fallback: If gcloud trigger fails, use the bundled script: Run script
with -- help to discover and learn the interface.
python scripts/trigger/airflow_trigger.py \ --project <PROJECT_ID>
--location <REGION> \ --environment <COMPOSER_ENV> --dag_id <PIPELINE_ID>
Get project, region, and composer_environment from deployment.yaml.
Definition of done
deployment.yaml file is created successfully.
- The orchestration pipeline file (e.g.,
orchestration_pipeline.yaml) is
created successfully, includes a mandatory endTime for every schedule, and
passes the validation command: gcloud beta orchestration-pipelines validate --environment=<ENV_NAME>
- If user requested to deploy the orchestration pipeline, the
gcloud beta orchestration-pipelines deploy --environment=<ENV_NAME> --local command
should return a success message with a version/bundle ID.
- If user requested to trigger/run the orchestration pipeline:
- Deploy succeeded (bundle ID extracted from output)
- DAG appeared in
gcloud beta orchestration-pipelines list within 2 min
gcloud beta orchestration-pipelines trigger returned success
- Run is visible in
gcloud beta orchestration-pipelines runs list
Other actions
If requested to pause/stop the orchestration pipeline, use
# Replace <ENV_NAME>, <BUNDLE_ID>, <PIPELINE_ID> with actual values
gcloud beta orchestration-pipelines pause \
--environment=<ENV_NAME> \
--bundle=<BUNDLE_ID> \
--pipeline=<PIPELINE_ID>
If requested to unpause/resume the orchestration pipeline, use
# Replace <ENV_NAME>, <BUNDLE_ID>, <PIPELINE_ID> with actual values
gcloud beta orchestration-pipelines unpause \
--environment=<ENV_NAME> \
--bundle=<BUNDLE_ID> \
--pipeline=<PIPELINE_ID>
1---2name: gcp-pipeline-orchestration3description: This skill helps the agent generate or update orchestration pipeline definitions for Google Cloud Composer to initialize orchestration pipeline or update the orchestration definition for orchestration of various data pipelines, like dbt pipelines, notebooks, Spark jobs, Dataform, Python scripts or inline BigQuery SQL queries. This skill also helps deploy and trigger orchestration pipelines.4license: Apache-2.05---67## Mandatory Reference Routing89If relevant, call the associated reference file(s) before you take actions.10Refer to the table below to determine which reference file to retrieve in11different scenarios involving specific functions. [!IMPORTANT]: DO NOT GUESS12filenames. You MUST only use the exact paths provided below.1314Function/Use Case | Required Reference File | Capabilities & Intent Keywords15---------------------------------- | ---------------------------------------------- | ------------------------------16**orchestration-pipelines schema** | `references/orchestration-pipelines-schema.md` | orchestrate, generate, create, update1718## How to use this skill1920Orchestration pipelines require creating two files to ensure a complete and21deployable pipeline:22231. `Orchestration File` (e.g., `orchestration-pipeline.yaml`,24 `test-pipeline.yaml`): Defines the pipeline's logic, tasks, and schedule.25 **IMPORTANT:** Check if a `deployment.yaml` file exists and references an26 existing orchestration file. If it does, you **must update the existing27 orchestration file** (e.g.,`test_pipeline.yaml`) instead of creating a new28 one. The filename can be customized but must be referenced in the29 `deployment.yaml` file.302. `deployment.yaml`: Defines the environment-specific configurations.(e.g.,31 `dev`, `prod`). `deployment.yaml`should only exists in the repository root32 and must be named `deployment.yaml`3334- All files should always be maintained together. And all files should be35 placed on the root of the workspace folder.3637- This skill is helpful to create or update configuration files to orchestrate38 data pipelines.3940## How to use this skill4142### Step 1: Assess Orchestration Pipeline Status and Initialize if Necessary4344Examine the repository's root directory for a `deployment.yaml` file.45461. **Check for existing setup**: The absence of `deployment.yaml` indicates47 that orchestration has not been set up.482. **Determine if initialization is required**: Initialization is required if49 `deployment.yaml` is missing. you **MUST** run the `init` command in Step 350 to scaffold the project if `deployment.yaml` is missing. Do NOT create the51 files manually.523. **Pipeline Name**: If initialization is needed, ask the user for the53 pipeline name. If user hasn't provided the orchestration pipeline name, name54 should be "orchestration_pipeline"554. **Environment Name**: If initialization is needed, you MUST ask the user for56 the environment name. If the user does not provide it, use **dev** as the57 default.58595. **Execute Initialization**: Once you have the pipeline name, run the60 following command:6162```63# Replace <ORCHESTRATION_PIPELINE_NAME> with the actual name64# Replace <ENV_NAME> with the actual environment name65gcloud beta orchestration-pipelines init <ORCHESTRATION_PIPELINE_NAME> --environment=<ENV_NAME>66```6768### Step 2: Review the orchestration pipeline code structure and syntax instruction6970*** Pipeline Models (mapping to YAML)7172> [!IMPORTANT]73>74> While the internal pipeline models are defined using protobuf (which typically75> uses `snake_case`), the **YAML configuration expects `camelCase`** for almost76> all field names.77>78> **Mapping Rule:** Always convert `snake_case` proto fields (e.g.,79> `pipeline_id`) to `camelCase` in YAML (e.g., `pipelineId`).8081#### Orchestration-Pipelines yaml structure and syntax instruction8283Reference to file `references/orchestration-pipelines-schema.md`.8485**Required Tags (Top-Level)**: You **MUST** add a `tags` field to the top-level86of the orchestration pipeline YAML definition. The value of this field depends87on the IDE environment:8889- For Antigravity, use `["job:datacloud:antigravity"]`.90- For VS Code, use `["job:datacloud:vscode"]`.91- For Gemini CLI, use `["job:datacloud:gemini-cli"]`.92- For Claude Code, use `["job:datacloud:claude"]`.93- For Codex, use `["job:datacloud:codex"]`.94- For any other environment, use `["job:datacloud:other"]`.9596#### Deployment yaml structure and syntax instruction.9798**Top-Level Structure:** The root of the YAML should be an object with the99following fields:100101- `environments` (dictionary): A map where keys are environment names (e.g.,102 'dev', 'prod', etc) and values are Environment objects.103104**Environment:** Each environment object contains the following fields:105106- `project` (string): The Google Cloud Project ID.107- `region` (string): The Google Cloud region (e.g., 'us-central1').108- `composer_environment` (string): The Cloud Composer environment name.109- `artifact_storage`110 - `bucket` (string): GCS bucket111 - `path_prefix`(string): prefix of path that we want to put in bucket112- `pipelines`113 - `- source` (string): orchestration pipeline yaml file names. It can be114 multiple115- `variables` (dictionary, optional): Key-value pairs representing environment116 variables. Values can be strings, numbers, or booleans.117118> [!TIP]119>120> If the user doesn't provide specific paths for scripts, dbt projects, or GCP121> details (Project ID, Region), use tools like `find_by_name` to search the122> repository and `gcloud` commands (e.g., `gcloud config get-value project`) to123> retrieve the necessary information.124125### Step 3: Generate the pipeline files126127- Before generating, check if an orchestration pipeline definition file and128 `deployment.yaml` already exist in the current directory. If they do, inform129 the user and ask if they want to update the existing files or create new130 ones with different names. Do not overwrite without confirmation.131132- First, before creating the orchestration pipeline definition file, you133 **must** first run the following command to get the list of available134 dataproc environments for the user's project. This avoids using placeholder135 values to run the jobs.136137 ```138 # Replace <PROJECT_ID> with the actual project_id139 # Replace <REGION> with the actual region140 gcloud dataproc clusters list \141 --project <PROJECT_ID> \142 --region <REGION> \143 ```144145 > [!TIP]146 >147 > Running the command without `--format=yaml` provides a clear, tabular148 > output that is easier to read.149150- Then use the returned dataproc list with details to create the orchestration151 pipeline definition file based on the user's requirements for the pipeline's152 logic and schedule. **IMPORTANT:** Every schedule **must** include an153 `endTime`. Every schedule **must** use the current date as `startTime` if154 the user hasn't specified.155156 > [!IMPORTANT]157 >158 > A Composer environment is not a Dataproc cluster. If no Dataproc clusters159 > are available, do not use a Composer environment for the160 > `sparkHistoryServerConfig`. It is better to omit this configuration if a161 > dedicated Spark History Server is not available.162163- If you want to schedule the python job, check the content of Python content164 to determine if it's a spark job. If it is, use `pyspark` as type instead of165 script as type.166167- Before creating or updating the `deployment.yaml` file, you **must** first168 run the following command to get the list of available Composer environments169 for the user's project.170171 ```172 # Replace <PROJECT_ID> with the actual project_id173 # Replace <REGION> with the actual region174 gcloud composer environments list \175 --project <PROJECT_ID> \176 --locations <REGION> \177 ```178179 After listing available Composer environments, you **must** check each180 environment to ensure the composer is using the right image version or has181 installed right PyPI packages. Run the following command for each182 environment:183184 ```185 # Replace <ENVIRONMENT_NAME> with the Composer environment name186 # Replace <REGION> with the region187 gcloud composer environments describe <ENVIRONMENT_NAME> \188 --location <REGION> \189 --format="json(config.softwareConfig.imageVersion, config.softwareConfig.pypiPackages)"190 ```191192 From the output, select an environment where the imageVersion value is one193 of is "composer-3-airflow-3.1.7-build.x, composer-3-airflow-2.11.1-build.x,194 composer-3-airflow-2.10.5-build.x, composer-3-airflow-2.9.3-build.x,195 composer-2.16.11-airflow-2.11.1, composer-2.16.11-airflow-2.10.5,196 composer-2.16.11-airflow-2.9.3" or select an environment197 where`orchestration-pipelines` field is presented listed in the PyPI198 packages. This ensures the selected environment is compatible with199 orchestration pipelines.200201- Third, before generating the `deployment.yaml` file, you **must ask the202 user** to provide the `artifact_storage` bucket name. Note that the203 `artifact_storage` bucket is typically initialized as a placeholder (e.g.,204 `YOUR_BUCKET`) by the `init` command in Step 1. You must identify any such205 placeholders, ask the user for the actual bucket name, and then update the206 `deployment.yaml` file with the provided value.207208 Use the returned composer list with details, along with the project ID,209 region, and the bucket name provided by the user, to generate or update the210 `deployment.yaml` file. When generating or updating the `deployment.yaml`211 file, you **must** replace placeholders (e.g., "<YOUR_PROJECT_ID>",212 "<YOUR_REGION>", "<YOUR_COMPOSER>", "<YOUR_BUCKET>") with the actual213 retrieved and provided values. Additionally, you **must** remove any214 associated `# TODO:` comments once the placeholders are replaced.215216- Ensure both files adhere to the code structures and syntax specified in this217 document.218219- **Renaming Pipelines**: If requested to change the orchestration pipeline220 name, you must rename the orchestration YAML file accordingly (e.g., from221 `dbt_clean_pipeline.yaml` to `new_name.yaml`) and update the `source` field222 within the `pipelines` list in `deployment.yaml` to match the new filename.223224> [!IMPORTANT]225>226> **Time Format**: Do NOT include the `Z` suffix in `startTime` and `endTime`.227> Use the format `"YYYY-MM-DDTHH:MM:SS"` (e.g., `"2025-10-01T00:00:00"`).228229### Step 4: Validate the content (REQUIRED)230231After creating or editing pipeline files, you **MUST** validate them using the232`gcloud beta orchestration-pipelines validate` command. you must: a. Read the233`deployment.yaml` file to identify all defined environments. b. Run the234`validate` command below for **each** environment found in `deployment.yaml`.235236```237# Replace <ENV_NAME> with the identified environment name238gcloud beta orchestration-pipelines validate --environment=<ENV_NAME>239```240241### Step 5: Handle Validation Errors2422431. Check the output of the validation command.2442452. If the command returns an error or failure message:246247 - Read the error message carefully.248 - Edit the orchestration and deployment files to fix the specific issue249 mentioned.2502513. Re-run the validation command to confirm the fix. Do not mark the task as252 complete until the validation passes (exit code 0), and do not fall back to253 create airflow dag in python if validation fails.254255## Declarative Pipeline Templates256257When asked to generate or verify declarative pipeline files, ensure they follow258these compliant structures. **Do not use the exact values below; adapt them to259the user's specific project, region, and environment details.**260261### `deployment.yaml` Template - IMPORTANT FORMAT MUST MATCH-262263```yaml264environments:265 <environment_name>: # e.g., dev, prod266 project: <PROJECT_ID>267 region: <REGION>268 composer_environment: <COMPOSER_ENVIRONMENT_NAME>269 gcs_bucket: "" # Optional270 artifact_storage:271 bucket: <ARTIFACT_BUCKET_NAME>272 path_prefix: "<prefix>-" # e.g., namespace or username prefix273 pipelines:274 - source: '<orchestration-pipeline.yaml>' # e.g., list of pipeline yaml names275```276277### Step 6: Deploy the Orchestration Pipeline (Optional)278279If requested to **deploy** the orchestration pipeline:2802811. You MUST ask the user which environment to deploy to. If no environment name282 is provided, list the available environments from `deployment.yaml` and ask283 the user to choose one, defaulting to `dev` if it exists.2842852. Read the orchestration YAML to extract the `pipelineId`.2862873. Deploy with `--local`. This uploads the DAG without running it:288289 ```290 # Replace <ENV_NAME> with the target environment291 # Replace <PIPELINE_SOURCE> with the orchestration YAML filename292 gcloud beta orchestration-pipelines deploy \293 --environment=<ENV_NAME> --local294 ```2952964. Parse the deploy output to extract the **bundle ID** (version). The output297 includes a line like: `Pipeline deployment successful for version298 local-b32d15e307b5` The version string (e.g., `local-b32d15e307b5`) is the299 bundle ID.300301> [!IMPORTANT]302>303> `--local` deployments now default to `--paused=true`. The deployed DAG will be304> visible in Airflow as a paused DAG without a schedule. It will **not**305> auto-run. Use Step 7 to trigger it.306307### Step 7: Trigger the Orchestration Pipeline Run (Optional)308309If requested to **trigger/run** the orchestration pipeline, you MUST follow the310Deploy → Poll → Trigger flow.3113121. **Ask for environment**: You MUST ask the user which environment to use.313 Default to `dev` if it exists in `deployment.yaml`.3143152. **Deploy first** (Step 6): Always deploy before triggering to ensure the run316 uses the latest code. Extract the `bundle ID` from deploy output and the317 `pipelineId` from the orchestration YAML.3183193. **Poll for DAG readiness**: Wait for the DAG to be registered in Composer.320321 ```bash322 # Initial delay: wait 30 seconds after deploy323 sleep 30324325 # Poll every 15 seconds, up to 2 minutes total326 # Replace <ENV_NAME>, <BUNDLE_ID> with actual values327328 gcloud beta orchestration-pipelines list \329 --environment=<ENV_NAME> \330 --bundle=<BUNDLE_ID>331 ```332333 The pipeline is ready when it appears in the list output. If it does not334 appear after 2 minutes, report failure and advise the user to check YAML335 validity.3363374. **Trigger the pipeline**:338339 ```340 # Replace <ENV_NAME>, <BUNDLE_ID>, <PIPELINE_ID> with actual values341 gcloud beta orchestration-pipelines trigger \342 --environment=<ENV_NAME> \343 --bundle=<BUNDLE_ID> \344 --pipeline=<PIPELINE_ID>345 ```3463475. **Verify the run started**:348349 ```350 gcloud beta orchestration-pipelines runs list \351 --environment=<ENV_NAME> \352 --bundle=<BUNDLE_ID> \353 --pipeline=<PIPELINE_ID>354 ```355356> [!TIP]357>358> **Trigger-only (no deploy):** If the user wants to trigger an already-deployed359> pipeline, skip Step 6. Use `gcloud beta orchestration-pipelines list360> --environment=<ENV_NAME>` to find the bundle ID, then trigger directly with361> Step 7.4.362363> [!IMPORTANT]364>365> **Fallback:** If `gcloud trigger` fails, use the bundled script: Run script366> with -- help to discover and learn the interface.367>368> ```369> python scripts/trigger/airflow_trigger.py \ --project <PROJECT_ID>370> --location <REGION> \ --environment <COMPOSER_ENV> --dag_id <PIPELINE_ID>371> ```372>373> Get `project`, `region`, and `composer_environment` from `deployment.yaml`.374375## Definition of done376377- `deployment.yaml` file is created successfully.378- The orchestration pipeline file (e.g., `orchestration_pipeline.yaml`) is379 created successfully, includes a mandatory `endTime` for every schedule, and380 passes the validation command: `gcloud beta orchestration-pipelines validate381 --environment=<ENV_NAME>`382- If user requested to **deploy** the orchestration pipeline, the `gcloud beta383 orchestration-pipelines deploy --environment=<ENV_NAME> --local` command384 should return a success message with a version/bundle ID.385- If user requested to **trigger/run** the orchestration pipeline:386 1. Deploy succeeded (bundle ID extracted from output)387 2. DAG appeared in `gcloud beta orchestration-pipelines list` within 2 min388 3. `gcloud beta orchestration-pipelines trigger` returned success389 4. Run is visible in `gcloud beta orchestration-pipelines runs list`390391## Other actions392393If requested to pause/stop the orchestration pipeline, use394395```bash396 # Replace <ENV_NAME>, <BUNDLE_ID>, <PIPELINE_ID> with actual values397 gcloud beta orchestration-pipelines pause \398 --environment=<ENV_NAME> \399 --bundle=<BUNDLE_ID> \400 --pipeline=<PIPELINE_ID>401```402403If requested to unpause/resume the orchestration pipeline, use404405```bash406 # Replace <ENV_NAME>, <BUNDLE_ID>, <PIPELINE_ID> with actual values407 gcloud beta orchestration-pipelines unpause \408 --environment=<ENV_NAME> \409 --bundle=<BUNDLE_ID> \410 --pipeline=<PIPELINE_ID>411```