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

Function onBlockStart

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

Source from the content-addressed store, hash-verified

287 }
288
289 const onBlockStart = async (
290 blockId: string,
291 blockName: string,
292 blockType: string,
293 executionOrder: number,
294 iterationContext?: IterationContext,
295 childWorkflowContext?: ChildWorkflowContext
296 ) => {
297 await sendBufferedEvent({
298 type: 'block:started',
299 timestamp: new Date().toISOString(),
300 executionId,
301 workflowId,
302 data: {
303 blockId,
304 blockName,
305 blockType,
306 executionOrder,
307 ...(iterationContext && {
308 iterationCurrent: iterationContext.iterationCurrent,
309 iterationTotal: iterationContext.iterationTotal,
310 iterationType: iterationContext.iterationType,
311 iterationContainerId: iterationContext.iterationContainerId,
312 ...(iterationContext.parentIterations?.length && {
313 parentIterations: iterationContext.parentIterations,
314 }),
315 }),
316 ...(childWorkflowContext && {
317 childWorkflowBlockId: childWorkflowContext.parentBlockId,
318 childWorkflowName: childWorkflowContext.workflowName,
319 }),
320 },
321 })
322 }
323
324 const onBlockComplete = async (
325 blockId: string,

Callers 1

wrappedOnBlockStartFunction · 0.70

Calls 1

sendBufferedEventFunction · 0.85

Tested by

no test coverage detected