Batch processing

  • BatchJobService allows performing batches of operations on multiple services without synchronously waiting for completion.

  • A single job can operate against a mixed collection of various Google Ads entities.

  • Submitted jobs run in parallel, and the service automatically retries operations that fail due to transient errors.

  • The service allows the use of temporary IDs for submitting dependent operations in a single job.

  • Operations in BatchJobService are executed with partial failure enabled, meaning successful operations are not rolled back if others fail.

While most services provide synchronous APIs that require you to make a request and then wait for a response, 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 can operate against a mixed collection of campaigns, ad groups, ads, criteria, labels, and assets. Submitted jobs run in parallel, and 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, following the API operations counting instructions.

BatchJobService also lets you use temporary IDs within your requests so you can submit dependent operations in a single job.

Operations

BatchJobService supports all of the operations listed in MutateOperation whose underlying service supports partial failure, as well as AssetGroupOperation and AssetGroupListingGroupFilterOperation, which are explicitly exempted and executed (along with related interdependent operations) in atomic sub-batches.

Because the Google Ads API executes standard operations in a job with partial failure enabled (except within atomic sub-batches), if a job is canceled or individual operations fail, operations that succeeded are not rolled back.

The following operations in MutateOperation must be atomic 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 error (or an InternalError.INTERNAL_ERROR for BookCampaignsOperation and QuoteCampaignsOperation). Instead, execute them using GoogleAdsService.Mutate with partial_failure set to false (and validate_only set to true for QuoteCampaignsOperation).

Unsupported operations in BatchJobService