(runId: string)
| 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; |
no test coverage detected