Skip to main content

Interface: ActivityHandle<R>

Defined in: node_modules/@temporalio/client/lib/activity-client.d.ts:110

Handle that can be used to perform operations on the associated Activity. Can be obtained by calling ActivityClient.start or ActivityClient.getHandle.

Type Parameters​

R​

R = any

Result type of the activity. Use ActivityClient.typed to start activities in a type-safe way.

Properties​

activityId​

readonly activityId: string

Defined in: node_modules/@temporalio/client/lib/activity-client.d.ts:114

ID of the Activity this handle refers to.


runId?​

readonly optional runId?: string

Defined in: node_modules/@temporalio/client/lib/activity-client.d.ts:119

Run ID of the specific Activity execution this handle refers to. If empty, this handle refers to the latest execution of the Activity with given ID.

Methods​

cancel()​

cancel(reason): Promise<void>

Defined in: node_modules/@temporalio/client/lib/activity-client.d.ts:133

Requests cancellation of the Activity execution. Note that cancellations are cooperative and not guaranteed to happen.

Parameters​

reason​

string

Returns​

Promise<void>


describe()​

describe(options?): Promise<ActivityExecutionDescription>

Defined in: node_modules/@temporalio/client/lib/activity-client.d.ts:129

Returns information about the Activity execution.

Parameters​

options?​

ActivityDescribeOptions

Returns​

Promise<ActivityExecutionDescription>


pause()​

pause(options?): Promise<void>

Defined in: node_modules/@temporalio/client/lib/activity-client.d.ts:143

Experimental

Requests Activity execution pause. Note that pausing is cooperative and not guaranteed to happen.

Activity Operator Commands are experimental. APIs may be subject to change.

Parameters​

options?​

ActivityPauseOptions

Returns​

Promise<void>


restoreOriginalOptions()​

restoreOriginalOptions(): Promise<ActivityOptionsUpdate>

Defined in: node_modules/@temporalio/client/lib/activity-client.d.ts:165

Experimental

Restores activity options of a running activity execution that it was originally started with.

Returns current options after restoring.

Activity Operator Commands are experimental. APIs may be subject to change.

Returns​

Promise<ActivityOptionsUpdate>


result()​

result(): Promise<R>

Defined in: node_modules/@temporalio/client/lib/activity-client.d.ts:125

Waits until the activity completes. If the activity is successful, returns the result of the activity. If the activity was not successful, throws ActivityExecutionFailedError. The activity failure is stored in the cause field.

Returns​

Promise<R>


terminate()​

terminate(reason): Promise<void>

Defined in: node_modules/@temporalio/client/lib/activity-client.d.ts:137

Terminates the Activity execution. Note that the worker is not immediately notified of termination and may continue running the activity.

Parameters​

reason​

string

Returns​

Promise<void>


unpause()​

unpause(options?): Promise<void>

Defined in: node_modules/@temporalio/client/lib/activity-client.d.ts:149

Experimental

Unpauses the Activity execution if it was previously paused.

Activity Operator Commands are experimental. APIs may be subject to change.

Parameters​

options?​

ActivityUnpauseOptions

Returns​

Promise<void>


updateOptions()​

updateOptions(options): Promise<ActivityOptionsUpdateResult>

Defined in: node_modules/@temporalio/client/lib/activity-client.d.ts:157

Experimental

Updates activity options of a running activity execution. See documentation for ActivityOptionsUpdate.

Returns current options after applying the update.

Activity Operator Commands are experimental. APIs may be subject to change.

Parameters​

options​

ActivityOptionsUpdate

Returns​

Promise<ActivityOptionsUpdateResult>