Skip to content

JobMethods

Methods available on job response objects. These are bound to the job data and delegate to the service.

Methods

getOutput()

getOutput(): Promise<null | Record<string, unknown>>

Gets the output of this job.

Retrieves the job's output arguments, handling both inline output (stored directly on the job as a JSON string in outputArguments) and file-based output (stored as a blob attachment for large outputs). Returns the parsed JSON output or null if the job has no output.

Returns

Promise<null | Record<string, unknown>>

Promise resolving to the parsed output as Record<string, unknown>, or null if no output exists

Example

const allJobs = await jobs.getAll();
const completedJob = allJobs.items.find(j => j.state === JobState.Successful);

if (completedJob) {
  const output = await completedJob.getOutput();
}