While most services provide synchronous APIs that require you to make a request
and then wait for a response, [`BatchJobService`](https://developers.google.com/google-ads/api/reference/rpc/v26/BatchJobService) provides a
way to perform batches of operations on multiple services without synchronously
waiting for the operations to complete.

Unlike service-specific mutate operations, a single job in
[`BatchJobService`](https://developers.google.com/google-ads/api/reference/rpc/v26/BatchJobService) can operate against a mixed collection of
campaigns, ad groups, ads, criteria, labels, and assets. Submitted jobs run in
parallel, and [`BatchJobService`](https://developers.google.com/google-ads/api/reference/rpc/v26/BatchJobService) automatically retries
operations that fail due to transient errors such as rate limit errors. The
Google Ads API still counts each operation towards your
[daily operation limit](https://developers.google.com/google-ads/api/docs/api-policy/access-levels#access-levels), following the
[API operations](https://developers.google.com/google-ads/api/docs/api-policy/rate-sheet) counting instructions.

[`BatchJobService`](https://developers.google.com/google-ads/api/reference/rpc/v26/BatchJobService) also lets you use
[temporary IDs](https://developers.google.com/google-ads/api/docs/batch-processing/temporary-ids) within your requests so you can submit dependent
operations in a single job.

> [!NOTE]
> **Note:** Use of [`BatchJobService`](https://developers.google.com/google-ads/api/reference/rpc/v26/BatchJobService) can reduce the number of requests sent, but its use must be evaluated to see if it's a good fit for your needs. The main reasons for using batch processing are to minimize the number of API requests and retry operations that fail due to transient errors. This doesn't guarantee improved performance resulting in higher throughput or quicker job completion. Experiment with different combinations of batch and non-batch processing to determine the optimal solution for your circumstances.

## Operations

[`BatchJobService`](https://developers.google.com/google-ads/api/reference/rpc/v26/BatchJobService) supports all of the operations listed in
[`MutateOperation`](https://developers.google.com/google-ads/api/reference/rpc/v26/MutateOperation) whose underlying service supports
[partial failure](https://developers.google.com/google-ads/api/docs/best-practices/partial-failures), as well as
[`AssetGroupOperation`](https://developers.google.com/google-ads/api/reference/rpc/v26/AssetGroupOperation) and
[`AssetGroupListingGroupFilterOperation`](https://developers.google.com/google-ads/api/reference/rpc/v26/AssetGroupListingGroupFilterOperation), which are
explicitly exempted and executed (along with related interdependent operations)
in [atomic sub-batches](https://developers.google.com/google-ads/api/docs/batch-processing/best-practices#atomicity-in-batch-splitting).

Because the Google Ads API executes standard operations in a job with
[partial failure](https://developers.google.com/google-ads/api/docs/best-practices/partial-failures) enabled (except within
[atomic sub-batches](https://developers.google.com/google-ads/api/docs/batch-processing/best-practices#atomicity-in-batch-splitting)), if a job is canceled or
individual operations fail, operations that succeeded are *not* rolled back.

The following operations in [`MutateOperation`](https://developers.google.com/google-ads/api/reference/rpc/v26/MutateOperation) must be
[atomic](https://developers.google.com/google-ads/api/docs/mutating/bulk-mutate) and don't support partial failure, so they aren't
supported within batch jobs. Adding any of these operations to a batch job
returns a
[`MutateError.OPERATION_DOES_NOT_SUPPORT_PARTIAL_FAILURE`](https://developers.google.com/google-ads/api/reference/rpc/v26/MutateErrorEnum.MutateError#operation_does_not_support_partial_failure)
error (or an [`InternalError.INTERNAL_ERROR`](https://developers.google.com/google-ads/api/reference/rpc/v26/InternalErrorEnum.InternalError#internal_error) for
[`BookCampaignsOperation`](https://developers.google.com/google-ads/api/reference/rpc/v26/BookCampaignsOperation) and
[`QuoteCampaignsOperation`](https://developers.google.com/google-ads/api/reference/rpc/v26/QuoteCampaignsOperation)). Instead, execute them using
[`GoogleAdsService.Mutate`](https://developers.google.com/google-ads/api/reference/rpc/v26/GoogleAdsService/Mutate) with `partial_failure` set to
`false` (and `validate_only` set to `true` for
[`QuoteCampaignsOperation`](https://developers.google.com/google-ads/api/reference/rpc/v26/QuoteCampaignsOperation)).

### Unsupported operations in BatchJobService

- [`BookCampaignsOperation`](https://developers.google.com/google-ads/api/reference/rpc/v26/BookCampaignsOperation) (available in [`MutateOperation`](https://developers.google.com/google-ads/api/reference/rpc/v26/MutateOperation))
- [`CampaignConversionGoalOperation`](https://developers.google.com/google-ads/api/reference/rpc/v26/CampaignConversionGoalOperation)
- [`ConversionGoalCampaignConfigOperation`](https://developers.google.com/google-ads/api/reference/rpc/v26/ConversionGoalCampaignConfigOperation)
- [`CustomConversionGoalOperation`](https://developers.google.com/google-ads/api/reference/rpc/v26/CustomConversionGoalOperation)
- [`CustomerConversionGoalOperation`](https://developers.google.com/google-ads/api/reference/rpc/v26/CustomerConversionGoalOperation)
- [`CustomerOperation`](https://developers.google.com/google-ads/api/reference/rpc/v26/CustomerOperation)
- [`QuoteCampaignsOperation`](https://developers.google.com/google-ads/api/reference/rpc/v26/QuoteCampaignsOperation) (available in [`MutateOperation`](https://developers.google.com/google-ads/api/reference/rpc/v26/MutateOperation); requires `validate_only` set to `true`)