We use cookies

We use cookies to ensure you get the best experience on our website. For more information on how we use cookies, please see our cookie policy.

By clicking "Accept", you agree to our use of cookies.
Learn more.

Runs Client

The runs client is a client for interacting with task and workflow runs within Hatchet.

Methods

cancel()

Cancels a task or workflow run by its ID.

Parameters

ParameterTypeDescription
optsCancelRunOptsThe options for the cancel operation.

Returns

Promise<AxiosResponse<V1CancelledTasks, any, { }>>

A promise that resolves to the cancelled run.

get()

Gets a task or workflow run by its ID.

Parameters

ParameterTypeDescription
runstring | WorkflowRunRef<T>The ID of the run to get.

Returns

Promise<V1WorkflowRunDetails>

A promise that resolves to the run.

get_status()

Gets the status of a task or workflow run by its ID.

Parameters

ParameterTypeDescription
runstring | WorkflowRunRef<T>The ID of the run to get the status of.

Returns

Promise<V1TaskStatus>

A promise that resolves to the status of the run.

list()

Lists all task and workflow runs for the current tenant.

Parameters

ParameterTypeDescription
opts?Partial<ListRunsOpts>The options for the list operation.

Returns

Promise<V1TaskSummaryList>

A promise that resolves to the list of runs.

replay()

Replays a task or workflow run by its ID.

Parameters

ParameterTypeDescription
optsReplayRunOptsThe options for the replay operation.

Returns

Promise<AxiosResponse<V1ReplayedTasks, any, { }>>

A promise that resolves to the replayed run.

runRef()

Creates a run reference for a task or workflow run by its ID.

Parameters

ParameterTypeDescription
idstringThe ID of the run to create a reference for.

Returns

WorkflowRunRef<T>

A promise that resolves to the run reference.

subscribeToStream()

Subscribes to a stream of events for a task or workflow run by its ID.

Parameters

ParameterTypeDescription
workflowRunIdstringThe ID of the run to subscribe to.

Returns

AsyncIterableIterator<string>

A promise that resolves to the stream of events.