definePlay — schedule, which changes count, how records enrol, and which rows are eligible. All of it deploys with cargo-ai cdk deploy.
Configure triggers in code
plays/onboarding.ts
Schedule
Theschedule field selects how the play is driven:
Real-time schedules are currently only available for HubSpot and
Salesforce. The minimum interval for scheduled syncs depends on the model
type (as short as 5 minutes, up to 1 day); a sync is skipped if the model was
already refreshed within that window.
Change detection
changeKinds controls which row changes create a run. Defaults to ["added"].
- Real-time schedules know exactly what happened — a row was
added(created in the source) orupdated. - Scheduled syncs (cron, dependency, watch) compare snapshots, so
addedmeans “appears in this sync but not the last” — which includes newly created rows, rows that now match thefilterfor the first time, and restored rows.
Enrolment rules
runCreationRule controls what happens when a record triggers repeatedly:
Eligibility filter
filter (and optional sort, limit) restricts which rows are eligible. It uses the same JSON schema as the UI segment builder and the segment download CLI command.

