feat: Add cron and workflow execution related fields to visibility#7527
Merged
neil-xie merged 10 commits intocadence-workflow:masterfrom Jan 27, 2026
Merged
feat: Add cron and workflow execution related fields to visibility#7527neil-xie merged 10 commits intocadence-workflow:masterfrom
neil-xie merged 10 commits intocadence-workflow:masterfrom
Conversation
e3eb767 to
8d8720b
Compare
| // Check if the first decision task has been scheduled yet | ||
| // If there's no decision info, the workflow is still pending | ||
| if !hasPending && !hasInFlight && !hasProcessed { | ||
| executionStatus = types.WorkflowExecutionStatusPending |
Member
There was a problem hiding this comment.
is this only true when there's backoff? What about when there's not backoff?
Member
Author
There was a problem hiding this comment.
Yeah, when decision task doesn't exist and there is backoff, we consider it as pending. Without backoff the status is started.
2d49e4d to
a94d046
Compare
Signed-off-by: Neil Xie <neil.xie@uber.com>
Signed-off-by: Neil Xie <neil.xie@uber.com>
Signed-off-by: Neil Xie <neil.xie@uber.com>
…uledExecutionTime This commit adds complete support for three new visibility fields to enable better workflow lifecycle tracking and cron workflow scheduling. Changes: 1. Type Mappers: - Added WorkflowExecutionStatus enum mappers (Thrift and Proto) - Added Ptr(), String(), UnmarshalText(), MarshalText() methods to WorkflowExecutionStatus - Updated WorkflowExecutionInfo mappers to include all three new fields 2. Elasticsearch Support: - Added three fields to VisibilityRecord struct for ES deserialization - Updated convertSearchResultToVisibilityRecord to populate the new fields - This fixes the issue where fields were written but not read from ES 3. Service Layer: - Updated timer active task executor to pass ScheduledExecutionTime - Updated transfer task executor base to include new fields in visibility records The fields are now properly: - Written to Elasticsearch during workflow start, upsert, and close - Read from Elasticsearch when listing workflows - Displayed in CLI output with --print_cron flag - Mapped correctly between Thrift, Proto, and internal types Signed-off-by: Neil Xie <neil.xie@uber.com>
Signed-off-by: Neil Xie <neil.xie@uber.com>
Signed-off-by: Neil Xie <neil.xie@uber.com>
… to helper function Signed-off-by: Neil Xie <neil.xie@uber.com>
a94d046 to
24ecb75
Compare
fimanishi
reviewed
Jan 23, 2026
| Aliases: []string{"psa"}, | ||
| Usage: "Print search attributes", | ||
| }, | ||
| &cli.BoolFlag{ |
Member
There was a problem hiding this comment.
Should we/is it complicated to have it by default?
Member
Author
There was a problem hiding this comment.
I am not sure how useful is it to show CronSchedule for all workflows, maybe we need to implement a filter to automatically hide the column if it is all empty.
I will make this flag more useful, maybe automatically apply isCron when they have this flag and show the cron related fields
fimanishi
approved these changes
Jan 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Detailed Description
Add cronSchedule, executionStatus and scheduleExecutionTime to visibility records, which will be available for list workflow executions.
ExecutionStatus will have pending, started and the close statuses, we populate the actual close status for cron workflows instead of purely displaying continued as new.
ScheduledExecutionTime will calculate the actual execution time for cron workflows, before that it will be in pending status. When it generates the first decision task, the status will be switched to started.
These changes will require a schema upgrade.
ExecutionStatus is available in CLI by default, CronSchedule and ScheduledExecutionTime are optional, will be available using the flag --print_cron
Impact Analysis
Testing Plan
Rollout Plan