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
- ActivityCancelledError
- ActivityClient
- ActivityCompletionError
- ActivityExecutionAlreadyStartedError
- ActivityExecutionFailedError
- ActivityNotFoundError
- ActivityPausedError
- ActivityResetError
- AsyncCompletionClient
BuildIdNotFoundError- Client
- Connection
- NexusClient
- NexusOperationAlreadyStartedError
- NexusOperationFailureError
- NexusOperationNotFoundError
- QueryNotRegisteredError
- QueryRejectedError
- ScheduleAlreadyRunning
- ScheduleClient
- ScheduleNotFoundError
- ServiceError
TaskQueueClient- WithStartWorkflowOperation
- WorkflowClient
- WorkflowContinuedAsNewError
- WorkflowFailedError
- WorkflowUpdateFailedError
- WorkflowUpdateRPCTimeoutOrCancelledError
Interfaces
- ActivityCancelInput
- ActivityClientInterceptor
- ActivityClientOptions
- ActivityCountInput
- ActivityDescribeInput
- ActivityDescribeOptions
- ActivityExecutionDescription
- ActivityExecutionInfo
- ActivityGetResultInput
- ActivityHandle
- ActivityListInput
- ActivityOptions
- ActivityOptionsUpdate
- ActivityPauseInput
- ActivityPauseOptions
- ActivityRestoreOriginalOptionsInput
- ActivityStartInput
- ActivityTerminateInput
- ActivityUnpauseInput
- ActivityUnpauseOptions
- ActivityUpdateOptionsInput
AddNewCompatibleVersionAddNewIdInNewDefaultSet- AsyncCompletionCompleteOptions
- AsyncCompletionOperationOptions
- AsyncWorkflowListIterable
- Backfill
- BackoffOptions
BaseReachabilityOptionsBuildIdReachabilityBuildIdVersionSet- CalendarSpec
- CalendarSpecDescription
- CallContext
- CancelNexusOperationInput
- ClientInterceptors
- ClientOptions
- ClientPlugin
- CompiledWorkflowOptions
- ConnectionLike
- ConnectionOptions
- ConnectionPlugin
- CountActivityExecutions
- CountNexusOperationsInput
- CountWorkflowExecution
- CreateScheduleInput
- DescribeNexusOperationInput
- DescribeNexusOperationOptions
- FullActivityId
- GetActivityHandleOptions
- GetNexusOperationHandleOptions
- GetNexusOperationResultInput
- GetWorkflowHandleOptions
- GetWorkflowUpdateHandleOptions
- GrpcRetryOptions
- IntervalSpec
- IntervalSpecDescription
- IntoHistoriesOptions
- ListNexusOperationsInput
- ListNexusOperationsOptions
- ListOptions
- ListScheduleOptions
MergeSets- NexusClientInterceptor
- NexusClientOptions
- NexusOperationExecution
- NexusOperationExecutionCancellationInfo
- NexusOperationExecutionCount
- NexusOperationExecutionCountGroup
- NexusOperationExecutionCountGroupValue
- NexusOperationHandle
- NexusServiceClient
PromoteBuildIdWithinSetPromoteSetByBuildId- Range
ReachabilityResponse- ScheduleClientInterceptor
- ScheduleClientOptions
- ScheduleExecutionResult
- ScheduleExecutionStartWorkflowActionResult
- ScheduleHandle
- ScheduleOptions
- ScheduleSpec
- ScheduleSummary
- ScheduleSummaryStartWorkflowAction
- StartNexusOperationInput
- StartNexusOperationOptions
- TerminateNexusOperationInput
- TypedActivityClient
WorkerBuildIdVersionSets- WorkflowCancelInput
- WorkflowClientCallsInterceptorFactory
WorkflowClientCallsInterceptorFactoryInput- WorkflowClientInterceptor
- WorkflowClientInterceptors
- WorkflowClientOptions
- WorkflowDescribeInput
- WorkflowExecution
- WorkflowExecutionInfo
- WorkflowFetchHistoryInput
- WorkflowHandle
- WorkflowHandleWithFirstExecutionRunId
- WorkflowHandleWithSignaledRunId
- WorkflowHandleWithStartDetails
- WorkflowListInput
- WorkflowOptions
- WorkflowQueryInput
- WorkflowResultOptions
- WorkflowSignalInput
- WorkflowSignalWithStartInput
- WorkflowSignalWithStartOptionsWithArgs
- WorkflowSignalWithStartOptionsWithoutArgs
- WorkflowStartInput
- WorkflowStartOutput
- WorkflowStartUpdateInput
- WorkflowStartUpdateOutput
- WorkflowStartUpdateWithStartInput
- WorkflowStartUpdateWithStartOutput
- WorkflowTerminateInput
- WorkflowUpdateHandle
- WorkflowUpdateOptions
Type Aliases
ActivityArgs
ActivityArgs<
T,N> =T[N] extendsActivityFunction<infer P,any> ?P:never
Utility type to support strong typing in TypedActivityClient. Extracts argument types of an activity.
Type Parameters
T
T
Activity interface
N
N extends ActivityName<T>
Activity name
ActivityExecutionStatus
ActivityExecutionStatus = typeof
ActivityExecutionStatus[keyof typeofActivityExecutionStatus]
ActivityHandleDefinitionOptions
ActivityHandleDefinitionOptions<
A> =Replace<GetActivityHandleOptions, {activity:A;typeInfo?:never; }>
Experimental
Options for getting an Activity handle using an Activity definition.
Standalone Activities are experimental. APIs may be subject to change.
Type Parameters
A
A extends ActivityFunction
ActivityIdConflictPolicy
ActivityIdConflictPolicy = typeof
ActivityIdConflictPolicy[keyof typeofActivityIdConflictPolicy]
ActivityIdReusePolicy
ActivityIdReusePolicy = typeof
ActivityIdReusePolicy[keyof typeofActivityIdReusePolicy]
ActivityName
ActivityName<
T> ={ [N in keyof T & string]: T[N] extends ActivityFunction<any, any> ? N : never }[keyofT&string]
Utility type to support strong typing in TypedActivityClient. Contains names of activities extracted from the specified activity interface.
Type Parameters
T
T
Activity 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
T
T
Activity interface
N
N extends ActivityName<T>
Activity name
ActivityOptionsUpdateResult
ActivityOptionsUpdateResult =
{ [K in keyof ActivityOptionsUpdate]: Exclude<ActivityOptionsUpdate[K], null> }
Experimental
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> =Argsextends [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
Args
Args extends any[]
Types of activity arguments as an array type.
ActivityResult
ActivityResult<
T,N> =T[N] extendsActivityFunction<any, infer R> ?R:never
Utility type to support strong typing in TypedActivityClient. Extracts result type of an activity.
Type Parameters
T
T
Activity interface
N
N extends 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">> &object
Type Declaration
connectTimeoutMs
connectTimeoutMs:
number
CreateScheduleOutput
CreateScheduleOutput =
object
Properties
conflictToken
readonlyconflictToken:Uint8Array
DayOfWeek
DayOfWeek = typeof
DAYS_OF_WEEK[number]
DescribeWorkflowExecutionResponse
DescribeWorkflowExecutionResponse =
IDescribeWorkflowExecutionResponse
GetWorkflowExecutionHistoryRequest
GetWorkflowExecutionHistoryRequest =
IGetWorkflowExecutionHistoryRequest
HealthService
HealthService =
Health
InternalConnectionLike
InternalConnectionLike =
ConnectionLike&object
Type Declaration
[InternalConnectionLikeSymbol]?
optional[InternalConnectionLikeSymbol]?:object
[InternalConnectionLikeSymbol].supportsEagerStart?
readonlyoptionalsupportsEagerStart?:boolean
Capability flag that determines whether the connection supports eager workflow start. This will only be true if the underlying connection is a NativeConnection.
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
Unit
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 typeofNexusOperationCancellationState]
State of a Nexus operation cancellation.
NexusOperationExecutionDescription
NexusOperationExecutionDescription =
Replace<NexusOperationExecution, {raw:INexusOperationExecutionInfo; }> &object
Detailed information about a standalone Nexus operation execution.
Type Declaration
attempt
readonlyattempt:number
Current attempt number.
blockedReason
readonlyblockedReason:string|undefined
Reason the operation is blocked, if any.
cancellationInfo
readonlycancellationInfo:NexusOperationExecutionCancellationInfo|undefined
Cancellation info if cancellation was requested.
expirationTime
readonlyexpirationTime:Date|undefined
Scheduled time plus schedule_to_close_timeout.
identity
readonlyidentity:string
Identity of the client that started this operation.
lastAttemptCompleteTime
readonlylastAttemptCompleteTime:Date|undefined
Time when the last attempt completed.
lastAttemptFailure
readonlylastAttemptFailure:Error|undefined
Failure from the last failed attempt, if any.
nextAttemptScheduleTime
readonlynextAttemptScheduleTime:Date|undefined
Time when the next attempt will be scheduled.
operationToken
readonlyoperationToken:string|undefined
operationToken is only set for asynchronous operations after a successful start_operation call.
requestId
readonlyrequestId:string
Server-generated request ID used as an idempotency token.
scheduleToCloseTimeout
readonlyscheduleToCloseTimeout:number|undefined
Schedule-to-close timeout for this operation in milliseconds.
scheduleToStartTimeout
readonlyscheduleToStartTimeout:number|undefined
Schedule-to-start timeout for this operation in milliseconds.
startToCloseTimeout
readonlystartToCloseTimeout:number|undefined
Start-to-close timeout for this operation in milliseconds.
state
readonlystate:PendingNexusOperationState|undefined
More detailed breakdown if status is NexusOperationExecutionStatus.RUNNING.
staticDetails
staticDetails: () =>
Promise<string|undefined>
Returns
Promise<string | undefined>
staticSummary
staticSummary: () =>
Promise<string|undefined>
Returns
Promise<string | undefined>
NexusOperationExecutionStatus
NexusOperationExecutionStatus = typeof
NexusOperationExecutionStatus[keyof typeofNexusOperationExecutionStatus]
A general status for a Nexus operation, indicating whether it is currently running or in a terminal state.
NexusOperationHandleDefinitionOptions
NexusOperationHandleDefinitionOptions<
Op> =Replace<GetNexusOperationHandleOptions, {operation:Op;typeInfo?:never; }>
Options for getting a Nexus Operation handle using an Operation definition.
Type Parameters
Op
Op extends nexus.OperationDefinition<any, any>
NexusOperationIdConflictPolicy
NexusOperationIdConflictPolicy = typeof
NexusOperationIdConflictPolicy[keyof typeofNexusOperationIdConflictPolicy]
Defines how to resolve an operation ID conflict with a running Nexus operation.
See NexusOperationIdReusePolicy for handling operation ID duplication with a closed operation.
NexusOperationIdReusePolicy
NexusOperationIdReusePolicy = typeof
NexusOperationIdReusePolicy[keyof typeofNexusOperationIdReusePolicy]
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.
OperatorService
OperatorService =
OperatorService
PendingActivityState
PendingActivityState = typeof
PendingActivityState[keyof typeofPendingActivityState]
PendingNexusOperationState
PendingNexusOperationState = typeof
PendingNexusOperationState[keyof typeofPendingNexusOperationState]
A more detailed breakdown of NexusOperationExecutionStatus.RUNNING.
QueryRejectCondition
QueryRejectCondition = typeof
QueryRejectCondition[keyof typeofQueryRejectCondition]
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 typeofReachabilityType]
There are different types of reachability:
NEW_WORKFLOWS: The Build Id might be used by new workflowsEXISTING_WORKFLOWSThe Build Id might be used by open workflows and/or closed workflows.OPEN_WORKFLOWSThe Build Id might be used by open workflowsCLOSED_WORKFLOWSThe 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
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.
Properties
action
action:
ScheduleDescriptionAction
The Action that will be taken.
info
info:
object
createdAt
createdAt:
Date
lastUpdatedAt
lastUpdatedAt:
Date|undefined
nextActionTimes
nextActionTimes:
Date[]
Next upcoming scheduled times of this Schedule
numActionsMissedCatchupWindow
numActionsMissedCatchupWindow:
number
Number of times a scheduled Action was skipped due to missing the catchup window.
numActionsSkippedOverlap
numActionsSkippedOverlap:
number
Number of Actions skipped due to overlap.
numActionsTaken
numActionsTaken:
number
Number of Actions taken so far.
recentActions
recentActions:
ScheduleExecutionResult[]
Most recent actions started (including manual triggers), sorted from older start time to newer.
runningActions
runningActions:
ScheduleExecutionActionResult[]
Currently-running workflows started by this schedule. (There might be more than one if the overlap policy allows overlaps.)
memo?
optionalmemo?:Record<string,unknown>
Additional non-indexed information attached to the Schedule. The values can be anything that is serializable by the DataConverter.
policies
policies:
object
catchupWindow
catchupWindow:
number
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.
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.
overlap
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.
pauseOnFailure
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.
scheduleId
scheduleId:
string
The Schedule Id. We recommend using a meaningful business identifier.
searchAttributes
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:
ScheduleSpecDescription
When will Actions be taken.
state
state:
object
note?
optionalnote?: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
paused:
boolean
Whether Schedule is currently paused.
remainingActions?
optionalremainingActions?:number
The 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.
typedSearchAttributes
typedSearchAttributes:
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.
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> =object&Pick<WorkflowStartOptions<W>,"taskQueue"|"args"|"memo"|"searchAttributes"|"typedSearchAttributes"|"retry"|"workflowExecutionTimeout"|"workflowRunTimeout"|"workflowTaskTimeout"|"staticDetails"|"staticSummary"> &object
Type Parameters
W
W extends Workflow
Type Declaration
type
type:
"startWorkflow"
workflowType
workflowType:
string|W
workflowId?
optionalworkflowId?:string
Workflow id to use when starting. Assign a meaningful business id. This ID can be used to ensure starting Workflows is idempotent.
Default
${scheduleId}-workflow
ScheduleOverlapPolicy
ScheduleOverlapPolicy = typeof
ScheduleOverlapPolicy[keyof typeofScheduleOverlapPolicy]
Policy for overlapping Actions.
ScheduleSpecDescription
ScheduleSpecDescription =
Omit<ScheduleSpec,"calendars"|"intervals"|"cronExpressions"|"skip"|"jitter"> &object
The version of ScheduleSpec that you get back from ScheduleHandle.describe and ScheduleClient.list
Type Declaration
calendars?
optionalcalendars?:CalendarSpecDescription[]
Calendar-based specifications of times.
intervals?
optionalintervals?:IntervalSpecDescription[]
Interval-based specifications of times.
jitter?
optionaljitter?:number
All times will be incremented by a random value from 0 to this amount of jitter.
Default
1 second
Format
number of milliseconds
skip?
optionalskip?:CalendarSpecDescription[]
Any matching times will be skipped.
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
A
A extends 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
T
T extends WorkflowOptions
WorkflowClientCallsInterceptor
WorkflowClientCallsInterceptor =
WorkflowClientInterceptor
@deprecated: Use WorkflowClientInterceptor instead
WorkflowExecutionDescription
WorkflowExecutionDescription =
Replace<WorkflowExecutionInfo, {raw:DescribeWorkflowExecutionResponse; }> &object
Type Declaration
staticDetails
staticDetails: () =>
Promise<string|undefined>
General fixed details for this workflow execution that may appear in UI/CLI. This can be in Temporal markdown format and can span multiple lines.
Returns
Promise<string | undefined>
staticSummary
staticSummary: () =>
Promise<string|undefined>
A single-line fixed summary for this workflow execution that may appear in the UI/CLI. This can be in single-line Temporal markdown format.
Returns
Promise<string | undefined>
WorkflowExecutionStatusName
WorkflowExecutionStatusName =
"UNSPECIFIED"|"RUNNING"|"COMPLETED"|"FAILED"|"CANCELLED"|"TERMINATED"|"CONTINUED_AS_NEW"|"TIMED_OUT"|"PAUSED"|"UNKNOWN"
WorkflowHandleDefinitionOptions
WorkflowHandleDefinitionOptions<
T> =Replace<GetWorkflowHandleOptions<WorkflowResultType<T>>, {typeInfo?:never;workflow:T; }>
Options for getting a Workflow handle using a Workflow definition.
Type Parameters
T
T extends Workflow
WorkflowService
WorkflowService =
WorkflowService
WorkflowSignalWithStartOptions
WorkflowSignalWithStartOptions<
SignalArgs> =WorkflowSignalWithStartOptionsBase<SignalArgs> &SignalWithStartTypeInfoOptions
Type Parameters
SignalArgs
SignalArgs extends any[] = []
WorkflowStartOptions
WorkflowStartOptions<
T> =WithWorkflowArgs<T,WorkflowOptions>
Options for starting a Workflow
Type Parameters
T
WorkflowUpdateStage
WorkflowUpdateStage = typeof
WorkflowUpdateStage[keyof typeofWorkflowUpdateStage]
Variables
ActivityExecutionStatus
constActivityExecutionStatus:object
Type Declaration
CANCELED
readonlyCANCELED:"CANCELED"
COMPLETED
readonlyCOMPLETED:"COMPLETED"
FAILED
readonlyFAILED:"FAILED"
PAUSED
readonlyPAUSED:"PAUSED"
RUNNING
readonlyRUNNING:"RUNNING"
TERMINATED
readonlyTERMINATED:"TERMINATED"
TIMED_OUT
readonlyTIMED_OUT:"TIMED_OUT"
ActivityIdConflictPolicy
constActivityIdConflictPolicy:object
Type Declaration
FAIL
readonlyFAIL:"FAIL"
USE_EXISTING
readonlyUSE_EXISTING:"USE_EXISTING"
ActivityIdReusePolicy
constActivityIdReusePolicy:object
Type Declaration
ALLOW_DUPLICATE
readonlyALLOW_DUPLICATE:"ALLOW_DUPLICATE"
ALLOW_DUPLICATE_FAILED_ONLY
readonlyALLOW_DUPLICATE_FAILED_ONLY:"ALLOW_DUPLICATE_FAILED_ONLY"
REJECT_DUPLICATE
readonlyREJECT_DUPLICATE:"REJECT_DUPLICATE"
DAYS_OF_WEEK
constDAYS_OF_WEEK: readonly ["SUNDAY","MONDAY","TUESDAY","WEDNESDAY","THURSDAY","FRIDAY","SATURDAY"]
decodeActivityExecutionStatus
constdecodeActivityExecutionStatus: (input) =>"RUNNING"|"COMPLETED"|"FAILED"|"TERMINATED"|"TIMED_OUT"|"PAUSED"|"CANCELED"|undefined
Parameters
input
ActivityExecutionStatus | null | undefined
Returns
"RUNNING" | "COMPLETED" | "FAILED" | "TERMINATED" | "TIMED_OUT" | "PAUSED" | "CANCELED" | undefined
decodeActivityIdConflictPolicy
constdecodeActivityIdConflictPolicy: (input) =>"FAIL"|"USE_EXISTING"|undefined
Parameters
input
ActivityIdConflictPolicy | null | undefined
Returns
"FAIL" | "USE_EXISTING" | undefined
decodeActivityIdReusePolicy
constdecodeActivityIdReusePolicy: (input) =>"ALLOW_DUPLICATE"|"ALLOW_DUPLICATE_FAILED_ONLY"|"REJECT_DUPLICATE"|undefined
Parameters
input
ActivityIdReusePolicy | null | undefined
Returns
"ALLOW_DUPLICATE" | "ALLOW_DUPLICATE_FAILED_ONLY" | "REJECT_DUPLICATE" | undefined
decodeNexusOperationCancellationState
constdecodeNexusOperationCancellationState: (input) =>"FAILED"|"TIMED_OUT"|"SCHEDULED"|"BACKING_OFF"|"BLOCKED"|"SUCCEEDED"|undefined
Parameters
input
NexusOperationCancellationState | null | undefined
Returns
"FAILED" | "TIMED_OUT" | "SCHEDULED" | "BACKING_OFF" | "BLOCKED" | "SUCCEEDED" | undefined
decodeNexusOperationExecutionStatus
constdecodeNexusOperationExecutionStatus: (input) =>"RUNNING"|"COMPLETED"|"FAILED"|"TERMINATED"|"TIMED_OUT"|"CANCELED"|undefined
Parameters
input
NexusOperationExecutionStatus | null | undefined
Returns
"RUNNING" | "COMPLETED" | "FAILED" | "TERMINATED" | "TIMED_OUT" | "CANCELED" | undefined
decodeNexusOperationIdConflictPolicy
constdecodeNexusOperationIdConflictPolicy: (input) =>"FAIL"|"USE_EXISTING"|undefined
Parameters
input
NexusOperationIdConflictPolicy | null | undefined
Returns
"FAIL" | "USE_EXISTING" | undefined
decodeNexusOperationIdReusePolicy
constdecodeNexusOperationIdReusePolicy: (input) =>"ALLOW_DUPLICATE"|"ALLOW_DUPLICATE_FAILED_ONLY"|"REJECT_DUPLICATE"|undefined
Parameters
input
NexusOperationIdReusePolicy | null | undefined
Returns
"ALLOW_DUPLICATE" | "ALLOW_DUPLICATE_FAILED_ONLY" | "REJECT_DUPLICATE" | undefined
decodePendingActivityState
constdecodePendingActivityState: (input) =>"CANCEL_REQUESTED"|"PAUSED"|"SCHEDULED"|"STARTED"|"PAUSE_REQUESTED"|undefined
Parameters
input
PendingActivityState | null | undefined
Returns
"CANCEL_REQUESTED" | "PAUSED" | "SCHEDULED" | "STARTED" | "PAUSE_REQUESTED" | undefined
decodePendingNexusOperationState
constdecodePendingNexusOperationState: (input) =>"SCHEDULED"|"STARTED"|"BACKING_OFF"|"BLOCKED"|undefined
Parameters
input
PendingNexusOperationState | null | undefined
Returns
"SCHEDULED" | "STARTED" | "BACKING_OFF" | "BLOCKED" | undefined
decodeQueryRejectCondition
constdecodeQueryRejectCondition: (input) =>"NONE"|"NOT_OPEN"|"NOT_COMPLETED_CLEANLY"|undefined
Parameters
input
QueryRejectCondition | null | undefined
Returns
"NONE" | "NOT_OPEN" | "NOT_COMPLETED_CLEANLY" | undefined
decodeScheduleOverlapPolicy
constdecodeScheduleOverlapPolicy: (input) =>"SKIP"|"BUFFER_ONE"|"BUFFER_ALL"|"CANCEL_OTHER"|"TERMINATE_OTHER"|"ALLOW_ALL"|undefined
Parameters
input
ScheduleOverlapPolicy | null | undefined
Returns
"SKIP" | "BUFFER_ONE" | "BUFFER_ALL" | "CANCEL_OTHER" | "TERMINATE_OTHER" | "ALLOW_ALL" | undefined
decodeTaskReachability
constdecodeTaskReachability: (input) =>"NEW_WORKFLOWS"|"EXISTING_WORKFLOWS"|"OPEN_WORKFLOWS"|"CLOSED_WORKFLOWS"|undefined
Parameters
input
TaskReachability | null | undefined
Returns
"NEW_WORKFLOWS" | "EXISTING_WORKFLOWS" | "OPEN_WORKFLOWS" | "CLOSED_WORKFLOWS" | undefined
encodeActivityExecutionStatus
constencodeActivityExecutionStatus: (input) =>ActivityExecutionStatus|undefined
Parameters
input
"RUNNING" | "COMPLETED" | "FAILED" | "TERMINATED" | "TIMED_OUT" | "PAUSED" | "CANCELED" | ActivityExecutionStatus | "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" | null | undefined
Returns
ActivityExecutionStatus | undefined
encodeActivityIdConflictPolicy
constencodeActivityIdConflictPolicy: (input) =>ActivityIdConflictPolicy|undefined
Parameters
input
"FAIL" | "USE_EXISTING" | ActivityIdConflictPolicy | "ACTIVITY_ID_CONFLICT_POLICY_FAIL" | "ACTIVITY_ID_CONFLICT_POLICY_USE_EXISTING" | null | undefined
Returns
ActivityIdConflictPolicy | undefined
encodeActivityIdReusePolicy
constencodeActivityIdReusePolicy: (input) =>ActivityIdReusePolicy|undefined
Parameters
input
"ALLOW_DUPLICATE" | "ALLOW_DUPLICATE_FAILED_ONLY" | "REJECT_DUPLICATE" | ActivityIdReusePolicy | "ACTIVITY_ID_REUSE_POLICY_ALLOW_DUPLICATE" | "ACTIVITY_ID_REUSE_POLICY_ALLOW_DUPLICATE_FAILED_ONLY" | "ACTIVITY_ID_REUSE_POLICY_REJECT_DUPLICATE" | null | undefined
Returns
ActivityIdReusePolicy | undefined
encodeNexusOperationCancellationState
constencodeNexusOperationCancellationState: (input) =>NexusOperationCancellationState|undefined
Parameters
input
"FAILED" | "TIMED_OUT" | "SCHEDULED" | "BACKING_OFF" | "BLOCKED" | "SUCCEEDED" | NexusOperationCancellationState | "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" | null | undefined
Returns
NexusOperationCancellationState | undefined
encodeNexusOperationExecutionStatus
constencodeNexusOperationExecutionStatus: (input) =>NexusOperationExecutionStatus|undefined
Parameters
input
"RUNNING" | "COMPLETED" | "FAILED" | "TERMINATED" | "TIMED_OUT" | "CANCELED" | NexusOperationExecutionStatus | "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" | null | undefined
Returns
NexusOperationExecutionStatus | undefined
encodeNexusOperationIdConflictPolicy
constencodeNexusOperationIdConflictPolicy: (input) =>NexusOperationIdConflictPolicy|undefined
Parameters
input
"FAIL" | "USE_EXISTING" | NexusOperationIdConflictPolicy | "NEXUS_OPERATION_ID_CONFLICT_POLICY_FAIL" | "NEXUS_OPERATION_ID_CONFLICT_POLICY_USE_EXISTING" | null | undefined
Returns
NexusOperationIdConflictPolicy | undefined
encodeNexusOperationIdReusePolicy
constencodeNexusOperationIdReusePolicy: (input) =>NexusOperationIdReusePolicy|undefined
Parameters
input
"ALLOW_DUPLICATE" | "ALLOW_DUPLICATE_FAILED_ONLY" | "REJECT_DUPLICATE" | NexusOperationIdReusePolicy | "NEXUS_OPERATION_ID_REUSE_POLICY_ALLOW_DUPLICATE" | "NEXUS_OPERATION_ID_REUSE_POLICY_ALLOW_DUPLICATE_FAILED_ONLY" | "NEXUS_OPERATION_ID_REUSE_POLICY_REJECT_DUPLICATE" | null | undefined
Returns
NexusOperationIdReusePolicy | undefined
encodePendingActivityState
constencodePendingActivityState: (input) =>PendingActivityState|undefined
Parameters
input
"CANCEL_REQUESTED" | "PAUSED" | "SCHEDULED" | "STARTED" | "PAUSE_REQUESTED" | PendingActivityState | "PENDING_ACTIVITY_STATE_SCHEDULED" | "PENDING_ACTIVITY_STATE_STARTED" | "PENDING_ACTIVITY_STATE_CANCEL_REQUESTED" | "PENDING_ACTIVITY_STATE_PAUSED" | "PENDING_ACTIVITY_STATE_PAUSE_REQUESTED" | null | undefined
Returns
PendingActivityState | undefined
encodePendingNexusOperationState
constencodePendingNexusOperationState: (input) =>PendingNexusOperationState|undefined
Parameters
input
"SCHEDULED" | "STARTED" | "BACKING_OFF" | "BLOCKED" | PendingNexusOperationState | "PENDING_NEXUS_OPERATION_STATE_SCHEDULED" | "PENDING_NEXUS_OPERATION_STATE_BACKING_OFF" | "PENDING_NEXUS_OPERATION_STATE_STARTED" | "PENDING_NEXUS_OPERATION_STATE_BLOCKED" | null | undefined
Returns
PendingNexusOperationState | undefined
encodeQueryRejectCondition
constencodeQueryRejectCondition: (input) =>QueryRejectCondition|undefined
Parameters
input
"NONE" | "NOT_OPEN" | "NOT_COMPLETED_CLEANLY" | "QUERY_REJECT_CONDITION_NONE" | "QUERY_REJECT_CONDITION_NOT_OPEN" | "QUERY_REJECT_CONDITION_NOT_COMPLETED_CLEANLY" | QueryRejectCondition | null | undefined
Returns
QueryRejectCondition | undefined
encodeScheduleOverlapPolicy
constencodeScheduleOverlapPolicy: (input) =>ScheduleOverlapPolicy|undefined
Parameters
input
"SKIP" | "BUFFER_ONE" | "BUFFER_ALL" | "CANCEL_OTHER" | "TERMINATE_OTHER" | "ALLOW_ALL" | ScheduleOverlapPolicy | "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" | null | undefined
Returns
ScheduleOverlapPolicy | undefined
encodeTaskReachability
constencodeTaskReachability: (input) =>TaskReachability|undefined
Parameters
input
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" | null | undefined
Returns
TaskReachability | undefined
HealthService
HealthService: typeof
Health
InternalConnectionLikeSymbol
constInternalConnectionLikeSymbol: uniquesymbol
isServerErrorResponse
constisServerErrorResponse: typeofisGrpcServiceError
Deprecated
Use isGrpcServiceError instead
LOCAL_TARGET
constLOCAL_TARGET:"localhost:7233"="localhost:7233"
MONTHS
constMONTHS: readonly ["JANUARY","FEBRUARY","MARCH","APRIL","MAY","JUNE","JULY","AUGUST","SEPTEMBER","OCTOBER","NOVEMBER","DECEMBER"]
NexusOperationCancellationState
constNexusOperationCancellationState:object
State of a Nexus operation cancellation.
Type Declaration
BACKING_OFF
readonlyBACKING_OFF:"BACKING_OFF"
BLOCKED
readonlyBLOCKED:"BLOCKED"
FAILED
readonlyFAILED:"FAILED"
SCHEDULED
readonlySCHEDULED:"SCHEDULED"
SUCCEEDED
readonlySUCCEEDED:"SUCCEEDED"
TIMED_OUT
readonlyTIMED_OUT:"TIMED_OUT"
NexusOperationExecutionStatus
constNexusOperationExecutionStatus:object
A general status for a Nexus operation, indicating whether it is currently running or in a terminal state.
Type Declaration
CANCELED
readonlyCANCELED:"CANCELED"
COMPLETED
readonlyCOMPLETED:"COMPLETED"
FAILED
readonlyFAILED:"FAILED"
RUNNING
readonlyRUNNING:"RUNNING"
TERMINATED
readonlyTERMINATED:"TERMINATED"
TIMED_OUT
readonlyTIMED_OUT:"TIMED_OUT"
NexusOperationIdConflictPolicy
constNexusOperationIdConflictPolicy: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
FAIL
readonlyFAIL:"FAIL"
USE_EXISTING
readonlyUSE_EXISTING:"USE_EXISTING"
NexusOperationIdReusePolicy
constNexusOperationIdReusePolicy: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
ALLOW_DUPLICATE
readonlyALLOW_DUPLICATE:"ALLOW_DUPLICATE"
ALLOW_DUPLICATE_FAILED_ONLY
readonlyALLOW_DUPLICATE_FAILED_ONLY:"ALLOW_DUPLICATE_FAILED_ONLY"
REJECT_DUPLICATE
readonlyREJECT_DUPLICATE:"REJECT_DUPLICATE"
OperatorService
OperatorService: typeof
OperatorService
PendingActivityState
constPendingActivityState:object
Type Declaration
CANCEL_REQUESTED
readonlyCANCEL_REQUESTED:"CANCEL_REQUESTED"
PAUSE_REQUESTED
readonlyPAUSE_REQUESTED:"PAUSE_REQUESTED"
PAUSED
readonlyPAUSED:"PAUSED"
SCHEDULED
readonlySCHEDULED:"SCHEDULED"
STARTED
readonlySTARTED:"STARTED"
PendingNexusOperationState
constPendingNexusOperationState:object
A more detailed breakdown of NexusOperationExecutionStatus.RUNNING.
Type Declaration
BACKING_OFF
readonlyBACKING_OFF:"BACKING_OFF"
BLOCKED
readonlyBLOCKED:"BLOCKED"
SCHEDULED
readonlySCHEDULED:"SCHEDULED"
STARTED
readonlySTARTED:"STARTED"
QueryRejectCondition
constQueryRejectCondition:object
Type Declaration
NONE
readonlyNONE:"NONE"
NOT_COMPLETED_CLEANLY
readonlyNOT_COMPLETED_CLEANLY:"NOT_COMPLETED_CLEANLY"
NOT_OPEN
readonlyNOT_OPEN:"NOT_OPEN"
QUERY_REJECT_CONDITION_NONE
readonlyQUERY_REJECT_CONDITION_NONE:"NONE"
Deprecated
Use NONE instead.
QUERY_REJECT_CONDITION_NOT_COMPLETED_CLEANLY
readonlyQUERY_REJECT_CONDITION_NOT_COMPLETED_CLEANLY:"NOT_COMPLETED_CLEANLY"
Deprecated
Use NOT_COMPLETED_CLEANLY instead.
QUERY_REJECT_CONDITION_NOT_OPEN
readonlyQUERY_REJECT_CONDITION_NOT_OPEN:"NOT_OPEN"
Deprecated
Use NOT_OPEN instead.
QUERY_REJECT_CONDITION_UNSPECIFIED
readonlyQUERY_REJECT_CONDITION_UNSPECIFIED:undefined