@@ -22,6 +22,7 @@ import "temporal/api/enums/v1/update.proto";
2222import "temporal/api/enums/v1/activity.proto" ;
2323import "temporal/api/enums/v1/nexus.proto" ;
2424import "temporal/api/activity/v1/message.proto" ;
25+ import "temporal/api/callback/v1/message.proto" ;
2526import "temporal/api/common/v1/message.proto" ;
2627import "temporal/api/history/v1/message.proto" ;
2728import "temporal/api/workflow/v1/message.proto" ;
@@ -3544,3 +3545,142 @@ message DeleteNexusOperationExecutionRequest {
35443545
35453546message DeleteNexusOperationExecutionResponse {
35463547}
3548+
3549+ message StartCallbackExecutionRequest {
3550+ string namespace = 1 ;
3551+ // The identity of the client who initiated this request.
3552+ string identity = 2 ;
3553+ // A unique identifier for this start request. Typically UUIDv4.
3554+ string request_id = 3 ;
3555+ // Identifier for this callback. Required. Must be unique among callbacks in the same namespace.
3556+ // If a callback with this ID already exists, the request will fail with CallbackExecutionAlreadyStarted.
3557+ string callback_id = 4 ;
3558+ // Information on how this callback should be invoked (e.g. its URL and type).
3559+ temporal.api.common.v1.Callback callback = 5 ;
3560+ // Schedule-to-close timeout for this callback.
3561+ // (-- api-linter: core::0140::prepositions=disabled
3562+ // aip.dev/not-precedent: "to" is used to indicate interval. --)
3563+ google.protobuf.Duration schedule_to_close_timeout = 6 ;
3564+ // Search attributes for indexing.
3565+ temporal.api.common.v1.SearchAttributes search_attributes = 7 ;
3566+ // The input data to deliver to the callback URL.
3567+ oneof input {
3568+ // The Nexus completion data to deliver to the callback URL.
3569+ // Contains either a successful result payload or a failure.
3570+ temporal.api.callback.v1.CallbackExecutionCompletion completion = 8 ;
3571+ }
3572+ }
3573+
3574+ message StartCallbackExecutionResponse {
3575+ // The run ID of the callback that was started.
3576+ string run_id = 1 ;
3577+ }
3578+
3579+ message DescribeCallbackExecutionRequest {
3580+ string namespace = 1 ;
3581+ // Identifier for the callback
3582+ string callback_id = 2 ;
3583+ // Run ID of the callback execution to describe. If empty, the latest run will be described.
3584+ string run_id = 3 ;
3585+ // Include the input field in the response.
3586+ bool include_input = 4 ;
3587+ // Include the outcome (result/failure) in the response if the callback has completed.
3588+ bool include_outcome = 5 ;
3589+ // Token from a previous DescribeCallbackExecutionResponse. If present, long-poll until callback
3590+ // state changes from the state encoded in this token. If absent, return current state immediately.
3591+ // Note that callback state may change multiple times between requests, therefore it is not
3592+ // guaranteed that a client making a sequence of long-poll requests will see a complete
3593+ // sequence of state changes.
3594+ bytes long_poll_token = 6 ;
3595+ }
3596+
3597+ message DescribeCallbackExecutionResponse {
3598+ // Information about the callback execution.
3599+ temporal.api.callback.v1.CallbackExecutionInfo info = 1 ;
3600+ // Only set if the callback is completed and include_outcome was true in the request.
3601+ temporal.api.callback.v1.CallbackExecutionOutcome outcome = 2 ;
3602+ // Token for follow-on long-poll requests. Absent only if the callback is complete.
3603+ bytes long_poll_token = 3 ;
3604+ }
3605+
3606+ message PollCallbackExecutionRequest {
3607+ string namespace = 1 ;
3608+ // Identifier for the callback
3609+ string callback_id = 2 ;
3610+ // Run ID of the callback execution to poll. If empty, the latest run will be polled.
3611+ string run_id = 3 ;
3612+ }
3613+
3614+ message PollCallbackExecutionResponse {
3615+ // The run ID of the callback, useful when run_id was not specified in the request.
3616+ string run_id = 1 ;
3617+ temporal.api.callback.v1.CallbackExecutionOutcome outcome = 2 ;
3618+ }
3619+
3620+ message ListCallbackExecutionsRequest {
3621+ string namespace = 1 ;
3622+ // Max number of executions to return per page.
3623+ int32 page_size = 2 ;
3624+ // Token returned in ListCallbackExecutionsResponse.
3625+ bytes next_page_token = 3 ;
3626+ // Visibility query, see https://docs.temporal.io/list-filter for the syntax.
3627+ string query = 4 ;
3628+ }
3629+
3630+ message ListCallbackExecutionsResponse {
3631+ repeated temporal.api.callback.v1.CallbackExecutionListInfo executions = 1 ;
3632+ // Token to use to fetch the next page. If empty, there is no next page.
3633+ bytes next_page_token = 2 ;
3634+ }
3635+
3636+ message CountCallbackExecutionsRequest {
3637+ string namespace = 1 ;
3638+ // Visibility query, see https://docs.temporal.io/list-filter for the syntax.
3639+ string query = 2 ;
3640+ }
3641+
3642+ message CountCallbackExecutionsResponse {
3643+ // If `query` is not grouping by any field, the count is an approximate number
3644+ // of callbacks that match the query.
3645+ // If `query` is grouping by a field, the count is simply the sum of the counts
3646+ // of the groups returned in the response. This number can be smaller than the
3647+ // total number of callbacks matching the query.
3648+ int64 count = 1 ;
3649+
3650+ // Contains the groups if the request is grouping by a field.
3651+ // The list might not be complete, and the counts of each group is approximate.
3652+ repeated AggregationGroup groups = 2 ;
3653+
3654+ message AggregationGroup {
3655+ repeated temporal.api.common.v1.Payload group_values = 1 ;
3656+ int64 count = 2 ;
3657+ }
3658+ }
3659+
3660+ message TerminateCallbackExecutionRequest {
3661+ string namespace = 1 ;
3662+ // Identifier for the callback
3663+ string callback_id = 2 ;
3664+ // Run ID of the callback execution to terminate. If empty, the latest run will be terminated.
3665+ string run_id = 3 ;
3666+ // The identity of the worker/client.
3667+ string identity = 4 ;
3668+ // Used to de-dupe termination requests.
3669+ string request_id = 5 ;
3670+ // Reason for requesting the termination.
3671+ string reason = 6 ;
3672+ }
3673+
3674+ message TerminateCallbackExecutionResponse {
3675+ }
3676+
3677+ message DeleteCallbackExecutionRequest {
3678+ string namespace = 1 ;
3679+ // Identifier for the callback
3680+ string callback_id = 2 ;
3681+ // Run ID of the callback execution to delete. If empty, the latest run will be deleted.
3682+ string run_id = 3 ;
3683+ }
3684+
3685+ message DeleteCallbackExecutionResponse {
3686+ }
0 commit comments