Skip to main content

Class: WorkflowService

workflowservice.v1.WorkflowService

WorkflowService API defines how Temporal SDKs and other clients interact with the Temporal server to create and interact with workflows and activities.

Users are expected to call StartWorkflowExecution to create a new workflow execution.

To drive workflows, a worker using a Temporal SDK must exist which regularly polls for workflow and activity tasks from the service. For each workflow task, the sdk must process the (incremental or complete) event history and respond back with any newly generated commands.

For each activity task, the worker is expected to execute the user's code which implements that activity, responding with completion or failure.

Hierarchy

  • Service

    WorkflowService

Constructors

constructor

new WorkflowService(rpcImpl, requestDelimited?, responseDelimited?): WorkflowService

Constructs a new WorkflowService service.

Parameters

NameTypeDescription
rpcImplRPCImplRPC implementation
requestDelimited?booleanWhether requests are length-delimited
responseDelimited?booleanWhether responses are length-delimited

Returns

WorkflowService

Overrides

$protobuf.rpc.Service.constructor

Properties

requestDelimited

requestDelimited: boolean

Whether requests are length-delimited.

Inherited from

$protobuf.rpc.Service.requestDelimited


responseDelimited

responseDelimited: boolean

Whether responses are length-delimited.

Inherited from

$protobuf.rpc.Service.responseDelimited


rpcImpl

rpcImpl: null | RPCImpl

RPC implementation. Becomes null once the service is ended.

Inherited from

$protobuf.rpc.Service.rpcImpl

Methods

countWorkflowExecutions

countWorkflowExecutions(request, callback): void

CountWorkflowExecutions is a visibility API to count of workflow executions in a specific namespace.

Parameters

NameTypeDescription
requestICountWorkflowExecutionsRequestCountWorkflowExecutionsRequest message or plain object
callbackCountWorkflowExecutionsCallbackNode-style callback called with the error, if any, and CountWorkflowExecutionsResponse

Returns

void

countWorkflowExecutions(request): Promise<CountWorkflowExecutionsResponse>

CountWorkflowExecutions is a visibility API to count of workflow executions in a specific namespace.

Parameters

NameTypeDescription
requestICountWorkflowExecutionsRequestCountWorkflowExecutionsRequest message or plain object

Returns

Promise<CountWorkflowExecutionsResponse>

Promise


createSchedule

createSchedule(request, callback): void

Creates a new schedule.

Parameters

NameTypeDescription
requestICreateScheduleRequestCreateScheduleRequest message or plain object
callbackCreateScheduleCallbackNode-style callback called with the error, if any, and CreateScheduleResponse

Returns

void

createSchedule(request): Promise<CreateScheduleResponse>

Creates a new schedule.

Parameters

NameTypeDescription
requestICreateScheduleRequestCreateScheduleRequest message or plain object

Returns

Promise<CreateScheduleResponse>

Promise


deleteSchedule

deleteSchedule(request, callback): void

Deletes a schedule, removing it from the system.

Parameters

NameTypeDescription
requestIDeleteScheduleRequestDeleteScheduleRequest message or plain object
callbackDeleteScheduleCallbackNode-style callback called with the error, if any, and DeleteScheduleResponse

Returns

void

deleteSchedule(request): Promise<DeleteScheduleResponse>

Deletes a schedule, removing it from the system.

Parameters

NameTypeDescription
requestIDeleteScheduleRequestDeleteScheduleRequest message or plain object

Returns

Promise<DeleteScheduleResponse>

Promise


deleteWorkflowExecution

deleteWorkflowExecution(request, callback): void

DeleteWorkflowExecution asynchronously deletes a specific Workflow Execution (when WorkflowExecution.run_id is provided) or the latest Workflow Execution (when WorkflowExecution.run_id is not provided). If the Workflow Execution is Running, it will be terminated before deletion.

(-- api-linter: core::0127::http-annotation=disabled aip.dev/not-precedent: Workflow deletion not exposed to HTTP, users should use cancel or terminate. --)

Parameters

NameTypeDescription
requestIDeleteWorkflowExecutionRequestDeleteWorkflowExecutionRequest message or plain object
callbackDeleteWorkflowExecutionCallbackNode-style callback called with the error, if any, and DeleteWorkflowExecutionResponse

Returns

void

deleteWorkflowExecution(request): Promise<DeleteWorkflowExecutionResponse>

DeleteWorkflowExecution asynchronously deletes a specific Workflow Execution (when WorkflowExecution.run_id is provided) or the latest Workflow Execution (when WorkflowExecution.run_id is not provided). If the Workflow Execution is Running, it will be terminated before deletion.

(-- api-linter: core::0127::http-annotation=disabled aip.dev/not-precedent: Workflow deletion not exposed to HTTP, users should use cancel or terminate. --)

Parameters

NameTypeDescription
requestIDeleteWorkflowExecutionRequestDeleteWorkflowExecutionRequest message or plain object

Returns

Promise<DeleteWorkflowExecutionResponse>

Promise


deprecateNamespace

deprecateNamespace(request, callback): void

DeprecateNamespace is used to update the state of a registered namespace to DEPRECATED.

Once the namespace is deprecated it cannot be used to start new workflow executions. Existing workflow executions will continue to run on deprecated namespaces. Deprecated.

(-- api-linter: core::0127::http-annotation=disabled aip.dev/not-precedent: Deprecated --)

Parameters

NameTypeDescription
requestIDeprecateNamespaceRequestDeprecateNamespaceRequest message or plain object
callbackDeprecateNamespaceCallbackNode-style callback called with the error, if any, and DeprecateNamespaceResponse

Returns

void

deprecateNamespace(request): Promise<DeprecateNamespaceResponse>

DeprecateNamespace is used to update the state of a registered namespace to DEPRECATED.

Once the namespace is deprecated it cannot be used to start new workflow executions. Existing workflow executions will continue to run on deprecated namespaces. Deprecated.

(-- api-linter: core::0127::http-annotation=disabled aip.dev/not-precedent: Deprecated --)

Parameters

NameTypeDescription
requestIDeprecateNamespaceRequestDeprecateNamespaceRequest message or plain object

Returns

Promise<DeprecateNamespaceResponse>

Promise


describeBatchOperation

describeBatchOperation(request, callback): void

DescribeBatchOperation returns the information about a batch operation

Parameters

NameTypeDescription
requestIDescribeBatchOperationRequestDescribeBatchOperationRequest message or plain object
callbackDescribeBatchOperationCallbackNode-style callback called with the error, if any, and DescribeBatchOperationResponse

Returns

void

describeBatchOperation(request): Promise<DescribeBatchOperationResponse>

DescribeBatchOperation returns the information about a batch operation

Parameters

NameTypeDescription
requestIDescribeBatchOperationRequestDescribeBatchOperationRequest message or plain object

Returns

Promise<DescribeBatchOperationResponse>

Promise


describeNamespace

describeNamespace(request, callback): void

DescribeNamespace returns the information and configuration for a registered namespace.

Parameters

NameTypeDescription
requestIDescribeNamespaceRequestDescribeNamespaceRequest message or plain object
callbackDescribeNamespaceCallbackNode-style callback called with the error, if any, and DescribeNamespaceResponse

Returns

void

describeNamespace(request): Promise<DescribeNamespaceResponse>

DescribeNamespace returns the information and configuration for a registered namespace.

Parameters

NameTypeDescription
requestIDescribeNamespaceRequestDescribeNamespaceRequest message or plain object

Returns

Promise<DescribeNamespaceResponse>

Promise


describeSchedule

describeSchedule(request, callback): void

Returns the schedule description and current state of an existing schedule.

Parameters

NameTypeDescription
requestIDescribeScheduleRequestDescribeScheduleRequest message or plain object
callbackDescribeScheduleCallbackNode-style callback called with the error, if any, and DescribeScheduleResponse

Returns

void

describeSchedule(request): Promise<DescribeScheduleResponse>

Returns the schedule description and current state of an existing schedule.

Parameters

NameTypeDescription
requestIDescribeScheduleRequestDescribeScheduleRequest message or plain object

Returns

Promise<DescribeScheduleResponse>

Promise


describeTaskQueue

describeTaskQueue(request, callback): void

DescribeTaskQueue returns information about the target task queue.

Parameters

NameTypeDescription
requestIDescribeTaskQueueRequestDescribeTaskQueueRequest message or plain object
callbackDescribeTaskQueueCallbackNode-style callback called with the error, if any, and DescribeTaskQueueResponse

Returns

void

describeTaskQueue(request): Promise<DescribeTaskQueueResponse>

DescribeTaskQueue returns information about the target task queue.

Parameters

NameTypeDescription
requestIDescribeTaskQueueRequestDescribeTaskQueueRequest message or plain object

Returns

Promise<DescribeTaskQueueResponse>

Promise


describeWorkflowExecution

describeWorkflowExecution(request, callback): void

DescribeWorkflowExecution returns information about the specified workflow execution.

Parameters

NameTypeDescription
requestIDescribeWorkflowExecutionRequestDescribeWorkflowExecutionRequest message or plain object
callbackDescribeWorkflowExecutionCallbackNode-style callback called with the error, if any, and DescribeWorkflowExecutionResponse

Returns

void

describeWorkflowExecution(request): Promise<DescribeWorkflowExecutionResponse>

DescribeWorkflowExecution returns information about the specified workflow execution.

Parameters

NameTypeDescription
requestIDescribeWorkflowExecutionRequestDescribeWorkflowExecutionRequest message or plain object

Returns

Promise<DescribeWorkflowExecutionResponse>

Promise


emit

emit(evt, ...args): this

Emits an event by calling its listeners with the specified arguments.

Parameters

NameTypeDescription
evtstringEvent name
...argsany[]Arguments

Returns

this

this

Inherited from

$protobuf.rpc.Service.emit


end

end(endedByRPC?): Service

Ends this service and emits the end event.

Parameters

NameTypeDescription
endedByRPC?booleanWhether the service has been ended by the RPC implementation.

Returns

Service

this

Inherited from

$protobuf.rpc.Service.end


getClusterInfo

getClusterInfo(request, callback): void

GetClusterInfo returns information about temporal cluster

Parameters

NameTypeDescription
requestIGetClusterInfoRequestGetClusterInfoRequest message or plain object
callbackGetClusterInfoCallbackNode-style callback called with the error, if any, and GetClusterInfoResponse

Returns

void

getClusterInfo(request): Promise<GetClusterInfoResponse>

GetClusterInfo returns information about temporal cluster

Parameters

NameTypeDescription
requestIGetClusterInfoRequestGetClusterInfoRequest message or plain object

Returns

Promise<GetClusterInfoResponse>

Promise


getSearchAttributes

getSearchAttributes(request, callback): void

GetSearchAttributes is a visibility API to get all legal keys that could be used in list APIs

(-- api-linter: core::0127::http-annotation=disabled aip.dev/not-precedent: We do not expose this search attribute API to HTTP (but may expose on OperatorService). --)

Parameters

NameTypeDescription
requestIGetSearchAttributesRequestGetSearchAttributesRequest message or plain object
callbackGetSearchAttributesCallbackNode-style callback called with the error, if any, and GetSearchAttributesResponse

Returns

void

getSearchAttributes(request): Promise<GetSearchAttributesResponse>

GetSearchAttributes is a visibility API to get all legal keys that could be used in list APIs

(-- api-linter: core::0127::http-annotation=disabled aip.dev/not-precedent: We do not expose this search attribute API to HTTP (but may expose on OperatorService). --)

Parameters

NameTypeDescription
requestIGetSearchAttributesRequestGetSearchAttributesRequest message or plain object

Returns

Promise<GetSearchAttributesResponse>

Promise


getSystemInfo

getSystemInfo(request, callback): void

GetSystemInfo returns information about the system.

Parameters

NameTypeDescription
requestIGetSystemInfoRequestGetSystemInfoRequest message or plain object
callbackGetSystemInfoCallbackNode-style callback called with the error, if any, and GetSystemInfoResponse

Returns

void

getSystemInfo(request): Promise<GetSystemInfoResponse>

GetSystemInfo returns information about the system.

Parameters

NameTypeDescription
requestIGetSystemInfoRequestGetSystemInfoRequest message or plain object

Returns

Promise<GetSystemInfoResponse>

Promise


getWorkerBuildIdCompatibility

getWorkerBuildIdCompatibility(request, callback): void

Fetches the worker build id versioning sets for a task queue.

Parameters

NameTypeDescription
requestIGetWorkerBuildIdCompatibilityRequestGetWorkerBuildIdCompatibilityRequest message or plain object
callbackGetWorkerBuildIdCompatibilityCallbackNode-style callback called with the error, if any, and GetWorkerBuildIdCompatibilityResponse

Returns

void

getWorkerBuildIdCompatibility(request): Promise<GetWorkerBuildIdCompatibilityResponse>

Fetches the worker build id versioning sets for a task queue.

Parameters

NameTypeDescription
requestIGetWorkerBuildIdCompatibilityRequestGetWorkerBuildIdCompatibilityRequest message or plain object

Returns

Promise<GetWorkerBuildIdCompatibilityResponse>

Promise


getWorkerTaskReachability

getWorkerTaskReachability(request, callback): void

Fetches task reachability to determine whether a worker may be retired. The request may specify task queues to query for or let the server fetch all task queues mapped to the given build IDs.

When requesting a large number of task queues or all task queues associated with the given build ids in a namespace, all task queues will be listed in the response but some of them may not contain reachability information due to a server enforced limit. When reaching the limit, task queues that reachability information could not be retrieved for will be marked with a single TASK_REACHABILITY_UNSPECIFIED entry. The caller may issue another call to get the reachability for those task queues.

Open source users can adjust this limit by setting the server's dynamic config value for limit.reachabilityTaskQueueScan with the caveat that this call can strain the visibility store.

Parameters

NameTypeDescription
requestIGetWorkerTaskReachabilityRequestGetWorkerTaskReachabilityRequest message or plain object
callbackGetWorkerTaskReachabilityCallbackNode-style callback called with the error, if any, and GetWorkerTaskReachabilityResponse

Returns

void

getWorkerTaskReachability(request): Promise<GetWorkerTaskReachabilityResponse>

Fetches task reachability to determine whether a worker may be retired. The request may specify task queues to query for or let the server fetch all task queues mapped to the given build IDs.

When requesting a large number of task queues or all task queues associated with the given build ids in a namespace, all task queues will be listed in the response but some of them may not contain reachability information due to a server enforced limit. When reaching the limit, task queues that reachability information could not be retrieved for will be marked with a single TASK_REACHABILITY_UNSPECIFIED entry. The caller may issue another call to get the reachability for those task queues.

Open source users can adjust this limit by setting the server's dynamic config value for limit.reachabilityTaskQueueScan with the caveat that this call can strain the visibility store.

Parameters

NameTypeDescription
requestIGetWorkerTaskReachabilityRequestGetWorkerTaskReachabilityRequest message or plain object

Returns

Promise<GetWorkerTaskReachabilityResponse>

Promise


getWorkflowExecutionHistory

getWorkflowExecutionHistory(request, callback): void

GetWorkflowExecutionHistory returns the history of specified workflow execution. Fails with NotFound if the specified workflow execution is unknown to the service.

Parameters

NameTypeDescription
requestIGetWorkflowExecutionHistoryRequestGetWorkflowExecutionHistoryRequest message or plain object
callbackGetWorkflowExecutionHistoryCallbackNode-style callback called with the error, if any, and GetWorkflowExecutionHistoryResponse

Returns

void

getWorkflowExecutionHistory(request): Promise<GetWorkflowExecutionHistoryResponse>

GetWorkflowExecutionHistory returns the history of specified workflow execution. Fails with NotFound if the specified workflow execution is unknown to the service.

Parameters

NameTypeDescription
requestIGetWorkflowExecutionHistoryRequestGetWorkflowExecutionHistoryRequest message or plain object

Returns

Promise<GetWorkflowExecutionHistoryResponse>

Promise


getWorkflowExecutionHistoryReverse

getWorkflowExecutionHistoryReverse(request, callback): void

GetWorkflowExecutionHistoryReverse returns the history of specified workflow execution in reverse order (starting from last event). Fails withNotFound if the specified workflow execution is unknown to the service.

Parameters

NameTypeDescription
requestIGetWorkflowExecutionHistoryReverseRequestGetWorkflowExecutionHistoryReverseRequest message or plain object
callbackGetWorkflowExecutionHistoryReverseCallbackNode-style callback called with the error, if any, and GetWorkflowExecutionHistoryReverseResponse

Returns

void

getWorkflowExecutionHistoryReverse(request): Promise<GetWorkflowExecutionHistoryReverseResponse>

GetWorkflowExecutionHistoryReverse returns the history of specified workflow execution in reverse order (starting from last event). Fails withNotFound if the specified workflow execution is unknown to the service.

Parameters

NameTypeDescription
requestIGetWorkflowExecutionHistoryReverseRequestGetWorkflowExecutionHistoryReverseRequest message or plain object

Returns

Promise<GetWorkflowExecutionHistoryReverseResponse>

Promise


listArchivedWorkflowExecutions

listArchivedWorkflowExecutions(request, callback): void

ListArchivedWorkflowExecutions is a visibility API to list archived workflow executions in a specific namespace.

Parameters

NameTypeDescription
requestIListArchivedWorkflowExecutionsRequestListArchivedWorkflowExecutionsRequest message or plain object
callbackListArchivedWorkflowExecutionsCallbackNode-style callback called with the error, if any, and ListArchivedWorkflowExecutionsResponse

Returns

void

listArchivedWorkflowExecutions(request): Promise<ListArchivedWorkflowExecutionsResponse>

ListArchivedWorkflowExecutions is a visibility API to list archived workflow executions in a specific namespace.

Parameters

NameTypeDescription
requestIListArchivedWorkflowExecutionsRequestListArchivedWorkflowExecutionsRequest message or plain object

Returns

Promise<ListArchivedWorkflowExecutionsResponse>

Promise


listBatchOperations

listBatchOperations(request, callback): void

ListBatchOperations returns a list of batch operations

Parameters

NameTypeDescription
requestIListBatchOperationsRequestListBatchOperationsRequest message or plain object
callbackListBatchOperationsCallbackNode-style callback called with the error, if any, and ListBatchOperationsResponse

Returns

void

listBatchOperations(request): Promise<ListBatchOperationsResponse>

ListBatchOperations returns a list of batch operations

Parameters

NameTypeDescription
requestIListBatchOperationsRequestListBatchOperationsRequest message or plain object

Returns

Promise<ListBatchOperationsResponse>

Promise


listClosedWorkflowExecutions

listClosedWorkflowExecutions(request, callback): void

ListClosedWorkflowExecutions is a visibility API to list the closed executions in a specific namespace.

(-- api-linter: core::0127::http-annotation=disabled aip.dev/not-precedent: HTTP users should use ListWorkflowExecutions instead. --)

Parameters

NameTypeDescription
requestIListClosedWorkflowExecutionsRequestListClosedWorkflowExecutionsRequest message or plain object
callbackListClosedWorkflowExecutionsCallbackNode-style callback called with the error, if any, and ListClosedWorkflowExecutionsResponse

Returns

void

listClosedWorkflowExecutions(request): Promise<ListClosedWorkflowExecutionsResponse>

ListClosedWorkflowExecutions is a visibility API to list the closed executions in a specific namespace.

(-- api-linter: core::0127::http-annotation=disabled aip.dev/not-precedent: HTTP users should use ListWorkflowExecutions instead. --)

Parameters

NameTypeDescription
requestIListClosedWorkflowExecutionsRequestListClosedWorkflowExecutionsRequest message or plain object

Returns

Promise<ListClosedWorkflowExecutionsResponse>

Promise


listNamespaces

listNamespaces(request, callback): void

ListNamespaces returns the information and configuration for all namespaces.

Parameters

NameTypeDescription
requestIListNamespacesRequestListNamespacesRequest message or plain object
callbackListNamespacesCallbackNode-style callback called with the error, if any, and ListNamespacesResponse

Returns

void

listNamespaces(request): Promise<ListNamespacesResponse>

ListNamespaces returns the information and configuration for all namespaces.

Parameters

NameTypeDescription
requestIListNamespacesRequestListNamespacesRequest message or plain object

Returns

Promise<ListNamespacesResponse>

Promise


listOpenWorkflowExecutions

listOpenWorkflowExecutions(request, callback): void

ListOpenWorkflowExecutions is a visibility API to list the open executions in a specific namespace.

(-- api-linter: core::0127::http-annotation=disabled aip.dev/not-precedent: HTTP users should use ListWorkflowExecutions instead. --)

Parameters

NameTypeDescription
requestIListOpenWorkflowExecutionsRequestListOpenWorkflowExecutionsRequest message or plain object
callbackListOpenWorkflowExecutionsCallbackNode-style callback called with the error, if any, and ListOpenWorkflowExecutionsResponse

Returns

void

listOpenWorkflowExecutions(request): Promise<ListOpenWorkflowExecutionsResponse>

ListOpenWorkflowExecutions is a visibility API to list the open executions in a specific namespace.

(-- api-linter: core::0127::http-annotation=disabled aip.dev/not-precedent: HTTP users should use ListWorkflowExecutions instead. --)

Parameters

NameTypeDescription
requestIListOpenWorkflowExecutionsRequestListOpenWorkflowExecutionsRequest message or plain object

Returns

Promise<ListOpenWorkflowExecutionsResponse>

Promise


listScheduleMatchingTimes

listScheduleMatchingTimes(request, callback): void

Lists matching times within a range.

Parameters

NameTypeDescription
requestIListScheduleMatchingTimesRequestListScheduleMatchingTimesRequest message or plain object
callbackListScheduleMatchingTimesCallbackNode-style callback called with the error, if any, and ListScheduleMatchingTimesResponse

Returns

void

listScheduleMatchingTimes(request): Promise<ListScheduleMatchingTimesResponse>

Lists matching times within a range.

Parameters

NameTypeDescription
requestIListScheduleMatchingTimesRequestListScheduleMatchingTimesRequest message or plain object

Returns

Promise<ListScheduleMatchingTimesResponse>

Promise


listSchedules

listSchedules(request, callback): void

List all schedules in a namespace.

Parameters

NameTypeDescription
requestIListSchedulesRequestListSchedulesRequest message or plain object
callbackListSchedulesCallbackNode-style callback called with the error, if any, and ListSchedulesResponse

Returns

void

listSchedules(request): Promise<ListSchedulesResponse>

List all schedules in a namespace.

Parameters

NameTypeDescription
requestIListSchedulesRequestListSchedulesRequest message or plain object

Returns

Promise<ListSchedulesResponse>

Promise


listTaskQueuePartitions

listTaskQueuePartitions(request, callback): void

(-- api-linter: core::0127::http-annotation=disabled aip.dev/not-precedent: We do not expose this low-level API to HTTP. --)

Parameters

NameTypeDescription
requestIListTaskQueuePartitionsRequestListTaskQueuePartitionsRequest message or plain object
callbackListTaskQueuePartitionsCallbackNode-style callback called with the error, if any, and ListTaskQueuePartitionsResponse

Returns

void

listTaskQueuePartitions(request): Promise<ListTaskQueuePartitionsResponse>

(-- api-linter: core::0127::http-annotation=disabled aip.dev/not-precedent: We do not expose this low-level API to HTTP. --)

Parameters

NameTypeDescription
requestIListTaskQueuePartitionsRequestListTaskQueuePartitionsRequest message or plain object

Returns

Promise<ListTaskQueuePartitionsResponse>

Promise


listWorkflowExecutions

listWorkflowExecutions(request, callback): void

ListWorkflowExecutions is a visibility API to list workflow executions in a specific namespace.

Parameters

NameTypeDescription
requestIListWorkflowExecutionsRequestListWorkflowExecutionsRequest message or plain object
callbackListWorkflowExecutionsCallbackNode-style callback called with the error, if any, and ListWorkflowExecutionsResponse

Returns

void

listWorkflowExecutions(request): Promise<ListWorkflowExecutionsResponse>

ListWorkflowExecutions is a visibility API to list workflow executions in a specific namespace.

Parameters

NameTypeDescription
requestIListWorkflowExecutionsRequestListWorkflowExecutionsRequest message or plain object

Returns

Promise<ListWorkflowExecutionsResponse>

Promise


off

off(evt?, fn?): this

Removes an event listener or any matching listeners if arguments are omitted.

Parameters

NameTypeDescription
evt?stringEvent name. Removes all listeners if omitted.
fn?EventEmitterListenerListener to remove. Removes all listeners of evt if omitted.

Returns

this

this

Inherited from

$protobuf.rpc.Service.off


on

on(evt, fn, ctx?): this

Registers an event listener.

Parameters

NameTypeDescription
evtstringEvent name
fnEventEmitterListenerListener
ctx?anyListener context

Returns

this

this

Inherited from

$protobuf.rpc.Service.on


patchSchedule

patchSchedule(request, callback): void

Makes a specific change to a schedule or triggers an immediate action.

Parameters

NameTypeDescription
requestIPatchScheduleRequestPatchScheduleRequest message or plain object
callbackPatchScheduleCallbackNode-style callback called with the error, if any, and PatchScheduleResponse

Returns

void

patchSchedule(request): Promise<PatchScheduleResponse>

Makes a specific change to a schedule or triggers an immediate action.

Parameters

NameTypeDescription
requestIPatchScheduleRequestPatchScheduleRequest message or plain object

Returns

Promise<PatchScheduleResponse>

Promise


pollActivityTaskQueue

pollActivityTaskQueue(request, callback): void

PollActivityTaskQueue is called by workers to process activity tasks from a specific task queue.

The worker is expected to call one of the RespondActivityTaskXXX methods when it is done processing the task.

An activity task is dispatched whenever a SCHEDULE_ACTIVITY_TASK command is produced during workflow execution. An in memory ACTIVITY_TASK_STARTED event is written to mutable state before the task is dispatched to the worker. The started event, and the final event (ACTIVITY_TASK_COMPLETED / ACTIVITY_TASK_FAILED / ACTIVITY_TASK_TIMED_OUT) will both be written permanently to Workflow execution history when Activity is finished. This is done to avoid writing many events in the case of a failure/retry loop.

(-- api-linter: core::0127::http-annotation=disabled aip.dev/not-precedent: We do not expose worker API to HTTP. --)

Parameters

NameTypeDescription
requestIPollActivityTaskQueueRequestPollActivityTaskQueueRequest message or plain object
callbackPollActivityTaskQueueCallbackNode-style callback called with the error, if any, and PollActivityTaskQueueResponse

Returns

void

pollActivityTaskQueue(request): Promise<PollActivityTaskQueueResponse>

PollActivityTaskQueue is called by workers to process activity tasks from a specific task queue.

The worker is expected to call one of the RespondActivityTaskXXX methods when it is done processing the task.

An activity task is dispatched whenever a SCHEDULE_ACTIVITY_TASK command is produced during workflow execution. An in memory ACTIVITY_TASK_STARTED event is written to mutable state before the task is dispatched to the worker. The started event, and the final event (ACTIVITY_TASK_COMPLETED / ACTIVITY_TASK_FAILED / ACTIVITY_TASK_TIMED_OUT) will both be written permanently to Workflow execution history when Activity is finished. This is done to avoid writing many events in the case of a failure/retry loop.

(-- api-linter: core::0127::http-annotation=disabled aip.dev/not-precedent: We do not expose worker API to HTTP. --)

Parameters

NameTypeDescription
requestIPollActivityTaskQueueRequestPollActivityTaskQueueRequest message or plain object

Returns

Promise<PollActivityTaskQueueResponse>

Promise


pollWorkflowExecutionUpdate

pollWorkflowExecutionUpdate(request, callback): void

Polls a workflow execution for the outcome of a workflow execution update previously issued through the UpdateWorkflowExecution RPC. The effective timeout on this call will be shorter of the the caller-supplied gRPC timeout and the server's configured long-poll timeout.

(-- api-linter: core::0127::http-annotation=disabled aip.dev/not-precedent: We don't expose update polling API to HTTP in favor of a potential future non-blocking form. --)

Parameters

NameTypeDescription
requestIPollWorkflowExecutionUpdateRequestPollWorkflowExecutionUpdateRequest message or plain object
callbackPollWorkflowExecutionUpdateCallbackNode-style callback called with the error, if any, and PollWorkflowExecutionUpdateResponse

Returns

void

pollWorkflowExecutionUpdate(request): Promise<PollWorkflowExecutionUpdateResponse>

Polls a workflow execution for the outcome of a workflow execution update previously issued through the UpdateWorkflowExecution RPC. The effective timeout on this call will be shorter of the the caller-supplied gRPC timeout and the server's configured long-poll timeout.

(-- api-linter: core::0127::http-annotation=disabled aip.dev/not-precedent: We don't expose update polling API to HTTP in favor of a potential future non-blocking form. --)

Parameters

NameTypeDescription
requestIPollWorkflowExecutionUpdateRequestPollWorkflowExecutionUpdateRequest message or plain object

Returns

Promise<PollWorkflowExecutionUpdateResponse>

Promise


pollWorkflowTaskQueue

pollWorkflowTaskQueue(request, callback): void

PollWorkflowTaskQueue is called by workers to make progress on workflows.

A WorkflowTask is dispatched to callers for active workflow executions with pending workflow tasks. The worker is expected to call RespondWorkflowTaskCompleted when it is done processing the task. The service will create a WorkflowTaskStarted event in the history for this task before handing it to the worker.

(-- api-linter: core::0127::http-annotation=disabled aip.dev/not-precedent: We do not expose worker API to HTTP. --)

Parameters

NameTypeDescription
requestIPollWorkflowTaskQueueRequestPollWorkflowTaskQueueRequest message or plain object
callbackPollWorkflowTaskQueueCallbackNode-style callback called with the error, if any, and PollWorkflowTaskQueueResponse

Returns

void

pollWorkflowTaskQueue(request): Promise<PollWorkflowTaskQueueResponse>

PollWorkflowTaskQueue is called by workers to make progress on workflows.

A WorkflowTask is dispatched to callers for active workflow executions with pending workflow tasks. The worker is expected to call RespondWorkflowTaskCompleted when it is done processing the task. The service will create a WorkflowTaskStarted event in the history for this task before handing it to the worker.

(-- api-linter: core::0127::http-annotation=disabled aip.dev/not-precedent: We do not expose worker API to HTTP. --)

Parameters

NameTypeDescription
requestIPollWorkflowTaskQueueRequestPollWorkflowTaskQueueRequest message or plain object

Returns

Promise<PollWorkflowTaskQueueResponse>

Promise


queryWorkflow

queryWorkflow(request, callback): void

QueryWorkflow requests a query be executed for a specified workflow execution.

Parameters

NameTypeDescription
requestIQueryWorkflowRequestQueryWorkflowRequest message or plain object
callbackQueryWorkflowCallbackNode-style callback called with the error, if any, and QueryWorkflowResponse

Returns

void

queryWorkflow(request): Promise<QueryWorkflowResponse>

QueryWorkflow requests a query be executed for a specified workflow execution.

Parameters

NameTypeDescription
requestIQueryWorkflowRequestQueryWorkflowRequest message or plain object

Returns

Promise<QueryWorkflowResponse>

Promise


recordActivityTaskHeartbeat

recordActivityTaskHeartbeat(request, callback): void

RecordActivityTaskHeartbeat is optionally called by workers while they execute activities.

If worker fails to heartbeat within the heartbeat_timeout interval for the activity task, then it will be marked as timed out and an ACTIVITY_TASK_TIMED_OUT event will be written to the workflow history. Calling RecordActivityTaskHeartbeat will fail with NotFound in such situations, in that event, the SDK should request cancellation of the activity.

Parameters

NameTypeDescription
requestIRecordActivityTaskHeartbeatRequestRecordActivityTaskHeartbeatRequest message or plain object
callbackRecordActivityTaskHeartbeatCallbackNode-style callback called with the error, if any, and RecordActivityTaskHeartbeatResponse

Returns

void

recordActivityTaskHeartbeat(request): Promise<RecordActivityTaskHeartbeatResponse>

RecordActivityTaskHeartbeat is optionally called by workers while they execute activities.

If worker fails to heartbeat within the heartbeat_timeout interval for the activity task, then it will be marked as timed out and an ACTIVITY_TASK_TIMED_OUT event will be written to the workflow history. Calling RecordActivityTaskHeartbeat will fail with NotFound in such situations, in that event, the SDK should request cancellation of the activity.

Parameters

NameTypeDescription
requestIRecordActivityTaskHeartbeatRequestRecordActivityTaskHeartbeatRequest message or plain object

Returns

Promise<RecordActivityTaskHeartbeatResponse>

Promise


recordActivityTaskHeartbeatById

recordActivityTaskHeartbeatById(request, callback): void

See RecordActivityTaskHeartbeat. This version allows clients to record heartbeats by namespace/workflow id/activity id instead of task token.

(-- api-linter: core::0136::prepositions=disabled aip.dev/not-precedent: "By" is used to indicate request type. --)

Parameters

NameTypeDescription
requestIRecordActivityTaskHeartbeatByIdRequestRecordActivityTaskHeartbeatByIdRequest message or plain object
callbackRecordActivityTaskHeartbeatByIdCallbackNode-style callback called with the error, if any, and RecordActivityTaskHeartbeatByIdResponse

Returns

void

recordActivityTaskHeartbeatById(request): Promise<RecordActivityTaskHeartbeatByIdResponse>

See RecordActivityTaskHeartbeat. This version allows clients to record heartbeats by namespace/workflow id/activity id instead of task token.

(-- api-linter: core::0136::prepositions=disabled aip.dev/not-precedent: "By" is used to indicate request type. --)

Parameters

NameTypeDescription
requestIRecordActivityTaskHeartbeatByIdRequestRecordActivityTaskHeartbeatByIdRequest message or plain object

Returns

Promise<RecordActivityTaskHeartbeatByIdResponse>

Promise


registerNamespace

registerNamespace(request, callback): void

RegisterNamespace creates a new namespace which can be used as a container for all resources.

A Namespace is a top level entity within Temporal, and is used as a container for resources like workflow executions, task queues, etc. A Namespace acts as a sandbox and provides isolation for all resources within the namespace. All resources belongs to exactly one namespace.

Parameters

NameTypeDescription
requestIRegisterNamespaceRequestRegisterNamespaceRequest message or plain object
callbackRegisterNamespaceCallbackNode-style callback called with the error, if any, and RegisterNamespaceResponse

Returns

void

registerNamespace(request): Promise<RegisterNamespaceResponse>

RegisterNamespace creates a new namespace which can be used as a container for all resources.

A Namespace is a top level entity within Temporal, and is used as a container for resources like workflow executions, task queues, etc. A Namespace acts as a sandbox and provides isolation for all resources within the namespace. All resources belongs to exactly one namespace.

Parameters

NameTypeDescription
requestIRegisterNamespaceRequestRegisterNamespaceRequest message or plain object

Returns

Promise<RegisterNamespaceResponse>

Promise


requestCancelWorkflowExecution

requestCancelWorkflowExecution(request, callback): void

RequestCancelWorkflowExecution is called by workers when they want to request cancellation of a workflow execution.

This results in a new WORKFLOW_EXECUTION_CANCEL_REQUESTED event being written to the workflow history and a new workflow task created for the workflow. It returns success if the requested workflow is already closed. It fails with 'NotFound' if the requested workflow doesn't exist.

Parameters

NameTypeDescription
requestIRequestCancelWorkflowExecutionRequestRequestCancelWorkflowExecutionRequest message or plain object
callbackRequestCancelWorkflowExecutionCallbackNode-style callback called with the error, if any, and RequestCancelWorkflowExecutionResponse

Returns

void

requestCancelWorkflowExecution(request): Promise<RequestCancelWorkflowExecutionResponse>

RequestCancelWorkflowExecution is called by workers when they want to request cancellation of a workflow execution.

This results in a new WORKFLOW_EXECUTION_CANCEL_REQUESTED event being written to the workflow history and a new workflow task created for the workflow. It returns success if the requested workflow is already closed. It fails with 'NotFound' if the requested workflow doesn't exist.

Parameters

NameTypeDescription
requestIRequestCancelWorkflowExecutionRequestRequestCancelWorkflowExecutionRequest message or plain object

Returns

Promise<RequestCancelWorkflowExecutionResponse>

Promise


resetStickyTaskQueue

resetStickyTaskQueue(request, callback): void

ResetStickyTaskQueue resets the sticky task queue related information in the mutable state of a given workflow. This is prudent for workers to perform if a workflow has been paged out of their cache.

Things cleared are:

  1. StickyTaskQueue
  2. StickyScheduleToStartTimeout

(-- api-linter: core::0127::http-annotation=disabled aip.dev/not-precedent: We do not expose worker API to HTTP. --)

Parameters

NameTypeDescription
requestIResetStickyTaskQueueRequestResetStickyTaskQueueRequest message or plain object
callbackResetStickyTaskQueueCallbackNode-style callback called with the error, if any, and ResetStickyTaskQueueResponse

Returns

void

resetStickyTaskQueue(request): Promise<ResetStickyTaskQueueResponse>

ResetStickyTaskQueue resets the sticky task queue related information in the mutable state of a given workflow. This is prudent for workers to perform if a workflow has been paged out of their cache.

Things cleared are:

  1. StickyTaskQueue
  2. StickyScheduleToStartTimeout

(-- api-linter: core::0127::http-annotation=disabled aip.dev/not-precedent: We do not expose worker API to HTTP. --)

Parameters

NameTypeDescription
requestIResetStickyTaskQueueRequestResetStickyTaskQueueRequest message or plain object

Returns

Promise<ResetStickyTaskQueueResponse>

Promise


resetWorkflowExecution

resetWorkflowExecution(request, callback): void

ResetWorkflowExecution will reset an existing workflow execution to a specified WORKFLOW_TASK_COMPLETED event (exclusive). It will immediately terminate the current execution instance. TODO: Does exclusive here mean just the completed event, or also WFT started? Otherwise the task is doomed to time out?

Parameters

NameTypeDescription
requestIResetWorkflowExecutionRequestResetWorkflowExecutionRequest message or plain object
callbackResetWorkflowExecutionCallbackNode-style callback called with the error, if any, and ResetWorkflowExecutionResponse

Returns

void

resetWorkflowExecution(request): Promise<ResetWorkflowExecutionResponse>

ResetWorkflowExecution will reset an existing workflow execution to a specified WORKFLOW_TASK_COMPLETED event (exclusive). It will immediately terminate the current execution instance. TODO: Does exclusive here mean just the completed event, or also WFT started? Otherwise the task is doomed to time out?

Parameters

NameTypeDescription
requestIResetWorkflowExecutionRequestResetWorkflowExecutionRequest message or plain object

Returns

Promise<ResetWorkflowExecutionResponse>

Promise


respondActivityTaskCanceled

respondActivityTaskCanceled(request, callback): void

RespondActivityTaskFailed is called by workers when processing an activity task fails.

This results in a new ACTIVITY_TASK_CANCELED event being written to the workflow history and a new workflow task created for the workflow. Fails with NotFound if the task token is no longer valid due to activity timeout, already being completed, or never having existed.

Parameters

NameTypeDescription
requestIRespondActivityTaskCanceledRequestRespondActivityTaskCanceledRequest message or plain object
callbackRespondActivityTaskCanceledCallbackNode-style callback called with the error, if any, and RespondActivityTaskCanceledResponse

Returns

void

respondActivityTaskCanceled(request): Promise<RespondActivityTaskCanceledResponse>

RespondActivityTaskFailed is called by workers when processing an activity task fails.

This results in a new ACTIVITY_TASK_CANCELED event being written to the workflow history and a new workflow task created for the workflow. Fails with NotFound if the task token is no longer valid due to activity timeout, already being completed, or never having existed.

Parameters

NameTypeDescription
requestIRespondActivityTaskCanceledRequestRespondActivityTaskCanceledRequest message or plain object

Returns

Promise<RespondActivityTaskCanceledResponse>

Promise


respondActivityTaskCanceledById

respondActivityTaskCanceledById(request, callback): void

See RecordActivityTaskCanceled. This version allows clients to record failures by namespace/workflow id/activity id instead of task token.

(-- api-linter: core::0136::prepositions=disabled aip.dev/not-precedent: "By" is used to indicate request type. --)

Parameters

NameTypeDescription
requestIRespondActivityTaskCanceledByIdRequestRespondActivityTaskCanceledByIdRequest message or plain object
callbackRespondActivityTaskCanceledByIdCallbackNode-style callback called with the error, if any, and RespondActivityTaskCanceledByIdResponse

Returns

void

respondActivityTaskCanceledById(request): Promise<RespondActivityTaskCanceledByIdResponse>

See RecordActivityTaskCanceled. This version allows clients to record failures by namespace/workflow id/activity id instead of task token.

(-- api-linter: core::0136::prepositions=disabled aip.dev/not-precedent: "By" is used to indicate request type. --)

Parameters

NameTypeDescription
requestIRespondActivityTaskCanceledByIdRequestRespondActivityTaskCanceledByIdRequest message or plain object

Returns

Promise<RespondActivityTaskCanceledByIdResponse>

Promise


respondActivityTaskCompleted

respondActivityTaskCompleted(request, callback): void

RespondActivityTaskCompleted is called by workers when they successfully complete an activity task.

This results in a new ACTIVITY_TASK_COMPLETED event being written to the workflow history and a new workflow task created for the workflow. Fails with NotFound if the task token is no longer valid due to activity timeout, already being completed, or never having existed.

Parameters

NameTypeDescription
requestIRespondActivityTaskCompletedRequestRespondActivityTaskCompletedRequest message or plain object
callbackRespondActivityTaskCompletedCallbackNode-style callback called with the error, if any, and RespondActivityTaskCompletedResponse

Returns

void

respondActivityTaskCompleted(request): Promise<RespondActivityTaskCompletedResponse>

RespondActivityTaskCompleted is called by workers when they successfully complete an activity task.

This results in a new ACTIVITY_TASK_COMPLETED event being written to the workflow history and a new workflow task created for the workflow. Fails with NotFound if the task token is no longer valid due to activity timeout, already being completed, or never having existed.

Parameters

NameTypeDescription
requestIRespondActivityTaskCompletedRequestRespondActivityTaskCompletedRequest message or plain object

Returns

Promise<RespondActivityTaskCompletedResponse>

Promise


respondActivityTaskCompletedById

respondActivityTaskCompletedById(request, callback): void

See RecordActivityTaskCompleted. This version allows clients to record completions by namespace/workflow id/activity id instead of task token.

(-- api-linter: core::0136::prepositions=disabled aip.dev/not-precedent: "By" is used to indicate request type. --)

Parameters

NameTypeDescription
requestIRespondActivityTaskCompletedByIdRequestRespondActivityTaskCompletedByIdRequest message or plain object
callbackRespondActivityTaskCompletedByIdCallbackNode-style callback called with the error, if any, and RespondActivityTaskCompletedByIdResponse

Returns

void

respondActivityTaskCompletedById(request): Promise<RespondActivityTaskCompletedByIdResponse>

See RecordActivityTaskCompleted. This version allows clients to record completions by namespace/workflow id/activity id instead of task token.

(-- api-linter: core::0136::prepositions=disabled aip.dev/not-precedent: "By" is used to indicate request type. --)

Parameters

NameTypeDescription
requestIRespondActivityTaskCompletedByIdRequestRespondActivityTaskCompletedByIdRequest message or plain object

Returns

Promise<RespondActivityTaskCompletedByIdResponse>

Promise


respondActivityTaskFailed

respondActivityTaskFailed(request, callback): void

RespondActivityTaskFailed is called by workers when processing an activity task fails.

This results in a new ACTIVITY_TASK_FAILED event being written to the workflow history and a new workflow task created for the workflow. Fails with NotFound if the task token is no longer valid due to activity timeout, already being completed, or never having existed.

Parameters

NameTypeDescription
requestIRespondActivityTaskFailedRequestRespondActivityTaskFailedRequest message or plain object
callbackRespondActivityTaskFailedCallbackNode-style callback called with the error, if any, and RespondActivityTaskFailedResponse

Returns

void

respondActivityTaskFailed(request): Promise<RespondActivityTaskFailedResponse>

RespondActivityTaskFailed is called by workers when processing an activity task fails.

This results in a new ACTIVITY_TASK_FAILED event being written to the workflow history and a new workflow task created for the workflow. Fails with NotFound if the task token is no longer valid due to activity timeout, already being completed, or never having existed.

Parameters

NameTypeDescription
requestIRespondActivityTaskFailedRequestRespondActivityTaskFailedRequest message or plain object

Returns

Promise<RespondActivityTaskFailedResponse>

Promise


respondActivityTaskFailedById

respondActivityTaskFailedById(request, callback): void

See RecordActivityTaskFailed. This version allows clients to record failures by namespace/workflow id/activity id instead of task token.

(-- api-linter: core::0136::prepositions=disabled aip.dev/not-precedent: "By" is used to indicate request type. --)

Parameters

NameTypeDescription
requestIRespondActivityTaskFailedByIdRequestRespondActivityTaskFailedByIdRequest message or plain object
callbackRespondActivityTaskFailedByIdCallbackNode-style callback called with the error, if any, and RespondActivityTaskFailedByIdResponse

Returns

void

respondActivityTaskFailedById(request): Promise<RespondActivityTaskFailedByIdResponse>

See RecordActivityTaskFailed. This version allows clients to record failures by namespace/workflow id/activity id instead of task token.

(-- api-linter: core::0136::prepositions=disabled aip.dev/not-precedent: "By" is used to indicate request type. --)

Parameters

NameTypeDescription
requestIRespondActivityTaskFailedByIdRequestRespondActivityTaskFailedByIdRequest message or plain object

Returns

Promise<RespondActivityTaskFailedByIdResponse>

Promise


respondQueryTaskCompleted

respondQueryTaskCompleted(request, callback): void

RespondQueryTaskCompleted is called by workers to complete queries which were delivered on the query (not queries) field of a PollWorkflowTaskQueueResponse.

Completing the query will unblock the corresponding client call to QueryWorkflow and return the query result a response.

(-- api-linter: core::0127::http-annotation=disabled aip.dev/not-precedent: We do not expose worker API to HTTP. --)

Parameters

NameTypeDescription
requestIRespondQueryTaskCompletedRequestRespondQueryTaskCompletedRequest message or plain object
callbackRespondQueryTaskCompletedCallbackNode-style callback called with the error, if any, and RespondQueryTaskCompletedResponse

Returns

void

respondQueryTaskCompleted(request): Promise<RespondQueryTaskCompletedResponse>

RespondQueryTaskCompleted is called by workers to complete queries which were delivered on the query (not queries) field of a PollWorkflowTaskQueueResponse.

Completing the query will unblock the corresponding client call to QueryWorkflow and return the query result a response.

(-- api-linter: core::0127::http-annotation=disabled aip.dev/not-precedent: We do not expose worker API to HTTP. --)

Parameters

NameTypeDescription
requestIRespondQueryTaskCompletedRequestRespondQueryTaskCompletedRequest message or plain object

Returns

Promise<RespondQueryTaskCompletedResponse>

Promise


respondWorkflowTaskCompleted

respondWorkflowTaskCompleted(request, callback): void

RespondWorkflowTaskCompleted is called by workers to successfully complete workflow tasks they received from PollWorkflowTaskQueue.

Completing a WorkflowTask will write a WORKFLOW_TASK_COMPLETED event to the workflow's history, along with events corresponding to whatever commands the SDK generated while executing the task (ex timer started, activity task scheduled, etc).

(-- api-linter: core::0127::http-annotation=disabled aip.dev/not-precedent: We do not expose worker API to HTTP. --)

Parameters

NameTypeDescription
requestIRespondWorkflowTaskCompletedRequestRespondWorkflowTaskCompletedRequest message or plain object
callbackRespondWorkflowTaskCompletedCallbackNode-style callback called with the error, if any, and RespondWorkflowTaskCompletedResponse

Returns

void

respondWorkflowTaskCompleted(request): Promise<RespondWorkflowTaskCompletedResponse>

RespondWorkflowTaskCompleted is called by workers to successfully complete workflow tasks they received from PollWorkflowTaskQueue.

Completing a WorkflowTask will write a WORKFLOW_TASK_COMPLETED event to the workflow's history, along with events corresponding to whatever commands the SDK generated while executing the task (ex timer started, activity task scheduled, etc).

(-- api-linter: core::0127::http-annotation=disabled aip.dev/not-precedent: We do not expose worker API to HTTP. --)

Parameters

NameTypeDescription
requestIRespondWorkflowTaskCompletedRequestRespondWorkflowTaskCompletedRequest message or plain object

Returns

Promise<RespondWorkflowTaskCompletedResponse>

Promise


respondWorkflowTaskFailed

respondWorkflowTaskFailed(request, callback): void

RespondWorkflowTaskFailed is called by workers to indicate the processing of a workflow task failed.

This results in a WORKFLOW_TASK_FAILED event written to the history, and a new workflow task will be scheduled. This API can be used to report unhandled failures resulting from applying the workflow task.

Temporal will only append first WorkflowTaskFailed event to the history of workflow execution for consecutive failures.

(-- api-linter: core::0127::http-annotation=disabled aip.dev/not-precedent: We do not expose worker API to HTTP. --)

Parameters

NameTypeDescription
requestIRespondWorkflowTaskFailedRequestRespondWorkflowTaskFailedRequest message or plain object
callbackRespondWorkflowTaskFailedCallbackNode-style callback called with the error, if any, and RespondWorkflowTaskFailedResponse

Returns

void

respondWorkflowTaskFailed(request): Promise<RespondWorkflowTaskFailedResponse>

RespondWorkflowTaskFailed is called by workers to indicate the processing of a workflow task failed.

This results in a WORKFLOW_TASK_FAILED event written to the history, and a new workflow task will be scheduled. This API can be used to report unhandled failures resulting from applying the workflow task.

Temporal will only append first WorkflowTaskFailed event to the history of workflow execution for consecutive failures.

(-- api-linter: core::0127::http-annotation=disabled aip.dev/not-precedent: We do not expose worker API to HTTP. --)

Parameters

NameTypeDescription
requestIRespondWorkflowTaskFailedRequestRespondWorkflowTaskFailedRequest message or plain object

Returns

Promise<RespondWorkflowTaskFailedResponse>

Promise


rpcCall

rpcCall<TReq, TRes>(method, requestCtor, responseCtor, request, callback): void

Calls a service method through rpcImpl.

Type parameters

NameType
TReqextends Message<TReq>
TResextends Message<TRes>

Parameters

NameTypeDescription
methodMethod | ServiceMethod<TReq, TRes>Reflected or static method
requestCtorConstructor<TReq>Request constructor
responseCtorConstructor<TRes>Response constructor
requestTReq | Properties<TReq>Request message or plain object
callbackServiceMethodCallback<TRes>Service callback

Returns

void

Inherited from

$protobuf.rpc.Service.rpcCall


scanWorkflowExecutions

scanWorkflowExecutions(request, callback): void

ScanWorkflowExecutions is a visibility API to list large amount of workflow executions in a specific namespace without order.

(-- api-linter: core::0127::http-annotation=disabled aip.dev/not-precedent: HTTP users should use ListWorkflowExecutions instead. --)

Parameters

NameTypeDescription
requestIScanWorkflowExecutionsRequestScanWorkflowExecutionsRequest message or plain object
callbackScanWorkflowExecutionsCallbackNode-style callback called with the error, if any, and ScanWorkflowExecutionsResponse

Returns

void

scanWorkflowExecutions(request): Promise<ScanWorkflowExecutionsResponse>

ScanWorkflowExecutions is a visibility API to list large amount of workflow executions in a specific namespace without order.

(-- api-linter: core::0127::http-annotation=disabled aip.dev/not-precedent: HTTP users should use ListWorkflowExecutions instead. --)

Parameters

NameTypeDescription
requestIScanWorkflowExecutionsRequestScanWorkflowExecutionsRequest message or plain object

Returns

Promise<ScanWorkflowExecutionsResponse>

Promise


signalWithStartWorkflowExecution

signalWithStartWorkflowExecution(request, callback): void

SignalWithStartWorkflowExecution is used to ensure a signal is sent to a workflow, even if it isn't yet started.

If the workflow is running, a WORKFLOW_EXECUTION_SIGNALED event is recorded in the history and a workflow task is generated.

If the workflow is not running or not found, then the workflow is created with WORKFLOW_EXECUTION_STARTED and WORKFLOW_EXECUTION_SIGNALED events in its history, and a workflow task is generated.

(-- api-linter: core::0136::prepositions=disabled aip.dev/not-precedent: "With" is used to indicate combined operation. --)

Parameters

NameTypeDescription
requestISignalWithStartWorkflowExecutionRequestSignalWithStartWorkflowExecutionRequest message or plain object
callbackSignalWithStartWorkflowExecutionCallbackNode-style callback called with the error, if any, and SignalWithStartWorkflowExecutionResponse

Returns

void

signalWithStartWorkflowExecution(request): Promise<SignalWithStartWorkflowExecutionResponse>

SignalWithStartWorkflowExecution is used to ensure a signal is sent to a workflow, even if it isn't yet started.

If the workflow is running, a WORKFLOW_EXECUTION_SIGNALED event is recorded in the history and a workflow task is generated.

If the workflow is not running or not found, then the workflow is created with WORKFLOW_EXECUTION_STARTED and WORKFLOW_EXECUTION_SIGNALED events in its history, and a workflow task is generated.

(-- api-linter: core::0136::prepositions=disabled aip.dev/not-precedent: "With" is used to indicate combined operation. --)

Parameters

NameTypeDescription
requestISignalWithStartWorkflowExecutionRequestSignalWithStartWorkflowExecutionRequest message or plain object

Returns

Promise<SignalWithStartWorkflowExecutionResponse>

Promise


signalWorkflowExecution

signalWorkflowExecution(request, callback): void

SignalWorkflowExecution is used to send a signal to a running workflow execution.

This results in a WORKFLOW_EXECUTION_SIGNALED event recorded in the history and a workflow task being created for the execution.

Parameters

NameTypeDescription
requestISignalWorkflowExecutionRequestSignalWorkflowExecutionRequest message or plain object
callbackSignalWorkflowExecutionCallbackNode-style callback called with the error, if any, and SignalWorkflowExecutionResponse

Returns

void

signalWorkflowExecution(request): Promise<SignalWorkflowExecutionResponse>

SignalWorkflowExecution is used to send a signal to a running workflow execution.

This results in a WORKFLOW_EXECUTION_SIGNALED event recorded in the history and a workflow task being created for the execution.

Parameters

NameTypeDescription
requestISignalWorkflowExecutionRequestSignalWorkflowExecutionRequest message or plain object

Returns

Promise<SignalWorkflowExecutionResponse>

Promise


startBatchOperation

startBatchOperation(request, callback): void

StartBatchOperation starts a new batch operation

Parameters

NameTypeDescription
requestIStartBatchOperationRequestStartBatchOperationRequest message or plain object
callbackStartBatchOperationCallbackNode-style callback called with the error, if any, and StartBatchOperationResponse

Returns

void

startBatchOperation(request): Promise<StartBatchOperationResponse>

StartBatchOperation starts a new batch operation

Parameters

NameTypeDescription
requestIStartBatchOperationRequestStartBatchOperationRequest message or plain object

Returns

Promise<StartBatchOperationResponse>

Promise


startWorkflowExecution

startWorkflowExecution(request, callback): void

StartWorkflowExecution starts a new workflow execution.

It will create the execution with a WORKFLOW_EXECUTION_STARTED event in its history and also schedule the first workflow task. Returns WorkflowExecutionAlreadyStarted, if an instance already exists with same workflow id.

Parameters

NameTypeDescription
requestIStartWorkflowExecutionRequestStartWorkflowExecutionRequest message or plain object
callbackStartWorkflowExecutionCallbackNode-style callback called with the error, if any, and StartWorkflowExecutionResponse

Returns

void

startWorkflowExecution(request): Promise<StartWorkflowExecutionResponse>

StartWorkflowExecution starts a new workflow execution.

It will create the execution with a WORKFLOW_EXECUTION_STARTED event in its history and also schedule the first workflow task. Returns WorkflowExecutionAlreadyStarted, if an instance already exists with same workflow id.

Parameters

NameTypeDescription
requestIStartWorkflowExecutionRequestStartWorkflowExecutionRequest message or plain object

Returns

Promise<StartWorkflowExecutionResponse>

Promise


stopBatchOperation

stopBatchOperation(request, callback): void

StopBatchOperation stops a batch operation

Parameters

NameTypeDescription
requestIStopBatchOperationRequestStopBatchOperationRequest message or plain object
callbackStopBatchOperationCallbackNode-style callback called with the error, if any, and StopBatchOperationResponse

Returns

void

stopBatchOperation(request): Promise<StopBatchOperationResponse>

StopBatchOperation stops a batch operation

Parameters

NameTypeDescription
requestIStopBatchOperationRequestStopBatchOperationRequest message or plain object

Returns

Promise<StopBatchOperationResponse>

Promise


terminateWorkflowExecution

terminateWorkflowExecution(request, callback): void

TerminateWorkflowExecution terminates an existing workflow execution by recording a WORKFLOW_EXECUTION_TERMINATED event in the history and immediately terminating the execution instance.

Parameters

NameTypeDescription
requestITerminateWorkflowExecutionRequestTerminateWorkflowExecutionRequest message or plain object
callbackTerminateWorkflowExecutionCallbackNode-style callback called with the error, if any, and TerminateWorkflowExecutionResponse

Returns

void

terminateWorkflowExecution(request): Promise<TerminateWorkflowExecutionResponse>

TerminateWorkflowExecution terminates an existing workflow execution by recording a WORKFLOW_EXECUTION_TERMINATED event in the history and immediately terminating the execution instance.

Parameters

NameTypeDescription
requestITerminateWorkflowExecutionRequestTerminateWorkflowExecutionRequest message or plain object

Returns

Promise<TerminateWorkflowExecutionResponse>

Promise


updateNamespace

updateNamespace(request, callback): void

UpdateNamespace is used to update the information and configuration of a registered namespace.

Parameters

NameTypeDescription
requestIUpdateNamespaceRequestUpdateNamespaceRequest message or plain object
callbackUpdateNamespaceCallbackNode-style callback called with the error, if any, and UpdateNamespaceResponse

Returns

void

updateNamespace(request): Promise<UpdateNamespaceResponse>

UpdateNamespace is used to update the information and configuration of a registered namespace.

Parameters

NameTypeDescription
requestIUpdateNamespaceRequestUpdateNamespaceRequest message or plain object

Returns

Promise<UpdateNamespaceResponse>

Promise


updateSchedule

updateSchedule(request, callback): void

Changes the configuration or state of an existing schedule.

Parameters

NameTypeDescription
requestIUpdateScheduleRequestUpdateScheduleRequest message or plain object
callbackUpdateScheduleCallbackNode-style callback called with the error, if any, and UpdateScheduleResponse

Returns

void

updateSchedule(request): Promise<UpdateScheduleResponse>

Changes the configuration or state of an existing schedule.

Parameters

NameTypeDescription
requestIUpdateScheduleRequestUpdateScheduleRequest message or plain object

Returns

Promise<UpdateScheduleResponse>

Promise


updateWorkerBuildIdCompatibility

updateWorkerBuildIdCompatibility(request, callback): void

Allows users to specify sets of worker build id versions on a per task queue basis. Versions are ordered, and may be either compatible with some extant version, or a new incompatible version, forming sets of ids which are incompatible with each other, but whose contained members are compatible with one another.

A single build id may be mapped to multiple task queues using this API for cases where a single process hosts multiple workers.

To query which workers can be retired, use the GetWorkerTaskReachability API.

NOTE: The number of task queues mapped to a single build id is limited by the limit.taskQueuesPerBuildId (default is 20), if this limit is exceeded this API will error with a FailedPrecondition.

(-- api-linter: core::0127::http-annotation=disabled aip.dev/not-precedent: We do yet expose versioning API to HTTP. --)

Parameters

NameTypeDescription
requestIUpdateWorkerBuildIdCompatibilityRequestUpdateWorkerBuildIdCompatibilityRequest message or plain object
callbackUpdateWorkerBuildIdCompatibilityCallbackNode-style callback called with the error, if any, and UpdateWorkerBuildIdCompatibilityResponse

Returns

void

updateWorkerBuildIdCompatibility(request): Promise<UpdateWorkerBuildIdCompatibilityResponse>

Allows users to specify sets of worker build id versions on a per task queue basis. Versions are ordered, and may be either compatible with some extant version, or a new incompatible version, forming sets of ids which are incompatible with each other, but whose contained members are compatible with one another.

A single build id may be mapped to multiple task queues using this API for cases where a single process hosts multiple workers.

To query which workers can be retired, use the GetWorkerTaskReachability API.

NOTE: The number of task queues mapped to a single build id is limited by the limit.taskQueuesPerBuildId (default is 20), if this limit is exceeded this API will error with a FailedPrecondition.

(-- api-linter: core::0127::http-annotation=disabled aip.dev/not-precedent: We do yet expose versioning API to HTTP. --)

Parameters

NameTypeDescription
requestIUpdateWorkerBuildIdCompatibilityRequestUpdateWorkerBuildIdCompatibilityRequest message or plain object

Returns

Promise<UpdateWorkerBuildIdCompatibilityResponse>

Promise


updateWorkflowExecution

updateWorkflowExecution(request, callback): void

Invokes the specified update function on user workflow code.

Parameters

NameTypeDescription
requestIUpdateWorkflowExecutionRequestUpdateWorkflowExecutionRequest message or plain object
callbackUpdateWorkflowExecutionCallbackNode-style callback called with the error, if any, and UpdateWorkflowExecutionResponse

Returns

void

updateWorkflowExecution(request): Promise<UpdateWorkflowExecutionResponse>

Invokes the specified update function on user workflow code.

Parameters

NameTypeDescription
requestIUpdateWorkflowExecutionRequestUpdateWorkflowExecutionRequest message or plain object

Returns

Promise<UpdateWorkflowExecutionResponse>

Promise


create

create(rpcImpl, requestDelimited?, responseDelimited?): WorkflowService

Creates new WorkflowService service using the specified rpc implementation.

Parameters

NameTypeDescription
rpcImplRPCImplRPC implementation
requestDelimited?booleanWhether requests are length-delimited
responseDelimited?booleanWhether responses are length-delimited

Returns

WorkflowService

RPC service. Useful where requests and/or responses are streamed.