feat(ui): schedules table, runs page and Schedule trigger

Schedules list as a table with enable, run now, edit, duplicate, delete and
view runs; built-ins only enable, retime and run. The runs page links each
run's tasks through its capture's dispatches. The Start node gains a Schedule
trigger that picks or creates a schedule and binds the schedule source to the
workflow. Times show in a per-browser display zone set under Appearance; the
cron time zone and run retention are edited on the Schedules page.
This commit is contained in:
sam committed 2026-10-26 00:57:52 +11:00
1 parent 12dd3084e5
commit d4e563a19c
52 files changed
+1425 -131

No files matched your search

+10
View File
@@ -179,6 +179,16 @@ export const api = {
request<{ version: number }>("/api/access/policies", { method: "PUT", body: policy }),
deletePolicy: (policy: unknown) =>
request<void>("/api/access/policies", { method: "DELETE", body: policy, parse: false }),
schedules: <T = unknown>() => request<T>("/api/schedules"),
// scheduleSave creates or replaces the schedule with this id.
scheduleSave: <T = unknown>(id: string, schedule: unknown) =>
request<T>(`/api/schedules/${encodeURIComponent(id)}`, { method: "PUT", body: schedule }),
scheduleDelete: (id: string) =>
request<void>(`/api/schedules/${encodeURIComponent(id)}`, { method: "DELETE", parse: false }),
scheduleRunNow: <T = unknown>(id: string) =>
request<T>(`/api/schedules/${encodeURIComponent(id)}/runs`, { method: "POST", body: {} }),
scheduleRuns: <T = unknown>(id: string) =>
request<T>(`/api/schedules/${encodeURIComponent(id)}/runs`),
orgs: <T = unknown>() => request<T>("/api/orgs"),
// orgCreate makes an org with its default workspace and first owner; only
// an instance admin may.
+5
View File
@@ -33,3 +33,8 @@ export function compact(n: number | null | undefined): string {
maximumFractionDigits: 1,
}).format(n);
}
/** An exact date and time in zone, or in the browser's zone when zone is empty. */
export function exactTime(value: Date, zone: string): string {
return value.toLocaleString(undefined, zone ? { timeZone: zone, timeZoneName: "short" } : undefined);
}
+1 -1
View File
@@ -41,7 +41,7 @@ const orgSpecs: NavSpec[] = [
},
{
label: "Automation",
paths: ["/org/playbooks"],
paths: ["/org/schedules", "/org/playbooks"],
},
],
},