Schema triggers
Create a schema trigger — send an email, push or SMS, call a webhook, push a realtime event or run code when a record is inserted, updated or deleted.
Where: Database → Collections → row menu → Edit schema → Triggers tab → Add New (or the flame icon in the Collections list) · /projects/<project>/db/schemas/<schemaName>/triggers/new
A schema trigger runs an action every time a record of one collection is inserted, updated or deleted — no matter which app, script or AI tool made the change. The rules that are the same in every module are on the Triggers concept page.
Before you start
The collection exists and is published — see Create a schema.
For Call Webhook: a webhook destination subscribed to the matching event (
database.record.inserted,…updated,…deleted) in Project → Settings → Webhooks. For Send Email / Push / SMS: an integration and a template of that channel, for example an email template.You need
database:updateon the schema's triggers (database:trigger:<schemaId>).
Steps
Open the collection's schema and switch to the Triggers tab. The list is titled Database Triggers. Press Add New.

The Triggers tab of the books schema. Under If this → Select trigger actions, pick the record event: When inserted, When updated or When deleted. Add activation code lets you add code that runs first and can stop the trigger.
Under ... then, open the action picker and choose the action.

The action picker. ActionWhat it doesRun Code
Runs an installed marketplace function with the event data.
Send Email / Send Push Notification / Send SMS
Sends a template to the recipients you choose. The record's fields reach the template as tokens (
@Model.title); an update also carries the previous values.Call Webhook
POSTs a signed JSON envelope to the destinations you tick. Only destinations subscribed to the event can be picked; Save stays off until you tick one.
Send In-App (Realtime / SSE)
Delivers the event live to connected apps or AI agents.
Fill the action's part of the form, then the trigger's own fields:
FieldRequiredWhat it doesExampleSend to webhook destinations (Call Webhook)
yes
The destinations that get the call.
Fulfilment service(Subscribed)Order
no
Run order when several triggers listen to the same event; lower runs first.
2Name the trigger
yes
The name in the list.
Notify fulfilment about a new bookDescription
no
Free text.
Sends every new book to the fulfilment serviceIs this trigger enabled?
no
On: the trigger runs. Off: saved but quiet.
on

A Call Webhook trigger, filled in. Press Save.
Result
The trigger is in the schema's Triggers list with When, What, Environment and Enabled, and the collection shows the flame icon on Database → Collections. The next matching record change runs the action — here, every new book is POSTed to the fulfilment service.

Each trigger fires only for its own event and only in its own environment. Triggers reach PROD by promotion.
A destination that is subscribed to the event and chosen on a Call Webhook trigger gets two deliveries for one change: the plain one and the trigger one. Both carry the same
eventId— de-duplicate on it, see Webhooks.An Email / Push / SMS run that cannot send marks the trigger Needs attention in the list.
Old triggers with the legacy Code action show Code (not run) in the list: they are saved but never run.
Change or remove it later
Click the trigger's name in the list. The form opens as Edit Trigger, with the trigger id (trg_1p4R3gTobGZpD6fXvHT4rd) and an Actions menu.

Edit — change any field and press Save. A trigger cannot move to another schema.
Disable / Enable — Actions → Disable keeps the trigger but stops it; a disabled trigger says Trigger is disabled, but you can still edit it.
Delete — Actions → Delete trigger..., then Delete in the confirmation (Are you sure you want to delete?). A schema with triggers cannot be deleted until its triggers are gone.
Do it from code
To create one from code, send saveSchemaTrigger with type: 'Schema', schemaId, name, when (OnInserted, OnUpdated, OnDeleted) and action. The client setup is on the Database page. API: Save Schema Trigger · Get Schema Triggers · Enable · Disable · Delete
Last updated
Was this helpful?