fix(orchestration): Use the step definition max retries on set step failure (#13319)
* fix(orchestration): Use the step definition max retries on set step failure * Create sweet-turkeys-wait.md * allow to force permanent failure * update changeset
This commit is contained in:
committed by
GitHub
parent
cbaa403744
commit
ff152e7ace
@@ -48,6 +48,13 @@ type RegisterStepSuccessOptions<T> = Omit<
|
||||
"transactionId" | "input"
|
||||
>
|
||||
|
||||
type RegisterStepFailureOptions<T> = Omit<
|
||||
WorkflowOrchestratorRunOptions<T>,
|
||||
"transactionId" | "input"
|
||||
> & {
|
||||
forcePermanentFailure?: boolean
|
||||
}
|
||||
|
||||
type IdempotencyKeyParts = {
|
||||
workflowId: string
|
||||
transactionId: string
|
||||
@@ -493,7 +500,7 @@ export class WorkflowOrchestratorService {
|
||||
}: {
|
||||
idempotencyKey: string | IdempotencyKeyParts
|
||||
stepResponse: unknown
|
||||
options?: RegisterStepSuccessOptions<T>
|
||||
options?: RegisterStepFailureOptions<T>
|
||||
}) {
|
||||
const {
|
||||
context,
|
||||
@@ -501,6 +508,7 @@ export class WorkflowOrchestratorService {
|
||||
resultFrom,
|
||||
container,
|
||||
events: eventHandlers,
|
||||
forcePermanentFailure,
|
||||
} = options ?? {}
|
||||
|
||||
let { throwOnError } = options ?? {}
|
||||
@@ -529,6 +537,7 @@ export class WorkflowOrchestratorService {
|
||||
events,
|
||||
response: stepResponse,
|
||||
container: container ?? this.container_,
|
||||
forcePermanentFailure,
|
||||
})
|
||||
|
||||
if (ret.transaction.hasFinished()) {
|
||||
|
||||
@@ -250,7 +250,9 @@ export class WorkflowsModuleService<
|
||||
}: {
|
||||
idempotencyKey: string | object
|
||||
stepResponse: unknown
|
||||
options?: Record<string, any>
|
||||
options?: Record<string, any> & {
|
||||
forcePermanentFailure?: boolean
|
||||
}
|
||||
},
|
||||
@MedusaContext() context: Context = {}
|
||||
) {
|
||||
|
||||
Reference in New Issue
Block a user