Skip to main content

Class: Client

client.Client

High level SDK client.

Constructors

constructor

new Client(options?)

Parameters

NameType
options?ClientOptions

Properties

activity

Readonly activity: AsyncCompletionClient

(Async) Activity completion sub-client - use to manually manage Activities


connection

Readonly connection: ConnectionLike

Underlying gRPC connection to the Temporal service


options

Readonly options: LoadedClientOptions


workflow

Readonly workflow: WorkflowClient

Workflow sub-client - use to start and interact with Workflows

Accessors

workflowService

get workflowService(): WorkflowService

Raw gRPC access to the Temporal service.

NOTE: The namespace provided in options is not automatically set on requests made via this service object.

Returns

WorkflowService

Methods

withDeadline

withDeadline<R>(deadline, fn): Promise<R>

Set the deadline for any service requests executed in fn's scope.

Type parameters

Name
R

Parameters

NameType
deadlinenumber | Date
fn() => Promise<R>

Returns

Promise<R>


withMetadata

withMetadata<R>(metadata, fn): Promise<R>

Set metadata for any service requests executed in fn's scope.

See

withMetadata

Type parameters

Name
R

Parameters

NameType
metadataMetadata
fn() => Promise<R>

Returns

Promise<R>

returned value of fn