Is that possible to cancel pending BatchJob?

309 views
Skip to first unread message

Antoni Martyniuk

unread,
Feb 12, 2021, 4:27:50 PM2/12/21
to AdWords API and Google Ads API Forum
Looking at https://developers.google.com/google-ads/api/docs/batch-processing/flow#canceljob I've had impression that it's possible to cancel pending BatchJob but in fact it looks like it's not possible to call CancelOperation before job has been started (otherwise there is no LRO name).

Am I wrong?

As I see in v6 there was an option to remove pending BatchJob but it has been deprecated since then.

Google Ads API Forum Advisor Prod

unread,
Feb 15, 2021, 3:46:45 AM2/15/21
to a.mar...@directica.pl, adwor...@googlegroups.com

Hi Antoni,

Thank you for raising this to us.

According to this Usage flow (under Canceling a batch job section), there should be an existing/running batch job before actually cancelling it. Looking on the CancelOperationRequest, it should have a name of the operation resource to be cancelled.

As for this statement: "As I see in v6 there was an option to remove pending BatchJob but it has been deprecated since then.", could you provide more details on this?

Regards,

Google Logo
Mark Kevin Albios
Google Ads API Team
 


ref:_00D1U1174p._5004Q2CQXng:ref

Antoni Martyniuk

unread,
Feb 27, 2021, 10:42:43 PM2/27/21
to AdWords API and Google Ads API Forum
Thanks for response! So the proper behavior to discard a job that I'm not going to run (lets say it contains dangerous, faulty changes) is to simply leave it as is so it would be cleared on API side at some point. This "pending" jobs are still counted in quota, right? 

Google Ads API Forum Advisor Prod

unread,
Mar 1, 2021, 12:27:59 PM3/1/21
to a.mar...@directica.pl, adwor...@googlegroups.com

Hi Antoni,

Thank you for reaching out. You could cancel the unwanted operations by using the CancelOperation. The resource names could be obtained from the returned value while creating the new batch job. If you don’t explicitly run the created batch jobs, they will not be executed. The “pending” jobs would be counted in quota and if they are older than 7 days they would be automatically removed.

Thanks and regards,
Xiaoming, Google Ads API Team



Google Logo
Xiaoming
Google Ads API Team
 


ref:_00D1U1174p._5004Q2CQXng:ref

Antoni Martyniuk

unread,
Mar 2, 2021, 6:23:46 AM3/2/21
to AdWords API and Google Ads API Forum
Hm, I've tried calling CancelOperation agains BatchJob that haven't been started yet and it did not work. Do you mean I can run CancelOperation against operations inside my batch job?

Google Ads API Forum Advisor Prod

unread,
Mar 3, 2021, 10:55:46 AM3/3/21
to a.mar...@directica.pl, adwor...@googlegroups.com

Hi Antoni,

Thank you for reaching out. Only the job that has been started could be cancelled. Please follow this guide on how to cancel a batch job.



Thanks and regards,
Xiaoming, Google Ads API Team

 

Mohsin Khan

unread,
Aug 31, 2021, 8:21:27 AM8/31/21
to AdWords API and Google Ads API Forum
Hello Everyone,

can I get a code sample on how to cancel a running batch job (in PHP) because this (https://developers.google.com/google-ads/api/docs/batch-processing/flow#canceljob) guide is confusing to cancel a batch job. 

Google Ads API Forum Advisor

unread,
Sep 2, 2021, 10:23:18 AM9/2/21
to mohsi...@gosign.de, adwor...@googlegroups.com
Hello,

Unfortunately, we do not have an existing code sample in the general documentation. However, I would recommend reaching out to the PHP client library owners here for further assistance on this.

Regards,
Matt
Google Ads API Team

Google Logo
Matt
Google Ads API Team
 


ref:_00D1U1174p._5004Q2CQXng:ref
Reply all
Reply to author
Forward
0 new messages