definePlay.
Define a play
plays/onboarding.ts
workflow is deployed as the play’s release. changeKinds and schedule control when runs are created. schedule accepts one of:
realtime and watch are distinct: realtime reacts to row changes in the
model, while watch follows an externally managed schedule.Deploy and trigger
{"kind":"filter"} enrols every row of the model; add a filter to narrow it.
See Triggering for the other data
kinds.
Fallbacks and health
Add fallback paths so a failed step doesn’t fail the whole run (notify, try an alternative provider, write defaults, or skip and continue). Watch success rate and set batch-health alerts. See Triggering for schedules and enrolment, and Monitoring for records and metrics. Batch health is declarative on the play:healthThreshold is the minimum percentage of successful runs (0–100) for a finished batch to count healthy, and healthAlertActions fire — each as its own run — when a batch lands below it. Actions take a connector action, an agent, or a tool:
[] clears the actions.
These are the same action shapes an alert fires, so config can be type-checked the same way — wrap a connector action in alertConnectorAction or a tool in alertToolAction, and an agent’s is typed already. Here the interpolation roots are play and batch ({{batch.url}}) rather than an alert’s alert and event.

