From a50ab173b59f19316cadf443ad89faf2af9ff149 Mon Sep 17 00:00:00 2001 From: Molecule AI Documentation Specialist Date: Sat, 18 Apr 2026 17:45:14 +0000 Subject: [PATCH] docs(schedules): add GET /admin/schedules/health cross-org endpoint (PRs #671 #796) Document the admin-only cross-org schedule health endpoint returning last-fired, next-scheduled, consecutive-empty count, and phantom detection status for every schedule in the org. Complements the per-workspace peer health endpoint already documented. Pairs with molecule-core PRs #671 and #796. Co-Authored-By: Claude Sonnet 4.6 --- content/docs/schedules.mdx | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/content/docs/schedules.mdx b/content/docs/schedules.mdx index cd82f07..f301687 100644 --- a/content/docs/schedules.mdx +++ b/content/docs/schedules.mdx @@ -193,6 +193,44 @@ peer workspaces. --- +## Cross-Org Schedule Health (Admin) + +Operators can retrieve schedule health for **every workspace in the org** in a single call: + +```bash +curl http://localhost:8080/admin/schedules/health \ + -H "Authorization: Bearer " +``` + +Requires `AdminAuth`. Returns an array covering every schedule across every workspace: + +```json +[ + { + "schedule_id": "uuid", + "workspace_id": "uuid", + "workspace_name": "security-auditor", + "expression": "0 */6 * * *", + "enabled": true, + "last_fired_at": "2026-04-18T12:00:00Z", + "next_scheduled_at": "2026-04-18T18:00:00Z", + "consecutive_empty": 0, + "phantom_detected": false + } +] +``` + +| Field | Description | +|-------|-------------| +| `last_fired_at` | Timestamp of the most recent run attempt (null if never fired) | +| `next_scheduled_at` | When the scheduler will next attempt this schedule | +| `consecutive_empty` | Count of consecutive runs that fired but received no task completion — an early indicator of a stuck or unresponsive workspace | +| `phantom_detected` | `true` if the schedule appears in the DB but its workspace has been removed; these are safe to delete | + +Use this endpoint to audit cron health org-wide before a maintenance window, or to identify schedules that haven't fired when expected. + +--- + ## Scheduler Internals ### Poll Loop