Skip to main content

Class: WorkflowExecutionVersioningInfo

workflow.v1.WorkflowExecutionVersioningInfo

Holds all the information about worker versioning for a particular workflow execution. Experimental. Versioning info is experimental and might change in the future.

Implements

Constructors

constructor

new WorkflowExecutionVersioningInfo(properties?): WorkflowExecutionVersioningInfo

Constructs a new WorkflowExecutionVersioningInfo.

Parameters

NameTypeDescription
properties?IWorkflowExecutionVersioningInfoProperties to set

Returns

WorkflowExecutionVersioningInfo

Properties

behavior

behavior: VersioningBehavior

Versioning behavior determines how the server should treat this execution when workers are upgraded. When present it means this workflow execution is versioned; UNSPECIFIED means unversioned. See the comments in VersioningBehavior enum for more info about different behaviors.

Child workflows or CaN executions inherit their parent/previous run's effective Versioning Behavior and Version (except when the new execution runs on a task queue not belonging to the same deployment version as the parent/previous run's task queue). The first workflow task will be dispatched according to the inherited behavior (or to the current version of the task-queue's deployment in the case of AutoUpgrade.) After completion of their first workflow task the Deployment Version and Behavior of the execution will update according to configuration on the worker.

Note that behavior is overridden by versioning_override if the latter is present.

Implementation of

IWorkflowExecutionVersioningInfo.behavior


deployment

Optional deployment: null | IDeployment

The worker deployment that completed the last workflow task of this workflow execution. Must be present if behavior is set. Absent value means no workflow task is completed, or the last workflow task was completed by an unversioned worker. Unversioned workers may still send a deployment value which will be stored here, so the right way to check if an execution is versioned if an execution is versioned or not is via the behavior field. Note that deployment is overridden by versioning_override if the latter is present. Deprecated. Use deployment_version.

Implementation of

IWorkflowExecutionVersioningInfo.deployment


deploymentTransition

Optional deploymentTransition: null | IDeploymentTransition

When present, indicates the workflow is transitioning to a different deployment. Can indicate one of the following transitions: unversioned -> versioned, versioned -> versioned on a different deployment, or versioned -> unversioned. Not applicable to workflows with PINNED behavior. When a workflow with AUTO_UPGRADE behavior creates a new workflow task, it will automatically start a transition to the task queue's current deployment if the task queue's current deployment is different from the workflow's deployment. If the AUTO_UPGRADE workflow is stuck due to backlogged activity or workflow tasks, those tasks will be redirected to the task queue's current deployment. As soon as a poller from that deployment is available to receive the task, the workflow will automatically start a transition to that deployment and continue execution there. A deployment transition can only exist while there is a pending or started workflow task. Once the pending workflow task completes on the transition's target deployment, the transition completes and the workflow's deployment and behavior fields are updated per the worker's task completion response. Pending activities will not start new attempts during a transition. Once the transition is completed, pending activities will start their next attempt on the new deployment. Deprecated. Use version_transition.

Implementation of

IWorkflowExecutionVersioningInfo.deploymentTransition


deploymentVersion

Optional deploymentVersion: null | IWorkerDeploymentVersion

The Worker Deployment Version that completed the last workflow task of this workflow execution. An absent value means no workflow task is completed, or the workflow is unversioned. If present, and behavior is UNSPECIFIED, the last task of this workflow execution was completed by a worker that is not using versioning but is passing Deployment Name and Build ID.

Child workflows or CaN executions inherit their parent/previous run's effective Versioning Behavior and Version (except when the new execution runs on a task queue not belonging to the same deployment version as the parent/previous run's task queue). The first workflow task will be dispatched according to the inherited behavior (or to the current version of the task-queue's deployment in the case of AutoUpgrade.) After completion of their first workflow task the Deployment Version and Behavior of the execution will update according to configuration on the worker.

Note that if versioning_override.behavior is PINNED then versioning_override.pinned_version will override this value.

Implementation of

IWorkflowExecutionVersioningInfo.deploymentVersion


revisionNumber

revisionNumber: Long

Monotonic counter reflecting the latest routing decision for this workflow execution. Used for staleness detection between history and matching when dispatching tasks to workers. Incremented when a workflow execution routes to a new deployment version, which happens when a worker of the new deployment version completes a workflow task. Note: Pinned tasks and sticky tasks send a value of 0 for this field since these tasks do not face the problem of inconsistent dispatching that arises from eventual consistency between task queues and their partitions.

Implementation of

IWorkflowExecutionVersioningInfo.revisionNumber


version

version: string

Deprecated. Use deployment_version.

Implementation of

IWorkflowExecutionVersioningInfo.version


versionTransition

Optional versionTransition: null | IDeploymentVersionTransition

When present, indicates the workflow is transitioning to a different deployment version (which may belong to the same deployment name or another). Can indicate one of the following transitions: unversioned -> versioned, versioned -> versioned on a different deployment version, or versioned -> unversioned. Not applicable to workflows with PINNED behavior. When a workflow with AUTO_UPGRADE behavior creates a new workflow task, it will automatically start a transition to the task queue's current version if the task queue's current version is different from the workflow's current deployment version. If the AUTO_UPGRADE workflow is stuck due to backlogged activity or workflow tasks, those tasks will be redirected to the task queue's current version. As soon as a poller from that deployment version is available to receive the task, the workflow will automatically start a transition to that version and continue execution there. A version transition can only exist while there is a pending or started workflow task. Once the pending workflow task completes on the transition's target version, the transition completes and the workflow's behavior, and deployment_version fields are updated per the worker's task completion response. Pending activities will not start new attempts during a transition. Once the transition is completed, pending activities will start their next attempt on the new version.

Implementation of

IWorkflowExecutionVersioningInfo.versionTransition


versioningOverride

Optional versioningOverride: null | IVersioningOverride

Present if user has set an execution-specific versioning override. This override takes precedence over SDK-sent behavior (and version when override is PINNED). An override can be set when starting a new execution, as well as afterwards by calling the UpdateWorkflowExecutionOptions API. Pinned overrides are automatically inherited by child workflows, continue-as-new workflows, workflow retries, and cron workflows.

Implementation of

IWorkflowExecutionVersioningInfo.versioningOverride

Methods

toJSON

toJSON(): Object

Converts this WorkflowExecutionVersioningInfo to JSON.

Returns

Object

JSON object


create

create(properties?): WorkflowExecutionVersioningInfo

Creates a new WorkflowExecutionVersioningInfo instance using the specified properties.

Parameters

NameTypeDescription
properties?IWorkflowExecutionVersioningInfoProperties to set

Returns

WorkflowExecutionVersioningInfo

WorkflowExecutionVersioningInfo instance


decode

decode(reader, length?): WorkflowExecutionVersioningInfo

Decodes a WorkflowExecutionVersioningInfo message from the specified reader or buffer.

Parameters

NameTypeDescription
readerUint8Array | ReaderReader or buffer to decode from
length?numberMessage length if known beforehand

Returns

WorkflowExecutionVersioningInfo

WorkflowExecutionVersioningInfo

Throws

If the payload is not a reader or valid buffer

Throws

If required fields are missing


decodeDelimited

decodeDelimited(reader): WorkflowExecutionVersioningInfo

Decodes a WorkflowExecutionVersioningInfo message from the specified reader or buffer, length delimited.

Parameters

NameTypeDescription
readerUint8Array | ReaderReader or buffer to decode from

Returns

WorkflowExecutionVersioningInfo

WorkflowExecutionVersioningInfo

Throws

If the payload is not a reader or valid buffer

Throws

If required fields are missing


encode

encode(message, writer?): Writer

Encodes the specified WorkflowExecutionVersioningInfo message. Does not implicitly temporal.api.workflow.v1.WorkflowExecutionVersioningInfo.verify|verify messages.

Parameters

NameTypeDescription
messageIWorkflowExecutionVersioningInfoWorkflowExecutionVersioningInfo message or plain object to encode
writer?WriterWriter to encode to

Returns

Writer

Writer


encodeDelimited

encodeDelimited(message, writer?): Writer

Encodes the specified WorkflowExecutionVersioningInfo message, length delimited. Does not implicitly temporal.api.workflow.v1.WorkflowExecutionVersioningInfo.verify|verify messages.

Parameters

NameTypeDescription
messageIWorkflowExecutionVersioningInfoWorkflowExecutionVersioningInfo message or plain object to encode
writer?WriterWriter to encode to

Returns

Writer

Writer


fromObject

fromObject(object): WorkflowExecutionVersioningInfo

Creates a WorkflowExecutionVersioningInfo message from a plain object. Also converts values to their respective internal types.

Parameters

NameTypeDescription
objectObjectPlain object

Returns

WorkflowExecutionVersioningInfo

WorkflowExecutionVersioningInfo


getTypeUrl

getTypeUrl(typeUrlPrefix?): string

Gets the default type url for WorkflowExecutionVersioningInfo

Parameters

NameTypeDescription
typeUrlPrefix?stringyour custom typeUrlPrefix(default "type.googleapis.com")

Returns

string

The default type url


toObject

toObject(message, options?): Object

Creates a plain object from a WorkflowExecutionVersioningInfo message. Also converts values to other types if specified.

Parameters

NameTypeDescription
messageWorkflowExecutionVersioningInfoWorkflowExecutionVersioningInfo
options?IConversionOptionsConversion options

Returns

Object

Plain object