Guide 04 · Planned work

Turn recurring service into ready work.

Revolution Road stores schedule timestamps in UTC, preserves each template’s local timezone, and uses an idempotent run ledger so a retry cannot create the same work order twice.

01

Apply the Phase 3 migration

Run 202608020005_phase_3_preventive_maintenance.sql after the earlier migrations. It adds templates, schedule runs, job logs, PM work-order metadata, indexes, RLS, and the transactional generator.

02

Deploy the scheduler

Deploy pm-scheduler from backend/supabase/functions. Add the service-role key and a long random PM_SCHEDULER_SECRET through Supabase Edge Function secrets.

03

Connect Supabase Cron

Store the project URL and the same scheduler secret in Supabase Vault, then run backend/supabase/cron/pm-scheduler.sql. The job invokes the function every five minutes.

04

Create an asset PM

Open an asset, choose Add PM, then set the cadence, instructions, first local run, timezone, priority, and optional email notification.

05

Read the calendar and ledger

Use month or week view to compare planned PMs with generated work orders. Review Recent runs for delivery state or a failure that needs attention.

Optional notifications

Keep delivery outside the scheduler transaction.

Set PM_EMAIL_WEBHOOK_URL and its bearer key to send generated-work mail through your HTTPS relay. A failed email is recorded without rolling back the already-created work order. The optional alert webhook receives scheduler failure summaries.

Open the productManage PM schedules →