Skip to content
Open
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
31 changes: 31 additions & 0 deletions temporal/api/activity/v1/message.proto
Original file line number Diff line number Diff line change
Expand Up @@ -219,3 +219,34 @@ message CallbackInfo {
// Common callback info.
temporal.api.callback.v1.CallbackInfo info = 2;
}

// NewActivityExecutionInfo holds config for starting a standalone activity in
// different contexts (e.g., schedule actions). Mirrors NewWorkflowExecutionInfo.
message NewActivityExecutionInfo {
// Identifier for this activity.
string activity_id = 1;
// The type of the activity.
temporal.api.common.v1.ActivityType activity_type = 2;
// Task queue to schedule this activity on.
temporal.api.taskqueue.v1.TaskQueue task_queue = 3;
// Serialized arguments to the activity.
temporal.api.common.v1.Payloads input = 4;
// Total time limit including retries.
google.protobuf.Duration schedule_to_close_timeout = 5;
// Max time waiting in task queue.
google.protobuf.Duration schedule_to_start_timeout = 6;
// Max time for a single attempt.
google.protobuf.Duration start_to_close_timeout = 7;
// Max time between heartbeats.
google.protobuf.Duration heartbeat_timeout = 8;
// Retry policy.
temporal.api.common.v1.RetryPolicy retry_policy = 9;
// Header for context propagation.
temporal.api.common.v1.Header header = 10;
// Search attributes for indexing.
temporal.api.common.v1.SearchAttributes search_attributes = 11;
// User metadata.
temporal.api.sdk.v1.UserMetadata user_metadata = 12;
// Priority metadata.
temporal.api.common.v1.Priority priority = 13;
}
7 changes: 7 additions & 0 deletions temporal/api/common/v1/message.proto
Original file line number Diff line number Diff line change
Expand Up @@ -254,11 +254,18 @@ message Link {
string run_id = 3;
}

// A link to a schedule.
message Schedule {
string namespace = 1;
string schedule_id = 2;
}

oneof variant {
WorkflowEvent workflow_event = 1;
BatchJob batch_job = 2;
Activity activity = 3;
NexusOperation nexus_operation = 4;
Schedule schedule = 5;
}
}

Expand Down
51 changes: 51 additions & 0 deletions temporal/api/schedule/v1/message.proto
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ 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/schedule.proto";
import "temporal/api/enums/v1/workflow.proto";
Expand Down Expand Up @@ -229,6 +230,40 @@ message SchedulePolicies {
bool keep_original_workflow_id = 4;
}

// Terminal status of a scheduled action, independent of the underlying execution
// type. The scheduler maps from source-specific statuses (WorkflowExecutionStatus,
// ActivityExecutionStatus, Nexus completion state) into this enum at the boundary.
enum ScheduleActionStatus {
SCHEDULE_ACTION_STATUS_UNSPECIFIED = 0;
SCHEDULE_ACTION_STATUS_RUNNING = 1;
SCHEDULE_ACTION_STATUS_COMPLETED = 2;
SCHEDULE_ACTION_STATUS_FAILED = 3;
SCHEDULE_ACTION_STATUS_CANCELED = 4;
SCHEDULE_ACTION_STATUS_TERMINATED = 5;
SCHEDULE_ACTION_STATUS_TIMED_OUT = 6;
}

// Identifies the kind of scheduled action.
enum ScheduleActionKind {
SCHEDULE_ACTION_KIND_UNSPECIFIED = 0;
SCHEDULE_ACTION_KIND_WORKFLOW = 1;
SCHEDULE_ACTION_KIND_ACTIVITY = 2;
}

// A uniform reference to a running execution started by a schedule.
message ScheduledExecutionReference {
oneof execution {
temporal.api.common.v1.WorkflowExecution workflow = 1;
ScheduleActivityExecution activity = 2;
}
}

// Identifies a running activity started by a schedule.
message ScheduleActivityExecution {
string activity_id = 1;
string run_id = 2;
}

message ScheduleAction {
oneof action {
// All fields of NewWorkflowExecutionInfo are valid except for:
Expand All @@ -237,6 +272,9 @@ 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;
// All fields of NewActivityExecutionInfo are valid except for activity_id
// (the scheduler generates a unique ID per run).
temporal.api.activity.v1.NewActivityExecutionInfo start_activity = 2;
}
}

Expand All @@ -253,6 +291,12 @@ 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;

// Generic fields for activities, nexus ops, and future primitives:
ScheduledExecutionReference start_execution_result = 21;
ScheduleActionStatus start_execution_status = 22;
// Link returned by Start{Workflow,Activity}ExecutionResponse.
temporal.api.common.v1.Link start_execution_link = 23;
}

message ScheduleState {
Expand Down Expand Up @@ -337,6 +381,9 @@ message ScheduleInfo {
// or were reset, they might still be running but with a different run_id.
repeated temporal.api.common.v1.WorkflowExecution running_workflows = 9;

// Running executions for non-workflow action types (activities, nexus ops).
repeated ScheduledExecutionReference running_executions = 13;

// Most recent ten actual action times (including manual triggers).
repeated ScheduleActionResult recent_actions = 4;

Expand Down Expand Up @@ -377,6 +424,10 @@ message ScheduleListInfo {
// From info (maybe fewer entries):
repeated ScheduleActionResult recent_actions = 5;
repeated google.protobuf.Timestamp future_action_times = 6;

// For non-workflow actions:
string action_type_name = 10;
ScheduleActionKind action_kind = 11;
}

// ScheduleListEntry is returned by ListSchedules.
Expand Down
Loading