Skip to content
Merged
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
51 changes: 46 additions & 5 deletions protos/local/core_interface.proto
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ package coresdk;
// and adding the "api_upstream" subdir as an include path.

import "google/protobuf/timestamp.proto";
import "google/protobuf/duration.proto";
import "google/protobuf/empty.proto";
import "dependencies/gogoproto/gogo.proto";
import "temporal/api/workflowservice/v1/request_response.proto";
Expand Down Expand Up @@ -72,6 +73,8 @@ message WFActivationJob {
CancelWorkflow cancel_workflow = 6;
// A request to signal the workflow was received.
SignalWorkflow signal_workflow = 7;
// An activity was resolved with, result could be completed, failed or cancelled
ResolveActivity resolve_activity = 8;
}
}

Expand All @@ -94,6 +97,11 @@ message FireTimer {
string timer_id = 1;
}

message ResolveActivity {
string activity_id = 1;
ActivityResult result = 2;
}

message CancelTimer {
string timer_id = 1;
}
Expand All @@ -116,19 +124,42 @@ message SignalWorkflow {
}

message StartActivity {
// TODO: add attributes
string workflow_namespace = 1;
temporal.api.common.v1.WorkflowType workflow_type = 2;
temporal.api.common.v1.WorkflowExecution workflow_execution = 3;
temporal.api.common.v1.ActivityType activity_type = 4;
temporal.api.common.v1.Header header = 5;
temporal.api.common.v1.Payloads input = 6;
temporal.api.common.v1.Payloads heartbeat_details = 7;
google.protobuf.Timestamp scheduled_time = 8 [(gogoproto.stdtime) = true];
google.protobuf.Timestamp current_attempt_scheduled_time = 9 [(gogoproto.stdtime) = true];
google.protobuf.Timestamp started_time = 10 [(gogoproto.stdtime) = true];
int32 attempt = 11;
// (-- api-linter: core::0140::prepositions=disabled
// aip.dev/not-precedent: "to" is used to indicate interval. --)
google.protobuf.Duration schedule_to_close_timeout = 12 [(gogoproto.stdduration) = true];
// (-- api-linter: core::0140::prepositions=disabled
// aip.dev/not-precedent: "to" is used to indicate interval. --)
google.protobuf.Duration start_to_close_timeout = 13 [(gogoproto.stdduration) = true];
google.protobuf.Duration heartbeat_timeout = 14 [(gogoproto.stdduration) = true];
// This is an actual retry policy the service uses.
// It can be different from the one provided (or not) during activity scheduling
// as the service can override the provided one in case its values are not specified
// or exceed configured system limits.
temporal.api.common.v1.RetryPolicy retry_policy = 15;
Comment on lines +127 to +149
Copy link
Member

Choose a reason for hiding this comment

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

Can we start instead we just the things you know you need? We may very well end up adding back all of this but we can at least not have these api linter comments etc.

I'd rather start small and add as needed than end up stuck with a bunch of cruft.

Copy link
Member

Choose a reason for hiding this comment

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

We also talked a bit more yesterday and agreed we want to not be tied at all to the upstream types, which would mean making our own versions of the things in the common package, etc. I don't expect you to do all that in this PR but just FYI we'll be doing that, probably sooner than later to avoid boiling the ocean.

Copy link
Member Author

Choose a reason for hiding this comment

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

I added it so we can construct ActivityInfo and pass that to the activity execution context.

Let's talk about this f2f and come up with a policy.
I'll wait with the ActivityInfo interface for now.

}

message CancelActivity {
// TODO: add attributes
}

message ActivityTask {
string activity_id = 1;
oneof job {
// Start activity execution.
StartActivity start = 1;
StartActivity start = 2;
// Attempt to cancel activity execution.
CancelActivity cancel = 2;
CancelActivity cancel = 3;
}
}

Expand All @@ -152,6 +183,7 @@ message WFActivationCompletion {
}
}

/// Used to report activity completion to core and to resolve the activity in a workflow activtion
message ActivityResult {
oneof status {
ActivityTaskSuccess completed = 1;
Expand All @@ -160,9 +192,16 @@ message ActivityResult {
}
}

/// Request cancellation of an activity from a workflow
message RequestActivityCancellation {
string activity_id = 1;
string reason = 2;
}

message CoreCommand {
oneof variant {
temporal.api.query.v1.WorkflowQueryResult query_result = 1;
temporal.api.query.v1.WorkflowQueryResult respond_to_query = 1;
RequestActivityCancellation request_activity_cancellation = 2;
}
}

Expand All @@ -188,15 +227,17 @@ message WFActivationFailure {
// Other bits from RespondWorkflowTaskFailedRequest as needed
}

/// Used in ActivityResult to report cancellation
message ActivityTaskCancelation {
temporal.api.common.v1.Payloads details = 1;
}

/// Used in ActivityResult to report successful completion
message ActivityTaskSuccess {
temporal.api.common.v1.Payloads result = 1;
// Other bits from RespondActivityTaskCompletedRequest as needed
}

/// Used in ActivityResult to report failure
message ActivityTaskFailure {
temporal.api.failure.v1.Failure failure = 1;
// Other bits from RespondActivityTaskFailedRequest as needed
Expand Down