From 2b12a76159449e1ae51dc4a1938f32956020e2f0 Mon Sep 17 00:00:00 2001 From: Nasit Sarwar Sony Date: Fri, 5 Jun 2026 16:13:40 -0700 Subject: [PATCH 1/2] Fix schedule create/update dropping priority/fairness flags toScheduleAction() called buildStartOptions() which correctly populated opts.Priority, but the resulting ScheduleWorkflowAction struct did not include the Priority field, silently discarding priority/fairness settings. Changes: - Add Priority: opts.Priority to ScheduleWorkflowAction in toScheduleAction() - Add Priority field to printableSchedule struct - Extract and display Priority in describeResultToPrintable() when action is ScheduleWorkflowAction Fixes #1028 --- internal/temporalcli/commands.schedule.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/internal/temporalcli/commands.schedule.go b/internal/temporalcli/commands.schedule.go index 3a18271bd..1a1fc9fe8 100644 --- a/internal/temporalcli/commands.schedule.go +++ b/internal/temporalcli/commands.schedule.go @@ -18,6 +18,7 @@ import ( schedpb "go.temporal.io/api/schedule/v1" "go.temporal.io/api/workflowservice/v1" "go.temporal.io/sdk/client" + "go.temporal.io/sdk/temporal" ) type printableSchedule struct { @@ -35,6 +36,7 @@ type printableSchedule struct { OverlapPolicy enumspb.ScheduleOverlapPolicy // describe only CatchupWindow string // describe only PauseOnFailure bool // describe only + Priority *temporal.Priority `cli:",cardOmitEmpty"` // describe only // Schedule.State Notes string `cli:",cardOmitEmpty"` Paused bool @@ -74,6 +76,14 @@ func describeResultToPrintable(id string, desc *client.ScheduleDescription) *pri } // Schedule.Action out.Action = desc.Schedule.Action + + // Extract priority from workflow action if present + if workflowAction, ok := desc.Schedule.Action.(*client.ScheduleWorkflowAction); ok { + if workflowAction.Priority != (temporal.Priority{}) { + out.Priority = &workflowAction.Priority + } + } + // Schedule.Spec specToPrintable(out, desc.Schedule.Spec) // Schedule.Policy @@ -273,6 +283,7 @@ func toScheduleAction(sw *SharedWorkflowStartOptions, i *PayloadInputOptions) (c Memo: opts.Memo, StaticSummary: opts.StaticSummary, StaticDetails: opts.StaticDetails, + Priority: opts.Priority, } if action.Args, err = i.buildRawInput(); err != nil { return nil, err From 58bb57406b7daae0b87bc745fa32e9bcfd84b648 Mon Sep 17 00:00:00 2001 From: Nasit Sarwar Sony Date: Mon, 22 Jun 2026 15:39:55 -0700 Subject: [PATCH 2/2] Add functional test for schedule create/describe with priority Verifies that --priority-key flag is correctly passed through to the server when creating a schedule, by asserting the priority field is present in the JSON output of schedule describe. JSON output is used since the SDK's convertScheduleAction does not currently deserialize the Priority field from the server response, so text output cannot verify the round-trip. --- .../temporalcli/commands.schedule_test.go | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/internal/temporalcli/commands.schedule_test.go b/internal/temporalcli/commands.schedule_test.go index d3bf978d9..ecebf50a4 100644 --- a/internal/temporalcli/commands.schedule_test.go +++ b/internal/temporalcli/commands.schedule_test.go @@ -136,6 +136,33 @@ func (s *SharedServerSuite) TestSchedule_Describe() { s.Equal(schedWfId, j.Schedule.Action.StartWorkflow.Id) } +func (s *SharedServerSuite) TestSchedule_Describe_Priority() { + schedId, _, res := s.createSchedule("--interval", "2s", "--priority-key", "1") + s.NoError(res.Err) + + // json — verify priority is sent to server correctly + res = s.Execute( + "schedule", "describe", + "--address", s.Address(), + "-s", schedId, + "-o", "json", + ) + s.NoError(res.Err) + var j struct { + Schedule struct { + Action struct { + StartWorkflow struct { + Priority struct { + PriorityKey int32 `json:"priorityKey"` + } `json:"priority"` + } `json:"startWorkflow"` + } `json:"action"` + } `json:"schedule"` + } + s.NoError(json.Unmarshal(res.Stdout.Bytes(), &j)) + s.Equal(int32(1), j.Schedule.Action.StartWorkflow.Priority.PriorityKey) +} + func (s *SharedServerSuite) TestSchedule_CreateDescribeCalendar() { schedId, _, res := s.createSchedule("--calendar", `{"hour":"2,4","dayOfWeek":"thu,fri"}`) s.NoError(res.Err)