Skip to main content

Interface: ScheduleOptions<A>

The specification of a Schedule to be created, as expected by ScheduleClient.create.

Type Parameters​

A​

A extends ScheduleOptionsAction = ScheduleOptionsAction

Properties​

action​

action: A

Which Action to take


memo?​

optional memo?: Record<string, unknown>

Additional non-indexed information attached to the Schedule. The values can be anything that is serializable by the DataConverter.


policies?​

optional policies?: object

catchupWindow?​

optional catchupWindow?: Duration

The Temporal Server might be down or unavailable at the time when a Schedule should take an Action. When the Server comes back up, catchupWindow controls which missed Actions should be taken at that point. If omitted, the Temporal Server's configured default applies. It takes those Actions according to the ScheduleOverlapPolicy. An outage that lasts longer than the Catchup Window could lead to missed Actions. (But you can always ScheduleHandle.backfill.)

Format​

number of milliseconds or ms-formatted string

overlap?​

optional overlap?: ScheduleOverlapPolicy

Controls what happens when an Action would be started by a Schedule at the same time that an older Action is still running. This can be changed after a Schedule has taken some Actions, and some changes might produce unintuitive results. In general, the later policy overrides the earlier policy.

Default​
ScheduleOverlapPolicy.SKIP

pauseOnFailure?​

optional pauseOnFailure?: boolean

When an Action times out or reaches the end of its Retry Policy, pause.

With ScheduleOverlapPolicy.ALLOW_ALL, this pause might not apply to the next Action, because the next Action might have already started previous to the failed one finishing. Pausing applies only to Actions that are scheduled to start after the failed one finishes.

Default​
false

scheduleId​

scheduleId: string

Schedule Id

We recommend using a meaningful business identifier.


searchAttributes?​

optional searchAttributes?: SearchAttributes

Additional indexed information attached to the Schedule. More info: https://docs.temporal.io/docs/typescript/search-attributes

Values are always converted using JsonPayloadConverter, even when a custom Data Converter is provided.

Deprecated​

Use typedSearchAttributes instead.


spec​

spec: ScheduleSpec

When Actions should be taken


state?​

optional state?: object

The initial state of the schedule, right after creation or update.

backfill?​

optional backfill?: Backfill[]

Runs though the specified time periods and takes Actions as if that time passed by right now, all at once. The overlap policy can be overridden for the scope of the backfill.

note?​

optional note?: string

Informative human-readable message with contextual notes, e.g. the reason a Schedule is paused. The system may overwrite this message on certain conditions, e.g. when pause-on-failure happens.

paused?​

optional paused?: boolean

Start in paused state.

Default​
false

remainingActions?​

optional remainingActions?: number

Limit the number of Actions to take.

This number is decremented after each Action is taken, and Actions are not taken when the number is 0 (unless ScheduleHandle.trigger is called).

If undefined, then no such limit applies.

Default​
undefined, which allows for unlimited exections

triggerImmediately?​

optional triggerImmediately?: boolean

Trigger one Action immediately on create.

Default​
false

typedSearchAttributes?​

optional typedSearchAttributes?: SearchAttributePair[] | TypedSearchAttributes

Additional indexed information attached to the Schedule. More info: https://docs.temporal.io/docs/typescript/search-attributes

Values are always converted using JsonPayloadConverter, even when a custom Data Converter is provided.

If both searchAttributes and typedSearchAttributes are provided, conflicting keys will be overwritten by typedSearchAttributes.