-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(workflows-sdk): Configurable retries upon step creation (#5728)
**What** - Allow to create step that can be configured to have a max retry - Step end retry mechanism on permanent failure Also added an API to override a step configuration from within the createWorkflow ```ts const step = createStep({ name: "step", maxRetries: 3 }, async (_, context) => { return new StepResponse({ output: "output" }) }) const workflow = createWorkflow("workflow", function () { const res = step().config({ maxRetries: 5 }) // This will override the original maxRetries of 3 }) ``` **NOTE** We can maybe find another name than config on the step workflow data to override the step config.
- Loading branch information
Showing
21 changed files
with
255 additions
and
92 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
"@medusajs/orchestration": patch | ||
"@medusajs/utils": patch | ||
"@medusajs/workflows-sdk": patch | ||
--- | ||
|
||
feat(workflows-sdk): Configurable retries upon step creation |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
export class PermanentStepFailureError extends Error { | ||
static isPermanentStepFailureError( | ||
error: Error | ||
): error is PermanentStepFailureError { | ||
return ( | ||
error instanceof PermanentStepFailureError || | ||
error.name === "PermanentStepFailure" | ||
) | ||
} | ||
|
||
constructor(message?: string) { | ||
super(message) | ||
this.name = "PermanentStepFailure" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from "./symbol" |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.