Skip to content
Merged
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
13 changes: 3 additions & 10 deletions common/message.proto
Original file line number Diff line number Diff line change
Expand Up @@ -63,25 +63,18 @@ message Header {
}

message RetryPolicy {
// Interval of the first retry. If coefficient is 1.0 then it is used for all retries.
// Interval of the first retry. If retryBackoffCoefficient is 1.0 then it is used for all retries.
int32 initialIntervalInSeconds = 1;

// Coefficient used to calculate the next retry interval.
// The next retry interval is previous interval multiplied by the coefficient.
// Must be 1 or larger.
double backoffCoefficient = 2;

// Maximum interval between retries. Exponential backoff leads to interval increase.
// This value is the cap of the increase. Default is 100x of initial interval.
// This value is the cap of the increase. Default is 100x of the initial interval.
int32 maximumIntervalInSeconds = 3;

// Maximum number of attempts. When exceeded the retries stop even if not expired yet.
// Must be 1 or bigger. Default is unlimited.
// 1 disables retries. 0 means unlimited (up to the timeouts)
int32 maximumAttempts = 4;

// Non-Retriable errors. Will stop retrying if error matches this list.
repeated string nonRetriableErrorReasons = 5;

// Expiration time for the whole retry process.
int32 expirationIntervalInSeconds = 6;
}
58 changes: 39 additions & 19 deletions decision/message.proto
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,26 @@ message ScheduleActivityTaskDecisionAttributes {
common.ActivityType activityType = 2;
string namespace = 3;
tasklist.TaskList taskList = 4;
common.Payload input = 5;
int32 scheduleToCloseTimeoutSeconds = 6;
int32 scheduleToStartTimeoutSeconds = 7;
int32 startToCloseTimeoutSeconds = 8;
int32 heartbeatTimeoutSeconds = 9;
common.RetryPolicy retryPolicy = 10;
common.Header header = 11;
common.Header header = 5;
common.Payload input = 6;
// Indicates how long the caller is willing to wait for an activity completion.
// Limits for how long retries are happening. Either this or startToCloseTimeoutSeconds is required.
// When not specified defaults to the workflow execution timeout.
int32 scheduleToCloseTimeoutSeconds = 7;
// Limits time an activity task can stay in a task queue before a worker picks it up.
// This timeout is always non retriable as all a retry would achieve is to put it back into the same queue.
// Defaults to scheduleToCloseTimeoutSeconds or workflow execution timeout if not specified.
int32 scheduleToStartTimeoutSeconds = 8;
// Maximum time an activity is allowed to execute after a pick up by a worker.
// This timeout is always retriable. Either this or scheduleToCloseTimeoutSeconds is required.
int32 startToCloseTimeoutSeconds = 9;
// Maximum time between successful worker heartbeats.
Copy link
Contributor

Choose a reason for hiding this comment

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

I would add required/optional and if optional what is default? The same way as you did for all 3 above.

// Optional. By default no heartbeating is required.
int32 heartbeatTimeoutSeconds = 10;
// Activity retry policy. Note that activity is retried by default according to a default retry policy.
// To disable retries provide a retry policy with maximumAttempts equals to 1.
// The retries happen up to scheduleToCloseTimeout.
common.RetryPolicy retryPolicy = 11;
}

message RequestCancelActivityTaskDecisionAttributes {
Expand Down Expand Up @@ -103,8 +116,11 @@ message ContinueAsNewWorkflowExecutionDecisionAttributes {
common.WorkflowType workflowType = 1;
tasklist.TaskList taskList = 2;
common.Payload input = 3;
int32 executionStartToCloseTimeoutSeconds = 4;
int32 taskStartToCloseTimeoutSeconds = 5;
// workflowExecutionTimeout is omitted as it shouldn'be overridden from within a workflow
// Timeout of a single workflow run
int32 workflowRunTimeoutSeconds = 4;
// Timeout of a single workflow task
int32 workflowTaskTimeoutSeconds = 5;
int32 backoffStartIntervalInSeconds = 6;
common.RetryPolicy retryPolicy = 7;
common.ContinueAsNewInitiator initiator = 8;
Expand All @@ -123,16 +139,20 @@ message StartChildWorkflowExecutionDecisionAttributes {
common.WorkflowType workflowType = 3;
tasklist.TaskList taskList = 4;
common.Payload input = 5;
int32 executionStartToCloseTimeoutSeconds = 6;
int32 taskStartToCloseTimeoutSeconds = 7;
common.ParentClosePolicy parentClosePolicy = 8;
string control = 9;
common.WorkflowIdReusePolicy workflowIdReusePolicy = 10;
common.RetryPolicy retryPolicy = 11;
string cronSchedule = 12;
common.Header header = 13;
common.Memo memo = 14;
common.SearchAttributes searchAttributes = 15;
// Total workflow execution timeout including retries and continue as new
int32 workflowExecutionTimeoutSeconds = 6;
// Timeout of a single workflow run
int32 workflowRunTimeoutSeconds = 7;
// Timeout of a single workflow task
int32 workflowTaskTimeoutSeconds = 8;
common.ParentClosePolicy parentClosePolicy = 9;
string control = 10;
common.WorkflowIdReusePolicy workflowIdReusePolicy = 11;
common.RetryPolicy retryPolicy = 12;
string cronSchedule = 13;
common.Header header = 14;
common.Memo memo = 15;
common.SearchAttributes searchAttributes = 16;
}

message Decision {
Expand Down
104 changes: 64 additions & 40 deletions event/message.proto
Original file line number Diff line number Diff line change
Expand Up @@ -39,27 +39,33 @@ message WorkflowExecutionStartedEventAttributes {
int64 parentInitiatedEventId = 4;
tasklist.TaskList taskList = 5;
common.Payload input = 6;
int32 executionStartToCloseTimeoutSeconds = 7;
int32 taskStartToCloseTimeoutSeconds = 8;
string continuedExecutionRunId = 9;
common.ContinueAsNewInitiator initiator = 10;
string continuedFailureReason = 11;
common.Payload continuedFailureDetails = 12;
common.Payload lastCompletionResult = 13;
// Total workflow execution timeout including retries and continue as new
int32 workflowExecutionTimeoutSeconds = 7;
// Timeout of a single workflow run
int32 workflowRunTimeoutSeconds = 8;
// Timeout of a single workflow task
int32 workflowTaskTimeoutSeconds = 9;
string continuedExecutionRunId = 10;
common.ContinueAsNewInitiator initiator = 11;
string continuedFailureReason = 12;
common.Payload continuedFailureDetails = 13;
common.Payload lastCompletionResult = 14;
// This is the runId when the WorkflowExecutionStarted event is written.
string originalExecutionRunId = 14;
string identity = 15;
string originalExecutionRunId = 15;
string identity = 16;
// This is the very first runId along the chain of ContinueAsNew and Reset.
string firstExecutionRunId = 16;
common.RetryPolicy retryPolicy = 17;
int32 attempt = 18;
int64 expirationTimestamp = 19;
string cronSchedule = 20;
int32 firstDecisionTaskBackoffSeconds = 21;
common.Memo memo = 22;
common.SearchAttributes searchAttributes = 23;
execution.ResetPoints prevAutoResetPoints = 24;
common.Header header = 25;
string firstExecutionRunId = 17;
common.RetryPolicy retryPolicy = 18;
int32 attempt = 19;
// The absolute time at which workflow is timed out.
// This time is passed without change to the next run/retry of a workflow.
int64 workflowExecutionExpirationTimestamp = 20;
string cronSchedule = 21;
int32 firstDecisionTaskBackoffSeconds = 22;
common.Memo memo = 23;
common.SearchAttributes searchAttributes = 24;
execution.ResetPoints prevAutoResetPoints = 25;
common.Header header = 26;
}

message WorkflowExecutionCompletedEventAttributes {
Expand All @@ -82,8 +88,11 @@ message WorkflowExecutionContinuedAsNewEventAttributes {
common.WorkflowType workflowType = 2;
tasklist.TaskList taskList = 3;
common.Payload input = 4;
int32 executionStartToCloseTimeoutSeconds = 5;
int32 taskStartToCloseTimeoutSeconds = 6;
// workflowExecutionTimeout is omitted as it shouldn'be overridden from within a workflow
// Timeout of a single workflow run
int32 workflowRunTimeoutSeconds = 5;
// Timeout of a single workflow task
int32 workflowTaskTimeoutSeconds = 6;
int64 decisionTaskCompletedEventId = 7;
int32 backoffStartIntervalInSeconds = 8;
common.ContinueAsNewInitiator initiator = 9;
Expand Down Expand Up @@ -139,14 +148,25 @@ message ActivityTaskScheduledEventAttributes {
common.ActivityType activityType = 2;
string namespace = 3;
tasklist.TaskList taskList = 4;
common.Payload input = 5;
int32 scheduleToCloseTimeoutSeconds = 6;
int32 scheduleToStartTimeoutSeconds = 7;
int32 startToCloseTimeoutSeconds = 8;
int32 heartbeatTimeoutSeconds = 9;
int64 decisionTaskCompletedEventId = 10;
common.RetryPolicy retryPolicy = 11;
common.Header header = 12;
common.Header header = 5;
common.Payload input = 6;
// Indicates how long the caller is willing to wait for an activity completion.
// Limits for how long retries are happening. Either this or startToCloseTimeoutSeconds is required.
int32 scheduleToCloseTimeoutSeconds = 7;
// Limits time an activity task can stay in a task queue before a worker picks it up.
// This timeout is always non retriable as all a retry would achieve is to put it back into the same queue.
// Defaults to scheduleToCloseTimeoutSeconds or workflow execution timeout if not specified.
int32 scheduleToStartTimeoutSeconds = 8;
// Maximum time an activity is allowed to execute after a pick up by a worker.
// This timeout is always retriable. Either this or scheduleToCloseTimeoutSeconds is required.
int32 startToCloseTimeoutSeconds = 9;
// Maximum time between successful worker heartbeats.
int32 heartbeatTimeoutSeconds = 10;
int64 decisionTaskCompletedEventId = 11;
// Activities are provided by a default retry policy controlled through the service dynamic configuration.
// Retries are happening up to scheduleToCloseTimeout.
// To disable retries set retryPolicy.maximumAttempts to 1.
common.RetryPolicy retryPolicy = 12;
}

message ActivityTaskStartedEventAttributes {
Expand Down Expand Up @@ -319,17 +339,21 @@ message StartChildWorkflowExecutionInitiatedEventAttributes {
common.WorkflowType workflowType = 3;
tasklist.TaskList taskList = 4;
common.Payload input = 5;
int32 executionStartToCloseTimeoutSeconds = 6;
int32 taskStartToCloseTimeoutSeconds = 7;
common.ParentClosePolicy parentClosePolicy = 8;
string control = 9;
int64 decisionTaskCompletedEventId = 10;
common.WorkflowIdReusePolicy workflowIdReusePolicy = 11;
common.RetryPolicy retryPolicy = 12;
string cronSchedule = 13;
common.Header header = 14;
common.Memo memo = 15;
common.SearchAttributes searchAttributes = 16;
// Total workflow execution timeout including retries and continue as new
int32 workflowExecutionTimeoutSeconds = 6;
// Timeout of a single workflow run
int32 workflowRunTimeoutSeconds = 7;
// Timeout of a single workflow task
int32 workflowTaskTimeoutSeconds = 8;
common.ParentClosePolicy parentClosePolicy = 9;
string control = 10;
int64 decisionTaskCompletedEventId = 11;
common.WorkflowIdReusePolicy workflowIdReusePolicy = 12;
common.RetryPolicy retryPolicy = 13;
string cronSchedule = 14;
common.Header header = 15;
common.Memo memo = 16;
common.SearchAttributes searchAttributes = 17;
}

message StartChildWorkflowExecutionFailedEventAttributes {
Expand Down
5 changes: 3 additions & 2 deletions execution/message.proto
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,9 @@ message WorkflowExecutionInfo {

message WorkflowExecutionConfiguration {
tasklist.TaskList taskList = 1;
int32 executionStartToCloseTimeoutSeconds = 2;
int32 taskStartToCloseTimeoutSeconds = 3;
int32 workflowExecutionTimeoutSeconds = 2;
int32 workflowRunTimeoutSeconds = 3;
int32 workflowTaskTimeoutSeconds = 4;
}

message PendingActivityInfo {
Expand Down
90 changes: 52 additions & 38 deletions workflowservice/request_response.proto
Original file line number Diff line number Diff line change
Expand Up @@ -118,16 +118,21 @@ message StartWorkflowExecutionRequest {
common.WorkflowType workflowType = 3;
tasklist.TaskList taskList = 4;
common.Payload input = 5;
int32 executionStartToCloseTimeoutSeconds = 6;
int32 taskStartToCloseTimeoutSeconds = 7;
string identity = 8;
string requestId = 9;
common.WorkflowIdReusePolicy workflowIdReusePolicy = 10;
common.RetryPolicy retryPolicy = 11;
string cronSchedule = 12;
common.Memo memo = 13;
common.SearchAttributes searchAttributes = 14;
common.Header header = 15;
// Total workflow execution timeout including retries and continue as new.
int32 workflowExecutionTimeoutSeconds = 6;
// Timeout of a single workflow run.
int32 workflowRunTimeoutSeconds = 7;
// Timeout of a single workflow task.
int32 workflowTaskTimeoutSeconds = 8;
string identity = 9;
string requestId = 10;
common.WorkflowIdReusePolicy workflowIdReusePolicy = 11;
// Retries up to workflowExecutionTimeoutSeconds.
common.RetryPolicy retryPolicy = 12;
string cronSchedule = 13;
common.Memo memo = 14;
common.SearchAttributes searchAttributes = 15;
common.Header header = 16;
}

message StartWorkflowExecutionResponse {
Expand Down Expand Up @@ -210,21 +215,26 @@ message PollForActivityTaskRequest {

message PollForActivityTaskResponse {
bytes taskToken = 1;
execution.WorkflowExecution workflowExecution = 2;
string activityId = 3;
common.ActivityType activityType = 4;
common.Payload input = 5;
int64 scheduledTimestamp = 6;
int32 scheduleToCloseTimeoutSeconds = 7;
int64 startedTimestamp = 8;
int32 startToCloseTimeoutSeconds = 9;
int32 heartbeatTimeoutSeconds = 10;
int32 attempt = 11;
int64 scheduledTimestampOfThisAttempt = 12;
common.Payload heartbeatDetails = 13;
common.WorkflowType workflowType = 14;
string workflowNamespace = 15;
common.Header header = 16;
string workflowNamespace = 2;
common.WorkflowType workflowType = 3;
execution.WorkflowExecution workflowExecution = 4;
common.ActivityType activityType = 5;
string activityId = 6;
common.Header header = 7;
common.Payload input = 8;
common.Payload heartbeatDetails = 9;
int64 scheduledTimestamp = 10;
int64 scheduledTimestampOfThisAttempt = 11;
int64 startedTimestamp = 12;
int32 attempt = 13;
int32 scheduleToCloseTimeoutSeconds = 14;
int32 startToCloseTimeoutSeconds = 15;
int32 heartbeatTimeoutSeconds = 16;
// 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.
common.RetryPolicy retryPolicy = 17;
}

message RecordActivityTaskHeartbeatRequest {
Expand Down Expand Up @@ -344,19 +354,23 @@ message SignalWithStartWorkflowExecutionRequest {
common.WorkflowType workflowType = 3;
tasklist.TaskList taskList = 4;
common.Payload input = 5;
int32 executionStartToCloseTimeoutSeconds = 6;
int32 taskStartToCloseTimeoutSeconds = 7;
string identity = 8;
string requestId = 9;
common.WorkflowIdReusePolicy workflowIdReusePolicy = 10;
string signalName = 11;
common.Payload signalInput = 12;
string control = 13;
common.RetryPolicy retryPolicy = 14;
string cronSchedule = 15;
common.Memo memo = 16;
common.SearchAttributes searchAttributes = 17;
common.Header header = 18;
// Total workflow execution timeout including retries and continue as new
int32 workflowExecutionTimeoutSeconds = 6;
// Timeout of a single workflow run
int32 workflowRunTimeoutSeconds = 7;
// Timeout of a single workflow task
int32 workflowTaskTimeoutSeconds = 8;
string identity = 9;
string requestId = 10;
common.WorkflowIdReusePolicy workflowIdReusePolicy = 11;
string signalName = 12;
common.Payload signalInput = 13;
string control = 14;
common.RetryPolicy retryPolicy = 15;
string cronSchedule = 16;
common.Memo memo = 17;
common.SearchAttributes searchAttributes = 18;
common.Header header = 19;
}

message SignalWithStartWorkflowExecutionResponse {
Expand Down