temporalio / temporalio/features
[Feature Request] Specify reset point in workflow code
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 32
- Forks
- 28
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 7
Description
Is your feature request related to a problem? Please describe.
Sometimes users want to update the workflow code rolling back some progress. Trivial example:
if patch("patch1") {
sleep(10 days);
} else {
sleep(100 days);
}
This patch is useless as if a workflow is already blocked on 100-day sleep, the patch is always going to return false, and the sleep is not going to be interrupted.
Describe the solution you'd like
Ability to reset workflow to any point by specifying the reset point in the code. Given that in many cases reset point can be reached through different code paths it is practically impossible to find the reset point just looking at a history. It is even less possible if millions of such workflows have to be reset through a batch call.
The strawman API proposal
Code before the change:
sleep(100 days);
Code after the change:
resetScope = reset("resetId");
sleep(10 days);
resetScope.close();
Any workflow that is blocked inside the resetScope (which can be modeled with real scopes and closures as well) will be rolled automatically back to the line just before reset call. After all the workflows executed the rollback the reset code can be removed.
The open question is what causes reset to happen for blocked workflows. It might require an automatically generated batch job that pokes all such blocked workflows after the code deployment.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the proposed reset() and resetScope API in the issue, then examine how blocked workflows and batch calls are expected to interact with deployment. Define what triggers rollback for blocked workflows and what completion means for workflows that reach the reset point, including removal of the reset code afterward.
Written by the indexing model from the issue text.
Assessment
- Domain
- distributed-systems
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100