fix(core): Fix sorting of executions not working on postgres and mysql (#15423)

This commit is contained in:
Danny Martini
2025-05-26 16:23:24 +02:00
committed by GitHub
parent 74d8afa52e
commit eca282d09c
3 changed files with 57 additions and 9 deletions

View File

@@ -32,13 +32,23 @@ export async function createExecution(
>,
workflow: IWorkflowBase,
) {
const { data, finished, mode, startedAt, stoppedAt, waitTill, status, deletedAt, metadata } =
attributes;
const {
data,
finished,
mode,
startedAt,
stoppedAt,
waitTill,
status,
deletedAt,
metadata,
createdAt,
} = attributes;
const execution = await Container.get(ExecutionRepository).save({
finished: finished ?? true,
mode: mode ?? 'manual',
createdAt: new Date(),
createdAt: createdAt ?? new Date(),
startedAt: startedAt === undefined ? new Date() : startedAt,
...(workflow !== undefined && { workflowId: workflow.id }),
stoppedAt: stoppedAt ?? new Date(),