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

Method createWorkflowRun

src/node/services/workflows/WorkflowService.ts:683–703  ·  view source on GitHub ↗
(input: StartWorkflowInput)

Source from the content-addressed store, hash-verified

681 }
682
683 private async createWorkflowRun(input: StartWorkflowInput): Promise<WorkflowRunRecord> {
684 assert(
685 input.workspaceId.length > 0,
686 "WorkflowService.createWorkflowRun: workspaceId is required"
687 );
688 const runId = this.generateRunId();
689 assert(runId.length > 0, "WorkflowService.createWorkflowRun: generated run id is required");
690
691 const normalized = normalizeWorkflowArgsForSource(input.script.source, input.args, {
692 defaultArgs: input.defaultArgs,
693 });
694 return await this.runStore.createRun({
695 id: runId,
696 workspaceId: input.workspaceId,
697 workflow: buildWorkflowScriptDescriptor(input.script),
698 source: input.script.source,
699 args: normalized.args,
700 ...(input.attentionPolicy != null ? { attentionPolicy: input.attentionPolicy } : {}),
701 now: this.clock?.nowIso() ?? new Date().toISOString(),
702 });
703 }
704
705 private async runInBackground(
706 runId: string,

Callers 2

startWorkflowMethod · 0.95

Calls 5

nowIsoMethod · 0.80
createRunMethod · 0.65
assertFunction · 0.50

Tested by

no test coverage detected