( record: AutonomyRunRecord, rootDir: string, )
| 456 | } |
| 457 | |
| 458 | async function queueManagedFlowStepRunForRecord( |
| 459 | record: AutonomyRunRecord, |
| 460 | rootDir: string, |
| 461 | ): Promise<void> { |
| 462 | if ( |
| 463 | record.parentFlowId && |
| 464 | record.flowStepId && |
| 465 | record.parentFlowSyncMode === 'managed' |
| 466 | ) { |
| 467 | const stepIndex = |
| 468 | ( |
| 469 | await getAutonomyFlowById(record.parentFlowId, rootDir) |
| 470 | )?.stateJson?.steps.findIndex( |
| 471 | step => step.stepId === record.flowStepId, |
| 472 | ) ?? 0 |
| 473 | await queueManagedAutonomyFlowStepRun({ |
| 474 | flowId: record.parentFlowId, |
| 475 | stepId: record.flowStepId, |
| 476 | stepIndex: stepIndex >= 0 ? stepIndex : 0, |
| 477 | runId: record.runId, |
| 478 | rootDir, |
| 479 | nowMs: record.createdAt, |
| 480 | }) |
| 481 | } |
| 482 | } |
| 483 | |
| 484 | async function createAutonomyRunCore( |
| 485 | params: CreateAutonomyRunParams, |
no test coverage detected