( payload: ResumeExecutionPayload, pausedExecution: Awaited<ReturnType<typeof PauseResumeManager.getPausedExecutionById>>, writers: CellWriters )
| 292 | } |
| 293 | |
| 294 | async function runResumeAndCellTerminal( |
| 295 | payload: ResumeExecutionPayload, |
| 296 | pausedExecution: Awaited<ReturnType<typeof PauseResumeManager.getPausedExecutionById>>, |
| 297 | writers: CellWriters |
| 298 | ): Promise<Awaited<ReturnType<typeof PauseResumeManager.startResumeExecution>>> { |
| 299 | if (!pausedExecution) throw new Error('Paused execution missing — already nulled by caller') |
| 300 | const result = await PauseResumeManager.startResumeExecution({ |
| 301 | resumeEntryId: payload.resumeEntryId, |
| 302 | resumeExecutionId: payload.resumeExecutionId, |
| 303 | pausedExecution, |
| 304 | contextId: payload.contextId, |
| 305 | resumeInput: payload.resumeInput, |
| 306 | userId: payload.userId, |
| 307 | onBlockComplete: writers.cellOnBlockComplete, |
| 308 | }) |
| 309 | |
| 310 | if (result.status === 'paused') { |
| 311 | await writers.writeCellTerminal('paused', null) |
| 312 | } else if (result.success) { |
| 313 | await writers.writeCellTerminal('completed', null) |
| 314 | } else { |
| 315 | await writers.writeCellTerminal('error', result.error ?? 'Workflow execution failed') |
| 316 | } |
| 317 | |
| 318 | return result |
| 319 | } |
| 320 | |
| 321 | async function continueCascadeAfterResume(cellContext: { |
| 322 | tableId: string |
no test coverage detected