Skip to content

Commit 41c1deb

Browse files
Copilottorosent
andcommitted
Initial plan
Co-authored-by: torosent <[email protected]>
1 parent 3fbb68e commit 41c1deb

File tree

1 file changed

+96
-9
lines changed

1 file changed

+96
-9
lines changed

internal/durabletask-protobuf/protos/orchestrator_service.proto

Lines changed: 96 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ message TaskFailureDetails {
4141
google.protobuf.StringValue stackTrace = 3;
4242
TaskFailureDetails innerFailure = 4;
4343
bool isNonRetriable = 5;
44+
map<string, google.protobuf.Value> properties = 6;
4445
}
4546

4647
enum OrchestrationStatus {
@@ -95,6 +96,7 @@ message TaskScheduledEvent {
9596
google.protobuf.StringValue version = 2;
9697
google.protobuf.StringValue input = 3;
9798
TraceContext parentTraceContext = 4;
99+
map<string, string> tags = 5;
98100
}
99101

100102
message TaskCompletedEvent {
@@ -192,7 +194,7 @@ message EntityOperationCalledEvent {
192194
}
193195

194196
message EntityLockRequestedEvent {
195-
string criticalSectionId = 1;
197+
string criticalSectionId = 1;
196198
repeated string lockSet = 2;
197199
int32 position = 3;
198200
google.protobuf.StringValue parentInstanceId = 4; // used only within messages, null in histories
@@ -217,7 +219,14 @@ message EntityUnlockSentEvent {
217219
message EntityLockGrantedEvent {
218220
string criticalSectionId = 1;
219221
}
220-
222+
223+
message ExecutionRewoundEvent {
224+
google.protobuf.StringValue reason = 1;
225+
google.protobuf.StringValue parentExecutionId = 2; // used only for rewinding suborchestrations, null otherwise
226+
google.protobuf.StringValue instanceId = 3; // used only for rewinding suborchestrations, null otherwise
227+
TraceContext parentTraceContext = 4; // used only for rewinding suborchestrations, null otherwise
228+
}
229+
221230
message HistoryEvent {
222231
int32 eventId = 1;
223232
google.protobuf.Timestamp timestamp = 2;
@@ -244,25 +253,29 @@ message HistoryEvent {
244253
ExecutionResumedEvent executionResumed = 22;
245254
EntityOperationSignaledEvent entityOperationSignaled = 23;
246255
EntityOperationCalledEvent entityOperationCalled = 24;
247-
EntityOperationCompletedEvent entityOperationCompleted = 25;
248-
EntityOperationFailedEvent entityOperationFailed = 26;
256+
EntityOperationCompletedEvent entityOperationCompleted = 25;
257+
EntityOperationFailedEvent entityOperationFailed = 26;
249258
EntityLockRequestedEvent entityLockRequested = 27;
250259
EntityLockGrantedEvent entityLockGranted = 28;
251260
EntityUnlockSentEvent entityUnlockSent = 29;
261+
ExecutionRewoundEvent executionRewound = 30;
252262
}
253263
}
254264

255265
message ScheduleTaskAction {
256266
string name = 1;
257267
google.protobuf.StringValue version = 2;
258268
google.protobuf.StringValue input = 3;
269+
map<string, string> tags = 4;
270+
TraceContext parentTraceContext = 5;
259271
}
260272

261273
message CreateSubOrchestrationAction {
262274
string instanceId = 1;
263275
string name = 2;
264276
google.protobuf.StringValue version = 3;
265277
google.protobuf.StringValue input = 4;
278+
TraceContext parentTraceContext = 5;
266279
}
267280

268281
message CreateTimerAction {
@@ -282,6 +295,7 @@ message CompleteOrchestrationAction {
282295
google.protobuf.StringValue newVersion = 4;
283296
repeated HistoryEvent carryoverEvents = 5;
284297
TaskFailureDetails failureDetails = 6;
298+
map<string, string> tags = 7;
285299
}
286300

287301
message TerminateOrchestrationAction {
@@ -312,6 +326,11 @@ message OrchestratorAction {
312326
}
313327
}
314328

329+
message OrchestrationTraceContext {
330+
google.protobuf.StringValue spanID = 1;
331+
google.protobuf.Timestamp spanStartTime = 2;
332+
}
333+
315334
message OrchestratorRequest {
316335
string instanceId = 1;
317336
google.protobuf.StringValue executionId = 2;
@@ -320,6 +339,8 @@ message OrchestratorRequest {
320339
OrchestratorEntityParameters entityParameters = 5;
321340
bool requiresHistoryStreaming = 6;
322341
map<string, google.protobuf.Value> properties = 7;
342+
343+
OrchestrationTraceContext orchestrationTraceContext = 8;
323344
}
324345

325346
message OrchestratorResponse {
@@ -331,6 +352,17 @@ message OrchestratorResponse {
331352
// The number of work item events that were processed by the orchestrator.
332353
// This field is optional. If not set, the service should assume that the orchestrator processed all events.
333354
google.protobuf.Int32Value numEventsProcessed = 5;
355+
OrchestrationTraceContext orchestrationTraceContext = 6;
356+
357+
// Whether or not a history is required to complete the original OrchestratorRequest and none was provided.
358+
bool requiresHistory = 7;
359+
360+
// True if this is a partial (chunked) completion. The backend must keep the work item open until the final chunk (isPartial=false).
361+
bool isPartial = 8;
362+
363+
// Zero-based position of the current chunk within a chunked completion sequence.
364+
// This field is omitted for non-chunked completions.
365+
google.protobuf.Int32Value chunkIndex = 9;
334366
}
335367

336368
message CreateInstanceRequest {
@@ -343,6 +375,7 @@ message CreateInstanceRequest {
343375
google.protobuf.StringValue executionId = 7;
344376
map<string, string> tags = 8;
345377
TraceContext parentTraceContext = 9;
378+
google.protobuf.Timestamp requestTime = 10;
346379
}
347380

348381
message OrchestrationIdReusePolicy {
@@ -453,6 +486,7 @@ message PurgeInstancesRequest {
453486
oneof request {
454487
string instanceId = 1;
455488
PurgeInstanceFilter purgeInstanceFilter = 2;
489+
InstanceBatch instanceBatch = 4;
456490
}
457491
bool recursive = 3;
458492
}
@@ -468,6 +502,15 @@ message PurgeInstancesResponse {
468502
google.protobuf.BoolValue isComplete = 2;
469503
}
470504

505+
message RestartInstanceRequest {
506+
string instanceId = 1;
507+
bool restartWithNewInstanceId = 2;
508+
}
509+
510+
message RestartInstanceResponse {
511+
string instanceId = 1;
512+
}
513+
471514
message CreateTaskHubRequest {
472515
bool recreateIfExists = 1;
473516
}
@@ -490,10 +533,12 @@ message SignalEntityRequest {
490533
google.protobuf.StringValue input = 3;
491534
string requestId = 4;
492535
google.protobuf.Timestamp scheduledTime = 5;
536+
TraceContext parentTraceContext = 6;
537+
google.protobuf.Timestamp requestTime = 7;
493538
}
494539

495540
message SignalEntityResponse {
496-
// no payload
541+
// no payload
497542
}
498543

499544
message GetEntityRequest {
@@ -575,6 +620,7 @@ message OperationRequest {
575620
string operation = 1;
576621
string requestId = 2;
577622
google.protobuf.StringValue input = 3;
623+
TraceContext traceContext = 4;
578624
}
579625

580626
message OperationResult {
@@ -591,10 +637,14 @@ message OperationInfo {
591637

592638
message OperationResultSuccess {
593639
google.protobuf.StringValue result = 1;
640+
google.protobuf.Timestamp startTimeUtc = 2;
641+
google.protobuf.Timestamp endTimeUtc = 3;
594642
}
595643

596644
message OperationResultFailure {
597645
TaskFailureDetails failureDetails = 1;
646+
google.protobuf.Timestamp startTimeUtc = 2;
647+
google.protobuf.Timestamp endTimeUtc = 3;
598648
}
599649

600650
message OperationAction {
@@ -610,6 +660,8 @@ message SendSignalAction {
610660
string name = 2;
611661
google.protobuf.StringValue input = 3;
612662
google.protobuf.Timestamp scheduledTime = 4;
663+
google.protobuf.Timestamp requestTime = 5;
664+
TraceContext parentTraceContext = 6;
613665
}
614666

615667
message StartNewOrchestrationAction {
@@ -618,6 +670,8 @@ message StartNewOrchestrationAction {
618670
google.protobuf.StringValue version = 3;
619671
google.protobuf.StringValue input = 4;
620672
google.protobuf.Timestamp scheduledTime = 5;
673+
google.protobuf.Timestamp requestTime = 6;
674+
TraceContext parentTraceContext = 7;
621675
}
622676

623677
message AbandonActivityTaskRequest {
@@ -644,6 +698,17 @@ message AbandonEntityTaskResponse {
644698
// Empty.
645699
}
646700

701+
message SkipGracefulOrchestrationTerminationsRequest {
702+
InstanceBatch instanceBatch = 1;
703+
google.protobuf.StringValue reason = 2;
704+
}
705+
706+
message SkipGracefulOrchestrationTerminationsResponse {
707+
// Those instances which could not be terminated because they had locked entities at the time of this termination call,
708+
// are already in a terminal state (completed, failed, terminated, etc.), are not orchestrations, or do not exist (i.e. have been purged)
709+
repeated string unterminatedInstanceIds = 1;
710+
}
711+
647712
service TaskHubSidecarService {
648713
// Sends a hello request to the sidecar service.
649714
rpc Hello(google.protobuf.Empty) returns (google.protobuf.Empty);
@@ -657,18 +722,21 @@ service TaskHubSidecarService {
657722
// Rewinds an orchestration instance to last known good state and replays from there.
658723
rpc RewindInstance(RewindInstanceRequest) returns (RewindInstanceResponse);
659724

725+
// Restarts an orchestration instance.
726+
rpc RestartInstance(RestartInstanceRequest) returns (RestartInstanceResponse);
727+
660728
// Waits for an orchestration instance to reach a running or completion state.
661729
rpc WaitForInstanceStart(GetInstanceRequest) returns (GetInstanceResponse);
662-
730+
663731
// Waits for an orchestration instance to reach a completion state (completed, failed, terminated, etc.).
664732
rpc WaitForInstanceCompletion(GetInstanceRequest) returns (GetInstanceResponse);
665733

666734
// Raises an event to a running orchestration instance.
667735
rpc RaiseEvent(RaiseEventRequest) returns (RaiseEventResponse);
668-
736+
669737
// Terminates a running orchestration instance.
670738
rpc TerminateInstance(TerminateRequest) returns (TerminateResponse);
671-
739+
672740
// Suspends a running orchestration instance.
673741
rpc SuspendInstance(SuspendRequest) returns (SuspendResponse);
674742

@@ -714,6 +782,10 @@ service TaskHubSidecarService {
714782

715783
// Abandon an entity work item
716784
rpc AbandonTaskEntityWorkItem(AbandonEntityTaskRequest) returns (AbandonEntityTaskResponse);
785+
786+
// "Skip" graceful termination of orchestrations by immediately changing their status in storage to "terminated".
787+
// Note that a maximum of 500 orchestrations can be terminated at a time using this method.
788+
rpc SkipGracefulOrchestrationTerminations(SkipGracefulOrchestrationTerminationsRequest) returns (SkipGracefulOrchestrationTerminationsResponse);
717789
}
718790

719791
message GetWorkItemsRequest {
@@ -732,6 +804,16 @@ enum WorkerCapability {
732804
// When set, the service may return work items without any history events as an optimization.
733805
// It is strongly recommended that all SDKs support this capability.
734806
WORKER_CAPABILITY_HISTORY_STREAMING = 1;
807+
808+
// Indicates that the worker supports scheduled tasks.
809+
// The service may send schedule-triggered orchestration work items,
810+
// and the worker must handle them, including the scheduledTime field.
811+
WORKER_CAPABILITY_SCHEDULED_TASKS = 2;
812+
813+
// Signals that the worker can handle large payloads stored externally (e.g., Blob Storage).
814+
// Work items may contain URI references instead of inline data, and the worker must fetch them.
815+
// This avoids message size limits and reduces network overhead.
816+
WORKER_CAPABILITY_LARGE_PAYLOADS = 3;
735817
}
736818

737819
message WorkItem {
@@ -750,7 +832,7 @@ message CompleteTaskResponse {
750832
}
751833

752834
message HealthPing {
753-
// No payload
835+
// No payload
754836
}
755837

756838
message StreamInstanceHistoryRequest {
@@ -764,3 +846,8 @@ message StreamInstanceHistoryRequest {
764846
message HistoryChunk {
765847
repeated HistoryEvent events = 1;
766848
}
849+
850+
message InstanceBatch {
851+
// A maximum of 500 instance IDs can be provided in this list.
852+
repeated string instanceIds = 1;
853+
}

0 commit comments

Comments
 (0)