@@ -316,26 +316,18 @@ type ScheduledWorkflowInfo struct {
316316func (c * dbosContext ) listScheduledWorkflows () []ScheduledWorkflowInfo {
317317 var scheduledWorkflows []ScheduledWorkflowInfo
318318
319- // Get all registered workflows first
320- registeredWorkflows := c .listRegisteredWorkflows ()
321-
322- // Create a map of FQN to workflow info for quick lookup
323- workflowMap := make (map [string ]RegisteredWorkflowInfo )
324- for _ , workflow := range registeredWorkflows {
325- workflowMap [workflow .FQN ] = workflow
326- }
327-
328- // Check which ones are scheduled by examining the scheduled workflow registry
329319 c .scheduledWorkflowRegistry .Range (func (key , value interface {}) bool {
330320 workflowFQN := key .(string )
331321 cronSchedule := value .(string )
332322
333- // Find the corresponding workflow info
334- if workflow , exists := workflowMap [workflowFQN ]; exists {
323+ // Get the workflow info directly from the main registry
324+ if workflowEntryAny , exists := c .workflowRegistry .Load (workflowFQN ); exists {
325+ workflowEntry := workflowEntryAny .(workflowRegistryEntry )
326+
335327 scheduledWorkflows = append (scheduledWorkflows , ScheduledWorkflowInfo {
336- FQN : workflow . FQN ,
337- CustomName : workflow . CustomName ,
338- MaxRetries : workflow . MaxRetries ,
328+ FQN : workflowFQN ,
329+ CustomName : workflowEntry . name ,
330+ MaxRetries : workflowEntry . maxRetries ,
339331 CronSchedule : cronSchedule ,
340332 })
341333 }
0 commit comments