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

Function wrappedOnBlockStart

apps/sim/lib/workflows/executor/execution-core.ts:582–628  ·  view source on GitHub ↗
(
      blockId: string,
      blockName: string,
      blockType: string,
      executionOrder: number,
      iterationContext?: IterationContext,
      childWorkflowContext?: ChildWorkflowContext
    )

Source from the content-addressed store, hash-verified

580 }
581
582 const wrappedOnBlockStart = (
583 blockId: string,
584 blockName: string,
585 blockType: string,
586 executionOrder: number,
587 iterationContext?: IterationContext,
588 childWorkflowContext?: ChildWorkflowContext
589 ) => {
590 let persistenceSucceeded = false
591 const persistencePromise = (async () => {
592 await loggingSession.onBlockStart(blockId, blockName, blockType, new Date().toISOString())
593 persistenceSucceeded = true
594 })().catch((error) => {
595 logger.warn(`[${requestId}] Block start persistence failed`, {
596 executionId,
597 blockId,
598 blockType,
599 error,
600 })
601 })
602
603 const lifecyclePromise = (async () => {
604 await persistencePromise
605 if (!persistenceSucceeded || !onBlockStart) return
606
607 try {
608 await onBlockStart(
609 blockId,
610 blockName,
611 blockType,
612 executionOrder,
613 iterationContext,
614 childWorkflowContext
615 )
616 } catch (error) {
617 logger.warn(`[${requestId}] Block start callback failed`, {
618 executionId,
619 blockId,
620 blockType,
621 error,
622 })
623 }
624 })()
625
626 trackLifecycleCallback(lifecyclePromise)
627 return persistencePromise
628 }
629
630 const largeValueExecutionIds = Array.from(
631 new Set(

Callers

nothing calls this directly

Calls 4

trackLifecycleCallbackFunction · 0.85
onBlockStartMethod · 0.80
onBlockStartFunction · 0.70
warnMethod · 0.65

Tested by

no test coverage detected