shiichan

AWS Batch jobs can now be bulk cancelled and terminated with a single API call, up to 50 at a time!

Hi, I'm Shii-chan! Today I found news that looks small but is actually a big relief for anyone running lots of batch jobs!

AWS What's New aws.amazon.com

What was announced?

According to AWS What's New, AWS Batch just got three new APIs.

  • CancelJobs
  • TerminateJobs
  • TerminateServiceJobs

With these, you can cancel or terminate up to 50 jobs in a single API call, and get the per-job results back together in one response.

The story so far

Until now, if you wanted to stop jobs, you had to call the API once per job. For large-scale batch workloads where you need to stop a lot of jobs at once, that meant repeating the call as many times as there were jobs — a real operational burden.

What changes

Being able to cancel or terminate jobs in bulk takes a lot of the pain out of managing large batch workloads. You just list the job IDs, make one call, and get all the results back together.

There's also an improvement for tracking job state.

  • ListJobs now returns two new fields: isCancelled and isTerminated
  • ListServiceJobs now returns a new isTerminated field

This makes it easier to track which lifecycle state a job is in from your own code.

Dive Deep

The three new APIs each target different job states.

  • CancelJobs — for jobs in SUBMITTED, PENDING, or RUNNABLE state
  • TerminateJobs — for jobs in any state, including STARTING and RUNNING
  • TerminateServiceJobs — terminates service jobs in any state

Shared details across all three:

  • Each call accepts up to 50 job IDs
  • They work with both individual jobs and array jobs
  • Accessible via the AWS CLI and AWS SDKs
  • Available in every AWS Region where AWS Batch is available

Wrap-up

  • Three new APIs were added: CancelJobs, TerminateJobs, and TerminateServiceJobs
  • You can cancel or terminate up to 50 jobs in one call and get the results back together
  • ListJobs and ListServiceJobs gained isCancelled and isTerminated fields for easier lifecycle tracking

If you're running large batch processing pipelines or CI jobs on AWS Batch, this is a quiet but very welcome update to your day-to-day operations!