diff --git a/openapi/openapiv2.json b/openapi/openapiv2.json index 7a8c0da69..59608b893 100644 --- a/openapi/openapiv2.json +++ b/openapi/openapiv2.json @@ -14804,6 +14804,16 @@ }, "description": "BatchOperationUpdateWorkflowExecutionOptions sends UpdateWorkflowExecutionOptions requests to batch workflows.\nKeep the parameters in sync with temporal.api.workflowservice.v1.UpdateWorkflowExecutionOptionsRequest." }, + "v1BoundWorkerInfo": { + "type": "object", + "properties": { + "workerQueue": { + "type": "string", + "description": "The worker's queue: the stable identity of a single-session worker, or\nthe worker address of a multi-session worker. The workflow's tasks are\nrouted here." + } + }, + "description": "EXPERIMENTAL. Subject to redesign or removal.\nThe worker a workflow is bound to. Recorded by the server. More fields may be\nadded later, such as the worker's instance key so that history can send it to\nmatching to understand if the worker's heartbeating information." + }, "v1BuildIdAssignmentRule": { "type": "object", "properties": { @@ -19927,6 +19937,20 @@ } } }, + "v1SessionInfo": { + "type": "object", + "properties": { + "exclusiveWorker": { + "type": "boolean", + "description": "True when the workflow is bound to a single-session worker. Such a\nbinding never moves to another worker. False for a multi-session worker,\nwhose binding moves with the worker that starts the workflow's tasks." + }, + "boundWorkerInfo": { + "$ref": "#/definitions/v1BoundWorkerInfo", + "description": "The worker the workflow is bound to. Always set." + } + }, + "description": "EXPERIMENTAL. Subject to redesign or removal.\nWhich worker a workflow (which is the session) is bound to. The server records it on history events\nso it can rebuild the binding from history (for example on reset). See\nsession_info on WorkflowTaskStartedEventAttributes and inherited_session_info\non WorkflowExecutionStartedEventAttributes. Not a worker or user option; SDKs\nshould not read or interpret it." + }, "v1SetCurrentDeploymentResponse": { "type": "object", "properties": { @@ -22376,6 +22400,10 @@ "propagatedNexusSerializationContext": { "$ref": "#/definitions/v1PropagatedSerializationContext", "description": "Serialization context propagated from the Nexus caller that started this workflow." + }, + "inheritedSessionInfo": { + "$ref": "#/definitions/v1SessionInfo", + "description": "Session info this run inherited from the previous run (continue-as-new, retry or cron), so the server\ncan rebuild it from history. Nil when the previous run was not bound or this run is on a different\ntask queue. Child workflows never inherit it.\nUsed internally by the server; SDKs should not read or interpret this field.\nEXPERIMENTAL. Subject to redesign or removal." } }, "title": "Always the first event in workflow history" @@ -22967,6 +22995,10 @@ "type": "string", "format": "int64", "title": "Used by server internally to properly reapply build ID redirects to an execution\nwhen rebuilding it from events.\nDeprecated. This field should be cleaned up when versioning-2 API is removed. [cleanup-experimental-wv]" + }, + "sessionInfo": { + "$ref": "#/definitions/v1SessionInfo", + "description": "Session info of this workflow as of this task start, so the server can rebuild it from history (for\nexample on reset). Nil when the workflow is not bound to a worker.\nUsed internally by the server; SDKs should not read or interpret this field.\nEXPERIMENTAL. Subject to redesign or removal." } } }, diff --git a/openapi/openapiv3.yaml b/openapi/openapiv3.yaml index d7f79afe3..c7beb4f98 100644 --- a/openapi/openapiv3.yaml +++ b/openapi/openapiv3.yaml @@ -10757,6 +10757,20 @@ components: description: |- BatchOperationUpdateWorkflowExecutionOptions sends UpdateWorkflowExecutionOptions requests to batch workflows. Keep the parameters in sync with temporal.api.workflowservice.v1.UpdateWorkflowExecutionOptionsRequest. + BoundWorkerInfo: + type: object + properties: + workerQueue: + type: string + description: |- + The worker's queue: the stable identity of a single-session worker, or + the worker address of a multi-session worker. The workflow's tasks are + routed here. + description: |- + EXPERIMENTAL. Subject to redesign or removal. + The worker a workflow is bound to. Recorded by the server. More fields may be + added later, such as the worker's instance key so that history can send it to + matching to understand if the worker's heartbeating information. BuildIdAssignmentRule: type: object properties: @@ -16811,6 +16825,26 @@ components: properties: nonRetryable: type: boolean + SessionInfo: + type: object + properties: + exclusiveWorker: + type: boolean + description: |- + True when the workflow is bound to a single-session worker. Such a + binding never moves to another worker. False for a multi-session worker, + whose binding moves with the worker that starts the workflow's tasks. + boundWorkerInfo: + allOf: + - $ref: '#/components/schemas/BoundWorkerInfo' + description: The worker the workflow is bound to. Always set. + description: |- + EXPERIMENTAL. Subject to redesign or removal. + Which worker a workflow (which is the session) is bound to. The server records it on history events + so it can rebuild the binding from history (for example on reset). See + session_info on WorkflowTaskStartedEventAttributes and inherited_session_info + on WorkflowExecutionStartedEventAttributes. Not a worker or user option; SDKs + should not read or interpret it. SetCurrentDeploymentRequest: type: object properties: @@ -21042,6 +21076,15 @@ components: allOf: - $ref: '#/components/schemas/PropagatedSerializationContext' description: Serialization context propagated from the Nexus caller that started this workflow. + inheritedSessionInfo: + allOf: + - $ref: '#/components/schemas/SessionInfo' + description: |- + Session info this run inherited from the previous run (continue-as-new, retry or cron), so the server + can rebuild it from history. Nil when the previous run was not bound or this run is on a different + task queue. Child workflows never inherit it. + Used internally by the server; SDKs should not read or interpret this field. + EXPERIMENTAL. Subject to redesign or removal. description: Always the first event in workflow history WorkflowExecutionTerminatedEventAttributes: type: object @@ -21722,6 +21765,14 @@ components: Used by server internally to properly reapply build ID redirects to an execution when rebuilding it from events. Deprecated. This field should be cleaned up when versioning-2 API is removed. [cleanup-experimental-wv] + sessionInfo: + allOf: + - $ref: '#/components/schemas/SessionInfo' + description: |- + Session info of this workflow as of this task start, so the server can rebuild it from history (for + example on reset). Nil when the workflow is not bound to a worker. + Used internally by the server; SDKs should not read or interpret this field. + EXPERIMENTAL. Subject to redesign or removal. WorkflowTaskTimedOutEventAttributes: type: object properties: diff --git a/temporal/api/history/v1/message.proto b/temporal/api/history/v1/message.proto index 96628ab87..5de25065c 100644 --- a/temporal/api/history/v1/message.proto +++ b/temporal/api/history/v1/message.proto @@ -219,6 +219,13 @@ message WorkflowExecutionStartedEventAttributes { // Serialization context propagated from the Nexus caller that started this workflow. temporal.api.nexus.v1.PropagatedSerializationContext propagated_nexus_serialization_context = 44; + + // Session info this run inherited from the previous run (continue-as-new, retry or cron), so the server + // can rebuild it from history. Nil when the previous run was not bound or this run is on a different + // task queue. Child workflows never inherit it. + // Used internally by the server; SDKs should not read or interpret this field. + // EXPERIMENTAL. Subject to redesign or removal. + temporal.api.session.v1.SessionInfo inherited_session_info = 45; } @@ -342,6 +349,11 @@ message WorkflowTaskStartedEventAttributes { // when rebuilding it from events. // Deprecated. This field should be cleaned up when versioning-2 API is removed. [cleanup-experimental-wv] int64 build_id_redirect_counter = 7 [deprecated = true]; + // Session info of this workflow as of this task start, so the server can rebuild it from history (for + // example on reset). Nil when the workflow is not bound to a worker. + // Used internally by the server; SDKs should not read or interpret this field. + // EXPERIMENTAL. Subject to redesign or removal. + temporal.api.session.v1.SessionInfo session_info = 10; } message WorkflowTaskCompletedEventAttributes { diff --git a/temporal/api/session/v1/message.proto b/temporal/api/session/v1/message.proto index ef59aeada..e700fa6ae 100644 --- a/temporal/api/session/v1/message.proto +++ b/temporal/api/session/v1/message.proto @@ -67,3 +67,29 @@ message ActivitySessionOptions { // Future: references to other types of sessions. } } + +// EXPERIMENTAL. Subject to redesign or removal. +// Which worker a workflow (which is the session) is bound to. The server records it on history events +// so it can rebuild the binding from history (for example on reset). See +// session_info on WorkflowTaskStartedEventAttributes and inherited_session_info +// on WorkflowExecutionStartedEventAttributes. Not a worker or user option; SDKs +// should not read or interpret it. +message SessionInfo { + // True when the workflow is bound to a single-session worker. Such a + // binding never moves to another worker. False for a multi-session worker, + // whose binding moves with the worker that starts the workflow's tasks. + bool exclusive_worker = 1; + // The worker the workflow is bound to. Always set. + BoundWorkerInfo bound_worker_info = 2; +} + +// EXPERIMENTAL. Subject to redesign or removal. +// The worker a workflow is bound to. Recorded by the server. More fields may be +// added later, such as the worker's instance key so that history can send it to +// matching to understand if the worker's heartbeating information. +message BoundWorkerInfo { + // The worker's queue: the stable identity of a single-session worker, or + // the worker address of a multi-session worker. The workflow's tasks are + // routed here. + string worker_queue = 1; +}