Skip to content

feature-pre-release: new time skipping for workflows and schedules - #1246

Open
feiyang3cat wants to merge 11 commits into
mainfrom
fx/time-skipping-cli
Open

feiyang3cat wants to merge 11 commits into
mainfrom
fx/time-skipping-cli

Conversation

@feiyang3cat

@feiyang3cat feiyang3cat commented Oct 27, 2026 •

Copy link
Copy Markdown
Member

What changed?

  • Added temporal schedule time-skipping enable, disable, and poll.
  • Added temporal workflow time-skipping enable, disable, and poll.
  • Added --enable-time-skipping (for all namespaces) server flag to enable time skipping for both workflows and schedules, and new chasm schedule will also be enabled

Checklist

Stability

  • Breaking changes are marked with 💥 in the PR title and release notes
  • Changes to JSON output (-o json / -o jsonl) are treated as breaking changes

Design

  • This feature does not depend on Cloud-only APIs or behavior (it works against an OSS server)
  • New commands follow temporal <noun> <verb> structure (e.g. temporal workflow start) (similar to temporal workflow update action the commands use temporal workflow time-skipping <verb> and temporal schedule time-skipping <verb>. The final segment is the action.)
  • New flags are named after the API concept, not the implementation mechanism (good: --search-attribute, bad: --index-field)
  • New flags don't duplicate an existing flag that serves the same purpose
  • New flags do not have short aliases without strong justification
  • Experimental features are marked with (Experimental) in commands.yaml

Help text (see style guide at the top of commands.yaml)

  • All flags shown in help text and examples are implemented and functional
  • Summaries use sentence case and have no trailing period
  • Long descriptions end with a period and include at least one example invocation (The two time-skipping group descriptions list related commands without an example invocation. The enable descriptions end with an example code block.)
  • Examples use long flags (--namespace, not -n), one flag per line
  • Placeholder values use YourXxx form (YourWorkflowId, YourNamespace)

Behavior

  • Results go to stdout; errors and warnings go to stderr
  • Error messages are lowercase with no trailing punctuation

Tests

  • Added functional test(s) (SharedServerSuite)
  • Added unit test(s) (func TestXxx) where applicable

Manual Testing

too long, added in comments

@feiyang3cat
feiyang3cat requested a review from a team as a code owner October 27, 2026 19:36
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-30T23:50:36.747403Z 440c1da New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@feiyang3cat

feiyang3cat commented Oct 27, 2026 •

Copy link
Copy Markdown
Member Author

This PR depends on

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ebca3a6d9f

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@feiyang3cat
feiyang3cat force-pushed the fx/time-skipping-cli branch 2 times, most recently from 1dd4c0f to c4691de Compare October 27, 2026 20:04
@feiyang3cat

feiyang3cat commented Oct 27, 2026 •

Copy link
Copy Markdown
Member Author

manual testing

Happy Path: workflow time skipping

(1) build both dev and server with a different name

go build -o /tmp/temporal-vts ./cmd/temporal

(2)Start the local server with Workflow and Schedule time skipping enabled for all Namespaces (terminal 1)

Note: Schedule time skipping requires CHASM Schedules. This flag also enables CHASM creation for new Schedules.

/tmp/temporal-vts server start-dev \
  --namespace timeskipping-test \
  --enable-time-skipping

check webUI: http://localhost:8233/

(3)start your worker (terminal-2)

(4) start workflow first without time skipping (terimnal-3) and check in webUI

/tmp/temporal-vts workflow start \
  --namespace timeskipping-test \
  --workflow-id vts-workflow-1 \
  --type TimerWorkflow \
  --task-queue vts-test-queue

(5) (option-1) start time skipping to run the workflow to completion(terimnal-3) and check in webUI to find time is skipped and workflow runs to completion

/tmp/temporal-vts workflow time-skipping enable \
  --namespace timeskipping-test \
  --workflow-id vts-workflow-1 \

(5)(option-2) start time skipping with a shorter fast-forward if you want your time skipping stop somewhere (terimnal-3) and check in webUI

/tmp/temporal-vts workflow time-skipping enable \
  --namespace timeskipping-test \
  --workflow-id vts-workflow-1 \
  --fast-forward-duration 5h \
  --fast-forward-id manual-wf-ff-1 \

/tmp/temporal-vts workflow time-skipping poll \
  --namespace timeskipping-test \
  --workflow-id vts-workflow-1 \
  --fast-forward-id manual-wf-ff-1

check in details of the event WorkflowExecutionTimeSkippingTransitioned to see 5 hours move forward

{
  "eventId": "7",
  "eventTime": "2026-10-27T20:19:27.266214Z",
  "eventType": "WorkflowExecutionTimeSkippingTransitioned",
  "taskId": "1048603",
  "workerMayIgnore": true,
  "workflowExecutionTimeSkippingTransitionedEventAttributes": {
    "targetTime": "2026-10-28T01:19:27.266156Z",
    "disabledAfterFastForward": true,
    "wallClockTime": "2026-10-27T20:19:27.266214Z"
  },
  "links": [],
  "billableActions": 0
}

Happy Path: schedule time skipping

  1. set up server and worker in the same way

  2. create schedule and check this schedule in UI

    /tmp/temporal-vts schedule create \
      --namespace timeskipping-test \
      --schedule-id vts-schedule-1 \
      --interval 10d \
      --workflow-id vts-scheduled-workflow \
      --type TimerWorkflow \
      --task-queue vts-test-queue
  3. fast-forward 30days, poll the completion of this fast-forward duration, and check in UI

    /tmp/temporal-vts schedule time-skipping enable \
      --namespace timeskipping-test \
      --schedule-id vts-schedule-1 \
      --fast-forward-duration 720h \
      --fast-forward-id manual-schedule-ff-30d
    
    /tmp/temporal-vts schedule time-skipping poll \
      --namespace timeskipping-test \
      --schedule-id vts-schedule-1 \
      --fast-forward-id manual-schedule-ff-30d \
      --timeout 2m
  4. describe schedule to check current virtual time in time skipping field

    /tmp/temporal-vts schedule describe \
      --namespace timeskipping-test \
      --schedule-id vts-schedule-1

Error case

Schedule enable requires a fast-forward duration:

/tmp/temporal-vts schedule time-skipping enable \
    --namespace YourNamespace \
    --schedule-id YourScheduleId
echo $?

Expected error and exit code:

Error: required flag(s) "fast-forward-duration" not set
1

Workflow enable rejects a fast-forward ID without a duration:

/tmp/temporal-vts workflow time-skipping enable \
    --namespace YourNamespace \
    --workflow-id YourWorkflowId \
    --fast-forward-id YourWorkflowFastForwardId
echo $?

Expected error and exit code:

Error: --fast-forward-id requires --fast-forward-duration
1

Composition

Start another Workflow to test a partial fast-forward:

/tmp/temporal-vts workflow start \
    --namespace YourNamespace \
    --workflow-id YourPartialWorkflowId \
    --type TimerWorkflow \
    --task-queue YourTaskQueue

/tmp/temporal-vts workflow time-skipping enable \
    --namespace YourNamespace \
    --workflow-id YourPartialWorkflowId \
    --fast-forward-duration 5h

Copy the generated fast-forward ID from the output and use it as YourFastForwardId:

/tmp/temporal-vts workflow time-skipping poll \
    --namespace YourNamespace \
    --workflow-id YourPartialWorkflowId \
    --fast-forward-id YourFastForwardId

Expected output:

completed

This means the five-hour fast-forward completed. The Workflow’s ten-hour timer should still be pending.

Inspect the effective configuration and fast-forward status:

/tmp/temporal-vts workflow describe \
    --namespace YourNamespace \
    --workflow-id YourPartialWorkflowId

In the Web UI at http://localhost:8233/, select YourNamespace and open YourPartialWorkflowId. Check that the Workflow is still running and inspect its time-skipping transition event.

Disable time skipping and describe again:

/tmp/temporal-vts workflow time-skipping disable \
    --namespace YourNamespace \
    --workflow-id YourPartialWorkflowId

/tmp/temporal-vts workflow describe \
    --namespace YourNamespace \
    --workflow-id YourPartialWorkflowId

Confirm that EffectiveEnabled is false in the Time Skipping section.

For the Schedule created in the happy-path test, inspect its status, then disable time skipping:

/tmp/temporal-vts schedule describe \
    --namespace YourNamespace \
    --schedule-id YourScheduleId

/tmp/temporal-vts schedule time-skipping disable \
    --namespace YourNamespace \
    --schedule-id YourScheduleId

/tmp/temporal-vts schedule describe \
    --namespace YourNamespace \
    --schedule-id YourScheduleId

Confirm that EffectiveEnabled is false in TimeSkippingInfo.

@feiyang3cat feiyang3cat changed the title feat: add Schedule time-skipping CLI commands for-feature-release: add Schedule time-skipping CLI commands Oct 27, 2026
@feiyang3cat feiyang3cat changed the title for-feature-release: add Schedule time-skipping CLI commands Feature-PreRelease: new time skipping for workflows and schedules Oct 27, 2026
@feiyang3cat feiyang3cat changed the title Feature-PreRelease: new time skipping for workflows and schedules feature-prerelease: new time skipping for workflows and schedules Oct 27, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f190d21f0e

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2f14e42094

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@feiyang3cat
feiyang3cat force-pushed the fx/time-skipping-cli branch 2 times, most recently from 0d5818e to cf312a5 Compare October 27, 2026 22:35

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: cf312a5a97

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

StartDelay: opts.StartDelay.Duration(),
Summary: opts.StaticSummary,
Details: opts.StaticDetails,
StaticDetails: opts.StaticDetails,

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

due to SDK version bump

@feiyang3cat
feiyang3cat force-pushed the fx/time-skipping-cli branch 9 times, most recently from faf0adb to 66ce2f0 Compare October 28, 2026 01:27
@feiyang3cat feiyang3cat changed the title feature-prerelease: new time skipping for workflows and schedules feature-pre-release: new time skipping for workflows and schedules Oct 28, 2026
@simvlad

simvlad commented Oct 28, 2026

Copy link
Copy Markdown
Contributor
/tmp/temporal-vts schedule time-skipping poll \
  --namespace timeskipping-test \
  --schedule-id vts-schedule-1 \
  --fast-forward-id manual-schedule-ff-30d \
  --timeout 2m

does this even exists (--timeout option)

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: cfa6772817

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +82 to +86
res, err := timeskipping.PollFastForward(cctx, cl, timeskipping.PollFastForwardOptions{
WorkflowID: c.WorkflowId,
RunID: c.RunId,
FastForwardID: c.FastForwardId,
})

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Bound workflow polling before retrying server timeouts

When a fast-forward remains pending and the caller does not set the global --command-timeout, PollFastForward retries every server-side long-poll timeout against a context with no deadline, so this command can block indefinitely and the poll timed out branch is unreachable. This contradicts the documented behavior in commands.yaml:4629-4630, which says a server timeout is reported so the caller may poll again; either perform a single server poll or give this operation its own bounded context.

Useful? React with 👍 / 👎.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d141452260

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread internal/temporalcli/commands.yaml Resolved

@simvlad simvlad left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

workflow part looks good

@feiyang3cat
feiyang3cat force-pushed the fx/time-skipping-cli branch 7 times, most recently from 3dbfb10 to 53f6787 Compare October 29, 2026 22:25

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 53f6787d7b

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@feiyang3cat
feiyang3cat force-pushed the fx/time-skipping-cli branch 2 times, most recently from 1d1cb30 to 2df0df5 Compare October 30, 2026 05:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants