MCPcopy Index your code
hub / github.com/coder/mux / createRunner

Method createRunner

src/node/services/workflows/WorkflowService.ts:867–891  ·  view source on GitHub ↗
(runId: string)

Source from the content-addressed store, hash-verified

865 }
866
867 private async createRunner(runId: string): Promise<WorkflowRunner> {
868 // The run record always exists by the time a runner is created (create/resume/retry
869 // paths persist it first), so resolve the display name for task labeling here.
870 const workflowName =
871 this.taskAdapterFactory != null
872 ? (await this.runStore.getRun(runId)).workflow.name
873 : undefined;
874 return new WorkflowRunner({
875 runStore: this.runStore,
876 runtimeFactory: this.runtimeFactory,
877 taskAdapter: this.taskAdapterFactory?.(runId, workflowName) ?? this.requireTaskAdapter(),
878 nestedWorkflowAdapter: {
879 createRun: async (input) => {
880 const run = await this.createNestedWorkflowRun(input);
881 return { runId: run.id, name: run.workflow.name };
882 },
883 run: async (childRunId, options) => {
884 const childRunner = await this.createRunner(childRunId);
885 return await childRunner.run(childRunId, options);
886 },
887 },
888 runnerId: generateWorkflowRunnerOwnerId(this.runnerId, runId),
889 ...(this.clock != null ? { clock: this.clock } : {}),
890 });
891 }
892
893 private async requireRunForWorkspace(input: {
894 workspaceId: string;

Callers 3

startWorkflowMethod · 0.95
runInBackgroundMethod · 0.95

Calls 5

requireTaskAdapterMethod · 0.95
getRunMethod · 0.65
runMethod · 0.65

Tested by

no test coverage detected