diff --git a/packages/cli/src/executions/executions.service.ee.ts b/packages/cli/src/executions/executions.service.ee.ts index 60a7167ae..62657d793 100644 --- a/packages/cli/src/executions/executions.service.ee.ts +++ b/packages/cli/src/executions/executions.service.ee.ts @@ -1,6 +1,11 @@ import type { User } from '@db/entities/User'; import { getSharedWorkflowIds } from '@/WorkflowHelpers'; import { ExecutionsService } from './executions.service'; +import type { ExecutionRequest } from '@/requests'; +import type { IExecutionResponse, IExecutionFlattedResponse } from '@/Interfaces'; +import { EEWorkflowsService as EEWorkflows } from '../workflows/workflows.services.ee'; +import { WorkflowRepository } from '@/databases/repositories'; +import Container from 'typedi'; export class EEExecutionsService extends ExecutionsService { /** @@ -10,4 +15,21 @@ export class EEExecutionsService extends ExecutionsService { // Get all workflows return getSharedWorkflowIds(user); } + + static async getExecution( + req: ExecutionRequest.Get, + ): Promise { + const execution = await super.getExecution(req); + + if (!execution) return; + + const workflow = Container.get(WorkflowRepository).create(execution.workflowData); + + EEWorkflows.addOwnerAndSharings(workflow); + await EEWorkflows.addCredentialsToWorkflow(workflow, req.user); + + execution.workflowData = workflow; + + return execution; + } }