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

Function stampQueuedForBatch

apps/sim/lib/table/dispatcher.ts:687–701  ·  view source on GitHub ↗

Pre-batch stamp: write each targeted cell as `pending` (no executionId) * before firing the batch so the renderer shows the cell as in-flight * immediately. The cell-task overwrites with `running` (and its own * executionId) once it acquires the row's cascade lock — if another * cell-task al

(pendingRuns: WorkflowGroupCellPayload[])

Source from the content-addressed store, hash-verified

685 * cell-task already holds the lock, this task bails and the pending stamp
686 * is later reconciled by whoever owns the cascade. */
687async function stampQueuedForBatch(pendingRuns: WorkflowGroupCellPayload[]): Promise<void> {
688 await Promise.allSettled(
689 pendingRuns.map((runOpts) =>
690 writeWorkflowGroupState(runOpts, {
691 executionState: {
692 status: 'pending',
693 executionId: null,
694 jobId: null,
695 workflowId: runOpts.workflowId,
696 error: null,
697 },
698 })
699 )
700 )
701}
702
703async function advanceCursor(dispatchId: string, newCursor: number): Promise<void> {
704 await db

Callers 1

dispatcherStepFunction · 0.85

Calls 1

writeWorkflowGroupStateFunction · 0.90

Tested by

no test coverage detected