The six states
submitted— server accepted, not startedworking— actively processinginput-required— waiting on client for more infocompleted— done successfullycanceled— cancelled before completionfailed— terminal error
Advertisement
Valid transitions
submitted → working → completed
→ failed
→ input-required → working
→ canceled (anytime pre-completion)
Advertisement
Polling from client
while (true) {
var task = client.tasksGet(taskId);
if (task.status().state() == TaskState.COMPLETED) return task.artifacts();
if (task.status().isTerminal()) throw new TaskFailedException(task);
Thread.sleep(pollInterval(task));
}