MCPcopy Index your code
hub / github.com/simstudioai/sim / handleExecutionResult

Function handleExecutionResult

apps/sim/background/webhook-execution.ts:322–352  ·  view source on GitHub ↗

* 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
  }
)

Source from the content-addressed store, hash-verified

320 * Shared between all provider paths to eliminate duplication.
321 */
322async 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
354async function executeWebhookJobInternal(
355 payload: WebhookExecutionPayload,

Callers 1

Calls 5

getTimeoutErrorMessageFunction · 0.90
infoMethod · 0.80
markAsFailedMethod · 0.80
waitForPostExecutionMethod · 0.80

Tested by

no test coverage detected