You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**What changed?**
Add initial protos for priority, enough to attach simple priority
metadata to workflows and activities.
See #513 for the full future plans, only the first field (priority_key)
is included so far.
**Why?**
Control task ordering.
**Server PR**
Implementation on `priority` branch:
temporalio/temporal@main...priority
---------
Co-authored-by: Spencer Judge <[email protected]>
Co-authored-by: Yuri <[email protected]>
Co-authored-by: Rodrigo Zhou <[email protected]>
Co-authored-by: Carly de Frondeville <[email protected]>
Co-authored-by: Spencer Judge <[email protected]>
Copy file name to clipboardExpand all lines: openapi/openapiv2.json
+59Lines changed: 59 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -7152,6 +7152,10 @@
7152
7152
"versioningOverride": {
7153
7153
"$ref": "#/definitions/v1VersioningOverride",
7154
7154
"description": "If set, takes precedence over the Versioning Behavior sent by the SDK on Workflow Task completion.\nTo unset the override after the workflow is running, use UpdateWorkflowExecutionOptions."
7155
+
},
7156
+
"priority": {
7157
+
"$ref": "#/definitions/v1Priority",
7158
+
"title": "Priority metadata"
7155
7159
}
7156
7160
}
7157
7161
},
@@ -7344,6 +7348,10 @@
7344
7348
"onConflictOptions": {
7345
7349
"$ref": "#/definitions/v1OnConflictOptions",
7346
7350
"description": "Defines actions to be done to the existing running workflow when the conflict policy\nWORKFLOW_ID_CONFLICT_POLICY_USE_EXISTING is used. If not set (ie., nil value) or set to a\nempty object (ie., all options with default value), it won't do anything to the existing\nrunning workflow. If set, it will add a history event to the running workflow."
7351
+
},
7352
+
"priority": {
7353
+
"$ref": "#/definitions/v1Priority",
7354
+
"title": "Priority metadata"
7347
7355
}
7348
7356
}
7349
7357
},
@@ -7992,6 +8000,10 @@
7992
8000
"useWorkflowBuildId": {
7993
8001
"type": "boolean",
7994
8002
"description": "If this is set, the activity would be assigned to the Build ID of the workflow. Otherwise,\nAssignment rules of the activity's Task Queue will be used to determine the Build ID."
8003
+
},
8004
+
"priority": {
8005
+
"$ref": "#/definitions/v1Priority",
8006
+
"description": "Priority metadata. If this message is not present, or any fields are not\npresent, they inherit the values from the workflow."
7995
8007
}
7996
8008
}
7997
8009
},
@@ -10642,6 +10654,10 @@
10642
10654
"versioningOverride": {
10643
10655
"$ref": "#/definitions/v1VersioningOverride",
10644
10656
"description": "If set, takes precedence over the Versioning Behavior sent by the SDK on Workflow Task completion.\nTo unset the override after the workflow is running, use UpdateWorkflowExecutionOptions."
10657
+
},
10658
+
"priority": {
10659
+
"$ref": "#/definitions/v1Priority",
10660
+
"title": "Priority metadata"
10645
10661
}
10646
10662
},
10647
10663
"description": "NewWorkflowExecutionInfo is a shared message that encapsulates all the\nrequired arguments to starting a workflow in different contexts."
@@ -11057,6 +11073,10 @@
11057
11073
"lastWorkerDeploymentVersion": {
11058
11074
"type": "string",
11059
11075
"description": "The Worker Deployment Version this activity was dispatched to most recently."
11076
+
},
11077
+
"priority": {
11078
+
"$ref": "#/definitions/v1Priority",
11079
+
"title": "Priority metadata"
11060
11080
}
11061
11081
}
11062
11082
},
@@ -11285,6 +11305,10 @@
11285
11305
"pollerScalingDecision": {
11286
11306
"$ref": "#/definitions/v1PollerScalingDecision",
11287
11307
"description": "Server-advised information the SDK may use to adjust its poller count."
11308
+
},
11309
+
"priority": {
11310
+
"$ref": "#/definitions/v1Priority",
11311
+
"title": "Priority metadata"
11288
11312
}
11289
11313
}
11290
11314
},
@@ -11440,6 +11464,17 @@
11440
11464
},
11441
11465
"description": "Attached to task responses to give hints to the SDK about how it may adjust its number of\npollers."
11442
11466
},
11467
+
"v1Priority": {
11468
+
"type": "object",
11469
+
"properties": {
11470
+
"priorityKey": {
11471
+
"type": "integer",
11472
+
"format": "int32",
11473
+
"description": "Priority key is a positive integer from 1 to n, where smaller integers\ncorrespond to higher priorities (tasks run sooner). In general, tasks in\na queue should be processed in close to priority order, although small\ndeviations are possible.\n\nThe maximum priority value (minimum priority) is determined by server\nconfiguration, and defaults to 5.\n\nThe default priority is (min+max)/2. With the default max of 5 and min of\n1, that comes out to 3."
11474
+
}
11475
+
},
11476
+
"description": "Priority contains metadata that controls relative ordering of task processing\nwhen tasks are backlogged in a queue. Initially, Priority will be used in\nactivity and workflow task queues, which are typically where backlogs exist.\nOther queues in the server (such as transfer and timer queues) and rate\nlimiting decisions do not use Priority, but may in the future.\n\nPriority is attached to workflows and activities. Activities and child\nworkflows inherit Priority from the workflow that created them, but may\noverride fields when they are started or modified. For each field of a\nPriority on an activity/workflow, not present or equal to zero/empty string\nmeans to inherit the value from the calling workflow, or if there is no\ncalling workflow, then use the default (documented below).\n\nDespite being named \"Priority\", this message will also contains fields that\ncontrol \"fairness\" mechanisms.\n\nThe overall semantics of Priority are:\n1. First, consider \"priority_key\": lower number goes first.\n(more will be added here later)"
11477
+
},
11443
11478
"v1ProtocolMessageCommandAttributes": {
11444
11479
"type": "object",
11445
11480
"properties": {
@@ -12180,6 +12215,10 @@
12180
12215
"useWorkflowBuildId": {
12181
12216
"type": "boolean",
12182
12217
"description": "If this is set, the activity would be assigned to the Build ID of the workflow. Otherwise,\nAssignment rules of the activity's Task Queue will be used to determine the Build ID."
12218
+
},
12219
+
"priority": {
12220
+
"$ref": "#/definitions/v1Priority",
12221
+
"description": "Priority metadata. If this message is not present, or any fields are not\npresent, they inherit the values from the workflow."
12183
12222
}
12184
12223
}
12185
12224
},
@@ -12759,6 +12798,10 @@
12759
12798
"inheritBuildId": {
12760
12799
"type": "boolean",
12761
12800
"description": "If this is set, the child workflow inherits the Build ID of the parent. Otherwise, the assignment\nrules of the child's Task Queue will be used to independently assign a Build ID to it."
12801
+
},
12802
+
"priority": {
12803
+
"$ref": "#/definitions/v1Priority",
12804
+
"description": "Priority metadata. If this message is not present, or any fields are not\npresent, they inherit the values from the workflow."
12762
12805
}
12763
12806
}
12764
12807
},
@@ -12876,6 +12919,10 @@
12876
12919
"inheritBuildId": {
12877
12920
"type": "boolean",
12878
12921
"description": "If this is set, the child workflow inherits the Build ID of the parent. Otherwise, the assignment\nrules of the child's Task Queue will be used to independently assign a Build ID to it."
12922
+
},
12923
+
"priority": {
12924
+
"$ref": "#/definitions/v1Priority",
12925
+
"title": "Priority metadata"
12879
12926
}
12880
12927
}
12881
12928
},
@@ -13068,6 +13115,10 @@
13068
13115
"onConflictOptions": {
13069
13116
"$ref": "#/definitions/v1OnConflictOptions",
13070
13117
"description": "Defines actions to be done to the existing running workflow when the conflict policy\nWORKFLOW_ID_CONFLICT_POLICY_USE_EXISTING is used. If not set (ie., nil value) or set to a\nempty object (ie., all options with default value), it won't do anything to the existing\nrunning workflow. If set, it will add a history event to the running workflow."
13118
+
},
13119
+
"priority": {
13120
+
"$ref": "#/definitions/v1Priority",
13121
+
"title": "Priority metadata"
13071
13122
}
13072
13123
}
13073
13124
},
@@ -14314,6 +14365,10 @@
14314
14365
"workerDeploymentName": {
14315
14366
"type": "string",
14316
14367
"description": "The name of Worker Deployment that completed the most recent workflow task.\nExperimental. Worker Deployments are experimental and might change in the future."
14368
+
},
14369
+
"priority": {
14370
+
"$ref": "#/definitions/v1Priority",
14371
+
"title": "Priority metadata"
14317
14372
}
14318
14373
},
14319
14374
"description": "Hold basic information about a workflow execution.\nThis structure is a part of visibility, and thus contain a limited subset of information."
@@ -14516,6 +14571,10 @@
14516
14571
"parentPinnedWorkerDeploymentVersion": {
14517
14572
"type": "string",
14518
14573
"description": "When present, it means this is a child workflow of a parent that is Pinned to this Worker\nDeployment Version. In this case, child workflow will start as Pinned to this Version instead\nof starting on the Current Version of its Task Queue.\nThis is set only if the child workflow is starting on a Task Queue belonging to the same\nWorker Deployment Version."
14574
+
},
14575
+
"priority": {
14576
+
"$ref": "#/definitions/v1Priority",
14577
+
"title": "Priority metadata"
14519
14578
}
14520
14579
},
14521
14580
"title": "Always the first event in workflow history"
0 commit comments