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

Function onBlockComplete

apps/sim/background/workflow-column-execution.ts:720–747  ·  view source on GitHub ↗
(blockId: string, output: unknown)

Source from the content-addressed store, hash-verified

718 }
719
720 const onBlockComplete = async (blockId: string, output: unknown): Promise<void> => {
721 const outputs = outputsByBlockId.get(blockId)
722 if (!outputs) return
723
724 const blockResult =
725 output && typeof output === 'object' && 'output' in (output as object)
726 ? (output as { output: unknown }).output
727 : output
728
729 const blockErrorMessage =
730 blockResult &&
731 typeof blockResult === 'object' &&
732 typeof (blockResult as { error?: unknown }).error === 'string'
733 ? (blockResult as { error: string }).error
734 : null
735
736 if (blockErrorMessage) {
737 blockErrors[blockId] = blockErrorMessage
738 } else {
739 for (const out of outputs) {
740 const plucked = pluckByPath(blockResult, out.path)
741 if (plucked === undefined) continue
742 accumulatedData[out.columnName] = plucked as RowData[string]
743 }
744 }
745 runningBlockIds.delete(blockId)
746 schedulePartialWrite()
747 }
748
749 // Enforce the per-plan execution timeout (from preprocessing), combined
750 // with the existing cancel signal so either a timeout or a Stop aborts.

Callers

nothing calls this directly

Calls 4

pluckByPathFunction · 0.85
schedulePartialWriteFunction · 0.85
getMethod · 0.65
deleteMethod · 0.65

Tested by

no test coverage detected