Improve workflow queue cron reliability (#13818)

Improve workflow enqueue cron : instead of relying on the cache to know
how many workflows we can enqueue, query the DB. Then set the cache and
process the not started workflows.

Also adding a second cron that will look for workflows enqueued one hour
ago or more and put these back in the not started status. This will
allow the first cron to start these again.
This commit is contained in:
Thomas Trompette
2025-08-12 15:54:58 +02:00
committed by GitHub
parent 3c0f3fd2ae
commit cee647435c
19 changed files with 443 additions and 173 deletions
@@ -90,6 +90,16 @@ export class WorkflowRunWorkspaceEntity extends BaseWorkspaceEntity {
})
name: string;
@WorkspaceField({
standardId: WORKFLOW_RUN_STANDARD_FIELD_IDS.enqueuedAt,
type: FieldMetadataType.DATE_TIME,
label: msg`Workflow run enqueued at`,
description: msg`Workflow run enqueued at`,
icon: 'IconHistory',
})
@WorkspaceIsNullable()
enqueuedAt: Date | null;
@WorkspaceField({
standardId: WORKFLOW_RUN_STANDARD_FIELD_IDS.startedAt,
type: FieldMetadataType.DATE_TIME,