Skip to content

Commit

Permalink
Fix RespondWorkflowTask capabilities (#467)
Browse files Browse the repository at this point in the history
  • Loading branch information
Quinn-With-Two-Ns authored Oct 23, 2024
1 parent 277bced commit efd54e9
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 26 deletions.
2 changes: 2 additions & 0 deletions buf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ breaking:
- WIRE_JSON
ignore:
- google
# TODO(klassenq): remove me
- temporal/api/workflowservice/v1/request_response.proto
lint:
use:
- DEFAULT
Expand Down
24 changes: 10 additions & 14 deletions openapi/openapiv2.json
Original file line number Diff line number Diff line change
Expand Up @@ -9772,6 +9772,16 @@
"v1RespondQueryTaskCompletedResponse": {
"type": "object"
},
"v1RespondWorkflowTaskCompletedRequestCapabilities": {
"type": "object",
"properties": {
"discardSpeculativeWorkflowTaskWithEvents": {
"type": "boolean",
"title": "True if the SDK can handle speculative workflow task with command events.\nIf true, the server may chosse, at its discretion, to discard a speculative workflow task\neven if that speculative task included command events the SDK had not previouly processed"
}
},
"description": "SDK capability details."
},
"v1RespondWorkflowTaskCompletedResponse": {
"type": "object",
"properties": {
Expand All @@ -9791,23 +9801,9 @@
"type": "string",
"format": "int64",
"description": "If non zero, indicates the server has discarded the workflow task that was being responded to.\nWill be the event ID of the last workflow task started event in the history before the new workflow task.\nServer is only expected to discard a workflow task if it could not have modified the workflow state."
},
"capabilities": {
"$ref": "#/definitions/v1RespondWorkflowTaskCompletedResponseCapabilities",
"description": "All capabilities the SDK supports."
}
}
},
"v1RespondWorkflowTaskCompletedResponseCapabilities": {
"type": "object",
"properties": {
"discardSpeculativeWorkflowTaskWithEvents": {
"type": "boolean",
"title": "True if the SDK can handle speculative workflow task with command events.\nIf true, the server may chosse, at its discretion, to discard a speculative workflow task\neven if that speculative task included command events the SDK had not previouly processed"
}
},
"description": "SDK capability details."
},
"v1RespondWorkflowTaskFailedResponse": {
"type": "object"
},
Expand Down
24 changes: 12 additions & 12 deletions temporal/api/workflowservice/v1/request_response.proto
Original file line number Diff line number Diff line change
Expand Up @@ -354,19 +354,8 @@ message RespondWorkflowTaskCompletedRequest {
temporal.api.sdk.v1.WorkflowTaskCompletedMetadata sdk_metadata = 12;
// Local usage data collected for metering
temporal.api.common.v1.MeteringMetadata metering_metadata = 13;
}

message RespondWorkflowTaskCompletedResponse {
// See `RespondWorkflowTaskCompletedResponse::return_new_workflow_task`
PollWorkflowTaskQueueResponse workflow_task = 1;
// See `ScheduleActivityTaskCommandAttributes::request_eager_execution`
repeated PollActivityTaskQueueResponse activity_tasks = 2;
// If non zero, indicates the server has discarded the workflow task that was being responded to.
// Will be the event ID of the last workflow task started event in the history before the new workflow task.
// Server is only expected to discard a workflow task if it could not have modified the workflow state.
int64 reset_history_event_id = 3;
// All capabilities the SDK supports.
Capabilities capabilities = 4;
Capabilities capabilities = 14;
// SDK capability details.
message Capabilities {
// True if the SDK can handle speculative workflow task with command events.
Expand All @@ -379,6 +368,17 @@ message RespondWorkflowTaskCompletedResponse {
}
}

message RespondWorkflowTaskCompletedResponse {
// See `RespondWorkflowTaskCompletedResponse::return_new_workflow_task`
PollWorkflowTaskQueueResponse workflow_task = 1;
// See `ScheduleActivityTaskCommandAttributes::request_eager_execution`
repeated PollActivityTaskQueueResponse activity_tasks = 2;
// If non zero, indicates the server has discarded the workflow task that was being responded to.
// Will be the event ID of the last workflow task started event in the history before the new workflow task.
// Server is only expected to discard a workflow task if it could not have modified the workflow state.
int64 reset_history_event_id = 3;
}

message RespondWorkflowTaskFailedRequest {
// The task token as received in `PollWorkflowTaskQueueResponse`
bytes task_token = 1;
Expand Down

0 comments on commit efd54e9

Please sign in to comment.