Skip to content

process.status ^v3.2.0 ​

Returns the state of a process run started by process.execute.

js
process.status(jobId)

Parameters ​

ParameterTypeDescription
jobIdstringThe job id returned by process.execute.

Returns ​

object | null

The 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, waitingForUser or paused.
  • running (boolean): true while the process is still running.
  • success (boolean): true if the process finished, false if it was aborted, or null while 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, or null while it's running.
  • duration (number): the seconds the run took, or has taken so far.
  • cancelled (boolean): true if the run was cancelled.
  • killed (boolean): true if 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 12s
js
// 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");
}