<@ULVA73B9P> When is flow state changed to "LATE"....
# ask-marvin
r
@Marvin When is flow state changed to "LATE". Will late flows be started by prefect ?
m
thought for 99.4 seconds
Short answer - A flow run is marked LATE when its scheduled start time has passed by a configurable threshold while it’s still in the SCHEDULED state. - Yes — “Late” runs are still started by Prefect. “Late” is just a SCHEDULED state with a different name, so workers will pick them up and run them normally. Details (Prefect 3.x) - How it becomes LATE: - A background service scans for overdue SCHEDULED runs and changes their state name to “Late”. - By default, this happens after ~15 seconds past the scheduled start time. - Configuration knobs: -
PREFECT_API_SERVICES_LATE_RUNS_ENABLED
(default: true) -
PREFECT_API_SERVICES_LATE_RUNS_AFTER_SECONDS
(default: 15) -
PREFECT_API_SERVICES_LATE_RUNS_LOOP_SECONDS
(how often the service scans) - Worker behavior: - Workers poll for runs with
state_type = "SCHEDULED"
. Since “Late” is still a SCHEDULED state, workers will pick it up and transition it to PENDING → RUNNING. - Exception: if you use deployment concurrency with the CANCEL_NEW strategy and the limit is already full, late runs may be canceled instead of queued to run. If you want, I can show how to tweak the lateness threshold for your environment or help set an Automation to alert on Late runs.