process.status ^v3.2.0
Returns the state of a process run started by process.execute.
js
process.status(jobId)Parameters
| Parameter | Type | Description |
|---|---|---|
jobId | string | The job id returned by process.execute. |
Returns
object | nullThe run's state, or null when the job can't be found. It has:
id(string): the job id.status(string):created,started,finished,aborted,waitingForUserorpaused.running(boolean):truewhile the process is still running.success(boolean):trueif the process finished,falseif it was aborted, ornullwhile it's running.modelId(string): the id of the model the process ran in.processId(string): the process's id.processName(string): the process's name.startTime(string): when the run started, as an ISO date.finishTime(string): when the run finished, as an ISO date, ornullwhile it's running.duration(number): the seconds the run took, or has taken so far.cancelled(boolean):trueif the run was cancelled.killed(boolean):trueif the run was killed.customStatus(string): the custom status set by the process.
Examples
js
const jobId = process.execute("yourProcess");
const job = process.status(jobId);
console.log(job.status + " in " + job.duration + "s");text
finished in 12sjs
// Start a process without waiting, then check on it later.
const jobId = process.execute("yourProcess", true);
// ...
if (process.status(jobId).running) {
console.log("Still running");
}