Skip to content

@oona/vlo / host / completeTask

Function: completeTask() ​

completeTask(ctx, taskId, attempt, output, usage?): Promise<TaskResult>

Defined in: sdk/ts/sdk/src/host/worker/complete.ts:34

Records an attempt's output. Validated against the registered activity's output schema when there is one; a violation fails the attempt with schema_violation and no retry. The first terminal result for an attempt wins; later ones return duplicate: true.

Parameters ​

ctx ​

HostContext

taskId ​

string

attempt ​

number

output ​

unknown

usage? ​

Usage

Returns ​

Promise<TaskResult>

Throws ​

TaskNotFound when no task has that id.