@@ -9,10 +9,36 @@ 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+ // Identifies a specific activity within a namespace. Practically speaking, because run_id is a
24+ // uuid, a workflow execution is globally unique. Note that many commands allow specifying an empty
25+ // run id as a way of saying "target the latest run of the activity".
26+ // TODO: Make this a generic EntityExecution?
27+ message ActivityExecution {
28+ string activity_id = 1 ;
29+ string run_id = 2 ;
30+ }
31+
32+ // When StartActivityExecution uses the ID_CONFLICT_POLICY_USE_EXISTING and there is already an existing running
33+ // activity, OnConflictOptions defines actions to be taken on the existing running activity, updating its state.
34+ message OnConflictOptions {
35+ // Attaches the request ID to the running workflow.
36+ bool attach_request_id = 1 ;
37+ // Attaches the completion callbacks to the running workflow.
38+ bool attach_completion_callbacks = 2 ;
39+ // Attaches the links to the WorkflowExecutionOptionsUpdatedEvent history event.
40+ bool attach_links = 3 ;
41+ }
1642
1743message ActivityOptions {
1844 temporal.api.taskqueue.v1.TaskQueue task_queue = 1 ;
@@ -40,6 +66,135 @@ message ActivityOptions {
4066 google.protobuf.Duration start_to_close_timeout = 4 ;
4167 // Maximum permitted time between successful worker heartbeats.
4268 google.protobuf.Duration heartbeat_timeout = 5 ;
43-
69+ // The retry policy for the activity. Will never exceed `schedule_to_close_timeout`.
4470 temporal.api.common.v1.RetryPolicy retry_policy = 6 ;
45- }
71+ }
72+
73+ // Info for a standalone activity.
74+ message ActivityExecutionInfo {
75+ // Unique identifier of this activity within its namespace.
76+ ActivityExecution activity_execution = 1 ;
77+
78+ // The type of the activity, a string that maps to a registered activity on a worker.
79+ temporal.api.common.v1.ActivityType activity_type = 2 ;
80+ // A general status for this activity, indicates whether it is currently running or in one of the terminal statuses.
81+ temporal.api.enums.v1.ActivityExecutionStatus status = 3 ;
82+ // More detailed breakdown of ACTIVITY_EXECUTION_STATUS_RUNNING.
83+ temporal.api.enums.v1.PendingActivityState run_state = 4 ;
84+ // Details provided in the last recorded activity heartbeat.
85+ temporal.api.common.v1.Payloads heartbeat_details = 5 ;
86+ // Time the last heartbeat was recorded.
87+ google.protobuf.Timestamp last_heartbeat_time = 6 ;
88+ // Time the last attempt was started.
89+ google.protobuf.Timestamp last_started_time = 7 ;
90+ // The attempt this activity is currently on.
91+ // Incremented each time a new attempt is started.
92+ // TODO: Confirm if this is on scheduled or started.
93+ int32 attempt = 8 ;
94+ int32 maximum_attempts = 9 ;
95+ // Time the activity was originally scheduled via a StartActivityExecution request.
96+ google.protobuf.Timestamp scheduled_time = 10 ;
97+ // Scheduled time + schedule to close timeout.
98+ google.protobuf.Timestamp expiration_time = 11 ;
99+ // Failure details from the last failed attempt.
100+ temporal.api.failure.v1.Failure last_failure = 12 ;
101+ string last_worker_identity = 13 ;
102+
103+ // Time from the last attempt failure to the next activity retry.
104+ // If the activity is currently running, this represents the next retry interval in case the attempt fails.
105+ // If activity is currently backing off between attempt, this represents the current retry interval.
106+ // If there is no next retry allowed, this field will be null.
107+ // This interval is typically calculated from the specified retry policy, but may be modified if an activity fails
108+ // with a retryable application failure specifying a retry delay.
109+ google.protobuf.Duration current_retry_interval = 14 ;
110+
111+ // The time when the last activity attempt completed. If activity has not been completed yet, it will be null.
112+ google.protobuf.Timestamp last_attempt_complete_time = 15 ;
113+
114+ // The time when the next activity attempt will be scheduled.
115+ // If activity is currently scheduled or started, this field will be null.
116+ google.protobuf.Timestamp next_attempt_schedule_time = 16 ;
117+
118+ // The Worker Deployment Version this activity was dispatched to most recently.
119+ // If nil, the activity has not yet been dispatched or was last dispatched to an unversioned worker.
120+ temporal.api.deployment.v1.WorkerDeploymentVersion last_deployment_version = 17 ;
121+
122+ // Priority metadata.
123+ temporal.api.common.v1.Priority priority = 18 ;
124+
125+ // TODO: Move this to a common package?
126+ message PauseInfo {
127+ // The time when the activity was paused.
128+ google.protobuf.Timestamp pause_time = 1 ;
129+
130+ message Manual {
131+ // The identity of the actor that paused the activity.
132+ string identity = 1 ;
133+ // Reason for pausing the activity.
134+ string reason = 2 ;
135+ }
136+
137+ oneof paused_by {
138+ // The activity was paused by direct API invocation.
139+ Manual manual = 2 ;
140+ }
141+ }
142+
143+ PauseInfo pause_info = 19 ;
144+
145+ // Current activity options. May be different from the one used to start the activity.
146+ temporal.api.activity.v1.ActivityOptions activity_options = 20 ;
147+
148+ // Serialized activity input, passed as arguments to the activity function.
149+ temporal.api.common.v1.Payloads input = 21 ;
150+
151+ // Incremented each time the activity's state is mutated in persistence.
152+ int64 state_transition_count = 22 ;
153+
154+ temporal.api.common.v1.SearchAttributes search_attributes = 23 ;
155+ temporal.api.common.v1.Header header = 24 ;
156+ // Whether the activity was started with a request_eager_execution flag set to `true`, indicating that the first
157+ // task was delivered inline in the start response, bypassing matching.
158+ bool eager_execution_requested = 25 ;
159+
160+ // Callbacks to be called by the server when this activity reaches a terminal status.
161+ // Callback addresses must be whitelisted in the server's dynamic configuration.
162+ repeated temporal.api.common.v1.Callback completion_callbacks = 26 ;
163+ // Metadata for use by user interfaces to display the fixed as-of-start summary and details of the activity.
164+ temporal.api.sdk.v1.UserMetadata user_metadata = 27 ;
165+ // Links to be associated with the activity.
166+ repeated temporal.api.common.v1.Link links = 28 ;
167+
168+ // Set if activity cancelation was requested.
169+ string canceled_reason = 31 ;
170+ }
171+
172+ // Limited activity information returned in the list response.
173+ message ActivityListInfo {
174+ // Unique identifier of this activity within its namespace.
175+ ActivityExecution activity_execution = 1 ;
176+ // The type of the activity, a string that maps to a registered activity on a worker.
177+ temporal.api.common.v1.ActivityType activity_type = 2 ;
178+ // Time the activity was originally scheduled via a StartActivityExecution request.
179+ // TODO: Workflows call this schedule_time but it's scheduled_time in PendingActivityInfo, what should we choose for
180+ // consistency?
181+ google.protobuf.Timestamp scheduled_time = 3 ;
182+ // If the activity is in a terminal status, this field represents the time the activity transitioned to that status.
183+ google.protobuf.Timestamp close_time = 4 ;
184+ // Only scheduled and terminal statuses appear here. More detailed information in PendingActivityInfo but not
185+ // available in the list response.
186+ temporal.api.enums.v1.ActivityExecutionStatus status = 5 ;
187+
188+ // Search attributes from the start request.
189+ temporal.api.common.v1.SearchAttributes search_attributes = 6 ;
190+
191+ // The task queue this activity was scheduled on when it was originally started, updated on activity options update.
192+ string task_queue = 7 ;
193+ // Updated on terminal status.
194+ int64 state_transition_count = 8 ;
195+ // Updated once on scheduled and once on terminal status.
196+ int64 state_size_bytes = 9 ;
197+ // The difference between close time and scheduled time.
198+ // This field is only populated if the activity is closed.
199+ google.protobuf.Duration execution_duration = 10 ;
200+ }
0 commit comments