Skip to content

Conversation

@chaptersix
Copy link
Contributor

@chaptersix chaptersix commented Jan 16, 2026

What changed?

Added bidirectional migration logic to convert scheduler state between V1 (legacy workflow-based) and V2 (CHASM component-based) architectures.

Key changes:

  • LegacyToCHASM() and CHASMToLegacy() conversion functions in chasm/lib/scheduler/migration/
  • Adapted to PR [Scheduler] Unify RunningWorkflows, RecentActions, BufferedStarts #8980: RunningWorkflows and RecentActions now unified into BufferedStarts structure
  • V1→V2 converts RunningWorkflows/RecentActions into BufferedStarts with RunId/Completed fields
  • V2→V1 extracts RunningWorkflows/RecentActions from BufferedStarts based on workflow state
  • Centralized ID generation functions in common/schedules/ package for use across legacy, CHASM, and migration code

Add bi-directional migration between legacy (workflow-powered) and CHASM
scheduler states. This core migration logic will be used by automatic
migration and manual tooling.

- Create chasm/lib/scheduler/migration package with LegacyToCHASM and
  CHASMToLegacy conversion functions
- Create common/scheduler package for shared ID generation (following
  the common/nexus pattern)
- Handle BufferedStart field population/dropping between versions
- Preserve backfill progress during migration
- Convert LastCompletionResult between Payloads (legacy) and Payload (CHASM)
…edStarts unification

- Add LegacyToCHASM and CHASMToLegacy conversion functions
- Adapt to PR temporalio#8980: RunningWorkflows/RecentActions now stored in BufferedStarts
- V1→V2: Convert RunningWorkflows/RecentActions to BufferedStarts with RunId/Completed fields
- V2→V1: Extract RunningWorkflows/RecentActions from BufferedStarts
- Centralize ID generation in common/schedules package (GenerateBackfillerID)
- Preserve all state: spec, metadata, execution history, active workflows, backfills
- Handle direction-specific transformations for buffered starts and backfill progress
- Comprehensive test coverage for state preservation and round-trips
@chaptersix chaptersix marked this pull request as ready for review January 16, 2026 20:48
@chaptersix chaptersix requested review from a team as code owners January 16, 2026 20:48
@chaptersix chaptersix changed the title Scheduler Migration Logic Schedules: Stack Converters Jan 16, 2026
@chaptersix chaptersix changed the title Schedules: Stack Converters implement scheduler state converters for V1/V2 Jan 16, 2026
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.

1 participant