diff --git a/packages/cli/src/services/ownership.service.ts b/packages/cli/src/services/ownership.service.ts index 575d186079..196fc39c91 100644 --- a/packages/cli/src/services/ownership.service.ts +++ b/packages/cli/src/services/ownership.service.ts @@ -94,6 +94,14 @@ export class OwnershipService { return sharedWorkflow.project; } + async setWorkflowProjectCacheEntry(workflowId: string, project: Project): Promise { + void this.cacheService.setHash('workflow-project', { + [workflowId]: this.copyProject(project), + }); + + return project; + } + /** * Retrieve the user who owns the personal project, or `null` if non-personal project. * Personal project ownership is **immutable**. diff --git a/packages/cli/src/workflows/workflow.service.ee.ts b/packages/cli/src/workflows/workflow.service.ee.ts index c8085cbe55..3965f9c304 100644 --- a/packages/cli/src/workflows/workflow.service.ee.ts +++ b/packages/cli/src/workflows/workflow.service.ee.ts @@ -344,7 +344,10 @@ export class EnterpriseWorkflowService { // @ts-ignore CAT-957 await this.workflowRepository.update({ id: workflow.id }, { parentFolder }); - // 10. try to activate it again if it was active + // 10. Update potential cached project association + await this.ownershipService.setWorkflowProjectCacheEntry(workflow.id, destinationProject); + + // 11. try to activate it again if it was active if (wasActive) { return await this.attemptWorkflowReactivation(workflowId); }