Skip to content

js-bao-wss-client


js-bao-wss-client / WorkflowRun

Interface: WorkflowRun ​

A workflow run record

Properties ​

contextDocId? ​

optional contextDocId?: string


createCallDurationMs? ​

optional createCallDurationMs?: number | null

Wall-clock ms the server spent on the run-creation call itself. null for runs started via a path that does not record it.


endedAt? ​

optional endedAt?: string


errorCode? ​

optional errorCode?: WorkflowRunErrorCode | null

Platform classification of the failure, from a closed set the server owns — "LOCK_CONTENTION" when this run lost a declarative-lock race under onContention: "fail", "LOCK_TIMEOUT" when it exhausted an onContention: "block" budget. null for a run that did not fail and for a failure the platform did not classify (every failure that predates the codes). Branch on this rather than on errorMessage text.


errorMessage? ​

optional errorMessage?: string | null

Error message when status is "failed", null otherwise. Always present in run responses (the server sends errorMessage || null).


errorTitle? ​

optional errorTitle?: string | null

Normalized form of errorMessage, with ids, numbers, URLs and quoted literals replaced by placeholder tokens, so runs that failed for the same reason share one title you can group on. null when the run did not fail.


executionStartedAt? ​

optional executionStartedAt?: string | null

ISO timestamp of the true execution start, stamped once the run actually starts executing. null/absent while the run is still queued. startedAt remains the request time.


failedStepErrorTitle? ​

optional failedStepErrorTitle?: string | null

Normalized title of the failed step's own error, for grouping failures by step-level cause. null whenever failedStepId is null.


failedStepId? ​

optional failedStepId?: string | null

Id of the step that failed the run — the lowest-index step whose status is "failed".

A run started with workflows.start() that aborted during setup, before any of its own steps ran, reads "__setup__" with failedStepKind: "setup" — a synthetic step, so it will not be found in the workflow definition. errorMessage carries the reason (a bad revision, a failed input-schema check, and so on). Only the durable path records that sentinel: the same abort on a syncCallable workflow (workflows.run()) reads null here, with the reason still in errorMessage.

null when the run did not fail, and for the failures that hold no step results at all: a run rejected at launch, a run reclaimed after its executor died, or one whose output failed schema validation after every step completed.


failedStepKind? ​

optional failedStepKind?: string | null

Kind of the failed step ("database.query", "llm", "setup" for the synthetic setup-phase step of a durable run, …). null whenever failedStepId is null.


instanceId ​

instanceId: string


meta? ​

optional meta?: Record<string, unknown>

User-defined metadata (max 1KB)


queueDelayMs? ​

optional queueDelayMs?: number | null

Derived queue delay in ms (executionStartedAt − startedAt), i.e. how long the run sat queued before executing. null while still queued.


revisionId ​

revisionId: string


runId ​

runId: string


runKey ​

runKey: string


skipReason? ​

optional skipReason?: "LOCK_CONTENTION" | null

Why an elided run did not run: "LOCK_CONTENTION" when the run's declarative lock was held and the definition declared onContention: "ignore". null for every run that is not "skipped". Such a run carries no errorMessage and produces no error analytics — it is a visible record that the work was not done, not a failure.


startedAt? ​

optional startedAt?: string

ISO timestamp stamped when the run started. Emitted by all run serializers (the model field is required); optional here only to tolerate hypothetical legacy records written before the field existed.


status ​

status: WorkflowRunStatus


workflowId ​

workflowId: string


workflowKey ​

workflowKey: string

Documentation validated against js-bao-wss-client 3.4.0 · js-bao 0.11.0 · primitive-admin 1.0.62 · primitive-app 3.1.0 — 2026-09-30