Kizaki
ReferenceInspire

Triggers, Effects, And Schedules

Declare synchronous hooks, retryable async work, and recurring jobs in Inspire.

Trigger And Effect Example

entity Order {
  status: string,

  @on(update, status) trigger updateOrderStats
  @on(update, status) effect sendReceipt {
    retries: 5,
    backoff: exponential(1s),
  }
}

Schedule Example

schedule nightlyDigest {
  cron: "0 2 * * *",
  function: sendDigest,
  timeout: 5m,
}

How To Choose

  • use a trigger for synchronous in-transaction work
  • use an effect for retryable async work
  • use a schedule for time-based execution

What It Affects

These declarations change how work happens around data changes and time, which is why they belong in the schema rather than as informal conventions in app code.

Related guide: Background Work

On this page