MCPcopy
hub / github.com/simstudioai/sim / generateLoopBlocks

Function generateLoopBlocks

apps/sim/stores/workflows/workflow/utils.ts:208–221  ·  view source on GitHub ↗
(blocks: Record<string, BlockState>)

Source from the content-addressed store, hash-verified

206 * @returns Record of Loop objects for execution engine
207 */
208export function generateLoopBlocks(blocks: Record<string, BlockState>): Record<string, Loop> {
209 const loops: Record<string, Loop> = {}
210
211 Object.entries(blocks)
212 .filter(([_, block]) => block.type === 'loop')
213 .forEach(([id, block]) => {
214 const loop = convertLoopBlockToLoop(id, blocks)
215 if (loop) {
216 loops[id] = loop
217 }
218 })
219
220 return loops
221}
222
223/**
224 * Builds a complete collection of parallel blocks from the UI blocks

Callers 8

store.tsFile · 0.90
normalizeWorkflowStateFunction · 0.90
sanitizeForExportFunction · 0.90
executeFunction · 0.90
serializeWorkflowMethod · 0.90
route.tsFile · 0.90

Calls 1

convertLoopBlockToLoopFunction · 0.70

Tested by

no test coverage detected