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.

Workers Client

The workers client is a client for managing workers programmatically within Hatchet.

Methods

get()

Get a worker by its ID.

Parameters

ParameterTypeDescription
workerIdstringThe ID of the worker to get.

Returns

Promise<Worker>

A promise that resolves to the worker.

isPaused()

Check if a worker is paused.

Parameters

ParameterTypeDescription
workerIdstringThe ID of the worker to check.

Returns

Promise<boolean>

A promise that resolves to true if the worker is paused, false otherwise.

list()

List all workers in the tenant.

Returns

Promise<WorkerList>

A promise that resolves to the list of workers.

pause()

Pause a worker.

Parameters

ParameterTypeDescription
workerIdstringThe ID of the worker to pause.

Returns

Promise<Worker>

A promise that resolves to the paused worker.

unpause()

Unpause a worker.

Parameters

ParameterTypeDescription
workerIdstringThe ID of the worker to unpause.

Returns

Promise<Worker>

A promise that resolves to the unpaused worker.