Skip to main content

Class: ScheduleClient

client.ScheduleClient

Client for starting Workflow executions and creating Workflow handles

Hierarchy

  • BaseClient

    ScheduleClient

Constructors

constructor

new ScheduleClient(options?): ScheduleClient

Parameters

NameType
options?ScheduleClientOptions

Returns

ScheduleClient

Overrides

BaseClient.constructor

Properties

connection

Readonly connection: ConnectionLike

Inherited from

BaseClient.connection


options

Readonly options: LoadedScheduleClientOptions

Accessors

workflowService

get workflowService(): WorkflowService

Raw gRPC access to the Temporal service. Schedule-related methods are included in WorkflowService.

NOTE: The namespace provided in options is not automatically set on requests made to the service.

Returns

WorkflowService

Methods

create

create<W>(options): Promise<ScheduleHandle>

Create a new Schedule.

Type parameters

NameType
Wextends Workflow = Workflow

Parameters

NameType
optionsScheduleOptions<ScheduleOptionsStartWorkflowAction<W>>

Returns

Promise<ScheduleHandle>

a ScheduleHandle to the created Schedule

Throws

ScheduleAlreadyRunning if there's a running (not deleted) Schedule with the given id


getHandle

getHandle(scheduleId): ScheduleHandle

Get a handle to a Schedule

This method does not validate scheduleId. If there is no Schedule with the given scheduleId, handle methods like handle.describe() will throw a ScheduleNotFoundError error.

Parameters

NameType
scheduleIdstring

Returns

ScheduleHandle


list

list(options?): AsyncIterable<ScheduleSummary>

List Schedules with an AsyncIterator:

for await (const schedule: Schedule of client.list()) {
const { id, memo, searchAttributes } = schedule
// ...
}

To list one page at a time, instead use the raw gRPC method WorkflowService.listSchedules:

await { schedules, nextPageToken } = client.scheduleService.listSchedules()

Parameters

NameType
options?ListScheduleOptions

Returns

AsyncIterable<ScheduleSummary>


withAbortSignal

withAbortSignal<R>(abortSignal, fn): Promise<R>

Set an AbortSignal that, when aborted, cancels any ongoing service requests executed in fn's scope.

Type parameters

Name
R

Parameters

NameType
abortSignalAbortSignal
fn() => Promise<R>

Returns

Promise<R>

value returned from fn

See

Connection.withAbortSignal

Inherited from

BaseClient.withAbortSignal


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>

Inherited from

BaseClient.withDeadline


withMetadata

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

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

Type parameters

Name
R

Parameters

NameType
metadataMetadata
fn() => Promise<R>

Returns

Promise<R>

returned value of fn

See

Connection.withMetadata

Inherited from

BaseClient.withMetadata