diff --git a/packages/@n8n/benchmark/src/n8n-api-client/workflows-api-client.ts b/packages/@n8n/benchmark/src/n8n-api-client/workflows-api-client.ts index 92bcfad89f..9d6ab30229 100644 --- a/packages/@n8n/benchmark/src/n8n-api-client/workflows-api-client.ts +++ b/packages/@n8n/benchmark/src/n8n-api-client/workflows-api-client.ts @@ -26,6 +26,10 @@ export class WorkflowApiClient { return response.data.data; } + async archiveWorkflow(workflowId: Workflow['id']): Promise { + await this.apiClient.post(`/workflows/${workflowId}/archive`, {}); + } + async deleteWorkflow(workflowId: Workflow['id']): Promise { await this.apiClient.delete(`/workflows/${workflowId}`); } diff --git a/packages/@n8n/benchmark/src/test-execution/scenario-data-importer.ts b/packages/@n8n/benchmark/src/test-execution/scenario-data-importer.ts index cf6029834a..885178c409 100644 --- a/packages/@n8n/benchmark/src/test-execution/scenario-data-importer.ts +++ b/packages/@n8n/benchmark/src/test-execution/scenario-data-importer.ts @@ -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); } }