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

Method withLoop

packages/testing/src/builders/workflow.builder.ts:338–346  ·  view source on GitHub ↗

* Creates a workflow with a loop.

(iterations = 3)

Source from the content-addressed store, hash-verified

336 * Creates a workflow with a loop.
337 */
338 static withLoop(iterations = 3): WorkflowBuilder {
339 return new WorkflowBuilder()
340 .addStarter('start', { x: 0, y: 0 })
341 .addLoop('loop', { x: 200, y: 0 }, { iterations })
342 .addLoopChild('loop', 'loop-body', 'function', { x: 50, y: 50 })
343 .addFunction('end', { x: 500, y: 0 })
344 .connect('start', 'loop')
345 .connect('loop', 'end')
346 }
347
348 /**
349 * Creates a workflow with parallel execution.

Callers 2

store.test.tsFile · 0.80

Calls 5

addFunctionMethod · 0.80
addLoopChildMethod · 0.80
addLoopMethod · 0.80
addStarterMethod · 0.80
connectMethod · 0.45

Tested by

no test coverage detected