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

Function onBlockStart

apps/sim/app/api/workflows/[id]/execute/route.ts:1283–1317  ·  view source on GitHub ↗
(
            blockId: string,
            blockName: string,
            blockType: string,
            executionOrder: number,
            iterationContext?: IterationContext,
            childWorkflowContext?: ChildWorkflowContext
          )

Source from the content-addressed store, hash-verified

1281 })
1282
1283 const onBlockStart = async (
1284 blockId: string,
1285 blockName: string,
1286 blockType: string,
1287 executionOrder: number,
1288 iterationContext?: IterationContext,
1289 childWorkflowContext?: ChildWorkflowContext
1290 ) => {
1291 reqLogger.info('onBlockStart called', { blockId, blockName, blockType })
1292 await sendEvent({
1293 type: 'block:started',
1294 timestamp: new Date().toISOString(),
1295 executionId,
1296 workflowId,
1297 data: {
1298 blockId,
1299 blockName,
1300 blockType,
1301 executionOrder,
1302 ...(iterationContext && {
1303 iterationCurrent: iterationContext.iterationCurrent,
1304 iterationTotal: iterationContext.iterationTotal,
1305 iterationType: iterationContext.iterationType,
1306 iterationContainerId: iterationContext.iterationContainerId,
1307 ...(iterationContext.parentIterations?.length && {
1308 parentIterations: iterationContext.parentIterations,
1309 }),
1310 }),
1311 ...(childWorkflowContext && {
1312 childWorkflowBlockId: childWorkflowContext.parentBlockId,
1313 childWorkflowName: childWorkflowContext.workflowName,
1314 }),
1315 },
1316 })
1317 }
1318
1319 const onBlockComplete = async (
1320 blockId: string,

Callers

nothing calls this directly

Calls 2

infoMethod · 0.80
sendEventFunction · 0.70

Tested by

no test coverage detected