Applies to v1.3.18

Scheduled Runs

Purpose

This page shows how to run a hosted agent on a timetable: the three ways to describe a schedule, Quartz cron syntax and how it differs from crontab, time zones and daylight-saving time, what happens to runs the platform missed, what happens when a run is still going at the next slot, and how precise the timing is.

How A Scheduled Run Works

A schedule trigger belongs to one hosted agent. The Jobs worker checks for due schedules every 15 seconds; for each one it records a queued execution for the slot, and a Runtime replica picks that execution up and runs the agent as the trigger's run identity. Nobody is present, so the agent is told not to ask for input — a turn that ends asking for input fails. See Run Identities for what the run executes as.

Each slot fires exactly once, even with several Jobs worker replicas or after a restart in the middle of a sweep.

Creating A Schedule

You need the Apps & Tools manage role, a hosted agent, and a run identity allowed for it (created under Security → Agent Run Identities).

In Apps & Tools → Agent Triggers, choose New trigger, pick the tenant (global sessions), the agent and the kind Schedule, and fill in:

  • Name, Instructions (what the agent does on each run) and optional Parameters (a JSON object);
  • Run identity — then Check identity, which says whether a run would be let in: that the identity resolves and that the agent's access policy allows it (Check identity);
  • the timetable, under When (below). The editor shows the next five runs as the scheduler will compute them, so you can check a schedule before saving it;
  • the execution settings: what to do if the previous run is still going, a time limit, the longest wait in the queue, attempts, and whether to keep each run's input.

The input each run receives is the trigger's instructions, under a header naming the trigger and the slot it fired for, followed by the parameters:

[Trigger: nightly-ledger-check · channel: Schedule · fired: 2026-11-02T01:00:00Z]

Compare yesterday's ledger totals with the bank statement and open a ticket for any difference.

The Three Kinds Of Schedule

Repeats Fields Example
Every… Every (minutes): 1 to 44 640 (31 days) Every 15 minutes
At times on days Days of the week, and up to 24 local times as HH:mm Monday to Friday at 08:00 and 17:30
Cron expression A Quartz cron expression, seconds first 0 0 6 1 * ? — 06:00 on the first of every month

All three take a Time zone (an IANA name such as Europe/Rome or America/New_York; UTC when empty), an optional Starts and Ends, and a missed-run policy.

Every… runs on absolute instants, not local clock times. Slots are counted from Starts, or from 1970-01-01T00:00Z when Starts is empty. So every 60 minutes without a start runs on the hour in UTC, and every 90 minutes runs at 00:00, 01:30, 03:00 UTC and so on. Set Starts to anchor the slots where you want them. Because the slots are absolute, daylight-saving changes neither skip nor repeat one — but the local time of each run shifts by an hour when the clocks change.

At times on days and Cron run on local clock times in the schedule's time zone. A daily 08:00 stays at 08:00 local time across daylight-saving changes.

Cron Syntax

The platform uses Quartz cron expressions: six fields, or seven with an optional year, seconds first:

┌──────── second (0-59)        must be a single value — the platform runs at most once a minute
│ ┌────── minute (0-59)
│ │ ┌──── hour (0-23)
│ │ │ ┌── day of month (1-31, L, W, ?)
│ │ │ │ ┌ month (1-12 or JAN-DEC)
│ │ │ │ │ ┌ day of week (1-7 = SUN-SAT, or SUN-SAT, L, #, ?)
│ │ │ │ │ │ ┌ year (optional)
0 0 8 ? * MON-FRI

Rules that trip people up coming from crontab:

  • Seconds come first. A five-field crontab line is not a valid Quartz expression.
  • The seconds field must be one number, usually 0. An expression that fires more than once a minute is refused.
  • One of day-of-month and day-of-week must be ?. Quartz does not combine them.
  • Day-of-week numbers differ. Quartz counts 1 = Sunday to 7 = Saturday; crontab counts 0 (or 7) = Sunday, 1 = Monday. Use names — MON, TUE — and the question does not arise.
  • Quartz adds L (last), W (nearest weekday) and # (nth weekday of the month).

Translating common crontab lines

Crontab (five fields) Meaning Quartz
* * * * * Every minute 0 * * * * ?
*/15 * * * * Every 15 minutes 0 0/15 * * * ?
0 * * * * Every hour, on the hour 0 0 * * * ?
30 */2 * * * Every two hours at half past 0 30 0/2 * * ?
0 8 * * * Every day at 08:00 0 0 8 * * ?
0 8,12,16 * * * At 08:00, 12:00 and 16:00 0 0 8,12,16 * * ?
30 17 * * 1-5 Weekdays at 17:30 0 30 17 ? * MON-FRI
0 9-17 * * 1-5 Every hour from 09:00 to 17:00 on weekdays 0 0 9-17 ? * MON-FRI
0 9 * * 1 Mondays at 09:00 0 0 9 ? * MON
0 0 * * 0 Sundays at midnight 0 0 0 ? * SUN
0 6 1 * * 06:00 on the first of the month 0 0 6 1 * ?
0 0 1 1 * Midnight on 1 January 0 0 0 1 1 ?
(not expressible) 18:00 on the last day of the month 0 0 18 L * ?
(not expressible) 09:00 on the first Monday of the month 0 0 9 ? * MON#1
(not expressible) 16:00 on the last Friday of the month 0 0 16 ? * 6L
0 9 1 * 1 09:00 on the 1st or on Mondays (crontab's OR) Two triggers: 0 0 9 1 * ? and 0 0 9 ? * MON

For simple timetables, At times on days is easier to read and review than a cron expression; use cron for what it cannot say.

Time Zones And Daylight-Saving Time

Choose the time zone the business thinks in. The editor's preview, the Upcoming tab and the scheduler all compute fire times the same way, so what the preview shows is what runs. Two rules apply to local times on the days the clocks change:

  • Spring forward — a time that does not exist that day runs one hour later. In Europe/Rome, clocks jump from 02:00 to 03:00 on the last Sunday of March, so a schedule for 02:30 runs at 03:30 local time that day. The day is not skipped.
  • Fall back — a time that occurs twice runs once, at its first occurrence. On the last Sunday of October, 02:30 happens twice in Europe/Rome; the schedule runs at the first 02:30 (still summer time) and not again an hour later.

If a run must never land in the changeover hour, schedule it outside 01:00–03:00 local time, or use UTC.

Every… schedules are unaffected by both rules: they run on absolute instants.

Missed Runs

A slot is missed when the scheduler reaches it more than about 30 seconds after it was due — two sweep intervals — because the Jobs worker or the database was down, or triggers were switched off by configuration. The trigger's If a run is missed policy decides what happens:

Policy What happens
Run once, if within the grace window (default) If the newest missed slot is within the grace window (default 3 600 seconds; 0 to 604 800), the agent runs once, for that slot. Earlier missed slots are not run; the log records how many were coalesced. If even the newest is older than the grace window, nothing runs and one Skipped execution records the gap
Skip Nothing runs late. One Skipped execution, failure kind Misfire, records how many slots were missed and between which times

Either way a gap is visible on the Executions tab rather than silent, and the schedule continues from its next future slot.

When The Previous Run Is Still Going

A scheduled run can take longer than the gap between slots. The trigger's If the previous run is still going setting decides:

Policy Behaviour
Skip while one is running (the schedule default) The new slot does not run. A Skipped execution with failure kind Overlap is recorded
Queue behind the running one The new slot waits until this trigger's earlier executions have finished, then runs
Run in parallel Runs alongside, within the agent's own concurrency limit

Independently of the trigger, the agent's Max concurrent executions (Agent Directory, Details) bounds how many of its executions run at once across every channel, and Max queued executions bounds how many may wait. When the queue is full, a scheduled slot is recorded as Skipped with failure kind AgentCapacity. Longest wait in queue on the trigger ends a run that waited longer as Skipped with QueueWaitExceeded.

Precision

The scheduler checks every 15 seconds by default, so a run is admitted within about 15 seconds of its slot, and starts when a Runtime replica claims it, normally a few seconds later. Do not rely on second-level timing. The hosted_agent_schedule_lag_seconds metric reports how late slots actually fire (see Monitoring & Troubleshooting).

Pausing, Editing And Deleting

  • Pause trigger (disable) stops the schedule. Enable trigger computes the next slot from now. Nothing is back-filled for the paused period: runs that would have happened while it was paused never run, and no skipped executions are recorded for them.
  • Editing the timetable also recomputes the next slot from now.
  • An execution already queued when you pause the trigger still runs: it was accepted while the trigger was enabled. To stop it, select it on the Executions tab and choose Cancel execution in its summary.
  • A schedule whose agent is inactive or deleted does not fire. It moves on to its next slot without recording an execution; reactivating the agent resumes it from the next slot.
  • A schedule stops for good after its Ends time.

Switching triggers off for the whole platform (HostedAgents:Triggers:Enabled, an operator setting) is different from pausing: schedules keep their next slot, so when triggers are switched back on, the slots that passed are handled as missed runs.

Running A Schedule Now

Fire now, in a schedule trigger's summary on the Agent Triggers page, runs the schedule once, immediately — with its instructions and parameters, as its run identity — exactly as its next slot would. It does not move the schedule: the next slot still runs at its time. It needs the Apps & Tools manage role. The run is recorded with channel Manual and names who pressed it, and the trigger's overlap policy applies to it as to any other run.

Fire now is offered on schedule triggers only. A webhook runs when its sender delivers an event, and a manual preset runs as whoever starts it with Run….

Testing A Schedule

Use the editor's preview and the Upcoming tab to check the timing, and Check identity in the editor to check, before the first slot, that the run identity resolves and that the agent's access policy lets it in. To check the agent and its tools, start it by hand with Run… in the Agent Directory, or set a near slot while testing. Upcoming lists every enabled schedule's fires over the next 24 hours, 3 days or 7 days, with each slot's local time.