diff --git a/openapi/openapiv2.json b/openapi/openapiv2.json index fd72f79f1..167dffbde 100644 --- a/openapi/openapiv2.json +++ b/openapi/openapiv2.json @@ -9751,6 +9751,15 @@ "type": "object", "description": "Trigger for when the activity is closed." }, + "CallbackInfoUpdateWorkflowExecutionCompleted": { + "type": "object", + "properties": { + "updateId": { + "type": "string" + } + }, + "description": "Trigger for when a workflow update is completed." + }, "CallbackInfoWorkflowClosed": { "type": "object", "description": "Trigger for when the workflow is closed." @@ -9897,6 +9906,24 @@ }, "description": "A link to a standalone Nexus operation." }, + "LinkWorkflow": { + "type": "object", + "properties": { + "namespace": { + "type": "string" + }, + "workflowId": { + "type": "string" + }, + "runId": { + "type": "string" + }, + "reason": { + "type": "string" + } + }, + "description": "A link to a workflow execution. This is a more general version of WorkflowEvent that doesn't specify a \nparticular event within the workflow, useful when you want to link to a workflow but there is no particular event to link to,\nsuch as a Query or a Rejected Update." + }, "LinkWorkflowEvent": { "type": "object", "properties": { @@ -10234,6 +10261,27 @@ }, "description": "RequestIdReference is a indirect reference to a history event through the request ID." }, + "WorkflowExecutionOptionsUpdatedEventAttributesWorkflowUpdateOptionsUpdate": { + "type": "object", + "properties": { + "updateId": { + "type": "string", + "description": "The ID of the workflow update this update options update corresponds to." + }, + "attachedRequestId": { + "type": "string", + "title": "Request ID attached to the running workflow update so that subsequent requests with same\nrequest ID will be deduped" + }, + "attachedCompletionCallbacks": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1Callback" + }, + "description": "Completion callbacks attached to the running workflow update." + } + } + }, "WorkflowRuleActionActionActivityPause": { "type": "object" }, @@ -11883,6 +11931,26 @@ "description": "The arguments to pass to the named Update handler." } } + }, + "requestId": { + "type": "string", + "description": "The request ID of the request." + }, + "completionCallbacks": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1Callback" + }, + "description": "Callbacks to be called by the server when this update reaches a terminal state." + }, + "links": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/apiCommonV1Link" + }, + "description": "Links to be associated with this update." } }, "description": "The request information that will be delivered all the way down to the\nWorkflow Execution." @@ -12078,6 +12146,9 @@ "properties": { "workflowClosed": { "$ref": "#/definitions/CallbackInfoWorkflowClosed" + }, + "updateWorkflowExecutionCompleted": { + "$ref": "#/definitions/CallbackInfoUpdateWorkflowExecutionCompleted" } } }, @@ -15018,6 +15089,9 @@ }, "nexusOperation": { "$ref": "#/definitions/LinkNexusOperation" + }, + "workflow": { + "$ref": "#/definitions/LinkWorkflow" } }, "description": "Link can be associated with history events. It might contain information about an external entity\nrelated to the history event. For example, workflow A makes a Nexus call that starts workflow B:\nin this case, a history event in workflow A could contain a Link to the workflow started event in\nworkflow B, and vice-versa." @@ -15480,6 +15554,10 @@ "workerCommands": { "type": "boolean", "description": "True if the namespace supports worker commands (server-to-worker communication via control queues)." + }, + "workflowUpdateCallbacks": { + "type": "boolean", + "title": "True if the namespace supports attaching callbacks on workflow updates" } }, "description": "Namespace capability details. Should contain what features are enabled in a namespace." @@ -16927,6 +17005,26 @@ }, "input": { "$ref": "#/definitions/v1Input" + }, + "requestId": { + "type": "string", + "description": "The request ID of the request." + }, + "completionCallbacks": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1Callback" + }, + "description": "Callbacks to be called by the server when this update reaches a terminal state." + }, + "links": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1Link" + }, + "description": "Links to be associated with this update." } }, "description": "The client request that triggers a Workflow Update." @@ -18676,6 +18774,10 @@ "stage": { "$ref": "#/definitions/v1UpdateWorkflowExecutionLifecycleStage", "description": "The most advanced lifecycle stage that the Update is known to have\nreached, where lifecycle stages are ordered\nUPDATE_WORKFLOW_EXECUTION_LIFECYCLE_STAGE_UNSPECIFIED <\nUPDATE_WORKFLOW_EXECUTION_LIFECYCLE_STAGE_ADMITTED <\nUPDATE_WORKFLOW_EXECUTION_LIFECYCLE_STAGE_ACCEPTED <\nUPDATE_WORKFLOW_EXECUTION_LIFECYCLE_STAGE_COMPLETED.\nUNSPECIFIED will be returned if and only if the server's maximum wait\ntime was reached before the Update reached the stage specified in the\nrequest WaitPolicy, and before the context deadline expired; clients may\nmay then retry the call as needed." + }, + "link": { + "$ref": "#/definitions/v1Link", + "description": "Link to the update event. May be null if the update has not yet been accepted." } } }, @@ -19698,6 +19800,14 @@ "timeSkippingConfig": { "$ref": "#/definitions/v1TimeSkippingConfig", "description": "If set, the time-skipping configuration was changed. Contains the full updated configuration." + }, + "workflowUpdateOptions": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/WorkflowExecutionOptionsUpdatedEventAttributesWorkflowUpdateOptionsUpdate" + }, + "description": "Updates to workflow updates options." } } }, diff --git a/openapi/openapiv3.yaml b/openapi/openapiv3.yaml index c1f534e66..b12bfa5c9 100644 --- a/openapi/openapiv3.yaml +++ b/openapi/openapiv3.yaml @@ -11645,6 +11645,8 @@ components: $ref: '#/components/schemas/Link_Activity' nexusOperation: $ref: '#/components/schemas/Link_NexusOperation' + workflow: + $ref: '#/components/schemas/Link_Workflow' description: |- Link can be associated with history events. It might contain information about an external entity related to the history event. For example, workflow A makes a Nexus call that starts workflow B: @@ -11679,6 +11681,18 @@ components: runId: type: string description: A link to a standalone Nexus operation. + Link_Workflow: + type: object + properties: + namespace: + type: string + workflowId: + type: string + runId: + type: string + reason: + type: string + description: "A link to a workflow execution. This is a more general version of WorkflowEvent that doesn't specify a \n particular event within the workflow, useful when you want to link to a workflow but there is no particular event to link to,\n such as a Query or a Rejected Update." Link_WorkflowEvent: type: object properties: @@ -12080,6 +12094,9 @@ components: workerCommands: type: boolean description: True if the namespace supports worker commands (server-to-worker communication via control queues). + workflowUpdateCallbacks: + type: boolean + description: True if the namespace supports attaching callbacks on workflow updates description: Namespace capability details. Should contain what features are enabled in a namespace. NamespaceInfo_Limits: type: object @@ -13674,6 +13691,19 @@ components: $ref: '#/components/schemas/Meta' input: $ref: '#/components/schemas/Input' + requestId: + type: string + description: The request ID of the request. + completionCallbacks: + type: array + items: + $ref: '#/components/schemas/Callback' + description: Callbacks to be called by the server when this update reaches a terminal state. + links: + type: array + items: + $ref: '#/components/schemas/Link' + description: Links to be associated with this update. description: The client request that triggers a Workflow Update. RequestCancelActivityExecutionRequest: type: object @@ -16910,6 +16940,10 @@ components: request WaitPolicy, and before the context deadline expired; clients may may then retry the call as needed. format: enum + link: + allOf: + - $ref: '#/components/schemas/Link' + description: Link to the update event. May be null if the update has not yet been accepted. UpsertWorkflowSearchAttributesEventAttributes: type: object properties: @@ -18254,6 +18288,27 @@ components: allOf: - $ref: '#/components/schemas/TimeSkippingConfig' description: If set, the time-skipping configuration was changed. Contains the full updated configuration. + workflowUpdateOptions: + type: array + items: + $ref: '#/components/schemas/WorkflowExecutionOptionsUpdatedEventAttributes_WorkflowUpdateOptionsUpdate' + description: Updates to workflow updates options. + WorkflowExecutionOptionsUpdatedEventAttributes_WorkflowUpdateOptionsUpdate: + type: object + properties: + updateId: + type: string + description: The ID of the workflow update this update options update corresponds to. + attachedRequestId: + type: string + description: |- + Request ID attached to the running workflow update so that subsequent requests with same + request ID will be deduped + attachedCompletionCallbacks: + type: array + items: + $ref: '#/components/schemas/Callback' + description: Completion callbacks attached to the running workflow update. WorkflowExecutionPauseInfo: type: object properties: diff --git a/temporal/api/common/v1/message.proto b/temporal/api/common/v1/message.proto index 13d9d1dc8..98908cf89 100644 --- a/temporal/api/common/v1/message.proto +++ b/temporal/api/common/v1/message.proto @@ -254,11 +254,22 @@ message Link { string run_id = 3; } + // A link to a workflow execution. This is a more general version of WorkflowEvent that doesn't specify a + // particular event within the workflow, useful when you want to link to a workflow but there is no particular event to link to, + // such as a Query or a Rejected Update. + message Workflow { + string namespace = 1; + string workflow_id = 2; + string run_id = 3; + string reason = 4; + } + oneof variant { WorkflowEvent workflow_event = 1; BatchJob batch_job = 2; Activity activity = 3; NexusOperation nexus_operation = 4; + Workflow workflow = 5; } } diff --git a/temporal/api/history/v1/message.proto b/temporal/api/history/v1/message.proto index e57ec8d60..96a06ab85 100644 --- a/temporal/api/history/v1/message.proto +++ b/temporal/api/history/v1/message.proto @@ -881,6 +881,15 @@ message ChildWorkflowExecutionTerminatedEventAttributes { } message WorkflowExecutionOptionsUpdatedEventAttributes { + message WorkflowUpdateOptionsUpdate { + // The ID of the workflow update this update options update corresponds to. + string update_id = 1; + // Request ID attached to the running workflow update so that subsequent requests with same + // request ID will be deduped + string attached_request_id = 2; + // Completion callbacks attached to the running workflow update. + repeated temporal.api.common.v1.Callback attached_completion_callbacks = 3; + } // Versioning override upserted in this event. // Ignored if nil or if unset_versioning_override is true. temporal.api.workflow.v1.VersioningOverride versioning_override = 1; @@ -898,6 +907,8 @@ message WorkflowExecutionOptionsUpdatedEventAttributes { temporal.api.common.v1.Priority priority = 6; // If set, the time-skipping configuration was changed. Contains the full updated configuration. temporal.api.workflow.v1.TimeSkippingConfig time_skipping_config = 7; + // Updates to workflow updates options. + repeated WorkflowUpdateOptionsUpdate workflow_update_options = 8; } // Not used anywhere. Use case is replaced by WorkflowExecutionOptionsUpdatedEventAttributes diff --git a/temporal/api/namespace/v1/message.proto b/temporal/api/namespace/v1/message.proto index 1e07f6cd3..991a5624f 100644 --- a/temporal/api/namespace/v1/message.proto +++ b/temporal/api/namespace/v1/message.proto @@ -52,6 +52,8 @@ message NamespaceInfo { bool poller_autoscaling = 9; // True if the namespace supports worker commands (server-to-worker communication via control queues). bool worker_commands = 10; + // True if the namespace supports attaching callbacks on workflow updates + bool workflow_update_callbacks = 11; } // Namespace configured limits diff --git a/temporal/api/update/v1/message.proto b/temporal/api/update/v1/message.proto index ce29a5694..76c46d47d 100644 --- a/temporal/api/update/v1/message.proto +++ b/temporal/api/update/v1/message.proto @@ -62,6 +62,12 @@ message Input { message Request { Meta meta = 1; Input input = 2; + // The request ID of the request. + string request_id = 3; + // Callbacks to be called by the server when this update reaches a terminal state. + repeated temporal.api.common.v1.Callback completion_callbacks = 4; + // Links to be associated with this update. + repeated temporal.api.common.v1.Link links = 5; } // An Update protocol message indicating that a Workflow Update has been rejected. diff --git a/temporal/api/workflow/v1/message.proto b/temporal/api/workflow/v1/message.proto index 51b39b76a..fdca1df4d 100644 --- a/temporal/api/workflow/v1/message.proto +++ b/temporal/api/workflow/v1/message.proto @@ -459,9 +459,15 @@ message CallbackInfo { // Trigger for when the workflow is closed. message WorkflowClosed {} + // Trigger for when a workflow update is completed. + message UpdateWorkflowExecutionCompleted { + string update_id = 1; + } + message Trigger { oneof variant { WorkflowClosed workflow_closed = 1; + UpdateWorkflowExecutionCompleted update_workflow_execution_completed = 2; } } diff --git a/temporal/api/workflowservice/v1/request_response.proto b/temporal/api/workflowservice/v1/request_response.proto index 5b7eba7f3..a29ff249f 100644 --- a/temporal/api/workflowservice/v1/request_response.proto +++ b/temporal/api/workflowservice/v1/request_response.proto @@ -1804,6 +1804,9 @@ message UpdateWorkflowExecutionResponse { // request WaitPolicy, and before the context deadline expired; clients may // may then retry the call as needed. temporal.api.enums.v1.UpdateWorkflowExecutionLifecycleStage stage = 3; + + // Link to the update event. May be null if the update has not yet been accepted. + temporal.api.common.v1.Link link = 4; } message StartBatchOperationRequest {