check_batch_job#

RETRIES_EXCEEDED_EXIT_CODE = 80#

Exit code used when task run retries exceed the maximum retries.

check_batch_job(job_arn: str, max_retries: int) int | State | bool[source]#

Check for exit code of an AWS Batch job.

If this task is running within a Prefect flow, it will use the task run context to get the current run count. While the run count is below the maximum number of retries, the task will continue to attempt to get the exit code, and can be called with a retry delay to periodically check the status of jobs.

If this task is not running within a Prefect flow, the max_retries parameters is ignored. Jobs that are still running will throw an exception.

Parameters:
  • job_arn – Job ARN.

  • max_retries – Maximum number of retries.

Returns:

Exit code if the job is complete, otherwise throws an exception.