Skip to main content

Namespace: client

Client for communicating with Temporal Server.

Most functionality is available through WorkflowClient, but you can also call gRPC methods directly using Connection.workflowService and Connection.operatorService.

Usage​

import { Connection, Client } from '@temporalio/client';
import { loadClientConnectConfig } from '@temporalio/envconfig';
import { sleepForDays } from './workflows';
import { nanoid } from 'nanoid';

async function run() {
const config = loadClientConnectConfig();
const connection = await Connection.connect(config.connectionOptions);
const client = new Client({ connection });

const handle = await client.workflow.start(sleepForDays, {
taskQueue: 'sleep-for-days',
workflowId: 'workflow-' + nanoid(),
});
console.log(`Started workflow ${handle.workflowId}`);

// Wait for workflow completion (runs indefinitely until it receives a signal)
console.log(await handle.result());
}

run().catch((err) => {
console.error(err);
process.exit(1);
});

Classes​

Interfaces​

References​

ActivityFailure​

Re-exports ActivityFailure


ActivityFunction​

Re-exports ActivityFunction


ActivityInterface​

Re-exports ActivityInterface


ApplicationFailure​

Re-exports ApplicationFailure


BaseWorkflowHandle​

Re-exports BaseWorkflowHandle


BaseWorkflowOptions​

Re-exports BaseWorkflowOptions


CancelledFailure​

Re-exports CancelledFailure


ChildWorkflowFailure​

Re-exports ChildWorkflowFailure


CommonWorkflowOptions​

Re-exports CommonWorkflowOptions


CompleteAsyncError​

Re-exports CompleteAsyncError


DataConverter​

Re-exports DataConverter


ExternalStorageDriverError​

Re-exports ExternalStorageDriverError


ExternalStorageError​

Re-exports ExternalStorageError


ExternalStorageNotConfiguredError​

Re-exports ExternalStorageNotConfiguredError


ExternalStorageReferenceError​

Re-exports ExternalStorageReferenceError


ExternalStorageUnregisteredDriverError​

Re-exports ExternalStorageUnregisteredDriverError


HandlerUnfinishedPolicy​

Re-exports HandlerUnfinishedPolicy


Headers​

Re-exports Headers


HistoryAndWorkflowId​

Re-exports HistoryAndWorkflowId


IllegalStateError​

Re-exports IllegalStateError


NamespaceNotFoundError​

Re-exports NamespaceNotFoundError


Next​

Re-exports Next


Payload​

Re-exports Payload


PayloadConverterError​

Re-exports PayloadConverterError


ProtoFailure​

Re-exports ProtoFailure


QueryDefinition​

Re-exports QueryDefinition


QueryDefinitionOptions​

Re-exports QueryDefinitionOptions


RetryPolicy​

Re-exports RetryPolicy


ServerFailure​

Re-exports ServerFailure


SignalDefinition​

Re-exports SignalDefinition


SignalDefinitionOptions​

Re-exports SignalDefinitionOptions


SignalTypeInfo​

Re-exports SignalTypeInfo


TLSConfig​

Re-exports TLSConfig


TemporalFailure​

Re-exports TemporalFailure


TerminatedFailure​

Re-exports TerminatedFailure


TimeoutFailure​

Re-exports TimeoutFailure


UntypedActivities​

Re-exports UntypedActivities


UpdateDefinition​

Re-exports UpdateDefinition


UpdateDefinitionOptions​

Re-exports UpdateDefinitionOptions


ValueError​

Re-exports ValueError


WithWorkflowArgs​

Re-exports WithWorkflowArgs


Workflow​

Re-exports Workflow


WorkflowDurationOptions​

Re-exports WorkflowDurationOptions


WorkflowExecutionAlreadyStartedError​

Re-exports WorkflowExecutionAlreadyStartedError


WorkflowIdConflictPolicy​

Re-exports WorkflowIdConflictPolicy


WorkflowIdReusePolicy​

Re-exports WorkflowIdReusePolicy


WorkflowNotFoundError​

Re-exports WorkflowNotFoundError


WorkflowQueryAnnotatedType​

Re-exports WorkflowQueryAnnotatedType


WorkflowQueryOptions​

Re-exports WorkflowQueryOptions


WorkflowQueryType​

Re-exports WorkflowQueryType


WorkflowResultType​

Re-exports WorkflowResultType


WorkflowReturnType​

Re-exports WorkflowReturnType


WorkflowSignalAnnotatedType​

Re-exports WorkflowSignalAnnotatedType


WorkflowSignalOptions​

Re-exports WorkflowSignalOptions


WorkflowSignalType​

Re-exports WorkflowSignalType


WorkflowTypeOptions​

Re-exports WorkflowTypeOptions


WorkflowUpdateAnnotatedType​

Re-exports WorkflowUpdateAnnotatedType


WorkflowUpdateType​

Re-exports WorkflowUpdateType


WorkflowUpdateValidatorType​

Re-exports WorkflowUpdateValidatorType


decodeWorkflowIdConflictPolicy​

Re-exports decodeWorkflowIdConflictPolicy


decodeWorkflowIdReusePolicy​

Re-exports decodeWorkflowIdReusePolicy


defaultPayloadConverter​

Re-exports defaultPayloadConverter


encodeWorkflowIdConflictPolicy​

Re-exports encodeWorkflowIdConflictPolicy


encodeWorkflowIdReusePolicy​

Re-exports encodeWorkflowIdReusePolicy


extractWorkflowType​

Re-exports extractWorkflowType


extractWorkflowTypeAndConfig​

Re-exports extractWorkflowTypeAndConfig

Type Aliases​

ActivityArgs​

Ƭ ActivityArgs<T, N>: T[N] extends ActivityFunction<infer P, any> ? P : never

Utility type to support strong typing in TypedActivityClient. Extracts argument types of an activity.

Type parameters​

NameTypeDescription
TTActivity interface
Nextends ActivityName<T>Activity name

ActivityExecutionStatus​

Ƭ ActivityExecutionStatus: typeof ActivityExecutionStatus[keyof typeof ActivityExecutionStatus]


ActivityIdConflictPolicy​

Ƭ ActivityIdConflictPolicy: typeof ActivityIdConflictPolicy[keyof typeof ActivityIdConflictPolicy]


ActivityIdReusePolicy​

Ƭ ActivityIdReusePolicy: typeof ActivityIdReusePolicy[keyof typeof ActivityIdReusePolicy]


ActivityName​

Ƭ ActivityName<T>: { [N in keyof T & string]: T[N] extends ActivityFunction<any, any> ? N : never }[keyof T & string]

Utility type to support strong typing in TypedActivityClient. Contains names of activities extracted from the specified activity interface.

Type parameters​

NameDescription
TActivity interface

ActivityOptionsFor​

Ƭ ActivityOptionsFor<T, N>: ActivityOptionsWithArgs<ActivityArgs<T, N>>

Utility type to support strong typing in TypedActivityClient. Represents ActivityOptions with strongly typed arguments matching specified Activity in specified interface.

Type parameters​

NameTypeDescription
TTActivity interface
Nextends ActivityName<T>Activity name

ActivityOptionsUpdateResult​

Ƭ ActivityOptionsUpdateResult: { [K in keyof ActivityOptionsUpdate]: Exclude<ActivityOptionsUpdate[K], null> }

Contains current activity options after applying an update. Returned by ActivityHandle.updateOptions.

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


ActivityOptionsWithArgs​

Ƭ ActivityOptionsWithArgs<Args>: Args extends [any, ...any] ? Replace<ActivityOptions, { args: Args | Readonly<Args> }> : Replace<ActivityOptions, { args?: Args | Readonly<Args> }>

Utility type to support strong typing in TypedActivityClient. Represents ActivityOptions with strongly typed arguments.

Type parameters​

NameTypeDescription
Argsextends any[]Types of activity arguments as an array type.

ActivityResult​

Ƭ ActivityResult<T, N>: T[N] extends ActivityFunction<any, infer R> ? R : never

Utility type to support strong typing in TypedActivityClient. Extracts result type of an activity.

Type parameters​

NameTypeDescription
TTActivity interface
Nextends ActivityName<T>Activity name

AsyncCompletionClientOptions​

Ƭ AsyncCompletionClientOptions: BaseClientOptions

Options used to configure AsyncCompletionClient


BuildIdOperation​

Ƭ BuildIdOperation: AddNewIdInNewDefaultSet | AddNewCompatibleVersion | PromoteSetByBuildId | PromoteBuildIdWithinSet | MergeSets

Operations that can be passed to TaskQueueClient.updateBuildIdCompatibility.

Deprecated

Worker Versioning is now deprecated. Please use the Worker Deployment API instead: https://docs.temporal.io/worker-deployments


CompiledScheduleAction​

Ƭ CompiledScheduleAction: Replace<ScheduleDescriptionAction, { args: unknown[] ; workflowType: string }>


CompiledScheduleOptions​

Ƭ CompiledScheduleOptions: Replace<ScheduleOptions, { action: CompiledScheduleAction }>


CompiledScheduleUpdateOptions​

Ƭ CompiledScheduleUpdateOptions: Replace<ScheduleUpdateOptions, { action: CompiledScheduleAction }>


ConnectionOptionsWithDefaults​

Ƭ ConnectionOptionsWithDefaults: Required<Omit<ConnectionOptions, "tls" | "connectTimeout" | "callCredentials" | "apiKey">> & { connectTimeoutMs: number }


CreateScheduleOutput​

Ƭ CreateScheduleOutput: Object

Type declaration​

NameType
conflictTokenUint8Array

DayOfWeek​

Ƭ DayOfWeek: typeof DAYS_OF_WEEK[number]


DescribeWorkflowExecutionResponse​

Ƭ DescribeWorkflowExecutionResponse: IDescribeWorkflowExecutionResponse


GetWorkflowExecutionHistoryRequest​

Ƭ GetWorkflowExecutionHistoryRequest: IGetWorkflowExecutionHistoryRequest


HealthService​

Ƭ HealthService: Health


InternalConnectionLike​

Ƭ InternalConnectionLike: ConnectionLike & { [InternalConnectionLikeSymbol]?: { supportsEagerStart?: boolean } }


LoadedAsyncCompletionClientOptions​

Ƭ LoadedAsyncCompletionClientOptions: LoadedWithDefaults<AsyncCompletionClientOptions>


LoadedClientOptions​

Ƭ LoadedClientOptions: LoadedWithDefaults<ClientOptions>


LoadedNexusClientOptions​

Ƭ LoadedNexusClientOptions: LoadedWithDefaults<NexusClientOptions>


LoadedScheduleClientOptions​

Ƭ LoadedScheduleClientOptions: LoadedWithDefaults<ScheduleClientOptions>


LoadedTaskQueueClientOptions​

Ƭ LoadedTaskQueueClientOptions: LoadedWithDefaults<TaskQueueClientOptions>

Deprecated

Worker Versioning is now deprecated. Please use the Worker Deployment API instead: https://docs.temporal.io/worker-deployments


LoadedWorkflowClientOptions​

Ƭ LoadedWorkflowClientOptions: LoadedWithDefaults<WorkflowClientOptions>


LooseRange​

Ƭ LooseRange<Unit>: Range<Unit> | { end?: Range<Unit>["end"] ; start: Range<Unit>["start"] ; step?: never } | Unit

A Range definition, with support for loose syntax.

For example:

3 ➡️ 3
{ start: 2 } ➡️ 2
{ start: 2, end: 4 } ➡️ 2, 3, 4
{ start: 2, end: 10, step: 3 } ➡️ 2, 5, 8

Type parameters​

Name
Unit

Metadata​

Ƭ Metadata: Record<string, grpc.MetadataValue>

Mapping of string to valid gRPC metadata value


Month​

Ƭ Month: typeof MONTHS[number]


NexusOperationCancellationState​

Ƭ NexusOperationCancellationState: typeof NexusOperationCancellationState[keyof typeof NexusOperationCancellationState]


NexusOperationExecutionDescription​

Ƭ NexusOperationExecutionDescription: Replace<NexusOperationExecution, { raw: INexusOperationExecutionInfo }> & { attempt: number ; blockedReason: string | undefined ; cancellationInfo: NexusOperationExecutionCancellationInfo | undefined ; expirationTime: Date | undefined ; identity: string ; lastAttemptCompleteTime: Date | undefined ; lastAttemptFailure: Error | undefined ; nextAttemptScheduleTime: Date | undefined ; operationToken: string | undefined ; requestId: string ; scheduleToCloseTimeout: number | undefined ; scheduleToStartTimeout: number | undefined ; startToCloseTimeout: number | undefined ; state: PendingNexusOperationState | undefined ; staticDetails: () => Promise<string | undefined> ; staticSummary: () => Promise<string | undefined> }

Detailed information about a standalone Nexus operation execution.


NexusOperationExecutionStatus​

Ƭ NexusOperationExecutionStatus: typeof NexusOperationExecutionStatus[keyof typeof NexusOperationExecutionStatus]


NexusOperationIdConflictPolicy​

Ƭ NexusOperationIdConflictPolicy: typeof NexusOperationIdConflictPolicy[keyof typeof NexusOperationIdConflictPolicy]


NexusOperationIdReusePolicy​

Ƭ NexusOperationIdReusePolicy: typeof NexusOperationIdReusePolicy[keyof typeof NexusOperationIdReusePolicy]


OperatorService​

Ƭ OperatorService: OperatorService


PendingActivityState​

Ƭ PendingActivityState: typeof PendingActivityState[keyof typeof PendingActivityState]


PendingNexusOperationState​

Ƭ PendingNexusOperationState: typeof PendingNexusOperationState[keyof typeof PendingNexusOperationState]


QueryRejectCondition​

Ƭ QueryRejectCondition: typeof QueryRejectCondition[keyof typeof QueryRejectCondition]


RawActivityExecutionCallbacks​

Ƭ RawActivityExecutionCallbacks: ICallbackInfo[]


RawActivityExecutionInfo​

Ƭ RawActivityExecutionInfo: IActivityExecutionInfo


RawActivityExecutionListInfo​

Ƭ RawActivityExecutionListInfo: IActivityExecutionListInfo


RawNexusOperationExecutionCancellationInfo​

Ƭ RawNexusOperationExecutionCancellationInfo: INexusOperationExecutionCancellationInfo


RawNexusOperationExecutionInfo​

Ƭ RawNexusOperationExecutionInfo: INexusOperationExecutionInfo


RawNexusOperationExecutionListInfo​

Ƭ RawNexusOperationExecutionListInfo: INexusOperationExecutionListInfo


RawWorkflowExecutionInfo​

Ƭ RawWorkflowExecutionInfo: IWorkflowExecutionInfo


ReachabilityOptions​

Ƭ ReachabilityOptions: RequireAtLeastOne<BaseReachabilityOptions, "buildIds" | "taskQueues">

Options for TaskQueueClient.getReachability

Deprecated

Worker Versioning is now deprecated. Please use the Worker Deployment API instead: https://docs.temporal.io/worker-deployments


ReachabilityType​

Ƭ ReachabilityType: typeof ReachabilityType[keyof typeof ReachabilityType]


ReachabilityTypeResponse​

Ƭ ReachabilityTypeResponse: ReachabilityType | "NOT_FETCHED"

Deprecated

Worker Versioning is now deprecated. Please use the Worker Deployment API instead: https://docs.temporal.io/worker-deployments


RequestCancelWorkflowExecutionResponse​

Ƭ RequestCancelWorkflowExecutionResponse: IRequestCancelWorkflowExecutionResponse


ScheduleDescription​

Ƭ ScheduleDescription: Object

A detailed description of an exisiting Schedule, as returned by ScheduleHandle.describe.

Type declaration​

NameTypeDescription
actionScheduleDescriptionActionThe Action that will be taken.
info{ createdAt: Date ; lastUpdatedAt: Date | undefined ; nextActionTimes: Date[] ; numActionsMissedCatchupWindow: number ; numActionsSkippedOverlap: number ; numActionsTaken: number ; recentActions: ScheduleExecutionResult[] ; runningActions: ScheduleExecutionActionResult[] }-
info.createdAtDate-
info.lastUpdatedAtDate | undefined-
info.nextActionTimesDate[]Next upcoming scheduled times of this Schedule
info.numActionsMissedCatchupWindownumberNumber of times a scheduled Action was skipped due to missing the catchup window.
info.numActionsSkippedOverlapnumberNumber of Actions skipped due to overlap.
info.numActionsTakennumberNumber of Actions taken so far.
info.recentActionsScheduleExecutionResult[]Most recent actions started (including manual triggers), sorted from older start time to newer.
info.runningActionsScheduleExecutionActionResult[]Currently-running workflows started by this schedule. (There might be more than one if the overlap policy allows overlaps.)
memo?Record<string, unknown>Additional non-indexed information attached to the Schedule. The values can be anything that is serializable by the DataConverter.
policies{ catchupWindow: number ; overlap: ScheduleOverlapPolicy ; pauseOnFailure: boolean }-
policies.catchupWindownumberThe 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. 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.) Unit is miliseconds.
policies.overlapScheduleOverlapPolicyControls what happens when an Action would be started by a Schedule at the same time that an older Action is still running.
policies.pauseOnFailurebooleanWhen 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.
scheduleIdstringThe Schedule Id. We recommend using a meaningful business identifier.
searchAttributesSearchAttributesAdditional 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.
specScheduleSpecDescriptionWhen will Actions be taken.
state{ note?: string ; paused: boolean ; remainingActions?: number }-
state.note?stringInformative 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.
state.pausedbooleanWhether Schedule is currently paused.
state.remainingActions?numberThe Actions remaining in this Schedule. Once this number hits 0, no further Actions are taken (unless ScheduleHandle.trigger is called). If undefined, then no such limit applies.
typedSearchAttributesTypedSearchAttributesAdditional 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.

ScheduleDescriptionAction​

Ƭ ScheduleDescriptionAction: ScheduleDescriptionStartWorkflowAction


ScheduleDescriptionStartWorkflowAction​

Ƭ ScheduleDescriptionStartWorkflowAction: ScheduleSummaryStartWorkflowAction & Pick<WorkflowStartOptions<Workflow>, "taskQueue" | "workflowId" | "args" | "memo" | "searchAttributes" | "typedSearchAttributes" | "retry" | "workflowExecutionTimeout" | "workflowRunTimeout" | "workflowTaskTimeout" | "staticSummary" | "staticDetails" | "priority">


ScheduleExecutionActionResult​

Ƭ ScheduleExecutionActionResult: ScheduleExecutionStartWorkflowActionResult


ScheduleOptionsAction​

Ƭ ScheduleOptionsAction: ScheduleOptionsStartWorkflowAction<Workflow>


ScheduleOptionsStartWorkflowAction​

Ƭ ScheduleOptionsStartWorkflowAction<W>: { type: "startWorkflow" ; workflowType: string | W } & Pick<WorkflowStartOptions<W>, "taskQueue" | "args" | "memo" | "searchAttributes" | "typedSearchAttributes" | "retry" | "workflowExecutionTimeout" | "workflowRunTimeout" | "workflowTaskTimeout" | "staticDetails" | "staticSummary"> & { workflowId?: string }

Type parameters​

NameType
Wextends Workflow

ScheduleOverlapPolicy​

Ƭ ScheduleOverlapPolicy: typeof ScheduleOverlapPolicy[keyof typeof ScheduleOverlapPolicy]


ScheduleSpecDescription​

Ƭ ScheduleSpecDescription: Omit<ScheduleSpec, "calendars" | "intervals" | "cronExpressions" | "skip" | "jitter"> & { calendars?: CalendarSpecDescription[] ; intervals?: IntervalSpecDescription[] ; jitter?: number ; skip?: CalendarSpecDescription[] }

The version of ScheduleSpec that you get back from ScheduleHandle.describe and ScheduleClient.list


ScheduleSummaryAction​

Ƭ ScheduleSummaryAction: ScheduleSummaryStartWorkflowAction


ScheduleUpdateOptions​

Ƭ ScheduleUpdateOptions<A>: Replace<Omit<ScheduleOptions, "scheduleId" | "memo">, { action: A ; state: Omit<ScheduleOptions["state"], "triggerImmediately" | "backfill"> }>

The specification of an updated Schedule, as expected by ScheduleHandle.update.

Type parameters​

NameType
Aextends ScheduleOptionsAction = ScheduleOptionsAction

StartWorkflowExecutionRequest​

Ƭ StartWorkflowExecutionRequest: IStartWorkflowExecutionRequest


TaskQueueClientOptions​

Ƭ TaskQueueClientOptions: BaseClientOptions

Deprecated

Worker Versioning is now deprecated. Please use the Worker Deployment API instead: https://docs.temporal.io/worker-deployments


TerminateWorkflowExecutionResponse​

Ƭ TerminateWorkflowExecutionResponse: ITerminateWorkflowExecutionResponse


TestService​

Ƭ TestService: TestService


UnversionedBuildIdType​

Ƭ UnversionedBuildIdType: typeof UnversionedBuildId


WithCompiledWorkflowOptions​

Ƭ WithCompiledWorkflowOptions<T>: Replace<T, { startDelay?: IDuration ; versioningOverride?: IVersioningOverride ; workflowExecutionTimeout?: IDuration ; workflowRunTimeout?: IDuration ; workflowTaskTimeout?: IDuration }>

Type parameters​

NameType
Textends WorkflowOptions

WorkflowClientCallsInterceptor​

Ƭ WorkflowClientCallsInterceptor: WorkflowClientInterceptor

@deprecated: Use WorkflowClientInterceptor instead


WorkflowExecutionDescription​

Ƭ WorkflowExecutionDescription: Replace<WorkflowExecutionInfo, { raw: DescribeWorkflowExecutionResponse }> & { staticDetails: () => Promise<string | undefined> ; staticSummary: () => Promise<string | undefined> }


WorkflowExecutionStatusName​

Ƭ WorkflowExecutionStatusName: "UNSPECIFIED" | "RUNNING" | "COMPLETED" | "FAILED" | "CANCELLED" | "TERMINATED" | "CONTINUED_AS_NEW" | "TIMED_OUT" | "PAUSED" | "UNKNOWN"


WorkflowService​

Ƭ WorkflowService: WorkflowService


WorkflowSignalWithStartOptions​

Ƭ WorkflowSignalWithStartOptions<SignalArgs>: WorkflowSignalWithStartOptionsBase<SignalArgs> & SignalWithStartTypeInfoOptions

Type parameters​

NameType
SignalArgsextends any[] = []

WorkflowStartOptions​

Ƭ WorkflowStartOptions<T>: WithWorkflowArgs<T, WorkflowOptions>

Options for starting a Workflow

Type parameters​

NameType
Textends Workflow = Workflow

WorkflowUpdateStage​

Ƭ WorkflowUpdateStage: typeof WorkflowUpdateStage[keyof typeof WorkflowUpdateStage]

Variables​

ActivityExecutionStatus​

• Const ActivityExecutionStatus: Object

Type declaration​

NameType
CANCELED"CANCELED"
COMPLETED"COMPLETED"
FAILED"FAILED"
PAUSED"PAUSED"
RUNNING"RUNNING"
TERMINATED"TERMINATED"
TIMED_OUT"TIMED_OUT"

ActivityIdConflictPolicy​

• Const ActivityIdConflictPolicy: Object

Type declaration​

NameType
FAIL"FAIL"
USE_EXISTING"USE_EXISTING"

ActivityIdReusePolicy​

• Const ActivityIdReusePolicy: Object

Type declaration​

NameType
ALLOW_DUPLICATE"ALLOW_DUPLICATE"
ALLOW_DUPLICATE_FAILED_ONLY"ALLOW_DUPLICATE_FAILED_ONLY"
REJECT_DUPLICATE"REJECT_DUPLICATE"

DAYS_OF_WEEK​

• Const DAYS_OF_WEEK: readonly ["SUNDAY", "MONDAY", "TUESDAY", "WEDNESDAY", "THURSDAY", "FRIDAY", "SATURDAY"]


HealthService​

• HealthService: typeof Health


InternalConnectionLikeSymbol​

• Const InternalConnectionLikeSymbol: unique symbol


LOCAL_TARGET​

• Const LOCAL_TARGET: "localhost:7233"


MONTHS​

• Const MONTHS: readonly ["JANUARY", "FEBRUARY", "MARCH", "APRIL", "MAY", "JUNE", "JULY", "AUGUST", "SEPTEMBER", "OCTOBER", "NOVEMBER", "DECEMBER"]


NexusOperationCancellationState​

• Const NexusOperationCancellationState: Object

State of a Nexus operation cancellation.

Type declaration​

NameType
BACKING_OFF"BACKING_OFF"
BLOCKED"BLOCKED"
FAILED"FAILED"
SCHEDULED"SCHEDULED"
SUCCEEDED"SUCCEEDED"
TIMED_OUT"TIMED_OUT"

NexusOperationExecutionStatus​

• Const NexusOperationExecutionStatus: Object

A general status for a Nexus operation, indicating whether it is currently running or in a terminal state.

Type declaration​

NameType
CANCELED"CANCELED"
COMPLETED"COMPLETED"
FAILED"FAILED"
RUNNING"RUNNING"
TERMINATED"TERMINATED"
TIMED_OUT"TIMED_OUT"

NexusOperationIdConflictPolicy​

• Const NexusOperationIdConflictPolicy: Object

Defines how to resolve an operation ID conflict with a running Nexus operation.

See NexusOperationIdReusePolicy for handling operation ID duplication with a closed operation.

Type declaration​

NameType
FAIL"FAIL"
USE_EXISTING"USE_EXISTING"

NexusOperationIdReusePolicy​

• Const NexusOperationIdReusePolicy: Object

Defines whether to allow re-using an operation ID from a previously completed Nexus operation.

See NexusOperationIdConflictPolicy for handling ID duplication with a running operation.

Type declaration​

NameType
ALLOW_DUPLICATE"ALLOW_DUPLICATE"
ALLOW_DUPLICATE_FAILED_ONLY"ALLOW_DUPLICATE_FAILED_ONLY"
REJECT_DUPLICATE"REJECT_DUPLICATE"

OperatorService​

• OperatorService: typeof OperatorService


PendingActivityState​

• Const PendingActivityState: Object

Type declaration​

NameType
CANCEL_REQUESTED"CANCEL_REQUESTED"
PAUSED"PAUSED"
PAUSE_REQUESTED"PAUSE_REQUESTED"
SCHEDULED"SCHEDULED"
STARTED"STARTED"

PendingNexusOperationState​

• Const PendingNexusOperationState: Object

A more detailed breakdown of NexusOperationExecutionStatus.RUNNING.

Type declaration​

NameType
BACKING_OFF"BACKING_OFF"
BLOCKED"BLOCKED"
SCHEDULED"SCHEDULED"
STARTED"STARTED"

QueryRejectCondition​

• Const QueryRejectCondition: Object

Type declaration​

NameTypeDescription
NONE"NONE"-
NOT_COMPLETED_CLEANLY"NOT_COMPLETED_CLEANLY"-
NOT_OPEN"NOT_OPEN"-
QUERY_REJECT_CONDITION_NONE"NONE"Deprecated Use NONE instead.
QUERY_REJECT_CONDITION_NOT_COMPLETED_CLEANLY"NOT_COMPLETED_CLEANLY"Deprecated Use NOT_COMPLETED_CLEANLY instead.
QUERY_REJECT_CONDITION_NOT_OPEN"NOT_OPEN"Deprecated Use NOT_OPEN instead.
QUERY_REJECT_CONDITION_UNSPECIFIEDundefinedDeprecated Use undefined instead.

ReachabilityType​

• Const ReachabilityType: Object

There are different types of reachability:

  • NEW_WORKFLOWS: The Build Id might be used by new workflows
  • EXISTING_WORKFLOWS The Build Id might be used by open workflows and/or closed workflows.
  • OPEN_WORKFLOWS The Build Id might be used by open workflows
  • CLOSED_WORKFLOWS The Build Id might be used by closed workflows

Deprecated

Worker Versioning is now deprecated. Please use the Worker Deployment API instead: https://docs.temporal.io/worker-deployments

Type declaration​

NameTypeDescription
CLOSED_WORKFLOWS"CLOSED_WORKFLOWS"The Build Id might be used by closed workflows.
EXISTING_WORKFLOWS"EXISTING_WORKFLOWS"The Build Id might be used by open workflows and/or closed workflows.
NEW_WORKFLOWS"NEW_WORKFLOWS"The Build Id might be used by new workflows.
OPEN_WORKFLOWS"OPEN_WORKFLOWS"The Build Id might be used by open workflows.

ScheduleOverlapPolicy​

• Const ScheduleOverlapPolicy: Object

Policy for overlapping Actions.

Type declaration​

NameTypeDescription
ALLOW_ALL"ALLOW_ALL"Allow any number of Actions to start immediately. This is the only policy under which multiple Actions can run concurrently.
BUFFER_ALL"BUFFER_ALL"Allows an unlimited number of Actions to buffer. They are started sequentially.
BUFFER_ONE"BUFFER_ONE"Start another Action as soon as the current Action completes, but only buffer one Action in this way. If another Action is supposed to start, but one Action is running and one is already buffered, then only the buffered one will be started after the running Action finishes.
CANCEL_OTHER"CANCEL_OTHER"Cancels the running Action, and then starts the new Action once the cancelled one completes.
SKIP"SKIP"Don't start a new Action. Default ts
TERMINATE_OTHER"TERMINATE_OTHER"Terminate the running Action and start the new Action immediately.
UNSPECIFIEDundefinedUse server default (currently SKIP). Deprecated Either leave property undefined, or use SKIP instead.

TestService​

• TestService: typeof TestService


UnversionedBuildId​

• Const UnversionedBuildId: unique symbol

A stand-in for a Build Id for unversioned Workers

Deprecated

Worker Versioning is now deprecated. Please use the Worker Deployment API instead: https://docs.temporal.io/worker-deployments


WorkflowService​

• WorkflowService: typeof WorkflowService


WorkflowUpdateStage​

• Const WorkflowUpdateStage: Object

Type declaration​

NameTypeDescription
ACCEPTED"ACCEPTED"Accepted stage. This stage is reached when a workflow has received the update and either accepted it (i.e. it has passed validation, or there was no validator configured on the update handler) or rejected it. This is currently the only allowed value when using startUpdate.
ADMITTED"ADMITTED"Admitted stage. This stage is reached when the server accepts the update request. It is not allowed to wait for this stage when using startUpdate, since the update request has not yet been durably persisted at this stage.
COMPLETED"COMPLETED"Completed stage. This stage is reached when a workflow has completed processing the update with either a success or failure.
UNSPECIFIEDundefinedThis is not an allowed value. Deprecated

Functions​

compileWorkflowOptions​

▸ compileWorkflowOptions<T>(options): WithCompiledWorkflowOptions<T>

Type parameters​

NameType
Textends WorkflowOptions

Parameters​

NameType
optionsT

Returns​

WithCompiledWorkflowOptions<T>


decodeActivityExecutionStatus​

▸ decodeActivityExecutionStatus(input): undefined | "RUNNING" | "FAILED" | "COMPLETED" | "TERMINATED" | "TIMED_OUT" | "PAUSED" | "CANCELED"

Parameters​

NameType
inputundefined | null | ActivityExecutionStatus

Returns​

undefined | "RUNNING" | "FAILED" | "COMPLETED" | "TERMINATED" | "TIMED_OUT" | "PAUSED" | "CANCELED"


decodeActivityIdConflictPolicy​

▸ decodeActivityIdConflictPolicy(input): undefined | "FAIL" | "USE_EXISTING"

Parameters​

NameType
inputundefined | null | ActivityIdConflictPolicy

Returns​

undefined | "FAIL" | "USE_EXISTING"


decodeActivityIdReusePolicy​

▸ decodeActivityIdReusePolicy(input): undefined | "ALLOW_DUPLICATE" | "ALLOW_DUPLICATE_FAILED_ONLY" | "REJECT_DUPLICATE"

Parameters​

NameType
inputundefined | null | ActivityIdReusePolicy

Returns​

undefined | "ALLOW_DUPLICATE" | "ALLOW_DUPLICATE_FAILED_ONLY" | "REJECT_DUPLICATE"


decodeNexusOperationCancellationState​

▸ decodeNexusOperationCancellationState(input): undefined | "FAILED" | "TIMED_OUT" | "SCHEDULED" | "BACKING_OFF" | "BLOCKED" | "SUCCEEDED"

Parameters​

NameType
inputundefined | null | NexusOperationCancellationState

Returns​

undefined | "FAILED" | "TIMED_OUT" | "SCHEDULED" | "BACKING_OFF" | "BLOCKED" | "SUCCEEDED"


decodeNexusOperationExecutionStatus​

▸ decodeNexusOperationExecutionStatus(input): undefined | "RUNNING" | "FAILED" | "COMPLETED" | "TERMINATED" | "TIMED_OUT" | "CANCELED"

Parameters​

NameType
inputundefined | null | NexusOperationExecutionStatus

Returns​

undefined | "RUNNING" | "FAILED" | "COMPLETED" | "TERMINATED" | "TIMED_OUT" | "CANCELED"


decodeNexusOperationIdConflictPolicy​

▸ decodeNexusOperationIdConflictPolicy(input): undefined | "FAIL" | "USE_EXISTING"

Parameters​

NameType
inputundefined | null | NexusOperationIdConflictPolicy

Returns​

undefined | "FAIL" | "USE_EXISTING"


decodeNexusOperationIdReusePolicy​

▸ decodeNexusOperationIdReusePolicy(input): undefined | "ALLOW_DUPLICATE" | "ALLOW_DUPLICATE_FAILED_ONLY" | "REJECT_DUPLICATE"

Parameters​

NameType
inputundefined | null | NexusOperationIdReusePolicy

Returns​

undefined | "ALLOW_DUPLICATE" | "ALLOW_DUPLICATE_FAILED_ONLY" | "REJECT_DUPLICATE"


decodePendingActivityState​

▸ decodePendingActivityState(input): undefined | "CANCEL_REQUESTED" | "PAUSED" | "SCHEDULED" | "STARTED" | "PAUSE_REQUESTED"

Parameters​

NameType
inputundefined | null | PendingActivityState

Returns​

undefined | "CANCEL_REQUESTED" | "PAUSED" | "SCHEDULED" | "STARTED" | "PAUSE_REQUESTED"


decodePendingNexusOperationState​

▸ decodePendingNexusOperationState(input): undefined | "SCHEDULED" | "STARTED" | "BACKING_OFF" | "BLOCKED"

Parameters​

NameType
inputundefined | null | PendingNexusOperationState

Returns​

undefined | "SCHEDULED" | "STARTED" | "BACKING_OFF" | "BLOCKED"


decodeQueryRejectCondition​

▸ decodeQueryRejectCondition(input): undefined | "NONE" | "NOT_OPEN" | "NOT_COMPLETED_CLEANLY"

Parameters​

NameType
inputundefined | null | QueryRejectCondition

Returns​

undefined | "NONE" | "NOT_OPEN" | "NOT_COMPLETED_CLEANLY"


decodeScheduleOverlapPolicy​

▸ decodeScheduleOverlapPolicy(input): undefined | "SKIP" | "BUFFER_ONE" | "BUFFER_ALL" | "CANCEL_OTHER" | "TERMINATE_OTHER" | "ALLOW_ALL"

Parameters​

NameType
inputundefined | null | ScheduleOverlapPolicy

Returns​

undefined | "SKIP" | "BUFFER_ONE" | "BUFFER_ALL" | "CANCEL_OTHER" | "TERMINATE_OTHER" | "ALLOW_ALL"


decodeTaskReachability​

▸ decodeTaskReachability(input): undefined | "NEW_WORKFLOWS" | "EXISTING_WORKFLOWS" | "OPEN_WORKFLOWS" | "CLOSED_WORKFLOWS"

Parameters​

NameType
inputundefined | null | TaskReachability

Returns​

undefined | "NEW_WORKFLOWS" | "EXISTING_WORKFLOWS" | "OPEN_WORKFLOWS" | "CLOSED_WORKFLOWS"


defaultGrpcRetryOptions​

▸ defaultGrpcRetryOptions(options?): GrpcRetryOptions

Generates the default retry behavior based on given backoff options

Parameters​

NameType
options?Partial<BackoffOptions>

Returns​

GrpcRetryOptions


encodeActivityExecutionStatus​

▸ encodeActivityExecutionStatus(input): undefined | ActivityExecutionStatus

Parameters​

NameType
inputundefined | null | ActivityExecutionStatus | "RUNNING" | "FAILED" | "COMPLETED" | "TERMINATED" | "TIMED_OUT" | "PAUSED" | "CANCELED" | "ACTIVITY_EXECUTION_STATUS_RUNNING" | "ACTIVITY_EXECUTION_STATUS_COMPLETED" | "ACTIVITY_EXECUTION_STATUS_FAILED" | "ACTIVITY_EXECUTION_STATUS_CANCELED" | "ACTIVITY_EXECUTION_STATUS_TERMINATED" | "ACTIVITY_EXECUTION_STATUS_TIMED_OUT" | "ACTIVITY_EXECUTION_STATUS_PAUSED"

Returns​

undefined | ActivityExecutionStatus


encodeActivityIdConflictPolicy​

▸ encodeActivityIdConflictPolicy(input): undefined | ActivityIdConflictPolicy

Parameters​

NameType
inputundefined | null | ActivityIdConflictPolicy | "FAIL" | "USE_EXISTING" | "ACTIVITY_ID_CONFLICT_POLICY_FAIL" | "ACTIVITY_ID_CONFLICT_POLICY_USE_EXISTING"

Returns​

undefined | ActivityIdConflictPolicy


encodeActivityIdReusePolicy​

▸ encodeActivityIdReusePolicy(input): undefined | ActivityIdReusePolicy

Parameters​

NameType
inputundefined | null | ActivityIdReusePolicy | "ALLOW_DUPLICATE" | "ALLOW_DUPLICATE_FAILED_ONLY" | "REJECT_DUPLICATE" | "ACTIVITY_ID_REUSE_POLICY_ALLOW_DUPLICATE" | "ACTIVITY_ID_REUSE_POLICY_ALLOW_DUPLICATE_FAILED_ONLY" | "ACTIVITY_ID_REUSE_POLICY_REJECT_DUPLICATE"

Returns​

undefined | ActivityIdReusePolicy


encodeNexusOperationCancellationState​

▸ encodeNexusOperationCancellationState(input): undefined | NexusOperationCancellationState

Parameters​

NameType
inputundefined | null | NexusOperationCancellationState | "FAILED" | "TIMED_OUT" | "SCHEDULED" | "BACKING_OFF" | "BLOCKED" | "SUCCEEDED" | "NEXUS_OPERATION_CANCELLATION_STATE_SCHEDULED" | "NEXUS_OPERATION_CANCELLATION_STATE_BACKING_OFF" | "NEXUS_OPERATION_CANCELLATION_STATE_SUCCEEDED" | "NEXUS_OPERATION_CANCELLATION_STATE_FAILED" | "NEXUS_OPERATION_CANCELLATION_STATE_TIMED_OUT" | "NEXUS_OPERATION_CANCELLATION_STATE_BLOCKED"

Returns​

undefined | NexusOperationCancellationState


encodeNexusOperationExecutionStatus​

▸ encodeNexusOperationExecutionStatus(input): undefined | NexusOperationExecutionStatus

Parameters​

NameType
inputundefined | null | NexusOperationExecutionStatus | "RUNNING" | "FAILED" | "COMPLETED" | "TERMINATED" | "TIMED_OUT" | "CANCELED" | "NEXUS_OPERATION_EXECUTION_STATUS_RUNNING" | "NEXUS_OPERATION_EXECUTION_STATUS_COMPLETED" | "NEXUS_OPERATION_EXECUTION_STATUS_FAILED" | "NEXUS_OPERATION_EXECUTION_STATUS_CANCELED" | "NEXUS_OPERATION_EXECUTION_STATUS_TERMINATED" | "NEXUS_OPERATION_EXECUTION_STATUS_TIMED_OUT"

Returns​

undefined | NexusOperationExecutionStatus


encodeNexusOperationIdConflictPolicy​

▸ encodeNexusOperationIdConflictPolicy(input): undefined | NexusOperationIdConflictPolicy

Parameters​

NameType
inputundefined | null | NexusOperationIdConflictPolicy | "FAIL" | "USE_EXISTING" | "NEXUS_OPERATION_ID_CONFLICT_POLICY_FAIL" | "NEXUS_OPERATION_ID_CONFLICT_POLICY_USE_EXISTING"

Returns​

undefined | NexusOperationIdConflictPolicy


encodeNexusOperationIdReusePolicy​

▸ encodeNexusOperationIdReusePolicy(input): undefined | NexusOperationIdReusePolicy

Parameters​

NameType
inputundefined | null | NexusOperationIdReusePolicy | "ALLOW_DUPLICATE" | "ALLOW_DUPLICATE_FAILED_ONLY" | "REJECT_DUPLICATE" | "NEXUS_OPERATION_ID_REUSE_POLICY_ALLOW_DUPLICATE" | "NEXUS_OPERATION_ID_REUSE_POLICY_ALLOW_DUPLICATE_FAILED_ONLY" | "NEXUS_OPERATION_ID_REUSE_POLICY_REJECT_DUPLICATE"

Returns​

undefined | NexusOperationIdReusePolicy


encodePendingActivityState​

▸ encodePendingActivityState(input): undefined | PendingActivityState

Parameters​

NameType
inputundefined | null | PendingActivityState | "CANCEL_REQUESTED" | "PAUSED" | "SCHEDULED" | "STARTED" | "PAUSE_REQUESTED" | "PENDING_ACTIVITY_STATE_SCHEDULED" | "PENDING_ACTIVITY_STATE_STARTED" | "PENDING_ACTIVITY_STATE_CANCEL_REQUESTED" | "PENDING_ACTIVITY_STATE_PAUSED" | "PENDING_ACTIVITY_STATE_PAUSE_REQUESTED"

Returns​

undefined | PendingActivityState


encodePendingNexusOperationState​

▸ encodePendingNexusOperationState(input): undefined | PendingNexusOperationState

Parameters​

NameType
inputundefined | null | PendingNexusOperationState | "SCHEDULED" | "STARTED" | "BACKING_OFF" | "BLOCKED" | "PENDING_NEXUS_OPERATION_STATE_SCHEDULED" | "PENDING_NEXUS_OPERATION_STATE_BACKING_OFF" | "PENDING_NEXUS_OPERATION_STATE_STARTED" | "PENDING_NEXUS_OPERATION_STATE_BLOCKED"

Returns​

undefined | PendingNexusOperationState


encodeQueryRejectCondition​

▸ encodeQueryRejectCondition(input): undefined | QueryRejectCondition

Parameters​

NameType
inputundefined | null | QueryRejectCondition | "NONE" | "NOT_OPEN" | "NOT_COMPLETED_CLEANLY" | "QUERY_REJECT_CONDITION_NONE" | "QUERY_REJECT_CONDITION_NOT_OPEN" | "QUERY_REJECT_CONDITION_NOT_COMPLETED_CLEANLY"

Returns​

undefined | QueryRejectCondition


encodeScheduleOverlapPolicy​

▸ encodeScheduleOverlapPolicy(input): undefined | ScheduleOverlapPolicy

Parameters​

NameType
inputundefined | null | ScheduleOverlapPolicy | "SKIP" | "BUFFER_ONE" | "BUFFER_ALL" | "CANCEL_OTHER" | "TERMINATE_OTHER" | "ALLOW_ALL" | "SCHEDULE_OVERLAP_POLICY_SKIP" | "SCHEDULE_OVERLAP_POLICY_BUFFER_ONE" | "SCHEDULE_OVERLAP_POLICY_BUFFER_ALL" | "SCHEDULE_OVERLAP_POLICY_CANCEL_OTHER" | "SCHEDULE_OVERLAP_POLICY_TERMINATE_OTHER" | "SCHEDULE_OVERLAP_POLICY_ALLOW_ALL"

Returns​

undefined | ScheduleOverlapPolicy


encodeTaskReachability​

▸ encodeTaskReachability(input): undefined | TaskReachability

Parameters​

NameType
inputundefined | null | TaskReachability | "NEW_WORKFLOWS" | "EXISTING_WORKFLOWS" | "OPEN_WORKFLOWS" | "CLOSED_WORKFLOWS" | "TASK_REACHABILITY_NEW_WORKFLOWS" | "TASK_REACHABILITY_EXISTING_WORKFLOWS" | "TASK_REACHABILITY_OPEN_WORKFLOWS" | "TASK_REACHABILITY_CLOSED_WORKFLOWS"

Returns​

undefined | TaskReachability


isGrpcCancelledError​

▸ isGrpcCancelledError(err): err is Error

Returns true if the provided error or its cause is a GrpcServiceError with code CANCELLED.

Parameters​

NameType
errunknown

Returns​

err is Error

See

Connection.withAbortSignal


isGrpcDeadlineError​

▸ isGrpcDeadlineError(err): err is Error

Returns true if the provided error or its cause is a GrpcServiceError with code DEADLINE_EXCEEDED.

Parameters​

NameType
errunknown

Returns​

err is Error

See

Connection.withDeadline


isGrpcServiceError​

▸ isGrpcServiceError(err): err is ServiceError

Returns true if the provided error is a GrpcServiceError.

Parameters​

NameType
errunknown

Returns​

err is ServiceError


isRetryableError​

▸ isRetryableError(status): boolean

Parameters​

NameType
statusStatusObject

Returns​

boolean


isServerErrorResponse​

▸ isServerErrorResponse(err): err is ServiceError

Parameters​

NameType
errunknown

Returns​

err is ServiceError

Deprecated

Use isGrpcServiceError instead


makeGrpcRetryInterceptor​

▸ makeGrpcRetryInterceptor(retryOptions): Interceptor

Returns a GRPC interceptor that will perform automatic retries for some types of failed calls

Parameters​

NameTypeDescription
retryOptionsGrpcRetryOptionsOptions for the retry interceptor

Returns​

Interceptor


reachabilityResponseFromProto​

▸ reachabilityResponseFromProto(resp): ReachabilityResponse

Parameters​

NameType
respGetWorkerTaskReachabilityResponse

Returns​

ReachabilityResponse