fix(core): Always set startedAt when executions start running (#11098)

Co-authored-by: Iván Ovejero <ivov.src@gmail.com>
This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™
2024-10-04 16:08:52 +02:00
committed by GitHub
parent 3950cab6dd
commit 722f4a8b77
4 changed files with 83 additions and 8 deletions

View File

@@ -766,7 +766,7 @@ export async function getWorkflowData(
/**
* Executes the workflow with the given ID
*/
async function executeWorkflow(
export async function executeWorkflow(
workflowInfo: IExecuteWorkflowInfo,
additionalData: IWorkflowExecuteAdditionalData,
options: ExecuteWorkflowOptions,
@@ -798,7 +798,13 @@ async function executeWorkflow(
const runData = options.loadedRunData ?? (await getRunData(workflowData, options.inputData));
const executionId = await activeExecutions.add(runData);
await executionRepository.updateStatus(executionId, 'running');
/**
* A subworkflow execution in queue mode is not enqueued, but rather runs in the
* same worker process as the parent execution. Hence ensure the subworkflow
* execution is marked as started as well.
*/
await executionRepository.setRunning(executionId);
Container.get(EventService).emit('workflow-pre-execute', { executionId, data: runData });