* Handle execution result status (timeout, pause, resume). * Shared between all provider paths to eliminate duplication.
(
executionResult: ExecutionResult,
ctx: {
loggingSession: LoggingSession
timeoutController: ReturnType<typeof createTimeoutAbortController>
requestId: string
executionId: string
workflowId: string
}
)
| 320 | * Shared between all provider paths to eliminate duplication. |
| 321 | */ |
| 322 | async function handleExecutionResult( |
| 323 | executionResult: ExecutionResult, |
| 324 | ctx: { |
| 325 | loggingSession: LoggingSession |
| 326 | timeoutController: ReturnType<typeof createTimeoutAbortController> |
| 327 | requestId: string |
| 328 | executionId: string |
| 329 | workflowId: string |
| 330 | } |
| 331 | ) { |
| 332 | if ( |
| 333 | executionResult.status === 'cancelled' && |
| 334 | ctx.timeoutController.isTimedOut() && |
| 335 | ctx.timeoutController.timeoutMs |
| 336 | ) { |
| 337 | const timeoutErrorMessage = getTimeoutErrorMessage(null, ctx.timeoutController.timeoutMs) |
| 338 | logger.info(`[${ctx.requestId}] Webhook execution timed out`, { |
| 339 | timeoutMs: ctx.timeoutController.timeoutMs, |
| 340 | }) |
| 341 | await ctx.loggingSession.markAsFailed(timeoutErrorMessage) |
| 342 | } else { |
| 343 | await handlePostExecutionPauseState({ |
| 344 | result: executionResult, |
| 345 | workflowId: ctx.workflowId, |
| 346 | executionId: ctx.executionId, |
| 347 | loggingSession: ctx.loggingSession, |
| 348 | }) |
| 349 | } |
| 350 | |
| 351 | await ctx.loggingSession.waitForPostExecution() |
| 352 | } |
| 353 | |
| 354 | async function executeWebhookJobInternal( |
| 355 | payload: WebhookExecutionPayload, |
no test coverage detected