feat(workflows-*): Allow to re run non idempotent but stored workflow with the same transaction id if considered done (#12362)
This commit is contained in:
committed by
GitHub
parent
97dd520c64
commit
80007f3afd
@@ -30,6 +30,7 @@ export type WorkflowOrchestratorRunOptions<T> = Omit<
|
||||
"container"
|
||||
> & {
|
||||
transactionId?: string
|
||||
runId?: string
|
||||
container?: ContainerLike
|
||||
}
|
||||
|
||||
@@ -38,6 +39,7 @@ export type WorkflowOrchestratorCancelOptions = Omit<
|
||||
"transaction" | "transactionId" | "container"
|
||||
> & {
|
||||
transactionId: string
|
||||
runId?: string
|
||||
container?: ContainerLike
|
||||
}
|
||||
|
||||
@@ -205,7 +207,6 @@ export class WorkflowOrchestratorService {
|
||||
throwOnError ??= true
|
||||
context ??= {}
|
||||
context.transactionId = transactionId ?? ulid()
|
||||
|
||||
const workflowId = isString(workflowIdOrWorkflow)
|
||||
? workflowIdOrWorkflow
|
||||
: workflowIdOrWorkflow.getName()
|
||||
@@ -319,7 +320,7 @@ export class WorkflowOrchestratorService {
|
||||
const transaction = await this.getRunningTransaction(
|
||||
workflowId,
|
||||
transactionId,
|
||||
options
|
||||
{ ...options, isCancelling: true }
|
||||
)
|
||||
if (!transaction) {
|
||||
if (!throwOnError) {
|
||||
|
||||
Reference in New Issue
Block a user