Skip to main content

Interface: JobAPI

User-facing API for a single configured job.

Methods

cancelRun()

cancelRun(runId: number): Promise<ExecutionResult<void>>;

Cancel a specific run.

Parameters

ParameterType
runIdnumber

Returns

Promise<ExecutionResult<void>>


getJob()

getJob(): Promise<ExecutionResult<Job>>;

Get the job definition.

Returns

Promise<ExecutionResult<Job>>


getRun()

getRun(runId: number): Promise<ExecutionResult<Run>>;

Get a specific run by ID.

Parameters

ParameterType
runIdnumber

Returns

Promise<ExecutionResult<Run>>


getRunOutput()

getRunOutput(runId: number): Promise<ExecutionResult<RunOutput>>;

Get output of a specific run.

Parameters

ParameterType
runIdnumber

Returns

Promise<ExecutionResult<RunOutput>>


lastRun()

lastRun(): Promise<ExecutionResult<BaseRun | undefined>>;

Get the most recent run for this job.

Returns

Promise<ExecutionResult<BaseRun | undefined>>


listRuns()

listRuns(options?: {
limit?: number;
}): Promise<ExecutionResult<BaseRun[]>>;

List runs for this job.

Parameters

ParameterType
options?{ limit?: number; }
options.limit?number

Returns

Promise<ExecutionResult<BaseRun[]>>


runAndWait()

runAndWait(params?: Record<string, unknown>, signal?: AbortSignal): AsyncGenerator<JobRunStatus, void, unknown>;

Trigger and poll until completion, yielding status updates.

Parameters

ParameterType
params?Record<string, unknown>
signal?AbortSignal

Returns

AsyncGenerator<JobRunStatus, void, unknown>


runNow()

runNow(params?: Record<string, unknown>): Promise<ExecutionResult<RunNowResponse>>;

Trigger the configured job with validated params. Returns the run response.

Parameters

ParameterType
params?Record<string, unknown>

Returns

Promise<ExecutionResult<RunNowResponse>>