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
6 changes: 5 additions & 1 deletion crates/protos/protos/api_upstream/openapi/openapiv2.json
Original file line number Diff line number Diff line change
Expand Up @@ -10879,9 +10879,13 @@
"$ref": "#/definitions/v1Payload",
"description": "There are restrictions on the maxium payload size a single callback can carry, as well as the\ntotal sum of all source context payloads attached to an execution. See dynamic configuration:\n\"callback.nexusHandler.sourceContext.maxSize\", \"callback.nexusHandler.sourceContext.aggregateMaxSize\".",
"title": "Arbitrary user-supplied data from the source operation's callsite. (As applicable, not all operations\nsupport attaching context data.)"
},
"progressOperation": {
"type": "string",
"description": "Target operation for progress of the source operation, e.g. \"OnProgress\". Empty means the\ncallback takes the completion only."
}
},
"description": "The targeted Nexus service must be registered within the same namespace as the source operation\nthe callback is attached to. (While Nexus allows for cross-namespace operations, NexusHandler callbacks\nare strictly caller-side.)\n\nNexusHandler callbacks are only supported for certain types of operations, e.g. standalone Nexus operations.\nAttempting to attach a Worker callback for an unsupported operation will result in an INVALID_ARGUMENT\nerror from the server.",
"description": "When `progress_operation` is set, the server also invokes that operation of the same service\nfor the source operation's progress. That operation must have the following:\n- Input: temporal.api.notificationservice.v1.OnProgressRequest\n- Output: temporal.api.notificationservice.v1.OnProgressResponse\nIt may be invoked any number of times before, during or after the single completion. It\nmust complete synchronously.\n\nThe targeted Nexus service must be registered within the same namespace as the source operation\nthe callback is attached to. (While Nexus allows for cross-namespace operations, NexusHandler callbacks\nare strictly caller-side.)\n\nNexusHandler callbacks are only supported for certain types of operations, e.g. standalone Nexus operations.\nAttempting to attach a Worker callback for an unsupported operation will result in an INVALID_ARGUMENT\nerror from the server.",
"title": "NexusHandler callbacks are requests to invoke a specific shape of Nexus operation on a Temporal worker.\nThe specified Nexus operation must have the following:\n- Input: temporal.api.notificationservice.v1.OnCompleteRequest\n- Output: temporal.api.notificationservice.v1.OnCompleteResponse"
},
"ComputeStatusProviderValidationStatus": {
Expand Down
12 changes: 12 additions & 0 deletions crates/protos/protos/api_upstream/openapi/openapiv3.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10935,12 +10935,24 @@ components:
There are restrictions on the maxium payload size a single callback can carry, as well as the
total sum of all source context payloads attached to an execution. See dynamic configuration:
"callback.nexusHandler.sourceContext.maxSize", "callback.nexusHandler.sourceContext.aggregateMaxSize".
progressOperation:
type: string
description: |-
Target operation for progress of the source operation, e.g. "OnProgress". Empty means the
callback takes the completion only.
description: |-
NexusHandler callbacks are requests to invoke a specific shape of Nexus operation on a Temporal worker.
The specified Nexus operation must have the following:
- Input: temporal.api.notificationservice.v1.OnCompleteRequest
- Output: temporal.api.notificationservice.v1.OnCompleteResponse

When `progress_operation` is set, the server also invokes that operation of the same service
for the source operation's progress. That operation must have the following:
- Input: temporal.api.notificationservice.v1.OnProgressRequest
- Output: temporal.api.notificationservice.v1.OnProgressResponse
It may be invoked any number of times before, during or after the single completion. It
must complete synchronously.

The targeted Nexus service must be registered within the same namespace as the source operation
the callback is attached to. (While Nexus allows for cross-namespace operations, NexusHandler callbacks
are strictly caller-side.)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,13 @@ message Callback {
// - Input: temporal.api.notificationservice.v1.OnCompleteRequest
// - Output: temporal.api.notificationservice.v1.OnCompleteResponse
//
// When `progress_operation` is set, the server also invokes that operation of the same service
// for the source operation's progress. That operation must have the following:
// - Input: temporal.api.notificationservice.v1.OnProgressRequest
// - Output: temporal.api.notificationservice.v1.OnProgressResponse
// It may be invoked any number of times before, during or after the single completion. It
// must complete synchronously.
//
// The targeted Nexus service must be registered within the same namespace as the source operation
// the callback is attached to. (While Nexus allows for cross-namespace operations, NexusHandler callbacks
// are strictly caller-side.)
Expand All @@ -232,6 +239,10 @@ message Callback {
// total sum of all source context payloads attached to an execution. See dynamic configuration:
// "callback.nexusHandler.sourceContext.maxSize", "callback.nexusHandler.sourceContext.aggregateMaxSize".
temporal.api.common.v1.Payload source_context = 4;

// Target operation for progress of the source operation, e.g. "OnProgress". Empty means the
// callback takes the completion only.
string progress_operation = 5;
}

reserved 1; // For a generic callback mechanism to be added later.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ message OnCompleteRequest {

// User-supplied data which was added to the source invocation. (As applicable.)
temporal.api.common.v1.Payload source_context = 3;

// The `receiver_state` of the last OnProgressResponse that the server accepted for this
// callback. Empty when no progress was accepted.
bytes receiver_state = 4;
}

// OnCompleteResponse is the return type of the OnComplete operation.
Expand Down
2 changes: 2 additions & 0 deletions crates/sdk-core/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ relevant information.
* Lang can set `heartbeat_task` on a successful activation completion to complete the workflow
task while local activities still run, as Core does at a local activity heartbeat. Core ignores
the flag on replay.
* Core keeps `progress_operation` on the Nexus callbacks it decodes from lang, and its vendored
protos include `receiver_state` on the Nexus `OnCompleteRequest`.
* A local activity's task names the workflow task in which core dispatched it. A rerun after a
failed task always names a later task, so lang can key each run's side effects by it.

Expand Down
Loading