---
title: "POST /v1/{+parent}/automations"
method: POST
path: "/v1/{+parent}/automations"
tags: ["projects"]
---

# POST /v1/{+parent}/automations

`POST /v1/{+parent}/automations`

Creates a new Automation in a given project and location.

## Path parameters

- `parent` string, required

## Query parameters

- `automationId` string
- `requestId` string
- `validateOnly` boolean

## Request body

- Automation — An `Automation` resource in the Cloud Deploy API. An `Automation` enables the automation of manually driven actions for a Delivery Pipeline, which includes Release promotion among Targets, Rollout repair and Rollout deployment strategy advancement. The intention of Automation is to reduce manual intervention in the continuous delivery process.
  - `rules` AutomationRule[] — Required. List of Automation rules associated with the Automation resource. Must have at least one rule and limited to 250 rules per Delivery Pipeline. Note: the order of the rules here is not the same as the order of execution.
    - `promoteReleaseRule` PromoteReleaseRule — The `PromoteRelease` rule will automatically promote a release from the current target to a specified target.
      - `id` string — Required. ID of the rule. This id must be unique in the `Automation` resource to which this rule belongs. The format is `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`.
      - `wait` string, google-duration — Optional. How long the release need to be paused until being promoted to the next target.
      - `destinationPhase` string — Optional. The starting phase of the rollout created by this operation. Default to the first phase.
      - `condition` AutomationRuleCondition — `AutomationRuleCondition` contains conditions relevant to an `Automation` rule.
        - `timedPromoteReleaseCondition` TimedPromoteReleaseCondition — `TimedPromoteReleaseCondition` contains conditions specific to an Automation with a Timed Promote Release rule defined.
          - `nextPromotionTime` string, google-datetime — Output only. When the next scheduled promotion(s) will occur.
          - `targetsList` Targets[] — Output only. A list of targets involved in the upcoming timed promotion(s).
            - `sourceTargetId` string — Optional. The source target ID.
            - `destinationTargetId` string — Optional. The destination target ID.
        - `targetsPresentCondition` TargetsPresentCondition — `TargetsPresentCondition` contains information on any Targets referenced in the Delivery Pipeline that do not actually exist.
          - `status` boolean — True if there aren't any missing Targets.
          - `updateTime` string, google-datetime — Last time the condition was updated.
          - `missingTargets` string[] — The list of Target names that do not exist. For example, `projects/{project_id}/locations/{location_name}/targets/{target_name}`.
      - `destinationTargetId` string — Optional. The ID of the stage in the pipeline to which this `Release` is deploying. If unspecified, default it to the next stage in the promotion flow. The value of this field could be one of the following: * The last segment of a target name * "@next", the next target in the promotion sequence
    - `advanceRolloutRule` AdvanceRolloutRule — The `AdvanceRollout` automation rule will automatically advance a successful Rollout to the next phase.
      - `sourcePhases` string[] — Optional. Proceeds only after phase name matched any one in the list. This value must consist of lower-case letters, numbers, and hyphens, start with a letter and end with a letter or a number, and have a max length of 63 characters. In other words, it must match the following regex: `^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$`.
      - `condition` AutomationRuleCondition — `AutomationRuleCondition` contains conditions relevant to an `Automation` rule.
        - `timedPromoteReleaseCondition` TimedPromoteReleaseCondition — `TimedPromoteReleaseCondition` contains conditions specific to an Automation with a Timed Promote Release rule defined.
          - `nextPromotionTime` string, google-datetime — Output only. When the next scheduled promotion(s) will occur.
          - `targetsList` Targets[] — Output only. A list of targets involved in the upcoming timed promotion(s).
            - `sourceTargetId` string — Optional. The source target ID.
            - `destinationTargetId` string — Optional. The destination target ID.
        - `targetsPresentCondition` TargetsPresentCondition — `TargetsPresentCondition` contains information on any Targets referenced in the Delivery Pipeline that do not actually exist.
          - `status` boolean — True if there aren't any missing Targets.
          - `updateTime` string, google-datetime — Last time the condition was updated.
          - `missingTargets` string[] — The list of Target names that do not exist. For example, `projects/{project_id}/locations/{location_name}/targets/{target_name}`.
      - `id` string — Required. ID of the rule. This id must be unique in the `Automation` resource to which this rule belongs. The format is `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`.
      - `wait` string, google-duration — Optional. How long to wait after a rollout is finished.
    - `repairRolloutRule` RepairRolloutRule — The `RepairRolloutRule` automation rule will automatically repair a failed `Rollout`.
      - `condition` AutomationRuleCondition — `AutomationRuleCondition` contains conditions relevant to an `Automation` rule.
        - `timedPromoteReleaseCondition` TimedPromoteReleaseCondition — `TimedPromoteReleaseCondition` contains conditions specific to an Automation with a Timed Promote Release rule defined.
          - `nextPromotionTime` string, google-datetime — Output only. When the next scheduled promotion(s) will occur.
          - `targetsList` Targets[] — Output only. A list of targets involved in the upcoming timed promotion(s).
            - `sourceTargetId` string — Optional. The source target ID.
            - `destinationTargetId` string — Optional. The destination target ID.
        - `targetsPresentCondition` TargetsPresentCondition — `TargetsPresentCondition` contains information on any Targets referenced in the Delivery Pipeline that do not actually exist.
          - `status` boolean — True if there aren't any missing Targets.
          - `updateTime` string, google-datetime — Last time the condition was updated.
          - `missingTargets` string[] — The list of Target names that do not exist. For example, `projects/{project_id}/locations/{location_name}/targets/{target_name}`.
      - `phases` string[] — Optional. Phases within which jobs are subject to automatic repair actions on failure. Proceeds only after phase name matched any one in the list, or for all phases if unspecified. This value must consist of lower-case letters, numbers, and hyphens, start with a letter and end with a letter or a number, and have a max length of 63 characters. In other words, it must match the following regex: `^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$`.
      - `repairPhases` RepairPhaseConfig[] — Required. Defines the types of automatic repair phases for failed jobs.
        - `retry` Retry — Retries the failed job.
          - `attempts` string, int64 — Required. Total number of retries. Retry is skipped if set to 0; The minimum value is 1, and the maximum value is 10.
          - `wait` string, google-duration — Optional. How long to wait for the first retry. Default is 0, and the maximum value is 14d.
          - `backoffMode` 'BACKOFF_MODE_UNSPECIFIED' | 'BACKOFF_MODE_LINEAR' | 'BACKOFF_MODE_EXPONENTIAL' — Optional. The pattern of how wait time will be increased. Default is linear. Backoff mode will be ignored if `wait` is 0.
        - `rollback` Rollback — Rolls back a `Rollout`.
          - `destinationPhase` string — Optional. The starting phase ID for the `Rollout`. If unspecified, the `Rollout` will start in the stable phase.
          - `disableRollbackIfRolloutPending` boolean — Optional. If pending rollout exists on the target, the rollback operation will be aborted.
      - `id` string — Required. ID of the rule. This id must be unique in the `Automation` resource to which this rule belongs. The format is `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`.
      - `jobs` string[] — Optional. Jobs to repair. Proceeds only after job name matched any one in the list, or for all jobs if unspecified or empty. The phase that includes the job must match the phase ID specified in `source_phase`. This value must consist of lower-case letters, numbers, and hyphens, start with a letter and end with a letter or a number, and have a max length of 63 characters. In other words, it must match the following regex: `^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$`.
    - `timedPromoteReleaseRule` TimedPromoteReleaseRule — The `TimedPromoteReleaseRule` will automatically promote a release from the current target(s) to the specified target(s) on a configured schedule.
      - `destinationTargetId` string — Optional. The ID of the stage in the pipeline to which this `Release` is deploying. If unspecified, default it to the next stage in the promotion flow. The value of this field could be one of the following: * The last segment of a target name * "@next", the next target in the promotion sequence
      - `condition` AutomationRuleCondition — `AutomationRuleCondition` contains conditions relevant to an `Automation` rule.
        - `timedPromoteReleaseCondition` TimedPromoteReleaseCondition — `TimedPromoteReleaseCondition` contains conditions specific to an Automation with a Timed Promote Release rule defined.
          - `nextPromotionTime` string, google-datetime — Output only. When the next scheduled promotion(s) will occur.
          - `targetsList` Targets[] — Output only. A list of targets involved in the upcoming timed promotion(s).
            - `sourceTargetId` string — Optional. The source target ID.
            - `destinationTargetId` string — Optional. The destination target ID.
        - `targetsPresentCondition` TargetsPresentCondition — `TargetsPresentCondition` contains information on any Targets referenced in the Delivery Pipeline that do not actually exist.
          - `status` boolean — True if there aren't any missing Targets.
          - `updateTime` string, google-datetime — Last time the condition was updated.
          - `missingTargets` string[] — The list of Target names that do not exist. For example, `projects/{project_id}/locations/{location_name}/targets/{target_name}`.
      - `schedule` string — Required. Schedule in crontab format. e.g. "0 9 * * 1" for every Monday at 9am.
      - `destinationPhase` string — Optional. The starting phase of the rollout created by this rule. Default to the first phase.
      - `timeZone` string — Required. The time zone in IANA format [IANA Time Zone Database](https://www.iana.org/time-zones) (e.g. America/New_York).
      - `id` string — Required. ID of the rule. This ID must be unique in the `Automation` resource to which this rule belongs. The format is `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`.
  - `updateTime` string, google-datetime — Output only. Time at which the automation was updated.
  - `labels` object — Optional. Labels are attributes that can be set and used by both the user and by Cloud Deploy. Labels must meet the following constraints: * Keys and values can contain only lowercase letters, numeric characters, underscores, and dashes. * All characters must use UTF-8 encoding, and international characters are allowed. * Keys must start with a lowercase letter or international character. * Each resource is limited to a maximum of 64 labels. Both keys and values are additionally constrained to be <= 63 characters.
  - `selector` AutomationResourceSelector — AutomationResourceSelector contains the information to select the resources to which an Automation is going to be applied.
    - `targets` TargetAttribute[] — Optional. Contains attributes about a target.
      - `id` string — Optional. ID of the `Target`. The value of this field could be one of the following: * The last segment of a target name * "*", all targets in a location
      - `labels` object — Target labels.
  - `name` string — Output only. Name of the `Automation`. Format is `projects/{project}/locations/{location}/deliveryPipelines/{delivery_pipeline}/automations/{automation}`.
  - `createTime` string, google-datetime — Output only. Time at which the automation was created.
  - `annotations` object — Optional. User annotations. These attributes can only be set and used by the user, and not by Cloud Deploy. Annotations must meet the following constraints: * Annotations are key/value pairs. * Valid annotation keys have two segments: an optional prefix and name, separated by a slash (`/`). * The name segment is required and must be 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. * The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots(`.`), not longer than 253 characters in total, followed by a slash (`/`). See https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/#syntax-and-character-set for more details.
  - `uid` string — Output only. Unique identifier of the `Automation`.
  - `description` string — Optional. Description of the `Automation`. Max length is 255 characters.
  - `etag` string — Optional. The weak etag of the `Automation` resource. This checksum is computed by the server based on the value of other fields, and may be sent on update and delete requests to ensure the client has an up-to-date value before proceeding.
  - `suspended` boolean — Optional. When Suspended, automation is deactivated from execution.
  - `serviceAccount` string — Required. Email address of the user-managed IAM service account that creates Cloud Deploy release and rollout resources.

## Response `200`

Successful response

---

[API](https://skmtc.net/google/apis/clouddeploy.md) · [All operations](https://skmtc.net/google/apis/clouddeploy/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/google/clouddeploy/versions/a8819765974a/schema)
