Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions openapi/openapiv2.json
Original file line number Diff line number Diff line change
Expand Up @@ -17372,6 +17372,16 @@
},
"title": "Metadata relevant for metering purposes"
},
"v1MultiSessionOptions": {
"type": "object",
"properties": {
"workerAddress": {
"type": "string",
"description": "Where the server routes session work bound to this worker.\nCurrently set by the SDK to the worker's sticky queue name, and not\nuser-configurable. May become configurable in the future."
}
},
"description": "EXPERIMENTAL. Subject to redesign or removal.\nServe any number of sessions concurrently. Future admission knobs (e.g.\nsession slots) belong here."
},
"v1NamespaceConfig": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -20140,6 +20150,16 @@
}
}
},
"v1SingleSessionOptions": {
"type": "object",
"properties": {
"stableIdentity": {
"type": "string",
"description": "Identity the binding is stored under. Required; must be non-empty.\nReuse it across restarts of the same session, not across concurrently\nrunning workers. If multiple workers poll with the same stable_identity\nconcurrently, the server treats them as pollers of a single worker and\nprocess affinity is lost.\n\nNote: this effectively acts as a configurable sticky queue.\nNote: we are currently unsure how this will evolve. May be deprecated as\nthe session model develops."
}
},
"description": "EXPERIMENTAL. Subject to redesign or removal.\nServe exactly one session for the worker's lifetime, including across\nprocess restarts with the same stable_identity. The server binds the worker\nto the first session that needs a worker, and dispatches no other work here,\neven after that session completes."
},
"v1StartActivityExecutionResponse": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -21543,6 +21563,10 @@
"environment": {
"$ref": "#/definitions/v1EnvironmentInfo",
"description": "Information about the environment this SDK is running in."
},
"sessionOptions": {
"$ref": "#/definitions/v1WorkerSessionOptions",
"description": "The worker's session options, as sent on its polls. Lets the server recognize a multi-session worker that has\nstopped, so it can move the workflows bound to it to other workers. Unset for a worker without sessions."
}
},
"description": "Worker info message, contains information about the worker and its current state.\nAll information is provided by the worker itself."
Expand Down Expand Up @@ -21681,6 +21705,20 @@
},
"description": "This is used to send commands to a specific worker or a group of workers.\nRight now, it is used to send commands to a specific worker instance.\nWill be extended to be able to send command to multiple workers."
},
"v1WorkerSessionOptions": {
"type": "object",
"properties": {
"singleSession": {
"$ref": "#/definitions/v1SingleSessionOptions",
"description": "If specified, the worker only polls for work belonging to its session."
},
"multiSession": {
"$ref": "#/definitions/v1MultiSessionOptions",
"description": "If specified, the worker can serve multiple sessions at once."
}
},
"description": "EXPERIMENTAL. Subject to redesign or removal.\nSent on workflow and activity polls. Presence means this worker can serve\nsessions. Currently, the only supported Session type is Workflow Session\n(aka Workflow-as-Session). A Workflow Session can receive both workflow\ntasks and activity tasks of an execution."
},
"v1WorkerSlotsInfo": {
"type": "object",
"properties": {
Expand Down
57 changes: 57 additions & 0 deletions openapi/openapiv3.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13601,6 +13601,19 @@ components:
aip.dev/not-precedent: Negative values make no sense to represent. --)
format: uint32
description: Metadata relevant for metering purposes
MultiSessionOptions:
type: object
properties:
workerAddress:
type: string
description: |-
Where the server routes session work bound to this worker.
Currently set by the SDK to the worker's sticky queue name, and not
user-configurable. May become configurable in the future.
description: |-
EXPERIMENTAL. Subject to redesign or removal.
Serve any number of sessions concurrently. Future admission knobs (e.g.
session slots) belong here.
NamespaceConfig:
type: object
properties:
Expand Down Expand Up @@ -17328,6 +17341,27 @@ components:
Link to be associated with the WorkflowExecutionSignaled event.
Added on the response to propagate the backlink.
Available from Temporal server 1.31 and up.
SingleSessionOptions:
type: object
properties:
stableIdentity:
type: string
description: |-
Identity the binding is stored under. Required; must be non-empty.
Reuse it across restarts of the same session, not across concurrently
running workers. If multiple workers poll with the same stable_identity
concurrently, the server treats them as pollers of a single worker and
process affinity is lost.

Note: this effectively acts as a configurable sticky queue.
Note: we are currently unsure how this will evolve. May be deprecated as
the session model develops.
description: |-
EXPERIMENTAL. Subject to redesign or removal.
Serve exactly one session for the worker's lifetime, including across
process restarts with the same stable_identity. The server binds the worker
to the first session that needs a worker, and dispatches no other work here,
even after that session completes.
StartActivityExecutionRequest:
type: object
properties:
Expand Down Expand Up @@ -19982,6 +20016,12 @@ components:
allOf:
- $ref: '#/components/schemas/EnvironmentInfo'
description: Information about the environment this SDK is running in.
sessionOptions:
allOf:
- $ref: '#/components/schemas/WorkerSessionOptions'
description: |-
The worker's session options, as sent on its polls. Lets the server recognize a multi-session worker that has
stopped, so it can move the workflows bound to it to other workers. Unset for a worker without sessions.
description: |-
Worker info message, contains information about the worker and its current state.
All information is provided by the worker itself.
Expand Down Expand Up @@ -20116,6 +20156,23 @@ components:
This is used to send commands to a specific worker or a group of workers.
Right now, it is used to send commands to a specific worker instance.
Will be extended to be able to send command to multiple workers.
WorkerSessionOptions:
type: object
properties:
singleSession:
allOf:
- $ref: '#/components/schemas/SingleSessionOptions'
description: If specified, the worker only polls for work belonging to its session.
multiSession:
allOf:
- $ref: '#/components/schemas/MultiSessionOptions'
description: If specified, the worker can serve multiple sessions at once.
description: |-
EXPERIMENTAL. Subject to redesign or removal.
Sent on workflow and activity polls. Presence means this worker can serve
sessions. Currently, the only supported Session type is Workflow Session
(aka Workflow-as-Session). A Workflow Session can receive both workflow
tasks and activity tasks of an execution.
WorkerSlotsInfo:
type: object
properties:
Expand Down
5 changes: 5 additions & 0 deletions temporal/api/worker/v1/message.proto
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import "google/protobuf/duration.proto";
import "google/protobuf/timestamp.proto";
import "temporal/api/deployment/v1/message.proto";
import "temporal/api/enums/v1/common.proto";
import "temporal/api/session/v1/message.proto";

message WorkerPollerInfo {
// Number of polling RPCs that are currently in flight.
Expand Down Expand Up @@ -137,6 +138,10 @@ message WorkerHeartbeat {

// Information about the environment this SDK is running in.
EnvironmentInfo environment = 25;

// The worker's session options, as sent on its polls. Lets the server recognize a multi-session worker that has
// stopped, so it can move the workflows bound to it to other workers. Unset for a worker without sessions.
temporal.api.session.v1.WorkerSessionOptions session_options = 26;
}

// Detailed worker information.
Expand Down
Loading