Skip to content
Draft
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
3 changes: 3 additions & 0 deletions temporal/api/command/v1/message.proto
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import "temporal/api/enums/v1/command_type.proto";
import "temporal/api/common/v1/message.proto";
import "temporal/api/failure/v1/message.proto";
import "temporal/api/taskqueue/v1/message.proto";
import "temporal/api/session/v1/message.proto";
import "temporal/api/workflow/v1/message.proto";
import "temporal/api/sdk/v1/user_metadata.proto";
import "temporal/api/sdk/v1/event_group_marker.proto";
Expand Down Expand Up @@ -68,6 +69,8 @@ message ScheduleActivityTaskCommandAttributes {
// Priority metadata. If this message is not present, or any fields are not
// present, they inherit the values from the workflow.
temporal.api.common.v1.Priority priority = 14;

temporal.api.session.v1.ActivitySessionOptions session_options = 15;
}

message RequestCancelActivityTaskCommandAttributes {
Expand Down
4 changes: 4 additions & 0 deletions temporal/api/history/v1/message.proto
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import "temporal/api/common/v1/message.proto";
import "temporal/api/deployment/v1/message.proto";
import "temporal/api/failure/v1/message.proto";
import "temporal/api/nexus/v1/message.proto";
import "temporal/api/session/v1/message.proto";
import "temporal/api/taskqueue/v1/message.proto";
import "temporal/api/update/v1/message.proto";
import "temporal/api/workflow/v1/message.proto";
Expand Down Expand Up @@ -465,6 +466,9 @@ message ActivityTaskScheduledEventAttributes {
// Priority metadata. If this message is not present, or any fields are not
// present, they inherit the values from the workflow.
temporal.api.common.v1.Priority priority = 14;
// Preserves the scheduling command's session routing options so activity state
// can be reconstructed from history.
temporal.api.session.v1.ActivitySessionOptions session_options = 15;
}

message ActivityTaskStartedEventAttributes {
Expand Down
44 changes: 44 additions & 0 deletions temporal/api/session/v1/message.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
syntax = "proto3";

package temporal.api.session.v1;

option go_package = "go.temporal.io/api/session/v1;session";
option java_package = "io.temporal.api.session.v1";
option java_multiple_files = true;
option java_outer_classname = "MessageProto";
option ruby_package = "Temporalio::Api::Session::V1";
option csharp_namespace = "Temporalio.Api.Session.V1";

// EXPERIMENTAL. Subject to redesign or removal.
// Configures a worker's polling for sessions that keep workflow and activity
// tasks on a stable worker destination. Activities opt into session routing
// through ActivitySessionOptions on their scheduling commands.
message WorkerSessionOptions {
oneof isolation {
SingleSessionOptions single_session = 1;
}
Comment on lines +17 to +19

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we also have a boolean for use_workflow_session here?

}

// EXPERIMENTAL. Subject to redesign or removal.
// Dedicates a sticky destination to the first workflow matched to it.
// Workflow sticky polls may be forwarded to the normal queue until the first
// workflow task is dispatched. The server persists that workflow ID and does
// not forward subsequent polls, including after workflow completion.
// Activity sticky polls are never forwarded to the normal queue.
message SingleSessionOptions {

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thomas: says that maybe we should think about what this is called if we wanna ActivitySessionOptions

  • another thing that he says is that we may not require to think about introducing this right now given that this is experimental

// Stable sticky task queue name, shared by workflow and activity polls.
// Reuse this value across worker restarts within the same session, but not
// across concurrently running workers. This is distinct from worker identity.
// The SDK must also set the polled sticky task queue's name to this value.
string stable_identity = 1;
}

message ActivitySessionOptions {

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i envision these options to be sent on the command attributes when we are going to schedule an activity task -- if that is the case, i wonder if we should have something defined or thought of for the stable identity piece (single session isolation) given that we seem to have thought this in the poll request structures

if not, then i wonder if we do even need the single session options defined in the general WorkerSessionOptions

oneof session {
// Execute this activity as part of its workflow's session.
// Currently routes to the workflow's sticky task queue when true.
bool use_workflow_session = 1;

// later session_id, etc
}
}
7 changes: 7 additions & 0 deletions temporal/api/workflowservice/v1/request_response.proto
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ import "temporal/api/replication/v1/message.proto";
import "temporal/api/rules/v1/message.proto";
import "temporal/api/sdk/v1/worker_config.proto";
import "temporal/api/schedule/v1/message.proto";
import "temporal/api/session/v1/message.proto";
import "temporal/api/taskqueue/v1/message.proto";
import "temporal/api/update/v1/message.proto";
import "temporal/api/version/v1/message.proto";
Expand Down Expand Up @@ -323,6 +324,9 @@ message PollWorkflowTaskQueueRequest {
// Removed in 1.55.0; was temporal.api.worker.v1.WorkerHeartbeat worker_heartbeat
reserved 7;
reserved "worker_heartbeat";

// EXPERIMENTAL. Subject to redesign or removal. Only applicable to sticky polls.
temporal.api.session.v1.WorkerSessionOptions session_options = 11;
}

message PollWorkflowTaskQueueResponse {
Expand Down Expand Up @@ -553,6 +557,9 @@ message PollActivityTaskQueueRequest {
// Removed in 1.55.0; was temporal.api.worker.v1.WorkerHeartbeat worker_heartbeat
reserved 7;
reserved "worker_heartbeat";

// EXPERIMENTAL. Subject to redesign or removal. Only applicable to sticky polls.
temporal.api.session.v1.WorkerSessionOptions session_options = 11;
}

message PollActivityTaskQueueResponse {
Expand Down
Loading