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 { sleepForDays } from './workflows';
import { nanoid } from 'nanoid';
async function run() {
const connection = await Connection.connect({ address: 'localhost:7233' });
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
- ActivityCompletionError
- ActivityNotFoundError
- AsyncCompletionClient
- BuildIdNotFoundError
- Client
- Connection
- QueryNotRegisteredError
- QueryRejectedError
- ScheduleAlreadyRunning
- ScheduleClient
- ScheduleNotFoundError
- ServiceError
- TaskQueueClient
- WithStartWorkflowOperation
- WorkflowClient
- WorkflowContinuedAsNewError
- WorkflowFailedError
- WorkflowUpdateFailedError
- WorkflowUpdateRPCTimeoutOrCancelledError
Interfaces
- AddNewCompatibleVersion
- AddNewIdInNewDefaultSet
- AsyncWorkflowListIterable
- Backfill
- BackoffOptions
- BaseReachabilityOptions
- BuildIdReachability
- BuildIdVersionSet
- CalendarSpec
- CalendarSpecDescription
- CallContext
- ClientInterceptors
- ClientOptions
- CompiledWorkflowOptions
- ConnectionLike
- ConnectionOptions
- CountWorkflowExecution
- CreateScheduleInput
- FullActivityId
- GetWorkflowHandleOptions
- GetWorkflowUpdateHandleOptions
- GrpcRetryOptions
- IntervalSpec
- IntervalSpecDescription
- IntoHistoriesOptions
- ListOptions
- ListScheduleOptions
- MergeSets
- PromoteBuildIdWithinSet
- PromoteSetByBuildId
- Range
- ReachabilityResponse
- ScheduleClientInterceptor
- ScheduleClientOptions
- ScheduleExecutionResult
- ScheduleExecutionStartWorkflowActionResult
- ScheduleHandle
- ScheduleOptions
- ScheduleSpec
- ScheduleSummary
- ScheduleSummaryStartWorkflowAction
- TLSConfig
- WorkerBuildIdVersionSets
- WorkflowCancelInput
- WorkflowClientCallsInterceptorFactory
- WorkflowClientCallsInterceptorFactoryInput
- WorkflowClientInterceptor
- WorkflowClientInterceptors
- WorkflowClientOptions
- WorkflowDescribeInput
- WorkflowExecution
- WorkflowExecutionInfo
- WorkflowHandle
- WorkflowHandleWithFirstExecutionRunId
- WorkflowHandleWithSignaledRunId
- WorkflowOptions
- WorkflowQueryInput
- WorkflowResultOptions
- WorkflowSignalInput
- WorkflowSignalWithStartInput
- WorkflowSignalWithStartOptionsWithArgs
- WorkflowSignalWithStartOptionsWithoutArgs
- WorkflowStartInput
- WorkflowStartUpdateInput
- WorkflowStartUpdateOutput
- WorkflowStartUpdateWithStartInput
- WorkflowStartUpdateWithStartOutput
- WorkflowTerminateInput
- WorkflowUpdateHandle
- WorkflowUpdateOptions
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
DataConverter
Re-exports DataConverter
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
RetryPolicy
Re-exports RetryPolicy
SearchAttributeValue
Re-exports SearchAttributeValue
SearchAttributes
Re-exports SearchAttributes
ServerFailure
Re-exports ServerFailure
SignalDefinition
Re-exports SignalDefinition
TemporalFailure
Re-exports TemporalFailure
TerminatedFailure
Re-exports TerminatedFailure
TimeoutFailure
Re-exports TimeoutFailure
UntypedActivities
Re-exports UntypedActivities
UpdateDefinition
Re-exports UpdateDefinition
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
WorkflowQueryType
Re-exports WorkflowQueryType
WorkflowResultType
Re-exports WorkflowResultType
WorkflowReturnType
Re-exports WorkflowReturnType
WorkflowSignalAnnotatedType
Re-exports WorkflowSignalAnnotatedType
WorkflowSignalType
Re-exports WorkflowSignalType
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
Type Aliases
AsyncCompletionClientOptions
Ƭ AsyncCompletionClientOptions: BaseClientOptions
Options used to configure AsyncCompletionClient
BuildIdOperation
Ƭ BuildIdOperation: AddNewIdInNewDefaultSet
| AddNewCompatibleVersion
| PromoteSetByBuildId
| PromoteBuildIdWithinSet
| MergeSets
Operations that can be passed to TaskQueueClient.updateBuildIdCompatibility.
The Worker Versioning API is still being designed. Major changes are expected.
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
Name | Type |
---|---|
conflictToken | Uint8Array |
DayOfWeek
Ƭ DayOfWeek: typeof DAYS_OF_WEEK
[number
]
DescribeWorkflowExecutionResponse
Ƭ DescribeWorkflowExecutionResponse: IDescribeWorkflowExecutionResponse
GetWorkflowExecutionHistoryRequest
Ƭ GetWorkflowExecutionHistoryRequest: IGetWorkflowExecutionHistoryRequest
HealthService
Ƭ HealthService: Health
LoadedAsyncCompletionClientOptions
Ƭ LoadedAsyncCompletionClientOptions: LoadedWithDefaults
<AsyncCompletionClientOptions
>
LoadedClientOptions
Ƭ LoadedClientOptions: LoadedWithDefaults
<ClientOptions
>
LoadedScheduleClientOptions
Ƭ LoadedScheduleClientOptions: LoadedWithDefaults
<ScheduleClientOptions
>
LoadedTaskQueueClientOptions
Ƭ LoadedTaskQueueClientOptions: LoadedWithDefaults
<TaskQueueClientOptions
>
The Worker Versioning API is still being designed. Major changes are expected.
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
]
OperatorService
Ƭ OperatorService: OperatorService
QueryRejectCondition
Ƭ QueryRejectCondition: typeof QueryRejectCondition
[keyof typeof QueryRejectCondition
]
RawWorkflowExecutionInfo
Ƭ RawWorkflowExecutionInfo: IWorkflowExecutionInfo
ReachabilityOptions
Ƭ ReachabilityOptions: RequireAtLeastOne
<BaseReachabilityOptions
, "buildIds"
| "taskQueues"
>
Options for TaskQueueClient.getReachability
ReachabilityType
Ƭ ReachabilityType: typeof ReachabilityType
[keyof typeof ReachabilityType
]
There are different types of reachability:
NEW_WORKFLOWS
: The Build Id might be used by new workflowsEXISTING_WORKFLOWS
The Build Id might be used by open workflows and/or closed workflows.OPEN_WORKFLOWS
The Build Id might be used by open workflowsCLOSED_WORKFLOWS
The Build Id might be used by closed workflows
ReachabilityTypeResponse
Ƭ ReachabilityTypeResponse: ReachabilityType
| "NOT_FETCHED"
RequestCancelWorkflowExecutionResponse
Ƭ RequestCancelWorkflowExecutionResponse: IRequestCancelWorkflowExecutionResponse
ScheduleDescription
Ƭ ScheduleDescription: Object
A detailed description of an exisiting Schedule, as returned by ScheduleHandle.describe.
Type declaration
Name | Type | Description |
---|---|---|
action | ScheduleDescriptionAction | The Action that will be taken. |
info | { createdAt : Date ; lastUpdatedAt : Date | undefined ; nextActionTimes : Date [] ; numActionsMissedCatchupWindow : number ; numActionsSkippedOverlap : number ; numActionsTaken : number ; recentActions : ScheduleExecutionResult [] ; runningActions : ScheduleExecutionActionResult [] } | - |
info.createdAt | Date | - |
info.lastUpdatedAt | Date | undefined | - |
info.nextActionTimes | Date [] | Next upcoming scheduled times of this Schedule |
info.numActionsMissedCatchupWindow | number | Number of times a scheduled Action was skipped due to missing the catchup window. |
info.numActionsSkippedOverlap | number | Number of Actions skipped due to overlap. |
info.numActionsTaken | number | Number of Actions taken so far. |
info.recentActions | ScheduleExecutionResult [] | Most recent actions started (including manual triggers), sorted from older start time to newer. |
info.runningActions | ScheduleExecutionActionResult [] | 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.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. |
policies.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. |
policies.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 | string | The Schedule Id. We recommend using a meaningful business identifier. |
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. |
spec | ScheduleSpecDescription | When will Actions be taken. |
state | { note? : string ; paused : boolean ; remainingActions? : number } | - |
state.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. |
state.paused | boolean | Whether Schedule is currently paused. |
state.remainingActions? | 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. |
ScheduleDescriptionAction
Ƭ ScheduleDescriptionAction: ScheduleDescriptionStartWorkflowAction
ScheduleDescriptionStartWorkflowAction
Ƭ ScheduleDescriptionStartWorkflowAction: ScheduleSummaryStartWorkflowAction
& Pick
<WorkflowStartOptions
<Workflow
>, "taskQueue"
| "workflowId"
| "args"
| "memo"
| "searchAttributes"
| "retry"
| "workflowExecutionTimeout"
| "workflowRunTimeout"
| "workflowTaskTimeout"
>
ScheduleExecutionActionResult
Ƭ ScheduleExecutionActionResult: ScheduleExecutionStartWorkflowActionResult
ScheduleOptionsAction
Ƭ ScheduleOptionsAction: ScheduleOptionsStartWorkflowAction
<Workflow
>
ScheduleOptionsStartWorkflowAction
Ƭ ScheduleOptionsStartWorkflowAction<W
>: { type
: "startWorkflow"
; workflowType
: string
| W
} & Pick
<WorkflowStartOptions
<W
>, "taskQueue"
| "args"
| "memo"
| "searchAttributes"
| "retry"
| "workflowExecutionTimeout"
| "workflowRunTimeout"
| "workflowTaskTimeout"
> & { workflowId?
: string
}
Type parameters
Name | Type |
---|---|
W | extends 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"
| "searchAttributes"
>, { action
: A
; state
: Omit
<ScheduleOptions
["state"
], "triggerImmediately"
| "backfill"
> }>
The specification of an updated Schedule, as expected by ScheduleHandle.update.
Type parameters
Name | Type |
---|---|
A | extends ScheduleOptionsAction = ScheduleOptionsAction |
StartWorkflowExecutionRequest
Ƭ StartWorkflowExecutionRequest: IStartWorkflowExecutionRequest
TaskQueueClientOptions
Ƭ TaskQueueClientOptions: BaseClientOptions
The Worker Versioning API is still being designed. Major changes are expected.
TerminateWorkflowExecutionResponse
Ƭ TerminateWorkflowExecutionResponse: ITerminateWorkflowExecutionResponse
UnversionedBuildIdType
Ƭ UnversionedBuildIdType: typeof UnversionedBuildId
WithCompiledWorkflowOptions
Ƭ WithCompiledWorkflowOptions<T
>: Replace
<T
, { startDelay?
: IDuration
; workflowExecutionTimeout?
: IDuration
; workflowRunTimeout?
: IDuration
; workflowTaskTimeout?
: IDuration
}>
Type parameters
Name | Type |
---|---|
T | extends WorkflowOptions |
WorkflowClientCallsInterceptor
Ƭ WorkflowClientCallsInterceptor: WorkflowClientInterceptor
@deprecated: Use WorkflowClientInterceptor instead
WorkflowExecutionDescription
Ƭ WorkflowExecutionDescription: Replace
<WorkflowExecutionInfo
, { raw
: DescribeWorkflowExecutionResponse
}>
WorkflowExecutionStatusName
Ƭ WorkflowExecutionStatusName: "UNSPECIFIED"
| "RUNNING"
| "COMPLETED"
| "FAILED"
| "CANCELLED"
| "TERMINATED"
| "CONTINUED_AS_NEW"
| "TIMED_OUT"
| "UNKNOWN"
WorkflowService
Ƭ WorkflowService: WorkflowService
WorkflowSignalWithStartOptions
Ƭ WorkflowSignalWithStartOptions<SignalArgs
>: SignalArgs
extends [any
, ...any[]] ? WorkflowSignalWithStartOptionsWithArgs
<SignalArgs
> : WorkflowSignalWithStartOptionsWithoutArgs
<SignalArgs
>
Type parameters
Name | Type |
---|---|
SignalArgs | extends any [] = [] |
WorkflowStartOptions
Ƭ WorkflowStartOptions<T
>: WithWorkflowArgs
<T
, WorkflowOptions
>
Options for starting a Workflow
Type parameters
Name | Type |
---|---|
T | extends Workflow = Workflow |
WorkflowUpdateStage
Ƭ WorkflowUpdateStage: typeof WorkflowUpdateStage
[keyof typeof WorkflowUpdateStage
]
Variables
DAYS_OF_WEEK
• Const
DAYS_OF_WEEK: readonly ["SUNDAY"
, "MONDAY"
, "TUESDAY"
, "WEDNESDAY"
, "THURSDAY"
, "FRIDAY"
, "SATURDAY"
]
HealthService
• HealthService: typeof Health
LOCAL_TARGET
• Const
LOCAL_TARGET: "localhost:7233"
MONTHS
• Const
MONTHS: readonly ["JANUARY"
, "FEBRUARY"
, "MARCH"
, "APRIL"
, "MAY"
, "JUNE"
, "JULY"
, "AUGUST"
, "SEPTEMBER"
, "OCTOBER"
, "NOVEMBER"
, "DECEMBER"
]
OperatorService
• OperatorService: typeof OperatorService
QueryRejectCondition
• Const
QueryRejectCondition: Object
Type declaration
Name | Type | Description |
---|---|---|
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_UNSPECIFIED | undefined | Deprecated Use undefined instead. |
ReachabilityType
• Const
ReachabilityType: Object
Type declaration
Name | Type | Description |
---|---|---|
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
Name | Type | Description |
---|---|---|
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. |
UNSPECIFIED | undefined | Use server default (currently SKIP). Deprecated Either leave property undefined , or use SKIP instead. |
UnversionedBuildId
• Const
UnversionedBuildId: unique symbol
A stand-in for a Build Id for unversioned Workers The Worker Versioning API is still being designed. Major changes are expected.
WorkflowService
• WorkflowService: typeof WorkflowService
WorkflowUpdateStage
• Const
WorkflowUpdateStage: Object
Type declaration
Name | Type | Description |
---|---|---|
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. |
UNSPECIFIED | undefined | This is not an allowed value. Deprecated |
Functions
compileWorkflowOptions
▸ compileWorkflowOptions<T
>(options
): WithCompiledWorkflowOptions
<T
>
Type parameters
Name | Type |
---|---|
T | extends WorkflowOptions |
Parameters
Name | Type |
---|---|
options | T |
Returns
WithCompiledWorkflowOptions
<T
>
decodeQueryRejectCondition
▸ decodeQueryRejectCondition(input
): undefined
| "NONE"
| "NOT_OPEN"
| "NOT_COMPLETED_CLEANLY"
Parameters
Name | Type |
---|---|
input | undefined | 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
Name | Type |
---|---|
input | undefined | 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
Name | Type |
---|---|
input | undefined | 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
Name | Type |
---|---|
options? | Partial <BackoffOptions > |
Returns
encodeQueryRejectCondition
▸ encodeQueryRejectCondition(input
): undefined
| QueryRejectCondition
Parameters
Name | Type |
---|---|
input | undefined | 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
Name | Type |
---|---|
input | undefined | 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
Name | Type |
---|---|
input | undefined | 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
Name | Type |
---|---|
err | unknown |
Returns
err is Error
See
isGrpcDeadlineError
▸ isGrpcDeadlineError(err
): err is Error
Returns true if the provided error or its cause is a GrpcServiceError with code DEADLINE_EXCEEDED.
Parameters
Name | Type |
---|---|
err | unknown |
Returns
err is Error
See
isGrpcServiceError
▸ isGrpcServiceError(err
): err is ServiceError
Returns true if the provided error is a GrpcServiceError.
Parameters
Name | Type |
---|---|
err | unknown |
Returns
err is ServiceError
isRetryableError
▸ isRetryableError(status
): boolean
Parameters
Name | Type |
---|---|
status | StatusObject |
Returns
boolean
isServerErrorResponse
▸ isServerErrorResponse(err
): err is ServiceError
Parameters
Name | Type |
---|---|
err | unknown |
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
Name | Type | Description |
---|---|---|
retryOptions | GrpcRetryOptions | Options for the retry interceptor |
Returns
Interceptor
reachabilityResponseFromProto
▸ reachabilityResponseFromProto(resp
): ReachabilityResponse
Parameters
Name | Type |
---|---|
resp | GetWorkerTaskReachabilityResponse |