% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/job.R
\name{job_status}
\alias{job_status}
\title{Check the current state of a DNAnexus job}
\usage{
job_status(job_id)
}
\arguments{
\item{job_id}{(character) Job ID returned by \code{extract_batch()},
e.g. \code{"job-XXXX"}.}
}
\value{
A named character string — the job state. Possible values:
\describe{
\item{\code{"idle"}}{Queued, waiting to be scheduled.}
\item{\code{"runnable"}}{Resources being allocated.}
\item{\code{"running"}}{Actively executing.}
\item{\code{"done"}}{Completed successfully.}
\item{\code{"failed"}}{Failed; see \code{attr(result, "failure_message")}.}
\item{\code{"terminated"}}{Manually terminated.}
}
}
\description{
Returns the current state of a job submitted by \code{extract_batch()}.
For failed jobs, the failure message is attached as an attribute.
}
\examples{
\dontrun{
job_id <- extract_batch(c(31, 53, 21022))
job_status(job_id)

s <- job_status(job_id)
if (s == "failed") cli::cli_inform(attr(s, "failure_message"))
}
}
