fix(benchmark): Archive workflow before deleting them (#16273)

This commit is contained in:
Guillaume Jacquart
2025-06-12 14:13:51 +02:00
committed by GitHub
parent 4e94488622
commit b685084957
2 changed files with 5 additions and 0 deletions

View File

@@ -26,6 +26,10 @@ export class WorkflowApiClient {
return response.data.data;
}
async archiveWorkflow(workflowId: Workflow['id']): Promise<void> {
await this.apiClient.post(`/workflows/${workflowId}/archive`, {});
}
async deleteWorkflow(workflowId: Workflow['id']): Promise<void> {
await this.apiClient.delete(`/workflows/${workflowId}`);
}

View File

@@ -27,6 +27,7 @@ export class ScenarioDataImporter {
const existingWorkflows = this.findExistingWorkflows(opts.existingWorkflows, opts.workflow);
if (existingWorkflows.length > 0) {
for (const toDelete of existingWorkflows) {
await this.workflowApiClient.archiveWorkflow(toDelete.id);
await this.workflowApiClient.deleteWorkflow(toDelete.id);
}
}