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?
optionalerror?:string
Error message when status === "failed".
existing?
optionalexisting?:boolean
True if the runKey matched an existing run; no new execution occurred.
output?
optionaloutput?:O
Final output of the workflow, when status === "completed".
run?
optionalrun?:WorkflowRun
Persisted WorkflowRun row for the call (always present on success).
runId
runId:
string
runKey
runKey:
string
skipReason?
optionalskipReason?:"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.