StateJobInfo
TypeSignature
type StateJobInfo = {
attempt: number;
attemptAt: Date | null;
attemptBy: string | null;
attemptToken: string | null;
chainId: string;
chainIndex: number;
completedAt: Date | null;
completedBy: string | null;
continuedToId: string | null;
createdAt: Date;
id: string;
input: unknown;
lastAttemptAt: Date | null;
lastAttemptError: string | null;
output: unknown;
scheduledAt: Date;
status: StateJobStatus;
traceContext: string | null;
typeName: string;
};core/src/state-adapter/state-adapter.ts:15
A job row as a state adapter returns it, without its chain.
Properties
- attempt
numberNumber of processing attempts so far.
- attemptAt
Date|nullWhen the current attempt started, or
nullwhen the job is not running. - attemptBy
string|nullWorker that owns the current attempt, or
nullwhen the job is not running. - attemptToken
string|nullToken of the current attempt, which attempt-scoped writes must present.
- chainId
stringID of the chain the job belongs to, equal to the ID of the chain's head job.
- chainIndex
numberPosition in the chain, starting at 0 for the head.
- completedAt
Date|nullWhen the job completed, or
nullbefore. - completedBy
string|nullWorker that completed the job, or
nullfor a workerless completion or before. - continuedToId
string|nullID of the job it continued to, or
nullfor a terminal or not yet completed job. - createdAt
DateWhen the job was created.
- id
stringJob ID.
- input
unknownStored input.
- lastAttemptAt
Date|nullWhen the last failed or reclaimed attempt ended, or
nullbefore one. - lastAttemptError
string|nullSerialized error of the last failed or reclaimed attempt, or
nullbefore one. - output
unknownStored output of a terminally completed job, otherwise
null. - scheduledAt
DateWhen the job becomes eligible for processing.
- status
StateJobStatusCurrent status.
- traceContext
string|nullSerialized trace context of the job, for observability adapters.
- typeName
stringJob type name.