diff --git a/openapi/openapiv2.json b/openapi/openapiv2.json index 9a389f44e..c06a0978d 100644 --- a/openapi/openapiv2.json +++ b/openapi/openapiv2.json @@ -13794,6 +13794,18 @@ } } }, + "v1ActivityExecution": { + "type": "object", + "properties": { + "activityId": { + "type": "string" + }, + "runId": { + "type": "string" + } + }, + "description": "Identifies a specific standalone activity execution within a namespace." + }, "v1ActivityExecutionInfo": { "type": "object", "properties": { @@ -14171,6 +14183,27 @@ } } }, + "v1ActivityScheduleActionInfo": { + "type": "object", + "properties": { + "activityType": { + "$ref": "#/definitions/v1ActivityType" + } + }, + "description": "Configuration summary of an Activity action in Schedule List views." + }, + "v1ActivityScheduleActionResult": { + "type": "object", + "properties": { + "execution": { + "$ref": "#/definitions/v1ActivityExecution" + }, + "status": { + "$ref": "#/definitions/v1ActivityExecutionStatus" + } + }, + "description": "Execution reference and recorded status of a scheduled standalone Activity.\nA failed retry attempt does not mark the execution failed; terminal status is\nrecorded after the execution finishes, including retries. Status may lag." + }, "v1ActivityTaskCancelRequestedEventAttributes": { "type": "object", "properties": { @@ -17539,6 +17572,64 @@ "default": "NAMESPACE_STATE_UNSPECIFIED", "description": " - NAMESPACE_STATE_SOFT_DELETED: Set by OperatorService.SoftDeleteNamespace. Executions make no progress, but no data is\nremoved until the namespace is restored or deleted." }, + "v1NewActivityExecutionInfo": { + "type": "object", + "properties": { + "activityId": { + "type": "string", + "description": "Identifier for this activity. Required. This identifier should be meaningful in the user's\nown system. For schedules, the scheduler generates a different Activity ID for each\ninvocation from this value. Retries of one execution retain its Activity ID." + }, + "activityType": { + "$ref": "#/definitions/v1ActivityType", + "description": "The type of the activity, a string that corresponds to a registered activity on a worker." + }, + "taskQueue": { + "$ref": "#/definitions/v1TaskQueue", + "description": "Task queue to schedule this activity on." + }, + "scheduleToCloseTimeout": { + "type": "string", + "description": "Indicates how long the caller is willing to wait for an activity completion. Limits how long\nretries will be attempted. Either this or `start_to_close_timeout` must be specified." + }, + "scheduleToStartTimeout": { + "type": "string", + "description": "Limits time an activity task can stay in a task queue before a worker picks it up. This\ntimeout is always non retryable, as all a retry would achieve is to put it back into the same\nqueue. Defaults to `schedule_to_close_timeout` if not specified." + }, + "startToCloseTimeout": { + "type": "string", + "description": "Maximum time an activity is allowed to execute after being picked up by a worker. This\ntimeout is always retryable. Either this or `schedule_to_close_timeout` must be\nspecified." + }, + "heartbeatTimeout": { + "type": "string", + "description": "Maximum permitted time between successful worker heartbeats." + }, + "retryPolicy": { + "$ref": "#/definitions/v1RetryPolicy", + "description": "The retry policy for the activity. Will never exceed `schedule_to_close_timeout`." + }, + "input": { + "$ref": "#/definitions/v1Payloads", + "description": "Serialized arguments to the activity. These are passed as arguments to the activity function." + }, + "searchAttributes": { + "$ref": "#/definitions/v1SearchAttributes", + "description": "Search attributes for indexing." + }, + "header": { + "$ref": "#/definitions/v1Header", + "description": "Header for context propagation and tracing purposes." + }, + "userMetadata": { + "$ref": "#/definitions/v1UserMetadata", + "description": "Metadata for use by user interfaces to display the fixed as-of-start summary and details of the activity." + }, + "priority": { + "$ref": "#/definitions/v1Priority", + "description": "Priority metadata." + } + }, + "description": "Options for starting a standalone activity from a Schedule.\nThe scheduler supplies namespace, request identity, completion callbacks, start timing,\nand ID reuse/conflict policies. Previous invocation results/failures are not inputs." + }, "v1NewWorkflowExecutionInfo": { "type": "object", "properties": { @@ -19558,6 +19649,32 @@ "default": "ROUTING_CONFIG_UPDATE_STATE_UNSPECIFIED", "description": "Indicates whether a change to the Routing Config has been\npropagated to all relevant Task Queues and their partitions.\n\n - ROUTING_CONFIG_UPDATE_STATE_IN_PROGRESS: Update to the RoutingConfig is currently in progress.\n - ROUTING_CONFIG_UPDATE_STATE_COMPLETED: Update to the RoutingConfig has completed successfully." }, + "v1RunningActivityExecutions": { + "type": "object", + "properties": { + "executions": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1ActivityExecution" + } + } + }, + "description": "Running standalone Activity executions started by a Schedule." + }, + "v1RunningWorkflowExecutions": { + "type": "object", + "properties": { + "executions": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1WorkflowExecution" + } + } + }, + "description": "Running Workflow executions started by a Schedule." + }, "v1Schedule": { "type": "object", "properties": { @@ -19581,6 +19698,10 @@ "startWorkflow": { "$ref": "#/definitions/v1NewWorkflowExecutionInfo", "description": "All fields of NewWorkflowExecutionInfo are valid except for:\n- workflow_id_reuse_policy\n- cron_schedule\nThe workflow id of the started workflow may not match this exactly,\nit may have a timestamp appended for uniqueness." + }, + "startActivity": { + "$ref": "#/definitions/v1NewActivityExecutionInfo", + "description": "Start a standalone Activity. The scheduler generates a distinct Activity\nID per invocation and manages retry identity and completion tracking." } } }, @@ -19604,6 +19725,12 @@ "startWorkflowStatus": { "$ref": "#/definitions/v1WorkflowExecutionStatus", "description": "If the action was start_workflow, this field will reflect an\neventually-consistent view of the started workflow's status." + }, + "workflowResult": { + "$ref": "#/definitions/v1WorkflowScheduleActionResult" + }, + "activityResult": { + "$ref": "#/definitions/v1ActivityScheduleActionResult" } } }, @@ -19680,6 +19807,12 @@ "timeSkippingInfo": { "$ref": "#/definitions/v1TimeSkippingInfo", "description": "Experimental.\nInformation about time skipping for this schedule.\nIf the schedule has never enabled time skipping, this will be unset." + }, + "workflowExecutions": { + "$ref": "#/definitions/v1RunningWorkflowExecutions" + }, + "activityExecutions": { + "$ref": "#/definitions/v1RunningActivityExecutions" } } }, @@ -19710,7 +19843,7 @@ }, "workflowType": { "$ref": "#/definitions/v1WorkflowType", - "title": "From action:\nAction is a oneof field, but we need to encode this in JSON and oneof fields don't work\nwell with JSON. If action is start_workflow, this is set:" + "title": "From action:\nLegacy Workflow summary. Populated alongside workflow_info for Workflow\nactions so existing clients can continue to read it:" }, "notes": { "type": "string", @@ -19738,6 +19871,16 @@ "type": "string", "format": "int64", "description": "Size of the schedule's internal state (including payloads) in bytes." + }, + "workflowInfo": { + "$ref": "#/definitions/v1WorkflowScheduleActionInfo" + }, + "activityInfo": { + "$ref": "#/definitions/v1ActivityScheduleActionInfo" + }, + "reducedListVisibility": { + "type": "boolean", + "description": "If true, runtime fields are unavailable, not zero/false. In particular,\npaused=false must not be interpreted as an unpaused Schedule. Configuration\nand the action summary remain indexed; Describe returns current runtime state." } }, "description": "ScheduleListInfo is an abbreviated set of values from Schedule and ScheduleInfo\nthat's returned in ListSchedules." @@ -19754,7 +19897,7 @@ "SCHEDULE_OVERLAP_POLICY_ALLOW_ALL" ], "default": "SCHEDULE_OVERLAP_POLICY_UNSPECIFIED", - "description": "ScheduleOverlapPolicy controls what happens when a workflow would be started\nby a schedule, and is already running.\n\n - SCHEDULE_OVERLAP_POLICY_SKIP: SCHEDULE_OVERLAP_POLICY_SKIP (default) means don't start anything. When the\nworkflow completes, the next scheduled event after that time will be considered.\n - SCHEDULE_OVERLAP_POLICY_BUFFER_ONE: SCHEDULE_OVERLAP_POLICY_BUFFER_ONE means start the workflow again soon as the\ncurrent one completes, but only buffer one start in this way. If another start is\nsupposed to happen when the workflow is running, and one is already buffered, then\nonly the first one will be started after the running workflow finishes.\n - SCHEDULE_OVERLAP_POLICY_BUFFER_ALL: SCHEDULE_OVERLAP_POLICY_BUFFER_ALL means buffer up any number of starts to all\nhappen sequentially, immediately after the running workflow completes.\n - SCHEDULE_OVERLAP_POLICY_CANCEL_OTHER: SCHEDULE_OVERLAP_POLICY_CANCEL_OTHER means that if there is another workflow\nrunning, cancel it, and start the new one after the old one completes cancellation.\n - SCHEDULE_OVERLAP_POLICY_TERMINATE_OTHER: SCHEDULE_OVERLAP_POLICY_TERMINATE_OTHER means that if there is another workflow\nrunning, terminate it and start the new one immediately.\n - SCHEDULE_OVERLAP_POLICY_ALLOW_ALL: SCHEDULE_OVERLAP_POLICY_ALLOW_ALL means start any number of concurrent workflows.\nNote that with this policy, last completion result and last failure will not be\navailable since workflows are not sequential." + "description": "ScheduleOverlapPolicy controls what happens when an execution would be started\nby a schedule, and is already running.\n\n - SCHEDULE_OVERLAP_POLICY_SKIP: SCHEDULE_OVERLAP_POLICY_SKIP (default) means don't start anything. When the\nexecution completes, the next scheduled event after that time will be considered.\n - SCHEDULE_OVERLAP_POLICY_BUFFER_ONE: SCHEDULE_OVERLAP_POLICY_BUFFER_ONE means start another execution as soon as the\ncurrent one completes, but only buffer one start in this way. If another start is\nsupposed to happen when the execution is running, and one is already buffered, then\nonly the first one will be started after the running execution finishes.\n - SCHEDULE_OVERLAP_POLICY_BUFFER_ALL: SCHEDULE_OVERLAP_POLICY_BUFFER_ALL means buffer up any number of starts to all\nhappen sequentially, immediately after the running execution completes.\n - SCHEDULE_OVERLAP_POLICY_CANCEL_OTHER: SCHEDULE_OVERLAP_POLICY_CANCEL_OTHER means that if there is another execution\nrunning, request cancellation and start the new one after the old execution closes.\n - SCHEDULE_OVERLAP_POLICY_TERMINATE_OTHER: SCHEDULE_OVERLAP_POLICY_TERMINATE_OTHER means that if there is another execution\nrunning, request termination and start the new one after observing its closure.\n - SCHEDULE_OVERLAP_POLICY_ALLOW_ALL: SCHEDULE_OVERLAP_POLICY_ALLOW_ALL means start any number of concurrent executions.\nNote that with this policy, last completion result and last failure will not be\navailable since executions are not sequential." }, "v1SchedulePatch": { "type": "object", @@ -19797,13 +19940,18 @@ }, "pauseOnFailure": { "type": "boolean", - "description": "If true, and a workflow run fails or times out, turn on \"paused\".\nThis applies after retry policies: the full chain of retries must fail to\ntrigger a pause here." + "description": "If true, and a started execution fails or times out, turn on \"paused\".\nThis applies after retry policies: the execution must reach a terminal\nfailure or timeout to trigger a pause. Cancellation and termination do not\nthemselves trigger a pause; pausing does not stop executions already running." }, "keepOriginalWorkflowId": { "type": "boolean", - "description": "If true, and the action would start a workflow, a timestamp will not be\nappended to the scheduled workflow id." + "description": "If true, and the action would start a workflow, a timestamp will not be\nappended to the scheduled workflow id.\nNot supported for Activity actions, whose IDs differ between invocations." + }, + "reducedListVisibility": { + "type": "boolean", + "description": "If true, index only Schedule configuration in List views, omitting runtime\nstate such as recent actions, future action times, pause state, and notes.\nDescribe continues to return current runtime state. Default false preserves\nexisting visibility behavior. The field set and rollout remain under review." } - } + }, + "description": "Shared Schedule policies for Workflow and Activity actions." }, "v1ScheduleSpec": { "type": "object", @@ -20869,7 +21017,7 @@ "scheduledTime": { "type": "string", "format": "date-time", - "description": "Timestamp used for the identity of the target workflow.\nIf not set the default value is the current time." + "description": "Timestamp used for the identity of the target execution.\nIf not set the default value is the current time." } } }, @@ -22727,6 +22875,27 @@ } } }, + "v1WorkflowScheduleActionInfo": { + "type": "object", + "properties": { + "workflowType": { + "$ref": "#/definitions/v1WorkflowType" + } + }, + "description": "Configuration summary of a Workflow action in Schedule List views." + }, + "v1WorkflowScheduleActionResult": { + "type": "object", + "properties": { + "execution": { + "$ref": "#/definitions/v1WorkflowExecution" + }, + "status": { + "$ref": "#/definitions/v1WorkflowExecutionStatus" + } + }, + "description": "Execution reference and recorded status of a scheduled Workflow." + }, "v1WorkflowTaskCompletedEventAttributes": { "type": "object", "properties": { diff --git a/openapi/openapiv3.yaml b/openapi/openapiv3.yaml index 6c8a7fbe5..def1314b5 100644 --- a/openapi/openapiv3.yaml +++ b/openapi/openapiv3.yaml @@ -9730,6 +9730,14 @@ paths: $ref: '#/components/schemas/Status' components: schemas: + ActivityExecution: + type: object + properties: + activityId: + type: string + runId: + type: string + description: Identifies a specific standalone activity execution within a namespace. ActivityExecutionInfo: type: object properties: @@ -10138,6 +10146,33 @@ components: description: |- If set, update the retry policy of the activity, replacing it with the specified one. The number of attempts at the activity is preserved. + ActivityScheduleActionInfo: + type: object + properties: + activityType: + $ref: '#/components/schemas/ActivityType' + description: Configuration summary of an Activity action in Schedule List views. + ActivityScheduleActionResult: + type: object + properties: + execution: + $ref: '#/components/schemas/ActivityExecution' + status: + enum: + - ACTIVITY_EXECUTION_STATUS_UNSPECIFIED + - ACTIVITY_EXECUTION_STATUS_RUNNING + - ACTIVITY_EXECUTION_STATUS_COMPLETED + - ACTIVITY_EXECUTION_STATUS_FAILED + - ACTIVITY_EXECUTION_STATUS_CANCELED + - ACTIVITY_EXECUTION_STATUS_TERMINATED + - ACTIVITY_EXECUTION_STATUS_TIMED_OUT + - ACTIVITY_EXECUTION_STATUS_PAUSED + type: string + format: enum + description: |- + Execution reference and recorded status of a scheduled standalone Activity. + A failed retry attempt does not mark the execution failed; terminal status is + recorded after the execution finishes, including retries. Status may lag. ActivityTaskCancelRequestedEventAttributes: type: object properties: @@ -13740,6 +13775,81 @@ components: - REPLICATION_STATE_HANDOVER type: string format: enum + NewActivityExecutionInfo: + type: object + properties: + activityId: + type: string + description: |- + Identifier for this activity. Required. This identifier should be meaningful in the user's + own system. For schedules, the scheduler generates a different Activity ID for each + invocation from this value. Retries of one execution retain its Activity ID. + activityType: + allOf: + - $ref: '#/components/schemas/ActivityType' + description: The type of the activity, a string that corresponds to a registered activity on a worker. + taskQueue: + allOf: + - $ref: '#/components/schemas/TaskQueue' + description: Task queue to schedule this activity on. + scheduleToCloseTimeout: + pattern: ^-?(?:0|[1-9][0-9]{0,11})(?:\.[0-9]{1,9})?s$ + type: string + description: |- + Indicates how long the caller is willing to wait for an activity completion. Limits how long + retries will be attempted. Either this or `start_to_close_timeout` must be specified. + (-- api-linter: core::0140::prepositions=disabled + aip.dev/not-precedent: "to" is used to indicate interval. --) + scheduleToStartTimeout: + pattern: ^-?(?:0|[1-9][0-9]{0,11})(?:\.[0-9]{1,9})?s$ + type: string + description: |- + Limits time an activity task can stay in a task queue before a worker picks it up. This + timeout is always non retryable, as all a retry would achieve is to put it back into the same + queue. Defaults to `schedule_to_close_timeout` if not specified. + (-- api-linter: core::0140::prepositions=disabled + aip.dev/not-precedent: "to" is used to indicate interval. --) + startToCloseTimeout: + pattern: ^-?(?:0|[1-9][0-9]{0,11})(?:\.[0-9]{1,9})?s$ + type: string + description: |- + Maximum time an activity is allowed to execute after being picked up by a worker. This + timeout is always retryable. Either this or `schedule_to_close_timeout` must be + specified. + (-- api-linter: core::0140::prepositions=disabled + aip.dev/not-precedent: "to" is used to indicate interval. --) + heartbeatTimeout: + pattern: ^-?(?:0|[1-9][0-9]{0,11})(?:\.[0-9]{1,9})?s$ + type: string + description: Maximum permitted time between successful worker heartbeats. + retryPolicy: + allOf: + - $ref: '#/components/schemas/RetryPolicy' + description: The retry policy for the activity. Will never exceed `schedule_to_close_timeout`. + input: + allOf: + - $ref: '#/components/schemas/Payloads' + description: Serialized arguments to the activity. These are passed as arguments to the activity function. + searchAttributes: + allOf: + - $ref: '#/components/schemas/SearchAttributes' + description: Search attributes for indexing. + header: + allOf: + - $ref: '#/components/schemas/Header' + description: Header for context propagation and tracing purposes. + userMetadata: + allOf: + - $ref: '#/components/schemas/UserMetadata' + description: Metadata for use by user interfaces to display the fixed as-of-start summary and details of the activity. + priority: + allOf: + - $ref: '#/components/schemas/Priority' + description: Priority metadata. + description: |- + Options for starting a standalone activity from a Schedule. + The scheduler supplies namespace, request identity, completion callbacks, start timing, + and ID reuse/conflict policies. Previous invocation results/failures are not inputs. NewWorkflowExecutionInfo: type: object properties: @@ -16410,6 +16520,22 @@ components: description: |- Monotonically increasing value which is incremented on every mutation to any field of this message to achieve eventual consistency between task queues and their partitions. + RunningActivityExecutions: + type: object + properties: + executions: + type: array + items: + $ref: '#/components/schemas/ActivityExecution' + description: Running standalone Activity executions started by a Schedule. + RunningWorkflowExecutions: + type: object + properties: + executions: + type: array + items: + $ref: '#/components/schemas/WorkflowExecution' + description: Running Workflow executions started by a Schedule. Schedule: type: object properties: @@ -16433,6 +16559,12 @@ components: - cron_schedule The workflow id of the started workflow may not match this exactly, it may have a timestamp appended for uniqueness. + startActivity: + allOf: + - $ref: '#/components/schemas/NewActivityExecutionInfo' + description: |- + Start a standalone Activity. The scheduler generates a distinct Activity + ID per invocation and manages retry identity and completion tracking. ScheduleActionResult: type: object properties: @@ -16464,6 +16596,10 @@ components: If the action was start_workflow, this field will reflect an eventually-consistent view of the started workflow's status. format: enum + workflowResult: + $ref: '#/components/schemas/WorkflowScheduleActionResult' + activityResult: + $ref: '#/components/schemas/ActivityScheduleActionResult' ScheduleInfo: type: object properties: @@ -16526,6 +16662,10 @@ components: Experimental. Information about time skipping for this schedule. If the schedule has never enabled time skipping, this will be unset. + workflowExecutions: + $ref: '#/components/schemas/RunningWorkflowExecutions' + activityExecutions: + $ref: '#/components/schemas/RunningActivityExecutions' ScheduleListEntry: type: object properties: @@ -16552,8 +16692,8 @@ components: - $ref: '#/components/schemas/WorkflowType' description: |- From action: - Action is a oneof field, but we need to encode this in JSON and oneof fields don't work - well with JSON. If action is start_workflow, this is set: + Legacy Workflow summary. Populated alongside workflow_info for Workflow + actions so existing clients can continue to read it: notes: type: string description: 'From state:' @@ -16572,6 +16712,16 @@ components: stateSizeBytes: type: string description: Size of the schedule's internal state (including payloads) in bytes. + workflowInfo: + $ref: '#/components/schemas/WorkflowScheduleActionInfo' + activityInfo: + $ref: '#/components/schemas/ActivityScheduleActionInfo' + reducedListVisibility: + type: boolean + description: |- + If true, runtime fields are unavailable, not zero/false. In particular, + paused=false must not be interpreted as an unpaused Schedule. Configuration + and the action summary remain indexed; Describe returns current runtime state. description: |- ScheduleListInfo is an abbreviated set of values from Schedule and ScheduleInfo that's returned in ListSchedules. @@ -16635,14 +16785,24 @@ components: pauseOnFailure: type: boolean description: |- - If true, and a workflow run fails or times out, turn on "paused". - This applies after retry policies: the full chain of retries must fail to - trigger a pause here. + If true, and a started execution fails or times out, turn on "paused". + This applies after retry policies: the execution must reach a terminal + failure or timeout to trigger a pause. Cancellation and termination do not + themselves trigger a pause; pausing does not stop executions already running. keepOriginalWorkflowId: type: boolean description: |- If true, and the action would start a workflow, a timestamp will not be appended to the scheduled workflow id. + Not supported for Activity actions, whose IDs differ between invocations. + reducedListVisibility: + type: boolean + description: |- + If true, index only Schedule configuration in List views, omitting runtime + state such as recent actions, future action times, pause state, and notes. + Describe continues to return current runtime state. Default false preserves + existing visibility behavior. The field set and rollout remain under review. + description: Shared Schedule policies for Workflow and Activity actions. ScheduleSpec: type: object properties: @@ -18615,7 +18775,7 @@ components: scheduledTime: type: string description: |- - Timestamp used for the identity of the target workflow. + Timestamp used for the identity of the target execution. If not set the default value is the current time. format: date-time TriggerWorkflowRuleRequest: @@ -21437,6 +21597,31 @@ components: * BETWEEN ... AND STARTS_WITH description: Activity trigger will be triggered when an activity is about to start. + WorkflowScheduleActionInfo: + type: object + properties: + workflowType: + $ref: '#/components/schemas/WorkflowType' + description: Configuration summary of a Workflow action in Schedule List views. + WorkflowScheduleActionResult: + type: object + properties: + execution: + $ref: '#/components/schemas/WorkflowExecution' + status: + enum: + - WORKFLOW_EXECUTION_STATUS_UNSPECIFIED + - WORKFLOW_EXECUTION_STATUS_RUNNING + - WORKFLOW_EXECUTION_STATUS_COMPLETED + - WORKFLOW_EXECUTION_STATUS_FAILED + - WORKFLOW_EXECUTION_STATUS_CANCELED + - WORKFLOW_EXECUTION_STATUS_TERMINATED + - WORKFLOW_EXECUTION_STATUS_CONTINUED_AS_NEW + - WORKFLOW_EXECUTION_STATUS_TIMED_OUT + - WORKFLOW_EXECUTION_STATUS_PAUSED + type: string + format: enum + description: Execution reference and recorded status of a scheduled Workflow. WorkflowTaskCompletedEventAttributes: type: object properties: diff --git a/temporal/api/activity/v1/message.proto b/temporal/api/activity/v1/message.proto index 077ceba99..e543fb6a9 100644 --- a/temporal/api/activity/v1/message.proto +++ b/temporal/api/activity/v1/message.proto @@ -272,3 +272,60 @@ message CallbackInfo { // Common callback info. temporal.api.callback.v1.CallbackInfo info = 2; } + +// Options for starting a standalone activity from a Schedule. +// The scheduler supplies namespace, request identity, completion callbacks, start timing, +// and ID reuse/conflict policies. Previous invocation results/failures are not inputs. +message NewActivityExecutionInfo { + // Identifier for this activity. Required. This identifier should be meaningful in the user's + // own system. For schedules, the scheduler generates a different Activity ID for each + // invocation from this value. Retries of one execution retain its Activity ID. + string activity_id = 1; + + // The type of the activity, a string that corresponds to a registered activity on a worker. + temporal.api.common.v1.ActivityType activity_type = 2; + + // Task queue to schedule this activity on. + temporal.api.taskqueue.v1.TaskQueue task_queue = 3; + + // Indicates how long the caller is willing to wait for an activity completion. Limits how long + // retries will be attempted. Either this or `start_to_close_timeout` must be specified. + // (-- api-linter: core::0140::prepositions=disabled + // aip.dev/not-precedent: "to" is used to indicate interval. --) + google.protobuf.Duration schedule_to_close_timeout = 4; + + // Limits time an activity task can stay in a task queue before a worker picks it up. This + // timeout is always non retryable, as all a retry would achieve is to put it back into the same + // queue. Defaults to `schedule_to_close_timeout` if not specified. + // (-- api-linter: core::0140::prepositions=disabled + // aip.dev/not-precedent: "to" is used to indicate interval. --) + google.protobuf.Duration schedule_to_start_timeout = 5; + + // Maximum time an activity is allowed to execute after being picked up by a worker. This + // timeout is always retryable. Either this or `schedule_to_close_timeout` must be + // specified. + // (-- api-linter: core::0140::prepositions=disabled + // aip.dev/not-precedent: "to" is used to indicate interval. --) + google.protobuf.Duration start_to_close_timeout = 6; + + // Maximum permitted time between successful worker heartbeats. + google.protobuf.Duration heartbeat_timeout = 7; + + // The retry policy for the activity. Will never exceed `schedule_to_close_timeout`. + temporal.api.common.v1.RetryPolicy retry_policy = 8; + + // Serialized arguments to the activity. These are passed as arguments to the activity function. + temporal.api.common.v1.Payloads input = 9; + + // Search attributes for indexing. + temporal.api.common.v1.SearchAttributes search_attributes = 10; + + // Header for context propagation and tracing purposes. + temporal.api.common.v1.Header header = 11; + + // Metadata for use by user interfaces to display the fixed as-of-start summary and details of the activity. + temporal.api.sdk.v1.UserMetadata user_metadata = 12; + + // Priority metadata. + temporal.api.common.v1.Priority priority = 13; +} diff --git a/temporal/api/common/v1/message.proto b/temporal/api/common/v1/message.proto index cc23e2faf..7c681bfa3 100644 --- a/temporal/api/common/v1/message.proto +++ b/temporal/api/common/v1/message.proto @@ -68,6 +68,12 @@ message WorkflowExecution { string run_id = 2; } +// Identifies a specific standalone activity execution within a namespace. +message ActivityExecution { + string activity_id = 1; + string run_id = 2; +} + // Identifies a specific execution within a namespace. message Execution { temporal.api.enums.v1.ExecutionType type = 1; diff --git a/temporal/api/enums/v1/schedule.proto b/temporal/api/enums/v1/schedule.proto index 27e0f4e98..b9bebe131 100644 --- a/temporal/api/enums/v1/schedule.proto +++ b/temporal/api/enums/v1/schedule.proto @@ -10,29 +10,29 @@ option ruby_package = "Temporalio::Api::Enums::V1"; option csharp_namespace = "Temporalio.Api.Enums.V1"; -// ScheduleOverlapPolicy controls what happens when a workflow would be started +// ScheduleOverlapPolicy controls what happens when an execution would be started // by a schedule, and is already running. enum ScheduleOverlapPolicy { SCHEDULE_OVERLAP_POLICY_UNSPECIFIED = 0; // SCHEDULE_OVERLAP_POLICY_SKIP (default) means don't start anything. When the - // workflow completes, the next scheduled event after that time will be considered. + // execution completes, the next scheduled event after that time will be considered. SCHEDULE_OVERLAP_POLICY_SKIP = 1; - // SCHEDULE_OVERLAP_POLICY_BUFFER_ONE means start the workflow again soon as the + // SCHEDULE_OVERLAP_POLICY_BUFFER_ONE means start another execution as soon as the // current one completes, but only buffer one start in this way. If another start is - // supposed to happen when the workflow is running, and one is already buffered, then - // only the first one will be started after the running workflow finishes. + // supposed to happen when the execution is running, and one is already buffered, then + // only the first one will be started after the running execution finishes. SCHEDULE_OVERLAP_POLICY_BUFFER_ONE = 2; // SCHEDULE_OVERLAP_POLICY_BUFFER_ALL means buffer up any number of starts to all - // happen sequentially, immediately after the running workflow completes. + // happen sequentially, immediately after the running execution completes. SCHEDULE_OVERLAP_POLICY_BUFFER_ALL = 3; - // SCHEDULE_OVERLAP_POLICY_CANCEL_OTHER means that if there is another workflow - // running, cancel it, and start the new one after the old one completes cancellation. + // SCHEDULE_OVERLAP_POLICY_CANCEL_OTHER means that if there is another execution + // running, request cancellation and start the new one after the old execution closes. SCHEDULE_OVERLAP_POLICY_CANCEL_OTHER = 4; - // SCHEDULE_OVERLAP_POLICY_TERMINATE_OTHER means that if there is another workflow - // running, terminate it and start the new one immediately. + // SCHEDULE_OVERLAP_POLICY_TERMINATE_OTHER means that if there is another execution + // running, request termination and start the new one after observing its closure. SCHEDULE_OVERLAP_POLICY_TERMINATE_OTHER = 5; - // SCHEDULE_OVERLAP_POLICY_ALLOW_ALL means start any number of concurrent workflows. + // SCHEDULE_OVERLAP_POLICY_ALLOW_ALL means start any number of concurrent executions. // Note that with this policy, last completion result and last failure will not be - // available since workflows are not sequential. + // available since executions are not sequential. SCHEDULE_OVERLAP_POLICY_ALLOW_ALL = 6; } diff --git a/temporal/api/schedule/v1/message.proto b/temporal/api/schedule/v1/message.proto index 914764ede..f66424d6c 100644 --- a/temporal/api/schedule/v1/message.proto +++ b/temporal/api/schedule/v1/message.proto @@ -17,7 +17,9 @@ option csharp_namespace = "Temporalio.Api.Schedule.V1"; import "google/protobuf/duration.proto"; import "google/protobuf/timestamp.proto"; +import "temporal/api/activity/v1/message.proto"; import "temporal/api/common/v1/message.proto"; +import "temporal/api/enums/v1/activity.proto"; import "temporal/api/enums/v1/schedule.proto"; import "temporal/api/enums/v1/workflow.proto"; import "temporal/api/workflow/v1/message.proto"; @@ -205,6 +207,7 @@ message ScheduleSpec { bytes timezone_data = 11; } +// Shared Schedule policies for Workflow and Activity actions. message SchedulePolicies { // Policy for overlaps. // Note that this can be changed after a schedule has taken some actions, @@ -219,14 +222,22 @@ message SchedulePolicies { // This value defaults to one year, and can't be less than 10 seconds. google.protobuf.Duration catchup_window = 2; - // If true, and a workflow run fails or times out, turn on "paused". - // This applies after retry policies: the full chain of retries must fail to - // trigger a pause here. + // If true, and a started execution fails or times out, turn on "paused". + // This applies after retry policies: the execution must reach a terminal + // failure or timeout to trigger a pause. Cancellation and termination do not + // themselves trigger a pause; pausing does not stop executions already running. bool pause_on_failure = 3; // If true, and the action would start a workflow, a timestamp will not be // appended to the scheduled workflow id. + // Not supported for Activity actions, whose IDs differ between invocations. bool keep_original_workflow_id = 4; + + // If true, index only Schedule configuration in List views, omitting runtime + // state such as recent actions, future action times, pause state, and notes. + // Describe continues to return current runtime state. Default false preserves + // existing visibility behavior. The field set and rollout remain under review. + bool reduced_list_visibility = 7; } message ScheduleAction { @@ -237,6 +248,10 @@ message ScheduleAction { // The workflow id of the started workflow may not match this exactly, // it may have a timestamp appended for uniqueness. temporal.api.workflow.v1.NewWorkflowExecutionInfo start_workflow = 1; + + // Start a standalone Activity. The scheduler generates a distinct Activity + // ID per invocation and manages retry identity and completion tracking. + temporal.api.activity.v1.NewActivityExecutionInfo start_activity = 2; } } @@ -253,6 +268,27 @@ message ScheduleActionResult { // If the action was start_workflow, this field will reflect an // eventually-consistent view of the started workflow's status. temporal.api.enums.v1.WorkflowExecutionStatus start_workflow_status = 12; + + // Typed execution result. Workflow results also populate the legacy Workflow + // fields above for older clients. The typed layout is a draft proposal. + oneof result { + WorkflowScheduleActionResult workflow_result = 13; + ActivityScheduleActionResult activity_result = 14; + } +} + +// Execution reference and recorded status of a scheduled Workflow. +message WorkflowScheduleActionResult { + temporal.api.common.v1.WorkflowExecution execution = 1; + temporal.api.enums.v1.WorkflowExecutionStatus status = 2; +} + +// Execution reference and recorded status of a scheduled standalone Activity. +// A failed retry attempt does not mark the execution failed; terminal status is +// recorded after the execution finishes, including retries. Status may lag. +message ActivityScheduleActionResult { + temporal.api.common.v1.ActivityExecution execution = 1; + temporal.api.enums.v1.ActivityExecutionStatus status = 2; } message ScheduleState { @@ -279,7 +315,7 @@ message TriggerImmediatelyRequest { // If set, override overlap policy for this one request. temporal.api.enums.v1.ScheduleOverlapPolicy overlap_policy = 1; - // Timestamp used for the identity of the target workflow. + // Timestamp used for the identity of the target execution. // If not set the default value is the current time. google.protobuf.Timestamp scheduled_time = 2; } @@ -362,6 +398,23 @@ message ScheduleInfo { // Information about time skipping for this schedule. // If the schedule has never enabled time skipping, this will be unset. temporal.api.common.v1.TimeSkippingInfo time_skipping_info = 13; + + // Typed running-execution view. Workflow actions also populate running_workflows + // for older clients. These references identify the originally started executions. + oneof running_actions { + RunningWorkflowExecutions workflow_executions = 14; + RunningActivityExecutions activity_executions = 15; + } +} + +// Running Workflow executions started by a Schedule. +message RunningWorkflowExecutions { + repeated temporal.api.common.v1.WorkflowExecution executions = 1; +} + +// Running standalone Activity executions started by a Schedule. +message RunningActivityExecutions { + repeated temporal.api.common.v1.ActivityExecution executions = 1; } message Schedule { @@ -379,8 +432,8 @@ message ScheduleListInfo { ScheduleSpec spec = 1; // From action: - // Action is a oneof field, but we need to encode this in JSON and oneof fields don't work - // well with JSON. If action is start_workflow, this is set: + // Legacy Workflow summary. Populated alongside workflow_info for Workflow + // actions so existing clients can continue to read it: temporal.api.common.v1.WorkflowType workflow_type = 2; // From state: @@ -393,6 +446,27 @@ message ScheduleListInfo { // Size of the schedule's internal state (including payloads) in bytes. int64 state_size_bytes = 7; + + // Typed action summary. Workflow actions also populate workflow_type above. + oneof action_info { + WorkflowScheduleActionInfo workflow_info = 8; + ActivityScheduleActionInfo activity_info = 9; + } + + // If true, runtime fields are unavailable, not zero/false. In particular, + // paused=false must not be interpreted as an unpaused Schedule. Configuration + // and the action summary remain indexed; Describe returns current runtime state. + bool reduced_list_visibility = 11; +} + +// Configuration summary of a Workflow action in Schedule List views. +message WorkflowScheduleActionInfo { + temporal.api.common.v1.WorkflowType workflow_type = 1; +} + +// Configuration summary of an Activity action in Schedule List views. +message ActivityScheduleActionInfo { + temporal.api.common.v1.ActivityType activity_type = 1; } // ScheduleListEntry is returned by ListSchedules.