Skip to content

js-bao-wss-client


js-bao-wss-client / RunSyncWorkflowResult

Interface: RunSyncWorkflowResult<O> ​

Result envelope from workflows.runSync. All non-transport outcomes resolve with this shape — promise rejection is reserved for connectivity / abort-before-send errors.

Type Parameters ​

O ​

O = any

Properties ​

error? ​

optional error?: string

Error message when status === "failed".


existing? ​

optional existing?: boolean

True if the runKey matched an existing run; no new execution occurred.


output? ​

optional output?: O

Final output of the workflow, when status === "completed".


run? ​

optional run?: WorkflowRun

Persisted WorkflowRun row for the call (always present on success).


runId ​

runId: string


runKey ​

runKey: string


skipReason? ​

optional skipReason?: "LOCK_CONTENTION"

Why the workflow did not run, when status === "skipped": the run's declarative lock was held and the definition declared onContention: "ignore". The envelope then carries neither output nor error — nothing went wrong, the work simply did not happen.


status ​

status: WorkflowRunStatus | "timeout"

Status from the run.

  • "completed" — workflow finished without error
  • "failed" — engine raised an error (see error)
  • "terminated" — caller-side AbortSignal fired mid-execution
  • "timeout" — server-side timeout ceiling tripped
  • "apply_pending" — workflow needs the client-side apply step

On an idempotency hit or write-race loss (existing: true), runSync echoes the matched run's raw persisted WorkflowRun.status, which can still be transient — "queued", "running", or "apply_claimed" — so this is WorkflowRunStatus (the model's full set) plus the runSync-only "timeout" value.

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