Class: BuildIdAssignmentRule
Assignment rules are applied to new Workflow and Activity executions at schedule time to assign them to a Build ID.
Assignment rules will not be used in the following cases:
- Child Workflows or Continue-As-New Executions who inherit their
parent/previous Workflow's assigned Build ID (by setting the
inherit_build_idflag - default behavior in SDKs when the same Task Queue is used.) - An Activity that inherits the assigned Build ID of its Workflow (by
setting the
use_workflow_build_idflag - default behavior in SDKs when the same Task Queue is used.)
In absence of (applicable) redirect rules (CompatibleBuildIdRedirectRules)
the task will be dispatched to Workers of the Build ID determined by the
assignment rules (or inherited). Otherwise, the final Build ID will be
determined by the redirect rules.
Once a Workflow completes its first Workflow Task in a particular Build ID it stays in that Build ID regardless of changes to assignment rules. Redirect rules can be used to move the workflow to another compatible Build ID.
When using Worker Versioning on a Task Queue, in the steady state,
there should typically be a single assignment rule to send all new executions
to the latest Build ID. Existence of at least one such "unconditional"
rule at all times is enforces by the system, unless the force flag is used
by the user when replacing/deleting these rules (for exceptional cases).
During a deployment, one or more additional rules can be added to assign a subset of the tasks to a new Build ID based on a "ramp percentage".
When there are multiple assignment rules for a Task Queue, the rules are evaluated in order, starting from index 0. The first applicable rule will be applied and the rest will be ignored.
In the event that no assignment rule is applicable on a task (or the Task Queue is simply not versioned), the tasks will be dispatched to an unversioned Worker.
Properties
percentageRamp?
optionalpercentageRamp?:$Properties|null
This ramp is useful for gradual Blue/Green deployments (and similar) where you want to send a certain portion of the traffic to the target Build ID.
ramp?
optionalramp?:"percentageRamp"
If a ramp is provided, this rule will be applied only to a sample of tasks according to the provided percentage. This option can be used only on "terminal" Build IDs (the ones not used as source in any redirect rules).
targetBuildId
targetBuildId:
string
BuildIdAssignmentRule targetBuildId.
Methods
toJSON()
toJSON():
object
Converts this BuildIdAssignmentRule to JSON.
Returns
object
JSON object
create()
Call Signature
staticcreate(properties?):BuildIdAssignmentRule&$Shape
Creates a new BuildIdAssignmentRule instance using the specified properties.
Parameters
properties?
Properties to set
Returns
BuildIdAssignmentRule & $Shape
BuildIdAssignmentRule instance
Call Signature
staticcreate(properties?):BuildIdAssignmentRule
Creates a new BuildIdAssignmentRule instance using the specified properties.
Parameters
properties?
Properties to set
Returns
BuildIdAssignmentRule
BuildIdAssignmentRule instance
decode()
staticdecode(reader,length?):BuildIdAssignmentRule&$Shape
Decodes a BuildIdAssignmentRule message from the specified reader or buffer.
Parameters
reader
Uint8Array<ArrayBufferLike> | Reader
Reader or buffer to decode from
length?
number
Message length if known beforehand
Returns
BuildIdAssignmentRule & $Shape
BuildIdAssignmentRule
Throws
If the payload is not a reader or valid buffer
Throws
If required fields are missing
decodeDelimited()
staticdecodeDelimited(reader):BuildIdAssignmentRule&$Shape
Decodes a BuildIdAssignmentRule message from the specified reader or buffer, length delimited.
Parameters
reader
Uint8Array<ArrayBufferLike> | Reader
Reader or buffer to decode from
Returns
BuildIdAssignmentRule & $Shape
BuildIdAssignmentRule
Throws
If the payload is not a reader or valid buffer
Throws
If required fields are missing
encode()
staticencode(message,writer?):Writer
Encodes the specified BuildIdAssignmentRule message. Does not implicitly temporal.api.taskqueue.v1.BuildIdAssignmentRule.verify|verify messages.
Parameters
message
BuildIdAssignmentRule message or plain object to encode
writer?
Writer
Writer to encode to
Returns
Writer
Writer
encodeDelimited()
staticencodeDelimited(message,writer?):Writer
Encodes the specified BuildIdAssignmentRule message, length delimited. Does not implicitly temporal.api.taskqueue.v1.BuildIdAssignmentRule.verify|verify messages.
Parameters
message
BuildIdAssignmentRule message or plain object to encode
writer?
Writer
Writer to encode to
Returns
Writer
Writer
fromObject()
staticfromObject(object):BuildIdAssignmentRule
Creates a BuildIdAssignmentRule message from a plain object. Also converts values to their respective internal types.
Parameters
object
Plain object
Returns
BuildIdAssignmentRule
BuildIdAssignmentRule
toObject()
statictoObject(message,options?):object
Creates a plain object from a BuildIdAssignmentRule message. Also converts values to other types if specified.
Parameters
message
BuildIdAssignmentRule
BuildIdAssignmentRule
options?
IConversionOptions
Conversion options
Returns
object
Plain object