Skip to content

js-bao-wss-client


js-bao-wss-client / FunctionInvokeResult

Interface: FunctionInvokeResult<TOutput> ​

The invoke envelope.

Deliberately without a runId: the request path writes no run row, so there is nothing to look up afterwards. A function that throws or times out is a settled invocation with a terminal status, NOT a transport error — only the platform refusing the call before the code ran (access, disabled, unpushed, rate) is an HTTP error.

Type Parameters ​

TOutput ​

TOutput = unknown

Properties ​

error? ​

optional error?: string

Present when status is "failed" or "timeout".


errorCode? ​

optional errorCode?: string


invocationId? ​

optional invocationId?: string

The invocation-log record this answer belongs to.

Minted before the run, so the record and the answer share it: hand it to primitive functions logs <functionId> --invocation <id> to read what the invocation printed and the error it threw.

Present exactly when the platform recorded the invocation — which is every outcome the function itself produced. Absent from a platform refusal whose record was suppressed, and from a server that predates the field.


limits? ​

optional limits?: FunctionInvokeLimits

The ceilings the sandbox ran under.

Present on every outcome the sandbox produced; absent from a refusal that never reached it, which has no run to describe — and those refusals are HTTP errors, so a caller holding this envelope has one.


output? ​

optional output?: TOutput

Present when status is "completed".


status ​

status: FunctionInvokeStatus

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