feat: workflow rollback types + Python SDK (withRollback, saga pattern) #5810
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.
Summary
Adds workflow rollback/saga support:
RollbackHandler<T>,RollbackStepConfig,withRollbackmethod,TerminateOptions,rollingBackstatusstep.with_rollback()decorator withundo=,depends=,concurrent=supportTypeScript Types (
types/defines/)Python SDK (
src/pyodide/)API:
step.with_rollback(name, *, undo=None, depends=None, concurrent=False, config=None, undo_config=None)ValueErrorif missing)depends=andconcurrent=Changed Files
types/defines/rpc.d.ts- rollback typestypes/defines/workflows.d.ts- TerminateOptions, rollingBack statussrc/pyodide/internal/workers-api/src/workers/_workers.py- RollbackStep classsrc/pyodide/internal/workers-api/src/workers/__init__.py- exportssrc/workerd/server/tests/python/workflow-rollback/- testsSnapshot Regeneration Needed
Type snapshots need regeneration (
just generate-typessegfaults on macOS).Note
This PR consolidates #5809 (Python SDK) and was written with AI assistance.