MCPcopy
hub / github.com/coder/mux / getSteps

Method getSteps

src/node/services/workflows/WorkflowRunStore.ts:673–689  ·  view source on GitHub ↗
(
    runId: string,
    lookups: readonly WorkflowStepLookup[]
  )

Source from the content-addressed store, hash-verified

671 }
672
673 async getSteps(
674 runId: string,
675 lookups: readonly WorkflowStepLookup[]
676 ): Promise<Array<WorkflowStepRecord | null>> {
677 if (lookups.length === 0) {
678 return [];
679 }
680 const requestedKeys = new Set(lookups.map(getWorkflowStepKey));
681 const byKey = new Map<string, WorkflowStepRecord>();
682 for (const step of await this.readSteps(runId)) {
683 const key = getWorkflowStepKey(step);
684 if (requestedKeys.has(key)) {
685 byKey.set(key, step);
686 }
687 }
688 return lookups.map((lookup) => byKey.get(getWorkflowStepKey(lookup)) ?? null);
689 }
690
691 async acquireLease(runId: string, ownerId: string, nowMs = Date.now()): Promise<boolean> {
692 assert(ownerId.length > 0, "WorkflowRunStore.acquireLease: ownerId is required");

Callers 2

getStepMethod · 0.95

Calls 5

readStepsMethod · 0.95
getWorkflowStepKeyFunction · 0.85
setMethod · 0.80
getMethod · 0.65
hasMethod · 0.45

Tested by

no test coverage detected