Skip to content

Scheduling and recurrence

A DroneMission can dispatch itself: once, at a future moment, or on a recurrence. The scheduler runs against the scheduledAt and recurrence fields and walks the mission through the same upload → register → prepare pipeline a manual dispatch uses.

One-shot (scheduledAt)

In the planner’s Schedule section pick Once and set a date/time. The mission document gets scheduledAt (epoch ms) and status: 'scheduled'. At the scheduled moment:

  1. The scheduler calls DjiMissionDispatcherService.dispatchToDock with scheduledTime = scheduledAt, which is passed through to the DJI flight task.
  2. Mission status progresses scheduleddji_dispatchedwayline_uploadingwayline_registereddji_preparingdji_readydji_executingdji_completed.
  3. Weather gates and dock-availability checks run just before dispatch. A hard fail after the configured retry budget sets status to weather_hold or schedule_cancelled.

Recurring (recurrence)

Pick Recurring to build a DroneMissionRecurrence:

  • freqdaily, weekly, or monthly.
  • timeOfDayHH:mm string, 24-hour, local timezone.
  • daysOfWeek — for weekly: array of 0-6 (Sun..Sat). Ignored otherwise.
  • dayOfMonth — for monthly: 1-31. Ignored otherwise.
  • endsAt — optional epoch ms. Unset = indefinite.
  • enabled — toggle without deleting the rule.

Each occurrence spawns a fresh mission instance cloned from the original, so you retain a browsable history of every flight. The original recurrence-template mission tracks lastDispatchedAt and nextDispatchAt as the scheduler advances.

Status flow for a recurring mission:

  • scheduled — armed, awaiting nextDispatchAt.
  • schedule_paused — pause via the planner without losing the rule.
  • schedule_completedendsAt reached.
  • schedule_cancelled — user-cancelled.

Auto-cancel on dependency failure

If a prerequisite fails at dispatch time — dock offline, aircraft not docked, wayline registration refused, weather gate red after retries — the occurrence transitions to dji_failed and the next occurrence is queued as normal. The parent recurrence is not killed; use Pause schedule in the planner to stop that.

Weather holds

Weather checks run inside the pre-dispatch phase. A weather_hold status means the scheduler is retrying on a backoff and the mission will dispatch as soon as conditions clear, up to the retry ceiling; after that it fails the occurrence and moves on.

Editing

Scheduled and recurring missions are fully editable until the next occurrence starts. Changing scheduledAt or the recurrence rule reschedules the next run.

Viewing upcoming runs

  • The operation’s mission list shows the next-run timestamp for every recurring plan.
  • The ops-map tile plots the next wayline preview when the mission is selected.