feat(orchestration): skip on permanent failure (#12027)

What:
 - Added step config `skipOnPermanentFailure`. Skip all the next steps when the current step fails. If a string is used, the workflow will resume from the given step.
 - Fix `continueOnPermanentFailure` to continue the execution of the flow when a step fails.
 
```ts
createWorkflow("some-workflow", () => {
  errorStep().config({
    skipOnPermanentFailure: true,
  })
  nextStep1() // skipped
  nextStep2() // skipped
})


createWorkflow("some-workflow", () => {
  errorStep().config({
    skipOnPermanentFailure: "resume-from-here",
  });
  nextStep1(); // skipped
  nextStep2(); // skipped
  nextStep3().config({ name: "resume-from-here" }); // executed
  nextStep4(); // executed
});
```
This commit is contained in:
Carlos R. L. Rodrigues
2025-04-17 09:49:58 -03:00
committed by GitHub
parent 1c5e82af51
commit e180253d60
7 changed files with 219 additions and 18 deletions

View File

@@ -74,7 +74,11 @@
* continueOnPermanentFailure:
* type: boolean
* title: continueOnPermanentFailure
* description: Whether the step continues executing even if its status is changed to failed.
* description: Whether the workflow should continue executing even if its status is changed to failed.
* skipOnPermanentFailure:
* type: boolean
* title: skipOnPermanentFailure
* description: Whether the workflow should skip subsequent steps in case of a permanent failure.
* maxRetries:
* type: number
* title: maxRetries
@@ -139,6 +143,5 @@
* type: number
* title: startedAt
* description: The timestamp the step started executing.
*
*/
*
*/