Class: ScheduleClient
client.ScheduleClient
Client for starting Workflow executions and creating Workflow handles
Hierarchy
-
BaseClient
↳
ScheduleClient
Constructors
constructor
• new ScheduleClient(options?
): ScheduleClient
Parameters
Name | Type |
---|---|
options? | ScheduleClientOptions |
Returns
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
Methods
create
▸ create<W
>(options
): Promise
<ScheduleHandle
>
Create a new Schedule.
Type parameters
Name | Type |
---|---|
W | extends Workflow = Workflow |
Parameters
Name | Type |
---|---|
options | ScheduleOptions <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
Name | Type |
---|---|
scheduleId | string |
Returns
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
Name | Type |
---|---|
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
Name | Type |
---|---|
abortSignal | AbortSignal |
fn | () => Promise <R > |
Returns
Promise
<R
>
value returned from fn
See
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
Name | Type |
---|---|
deadline | number | 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
Name | Type |
---|---|
metadata | Metadata |
fn | () => Promise <R > |
Returns
Promise
<R
>
returned value of fn
See
Inherited from
BaseClient.withMetadata