BetaWorkflow trigger
On a schedule
Beta — ready to use, but some details may still change.
Overview
Runs the workflow at fixed times — every morning, every Monday, once an hour — for published apps, on their live data.
Purpose
Recurring work: generate due preventive maintenance, send daily reminders for tomorrow's appointments, weekly summaries, nightly clean-ups.
Inputs
- Schedule — one of:
every hour(orhourly),every hour at :30,every day at 09:00(ordaily 09:00),every weekday at 08:30,every monday at 08:00(any day name),every month on day 1 at 07:00(days 1–28). 24-hour times in the app's time zone (Settings → Time zone; UTC when unset). Anything else is refused when you save. - Also run on test data (optional) — also run the draft's version of the workflow on schedule against the test data. Off by default.
Configuration
- Runs come from the server's workflow cron (
/api/workflows/cron): published apps only — the published version runs against live data. A workflow only in the draft runs on schedule after you publish (or with Also run on test data). - Each occurrence runs once: it is claimed under the project's data lock, so a retried or overlapping cron call never runs it twice. A run that fails with an error is rolled back and retried at the next tick; a Stop step counts as done.
- Occurrences are checked when the cron ticks. Missed occurrences are coalesced: at most one run per workflow per tick, for the latest occurrence of the last 26 hours. On Vercel Hobby the cron ticks once a day (06:00 UTC), so
every houreffectively runs daily there; on Vercel Pro the cron can tick hourly. - Test run runs it now against test data (“Run now”). Previews and the public demo never run schedules by themselves — add a button with Run workflow if people should start it by hand too.
- Scheduled runs hold the project's data lock like button runs: keep Wait, Call API and AI steps out of workflows that check and write records.
Outputs
- No trigger record and no signed-in user (
{{user.email}}is empty,{{user.roleId}}isrole_public). Event data describes the occurrence:{{event.occurrence}}(UTC instant),{{event.date}}and{{event.time}}(in the app's time zone) and{{event.schedule}}. Use Find records to load what to work on. - Available data in every step: Current record /
{{record.field_key}}(the record that triggered the run), Event /{{event.name}}(inputs passed to the run;{{event.before.field_key}}holds the previous values after an update), Action results /{{results.key}}(values saved by earlier steps) and Current user /{{user.email}}(whoever caused the run; for test runs, you).
Example
Generate due preventive work orders every morning
Example
Trigger: On a schedule · every day at 06:00
Step 1 Database › Find records Maintenance Plans (Status = Active, Next Due Date ≤ {{today}}) → save as due
Step 2 Repeat for each Action results › due
Each → Run action: Run workflow “Create preventive work order” (plan_id = {{event.item.id}})Errors
- A failed run appears in Run history with the step and error (trigger: schedule, with the occurrence); it is retried at the next tick while the occurrence is within 26 hours.
- A schedule that MyAppBuilder can't read is refused when the workflow is saved.
Limitations
- No cron expressions, seconds or minute intervals other than once an hour; monthly schedules run on days 1–28.
- Missed occurrences are not replayed one by one (one run per tick, the latest within 26 hours).
- Nothing runs unless the deployment calls the workflow cron (Vercel Cron with
CRON_SECRET, or any scheduler calling the URL with the secret). - Apps of a workspace whose trial ended or whose plan is suspended don't run schedules (live apps are paused); test-data schedules run only while the workspace can edit.
Advanced
- Trigger:
{ type: "schedule", schedule?: string, runOnTestData?: boolean }. Syntax and occurrence math:parseSchedule()/latestOccurrence()in src/core/schedule.ts (validated by createworkflow / updateworkflow / create_trigger viaworkflowTriggerIssues). - Runner:
runDueScheduledWorkflows()(src/server/workflows/schedule.ts) — live projects whose deployed snapshot contains a schedule trigger (jsonb containment), draft projects withrunOnTestData, paged, max 200 runs and a 45 s budget per tick. Each due occurrence callsrunWorkflow(ctx, wf, { type: "schedule", occurrence, input })withuser: null. - Exactly once: inside the data lock the executor checks and records
occ:<iso>inworkflow_idempotency_keys(kept 8 days) — recorded for succeeded and stopped runs, rolled back with failed ones; a duplicate's run row is deleted.