@@ -9,10 +9,26 @@ option java_outer_classname = "MessageProto";
99option ruby_package = "Temporalio::Api::Activity::V1" ;
1010option csharp_namespace = "Temporalio.Api.Activity.V1" ;
1111
12+ import "google/protobuf/duration.proto" ;
13+ import "google/protobuf/timestamp.proto" ;
14+
1215import "temporal/api/common/v1/message.proto" ;
16+ import "temporal/api/deployment/v1/message.proto" ;
17+ import "temporal/api/enums/v1/activity.proto" ;
18+ import "temporal/api/enums/v1/workflow.proto" ;
19+ import "temporal/api/failure/v1/message.proto" ;
1320import "temporal/api/taskqueue/v1/message.proto" ;
21+ import "temporal/api/sdk/v1/user_metadata.proto" ;
1422
15- import "google/protobuf/duration.proto" ;
23+ // The outcome of a completed activity execution: either a successful result or a failure.
24+ message ActivityExecutionOutcome {
25+ oneof value {
26+ // The result if the activity completed successfully.
27+ temporal.api.common.v1.Payloads result = 1 ;
28+ // The failure if the activity completed unsuccessfully.
29+ temporal.api.failure.v1.Failure failure = 2 ;
30+ }
31+ }
1632
1733message ActivityOptions {
1834 temporal.api.taskqueue.v1.TaskQueue task_queue = 1 ;
@@ -40,10 +56,142 @@ message ActivityOptions {
4056 google.protobuf.Duration start_to_close_timeout = 4 ;
4157 // Maximum permitted time between successful worker heartbeats.
4258 google.protobuf.Duration heartbeat_timeout = 5 ;
43-
59+ // The retry policy for the activity. Will never exceed `schedule_to_close_timeout`.
4460 temporal.api.common.v1.RetryPolicy retry_policy = 6 ;
4561
4662 // Priority metadata. If this message is not present, or any fields are not
4763 // present, they inherit the values from the workflow.
4864 temporal.api.common.v1.Priority priority = 7 ;
49- }
65+ }
66+
67+ // Information about a standalone activity.
68+ message ActivityExecutionInfo {
69+ // Unique identifier of this activity within its namespace along with run ID (below).
70+ string activity_id = 1 ;
71+ string run_id = 2 ;
72+
73+ // The type of the activity, a string that maps to a registered activity on a worker.
74+ temporal.api.common.v1.ActivityType activity_type = 3 ;
75+ // A general status for this activity, indicates whether it is currently running or in one of the terminal statuses.
76+ temporal.api.enums.v1.ActivityExecutionStatus status = 4 ;
77+ // More detailed breakdown of ACTIVITY_EXECUTION_STATUS_RUNNING.
78+ temporal.api.enums.v1.PendingActivityState run_state = 5 ;
79+
80+ string task_queue = 6 ;
81+
82+ // Indicates how long the caller is willing to wait for an activity completion. Limits how long
83+ // retries will be attempted.
84+ //
85+ // (-- api-linter: core::0140::prepositions=disabled
86+ // aip.dev/not-precedent: "to" is used to indicate interval. --)
87+ google.protobuf.Duration schedule_to_close_timeout = 7 ;
88+ // Limits time an activity task can stay in a task queue before a worker picks it up. This
89+ // timeout is always non retryable, as all a retry would achieve is to put it back into the same
90+ // queue. Defaults to `schedule_to_close_timeout`.
91+ //
92+ // (-- api-linter: core::0140::prepositions=disabled
93+ // aip.dev/not-precedent: "to" is used to indicate interval. --)
94+ google.protobuf.Duration schedule_to_start_timeout = 8 ;
95+ // Maximum time a single activity attempt is allowed to execute after being picked up by a worker. This
96+ // timeout is always retryable.
97+ //
98+ // (-- api-linter: core::0140::prepositions=disabled
99+ // aip.dev/not-precedent: "to" is used to indicate interval. --)
100+ google.protobuf.Duration start_to_close_timeout = 9 ;
101+
102+ // Maximum permitted time between successful worker heartbeats.
103+ google.protobuf.Duration heartbeat_timeout = 10 ;
104+
105+ // The retry policy for the activity. Will never exceed `schedule_to_close_timeout`.
106+ temporal.api.common.v1.RetryPolicy retry_policy = 11 ;
107+
108+ // Details provided in the last recorded activity heartbeat.
109+ temporal.api.common.v1.Payloads heartbeat_details = 12 ;
110+ // Time the last heartbeat was recorded.
111+ google.protobuf.Timestamp last_heartbeat_time = 13 ;
112+ // Time the last attempt was started.
113+ google.protobuf.Timestamp last_started_time = 14 ;
114+ // The attempt this activity is currently on. Incremented each time a new attempt is scheduled.
115+ int32 attempt = 15 ;
116+ // How long this activity has been running for, including all attempts and backoff between attempts.
117+ google.protobuf.Duration execution_duration = 16 ;
118+ // Time the activity was originally scheduled via a StartActivityExecution request.
119+ google.protobuf.Timestamp schedule_time = 17 ;
120+ // Scheduled time + schedule to close timeout.
121+ google.protobuf.Timestamp expiration_time = 18 ;
122+ // Time when the activity transitioned to a closed state.
123+ google.protobuf.Timestamp close_time = 19 ;
124+
125+ // Failure details from the last failed attempt.
126+ temporal.api.failure.v1.Failure last_failure = 20 ;
127+ string last_worker_identity = 21 ;
128+
129+ // Time from the last attempt failure to the next activity retry.
130+ // If the activity is currently running, this represents the next retry interval in case the attempt fails.
131+ // If activity is currently backing off between attempt, this represents the current retry interval.
132+ // If there is no next retry allowed, this field will be null.
133+ // This interval is typically calculated from the specified retry policy, but may be modified if an activity fails
134+ // with a retryable application failure specifying a retry delay.
135+ google.protobuf.Duration current_retry_interval = 22 ;
136+
137+ // The time when the last activity attempt completed. If activity has not been completed yet, it will be null.
138+ google.protobuf.Timestamp last_attempt_complete_time = 23 ;
139+
140+ // The time when the next activity attempt will be scheduled.
141+ // If activity is currently scheduled or started, this field will be null.
142+ google.protobuf.Timestamp next_attempt_schedule_time = 24 ;
143+
144+ // The Worker Deployment Version this activity was dispatched to most recently.
145+ // If nil, the activity has not yet been dispatched or was last dispatched to an unversioned worker.
146+ temporal.api.deployment.v1.WorkerDeploymentVersion last_deployment_version = 25 ;
147+
148+ // Priority metadata.
149+ temporal.api.common.v1.Priority priority = 26 ;
150+
151+ // Incremented each time the activity's state is mutated in persistence.
152+ int64 state_transition_count = 27 ;
153+
154+ // Updated once on scheduled and once on terminal status.
155+ int64 state_size_bytes = 28 ;
156+
157+ temporal.api.common.v1.SearchAttributes search_attributes = 29 ;
158+ temporal.api.common.v1.Header header = 30 ;
159+ // Metadata for use by user interfaces to display the fixed as-of-start summary and details of the activity.
160+ temporal.api.sdk.v1.UserMetadata user_metadata = 31 ;
161+
162+ // Set if activity cancelation was requested.
163+ string canceled_reason = 32 ;
164+ }
165+
166+ // Limited activity information returned in the list response.
167+ // When adding fields here, ensure that it is also present in ActivityExecutionInfo (note that it
168+ // may already be present in ActivityExecutionInfo but not at the top-level).
169+ message ActivityExecutionListInfo {
170+ // A unique identifier of this activity within its namespace along with run ID (below).
171+ string activity_id = 1 ;
172+ // The run ID of the standalone activity.
173+ string run_id = 2 ;
174+
175+ // The type of the activity, a string that maps to a registered activity on a worker.
176+ temporal.api.common.v1.ActivityType activity_type = 3 ;
177+ // Time the activity was originally scheduled via a StartActivityExecution request.
178+ google.protobuf.Timestamp schedule_time = 4 ;
179+ // If the activity is in a terminal status, this field represents the time the activity transitioned to that status.
180+ google.protobuf.Timestamp close_time = 5 ;
181+ // Only scheduled and terminal statuses appear here. More detailed information in PendingActivityInfo but not
182+ // available in the list response.
183+ temporal.api.enums.v1.ActivityExecutionStatus status = 6 ;
184+
185+ // Search attributes from the start request.
186+ temporal.api.common.v1.SearchAttributes search_attributes = 7 ;
187+
188+ // The task queue this activity was scheduled on when it was originally started, updated on activity options update.
189+ string task_queue = 8 ;
190+ // Updated on terminal status.
191+ int64 state_transition_count = 9 ;
192+ // Updated once on scheduled and once on terminal status.
193+ int64 state_size_bytes = 10 ;
194+ // The difference between close time and scheduled time.
195+ // This field is only populated if the activity is closed.
196+ google.protobuf.Duration execution_duration = 11 ;
197+ }
0 commit comments