CronNudge

Published October 21, 2026

How to Monitor Prefect Flow Schedules

A Prefect schedule creates a flow run and leaves it in Scheduled. The Upcoming tab lists runs that were created. A Scheduled run has not finished. An inactive schedule creates no new runs. A serve process that has stopped, or a worker that is not polling, leaves a run sitting there. Nothing emails you. A ping after the work is the alert for that silence.

The schedule facts below are from the Prefect 3 docs. A Linux crontab on a machine you run is crontab not running. The closest scheduler siblings are Airflow Dag schedules and Dagster schedules and sensors. The five fields are in cron expression examples. The general pattern is how to monitor cron jobs.

The schedule lives on a deployment

A flow is a template. Only a run has a state. You add one or more schedules to a deployed flow. flow.serve and flow.deploy create that deployment and take cron, interval, or rrule.

serve creates the deployment and starts a long-running process that listens for scheduled runs and executes them in-process. The script has to stay running. Stopping it pauses the schedule, unless you pass pause_on_shutdown=False. CTRL+C pauses it. With the flag set to False, the schedule stays active and nothing is listening, so runs stay Scheduled.

A work-pool deployment is the other path. flow.deploy or prefect deploy puts the deployment on a pool. A hybrid pool needs a worker you run. A push pool submits runs to your serverless provider. A managed pool submits them to Prefect-managed infrastructure. Those two do not need a worker process from you.

There are three schedule types. Cron is a clock time. Interval is a fixed gap from an anchor. RRule is calendar logic: exclusions, the last weekday of a month, every other Tuesday. The UI can add an interval or a cron. It does not create an RRule. It will display an RRule you created from the CLI. New runs show up on the Upcoming tab of the deployment.

A schedule can be inactive. Set active to False in Python, or false in YAML, and the configuration stays while the schedule creates no new runs. prefect deployment schedule pause my-flow/my-deployment <schedule-id> pauses one schedule. prefect deployment schedule resume turns it back on. prefect deployment schedule pause --all pauses every active schedule in the current workspace. prefect deployment schedule clear removes every schedule on that deployment. Pausing a deployment through the pause-deployment API sets its schedule inactive and deletes auto-scheduled runs that are still Scheduled.

schedules:
  - cron: "0 0 * * *"
    timezone: "UTC"
    active: true

prefect deployment schedule create adds a schedule. It does not replace the ones already there unless you pass --replace. Replacing or editing a schedule removes previously scheduled runs that have not started, then creates new ones. Removing the schedule removes those runs too.

Cron, interval, and RRule

Prefect cron uses croniter. It does not support R (random) or H (hashed), or the jitter those tokens add. Do not put either token on the check. R does not parse. H does parse, and the parser picks a new value each time it calculates the next run, so the deadline moves. Copy a five-field expression and read it on the cron tool before you save it.

0 9 * * MON-FRI is 09:00 Monday through Friday. The check accepts that expression. 0 9 * * 1-5 is the same Monday-through-Friday clock. Pass the IANA zone on the schedule: Cron("0 9 * * MON-FRI", timezone="America/New_York"), the YAML timezone field, or prefect deployment schedule create --timezone "America/New_York". Put that same name on the check. America/New_York and UTC both pass.

day_or defaults to True, which is cron's OR. If the day-of-month and the day-of-week are both set, the schedule runs on either one. That is the reading in cron expression examples. day_or=False joins them with AND, which is fcron, not the check. Leave day_or at the default, or write the five fields the check will actually fire.

When the zone observes daylight saving time, cron follows the clock, not elapsed time. An hourly cron fires on each new schedule hour. When the clocks are set back, the docs' case is a two-hour pause: the schedule fires the first time 1 AM is reached and the first time 2 AM is reached, 120 minutes later. A daily 9 AM cron stays at 9 AM local. The skipped hour is in cron jobs and daylight saving time.

An interval is a number of seconds, a timedelta, an ISO 8601 duration such as PT15M, or a time string such as 00:15:00. anchor_date is the fixed point those gaps are counted from. It is not the moment the first run starts. If you omit it, the current UTC time is used. If the anchor is in the future, the dates are computed by subtracting the interval from it.

Intervals of less than 24 hours follow UTC across a daylight-saving change. An hourly interval can show two runs at 1 AM local that are an hour apart in UTC. Intervals of more than 24 hours follow daylight saving. A daily interval is in that longer group: it keeps the local clock hour. The matching check is a cron, 0 9 * * *, in that zone. A one-day interval check counts 86,400 seconds from the last success and stores the zone as UTC. It does not hold a local hour.

An RRule is an iCal recurrence, up to 6,500 characters. COUNT is not supported. Use UNTIL, or schedule a fixed number of runs from the runs endpoint. The check has no RRule field. If the rule is one clock time, write the five fields. If it excludes dates, one cron check cannot represent the exclusions.

The older scheduler setting names PREFECT_API_SERVICES_SCHEDULER_* are still accepted as legacy aliases of PREFECT_SERVER_SERVICES_SCHEDULER_*.

The scheduler only creates Scheduled runs

The Scheduler service reads each deployment's schedules and creates runs. It starts when you run prefect server start. Prefect Cloud includes it. It places the new runs in Scheduled. It does not execute flows or tasks.

It creates the fewest runs that satisfy these constraints, in order: no more than 100 runs, nothing more than 100 days out, at least three runs, and runs until at least one hour ahead. An hourly schedule therefore gets about the next four days (100 hours) under the defaults. A weekly schedule keeps the next 14 runs, up to 100 days out. The loop defaults to 60 seconds (PREFECT_SERVER_SERVICES_SCHEDULER_LOOP_SECONDS). The service is enabled by default (PREFECT_SERVER_SERVICES_SCHEDULER_ENABLED). Runs are created ahead of the tick. The Upcoming tab can show tomorrow's run today. That row is not a finish.

Scheduled means the run will begin at a time in the future. Late is still type SCHEDULED: the start time has passed and the run has not entered Pending. The default wait before Late is 15 seconds. Completed is the successful terminal state. Failed is a code failure with no retries left. Crashed is an infrastructure failure. AwaitingConcurrencySlot is still Scheduled: the run is waiting for a concurrency slot before anyone submits it.

The transition into Late is the usual case of a worker not picking the run up. Prefect names three causes: no workers are healthy, workers are not polling the right pool or queue, or workers are concurrency limited.

Serve, workers, and a run that sits there

serve executes the run only while that process is up. A hybrid pool needs prefect worker start -p "my-pool". The worker polls the pool, takes scheduled runs, and submits them to the infrastructure for its type. The type has to match the pool. Workers poll every 15 seconds by default (PREFECT_WORKER_QUERY_SECONDS). By default a worker submits a run 10 seconds before the scheduled start (PREFECT_WORKER_PREFETCH_SECONDS), so the infrastructure can exist in time. If the infrastructure is ready early, the run waits until its scheduled start.

A worker is ONLINE while it sends heartbeats. Three missed heartbeats mark it OFFLINE. By default that is at most 90 seconds after the heartbeats stop (PREFECT_WORKER_HEARTBEAT_SECONDS).

Workers were introduced in Prefect 2.0 as the next generation of agents, and they are the standard in Prefect 3.0. Agents are the deployment pattern for prefect greater than 2.0 and less than 3.0. A worker polls a pool the way an agent did, and it is typed the way an infrastructure block was. It is not a drop-in replacement. prefect deployment build and prefect deployment apply became prefect deploy. Deployment.build_from_flow became flow.deploy. The process you start is prefect worker start -p, which is the thing that has to be up for a hybrid pool.

Pausing a work pool stops delivery of all work. It does not pause deployment schedules. The scheduler can keep creating Scheduled runs, and nothing submits them, until you prefect work-pool resume the pool. prefect work-pool preview lists scheduled work for a pool.

Each pool has a default queue. A queue is READY when a worker has polled it in the last 60 seconds. Pausing a queue sets it to PAUSED, and it accepts no new work until you unpause it. Unpausing leaves it NOT_READY until a worker polls it. Without --work-queue, a worker pulls from every queue in the pool. With that flag, it pulls only from the queues you named. If the worker names a queue that does not exist, the queue is created.

--limit caps how many runs that worker executes at once. A pool can have its own concurrency limit, and a queue can too. Past the limit, runs wait in AwaitingConcurrencySlot. They have not executed. While a run waits for infrastructure, it holds any deployment concurrency slot it took at submission, as long as it reaches Running within the deployment's grace_period_seconds. That grace is Prefect's, not the check's.

Push and managed pools do not use a worker you start. A paused pool still stops delivery. A schedule that is inactive never creates the run those pools would have submitted.

The Upcoming tab is not a finish

These documented cases leave no successful ping:

  • The schedule is inactive: active: false, prefect deployment schedule pause, or a serve process that exited and paused the schedule on the way down.
  • The self-hosted server is stopped, so the scheduler is stopped. Prefect Cloud runs that service for you.
  • The schedule was edited or removed, and the runs that had not started were removed with it.
  • serve is down with pause_on_shutdown=False, so the schedule is still active and nothing is listening.
  • No healthy worker is polling the hybrid pool, or it is polling a different pool or queue. The run goes Late and stays type Scheduled.
  • The work pool is paused, or the work queue is paused. Schedules on a paused pool keep creating runs. Delivery is what stops.
  • A concurrency limit or --limit left the run in AwaitingConcurrencySlot.
  • The flow entered Failed or Crashed before the ping task ran.
  • The run is Pending or Running and has not reached the ping task. Pending means it was submitted and is still waiting on infrastructure.

CronNudge does not call the Prefect API, cannot read flow-run state, and cannot trigger or retry a flow. It only knows about pings it receives. The UI is still where you open a run that did start.

Ping after the flow succeeds

The success URL is https://cronnudge.com/ping/YOUR_ID. GET, POST, and HEAD all count. A stored ping answers ok with Cache-Control: no-store. YOUR_ID is the id in the ping URL, not the badge id. Anyone with that URL can send a ping. Keep the value free of a query string and of /start or /fail.

Do not hard-code it. The URL is a secret: anyone who has it can signal the check. A Secret block stores that string encrypted at rest. Load it inside the task. Variable.get is the same read when the value is not a secret. Variables are not encrypted. Anyone who can open the server or the workspace can see the name and the value. os.environ["CRONNUDGE_URL"] is the environment on the serve process or the worker. Read that inside the task too.

The ping task runs after the work. If work raises, ping does not run, and the flow is marked Failed. return_state=True is the documented way to catch a task's state without raising. Leave that off here, so a failed task does not ping success.

from prefect import flow, task
from prefect.blocks.system import Secret

@task
def work():
    print("work")

@task
def ping():
    import urllib.request

    url = Secret.load("cronnudge-url").get().split("?", 1)[0].rstrip("/")
    try:
        urllib.request.urlopen(url, timeout=10).read()
    except Exception as exc:
        print(f"heartbeat ping failed: {exc}")

@flow
def nightly():
    work()
    ping()

if __name__ == "__main__":
    nightly.serve(name="nightly", cron="0 0 * * *")

urlopen raises on an HTTP error, so the try is what keeps a monitoring hiccup from failing the flow. The ping is still missed, and the check alerts after grace. Importing inside the function means a missing library fails that task, not the import of the flow file.

httpx is the same GET if the flow already uses it. httpx.get does not raise on an HTTP status unless you call raise_for_status().

@task
def ping():
    import httpx
    from prefect.blocks.system import Secret

    url = Secret.load("cronnudge-url").get().split("?", 1)[0].rstrip("/")
    try:
        httpx.get(url, timeout=10).raise_for_status()
    except Exception as exc:
        print(f"heartbeat ping failed: {exc}")

requests is the same shape. requests.get does not raise on an HTTP status unless you call raise_for_status().

Pass the exit code

?exit= accepts an integer from 0 to 255. 0 is a success. 1 through 255 is a failure: the check is marked down immediately when it was not already down. Anything else is ignored, and the ping stays a success. Use this or /fail, not both.

@task
def run_and_ping():
    import subprocess
    import urllib.request
    from prefect.blocks.system import Secret

    url = Secret.load("cronnudge-url").get().split("?", 1)[0].rstrip("/")
    completed = subprocess.run(["./do-the-work"])
    code = completed.returncode
    try:
        urllib.request.urlopen(f"{url}?exit={code}", timeout=10).read()
    except Exception as exc:
        print(f"heartbeat ping failed: {exc}")
    if code != 0:
        raise RuntimeError(code)

That task is the work and the ping together. Do not also add a success ping after it, and do not also register on_failure on that flow. The non-zero ?exit= already marks the check down. Raising keeps the flow Failed.

/fail is the same immediate down alert. A paused check stores the ping and does not alert. A second failure while the check is already down does not send another alert. One alert when it goes down, and one when a later success recovers it.

on_failure runs when a flow or a task enters Failed. on_crashed runs when a flow enters Crashed. It is not a task hook. With retries set, on_failure waits until the retries are finished and the run is Failed. Hooks run in the flow process, and the docs say that execution is not guaranteed. A run that never leaves Scheduled never enters Failed or Crashed, so neither hook runs. The missed success ping is the alert after grace.

@nightly.on_failure
def ping_fail(flow, flow_run, state):
    import urllib.request
    from prefect.blocks.system import Secret

    url = Secret.load("cronnudge-url").get().split("?", 1)[0].rstrip("/")
    request = urllib.request.Request(
        url + "/fail",
        headers={"Idempotency-Key": f"{flow_run.id}-fail"[:128]},
        method="POST",
    )
    urllib.request.urlopen(request, timeout=10).read()

Put on_crashed next to it when an infrastructure crash should page the same way. Use a different idempotency key, such as f"{flow_run.id}-crashed". A repeated key on the same check is a replay. It does not send a second alert.

/start and a max runtime

/start records a start. It is not a success. Turn on "Track start and finish," or set Max runtime (seconds), which turns run tracking on. on_running is the hook for a flow or task that enters Running. A run that stays Scheduled never calls it, so it cannot go stuck. Silence until the schedule deadline is the alert.

A second /start while a run is open is an overlap alert and does not close the first run. The idempotency key makes a retry of the same start a replay instead. The key is cut at 128 characters and matched per check, so the finish ping needs its own key. A repeated key does not open a second run. A success or /fail closes the open runs. Two success pings alone do not raise an overlap alert.

@nightly.on_running
def ping_start(flow, flow_run, state):
    import urllib.request
    from prefect.blocks.system import Secret

    url = Secret.load("cronnudge-url").get().split("?", 1)[0].rstrip("/")
    request = urllib.request.Request(
        url + "/start",
        headers={"Idempotency-Key": f"{flow_run.id}-start"[:128]},
        method="POST",
    )
    try:
        urllib.request.urlopen(request, timeout=10).read()
    except Exception as exc:
        print(f"heartbeat ping failed: {exc}")

Max runtime is 1 second through 7 days. With a run open and a max runtime set, the deadline becomes that start plus the max runtime. It is not the earlier of that and the schedule. No finish means one stuck alert, once for that start, and the check goes down. A later success is the recovery. With run tracking and no max runtime, an open run is due at the earlier of the schedule deadline and the start plus grace. The grace used for that run is at least 60 seconds. The alert is down, not stuck. Free includes run tracking on 3 checks. Pro removes that cap. Details are in assertions, runs, and agents.

Set max runtime a little past the longest healthy flow. A worker --limit, or a run still Pending because infrastructure has not started, has not called /start. That one alerts at the schedule deadline, not as stuck. Hangs are in cron job stuck or hanging. Overlapping runs are in prevent overlapping cron jobs.

Match the check to the schedule

One deployment can carry several schedules. The 08:00 run and the 08:05 run are two clocks. Give each its own check. A shared URL stays up while either one pings, and the one that stopped is hidden.

Copy the five fields and set the check timezone to the IANA zone on the Prefect schedule. The cron tool lists the next runs before grace is added.

The form's periods are 5 minutes, 15 minutes, 30 minutes, 1 hour, 6 hours, 1 day, and 1 week. Grace is none, 1 minute, 5 minutes (the default), 15 minutes, or 1 hour. Anything else, from the plan minimum up to 31 days for an interval and from 0 through 7 days for grace, is an API value, and the API is on Pro. Creating a check sets the first deadline from that moment. A run that reaches the ping task stores a ping, and a success then moves the deadline. An interval counts from the last success. A cron expression uses the next occurrence after that success, then adds grace. An interval check stores UTC. The timezone field on the form is for cron.

The scheduler creates runs ahead of time. The worker polls every 15 seconds and may submit about 10 seconds early, then the flow still has to finish. The default grace is 5 minutes. A short final task fits. A flow that is still running at the deadline alerts, and the late success is the recovery.

Every night at midnight UTC. Schedule 0 0 * * * with timezone UTC. Check 0 0 * * *, timezone UTC. A success at 00:02 is inside the default 5 minutes of grace. The next deadline is 00:05 the next night. A run that never pings alerts at 00:05. A flow that pings at 00:20 is past 00:05, so the check alerts and that success is the recovery. One hour of grace is the form value when the tasks themselves take most of an hour. The deadline is then 01:00.

Weekdays at 09:00 in New York. Prefect cron 0 9 * * MON-FRI and timezone America/New_York. The check takes that expression, or 0 9 * * 1-5, in the same zone. A success at 09:02 is inside the default grace. The next deadline is 09:05 on the next weekday. Saturday and Sunday are not expected.

Every 15 minutes. A Prefect interval of 900, timedelta(minutes=15), or PT15M. The form period is 15 minutes. With the default grace, the deadline is 20 minutes after the last success. Prefect's ticks stay on the anchor, whether or not the previous run has finished. A flow that takes about a minute still pings inside that window. A tick that never starts alerts 20 minutes after the last success, which is the previous runtime plus grace after the missed anchor. Use a cron of */15 * * * * only when you mean :00, :15, :30, and :45. An anchor at :03 is not that clock.

Every 10 minutes. 600 seconds is not a form period. The API can set it, and the API is on Pro. */10 * * * * is a cron the form accepts. The gap is 10 minutes, which is inside Free's 5-minute minimum, so the cron is a Free check. It fires on the tens. A Prefect interval fires on the anchor. Use the interval check when the schedule is an interval.

Every minute. The serve example cron="* * * * *" is every minute. It is valid cron and it is not a Free check. Pro's minimum is 1 minute.

Hourly. 0 * * * * is slower than Free's 5-minute minimum, so it is a Free check.

A daily interval that stays at a local hour. Intervals longer than 24 hours follow daylight saving and keep that clock hour. The matching check is 0 9 * * * in the schedule's IANA zone, not a 1-day interval. The interval check would count 86,400 seconds from the last success.

Free is 10 checks, a 5-minute minimum interval, email plus one Slack or Discord channel, and run tracking on 3 checks. Pro is $12 a month for 100 checks, a 1-minute minimum, signed webhooks, and the API. Details are on pricing.

FAQ

Does Prefect tell me when a scheduled flow never starts? No. The scheduler creates runs and leaves them in Scheduled. An inactive schedule creates none. on_failure runs when a flow or task enters Failed, and on_crashed runs when a flow enters Crashed. Neither runs for a run that stays Scheduled, and those hooks run in the flow process. A ping after the work is the alert.

Is a Scheduled run a finished run? No. Scheduled means the run will begin at a time in the future. Late is still a Scheduled type: the start time passed and the run has not gone Pending, 15 seconds by default. Completed is the successful terminal state. The Upcoming tab lists runs the scheduler created.

Why is a deployment schedule not creating runs? The schedule is inactive, or the scheduler is not running. active set to false, prefect deployment schedule pause, and a serve process that exited all leave the schedule inactive unless pause_on_shutdown is False. An inactive schedule creates no new runs. Changing a schedule removes runs that have not started. The scheduler starts with prefect server start, and Prefect Cloud includes it.

Why is a run Late, with the worker not picking it up? Late means the scheduled start passed and the run has not entered Pending. That usually means no workers are healthy, workers are not polling the right work pool or work queue, or workers are concurrency limited. A paused work pool stops delivery and does not pause deployment schedules. A paused work queue accepts no new work. serve has to be running to execute its own runs.

Does a failed flow alert immediately? Only if a ping is sent. A later ping task does not run when the work raises. on_failure can call /fail once retries are finished and the flow is Failed. ?exit= from 1 to 255 does the same. exit=0 is a success. A value outside 0 to 255 is ignored. A second failure while the check is already down does not send another alert. A run that never starts never reaches the hook, so the missed success ping is the alert after grace.

Can CronNudge read the flow run or start the flow? No. It does not call the Prefect API, read flow-run state, or trigger or retry a flow. It only knows about pings it receives. The Prefect UI is still where you open a run that did start.


The scheduler creates a Scheduled run. The worker or serve process is what finishes it. The ping is how you hear about the run that never called home. Create the check, or read the five fields on the cron tool. Related: how to monitor cron jobs, crontab not running, cron expression examples, Airflow Dag schedules, Dagster schedules and sensors, and the Python docs.