fix(workflow-sdk): Async/nested runAsStep propagation (#12675)

FIXES CLO-524

**What**
Add hidden stepDefinition object as part of the step argument and ensure the runAsStep handlers rely on the latest definition when config is being used on the returned step in order to ensure async configuration propagation and nested configuration
This commit is contained in:
Adrien de Peretti
2025-06-10 09:23:12 +02:00
committed by GitHub
parent b456044060
commit 1a78476608
10 changed files with 210 additions and 23 deletions

View File

@@ -268,8 +268,12 @@ export class WorkflowOrchestratorService {
await this.triggerParentStep(ret.transaction, result)
}
if (throwOnError && ret.thrownError) {
throw ret.thrownError
if (throwOnError && (ret.thrownError || ret.errors?.length)) {
if (ret.thrownError) {
throw ret.thrownError
}
throw ret.errors[0].error
}
return { acknowledgement, ...ret }
@@ -373,8 +377,12 @@ export class WorkflowOrchestratorService {
await this.triggerParentStep(ret.transaction, result)
}
if (throwOnError && ret.thrownError) {
throw ret.thrownError
if (throwOnError && (ret.thrownError || ret.errors?.length)) {
if (ret.thrownError) {
throw ret.thrownError
}
throw ret.errors[0].error
}
return { acknowledgement, ...ret }
@@ -467,8 +475,12 @@ export class WorkflowOrchestratorService {
await this.triggerParentStep(ret.transaction, result)
}
if (throwOnError && ret.thrownError) {
throw ret.thrownError
if (throwOnError && (ret.thrownError || ret.errors?.length)) {
if (ret.thrownError) {
throw ret.thrownError
}
throw ret.errors[0].error
}
return ret
@@ -534,8 +546,12 @@ export class WorkflowOrchestratorService {
await this.triggerParentStep(ret.transaction, result)
}
if (throwOnError && ret.thrownError) {
throw ret.thrownError
if (throwOnError && (ret.thrownError || ret.errors?.length)) {
if (ret.thrownError) {
throw ret.thrownError
}
throw ret.errors[0].error
}
return ret