Retry all failed jobs via API
You can now retry all failed jobs in a build with a single API call, matching the behavior of the "Retry Failed Jobs" button in the UI.
REST: POST /organizations/{org}/pipelines/{pipeline}/builds/{number}/retry_failed_jobs
GraphQL: buildRetryFailedJobs mutation
Both return the count of jobs queued for retry.
An optional filter parameter states lets you choose which job states to retry, so you can target exactly the failures that matter:
failed: Jobs that ran and exited with a non-zero statussoft_failed: Jobs that failed but were marked withsoft_fail— the build continues regardlessexpired: Jobs that weren't accepted by an agent before the timeougcanceled: Jobs that were manually or programmatically canceled before completing
By default, all failed states are retried. Pass a filter to narrow it — for example, retry only failed jobs without re-queuing dozens of soft failures that would just add pressure to your queue.
David
Start turning complexity into an advantage
Create an account to get started for free.