mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-16 17:46:45 +00:00
fix(benchmark): Archive workflow before deleting them (#16273)
This commit is contained in:
committed by
GitHub
parent
4e94488622
commit
b685084957
@@ -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}`);
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user