Skip to content

Configuring Event Triggers

Fire webhooks when database rows are inserted, updated, or deleted

event triggers database events webhooks insert update delete webhook handler

Event triggers fire a webhook whenever a row in a tracked table is inserted, updated, or deleted. The webhook receives the old and new row data, letting your handler react to exactly what changed.

Navigate to Events > Event Triggers and click New Event Trigger.

Create Event Trigger

FieldDescription
Trigger NameUnique identifier (e.g. community_description_updated)
Data SourceThe database to monitor (typically default)
Schema / TableDatabase schema and table to watch
Trigger OperationsCheckboxes: Insert, Update, Delete, Manual
Update ColumnsWhen Update is selected — all columns or specific columns
Webhook URL or templateEndpoint URL, supports {{ENV_VAR}} syntax (e.g. {{NHOST_FUNCTIONS_URL}}/events/your-handler)
Retry and Headers SettingsRetry count, interval, timeout, and custom HTTP headers
Configure TransformationRequest options transform and payload transform (see Transformations)
OperationFires WhenPayload
InsertA new row is insertedold is null, new contains the inserted row
UpdateA row is updated (optionally filtered to specific columns)old contains the previous row, new contains the updated row
DeleteA row is deletedold contains the deleted row, new is null
ManualInvoked via the metadata API (pg_invoke_event_trigger)old is null, new contains the current row

The Manual operation enables on-demand invocation from the dashboard. When browsing a table in the Database section, select a row and click Invoke Event Trigger in the toolbar. A dropdown lists all event triggers for that table — triggers with Manual enabled can be invoked with the selected row’s data as the payload. Triggers without Manual enabled appear disabled with a lock icon.

Invoke Event Trigger

The webhook target can be any HTTP endpoint that returns a 2xx status code. By default, events are delivered as POST requests, but you can change the HTTP method using request transformations.

Event triggers deliver the old and new row data, the operation type, and session variables identifying who made the change.

{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"created_at": "2026-03-25T12:00:00.000Z",
"event": {
"op": "UPDATE",
"data": {
"old": {
"id": "community-123",
"description": "Old description"
},
"new": {
"id": "community-123",
"description": "New description"
}
},
"session_variables": {
"x-hasura-role": "user",
"x-hasura-user-id": "user-456"
},
"trace_context": {
"span_id": "abc123",
"trace_id": "def456"
}
},
"delivery_info": {
"current_retry": 0,
"max_retries": 3
},
"trigger": {
"name": "community_description_updated"
},
"table": {
"schema": "public",
"name": "communities"
}
}
FieldDescription
idUnique event UUID
created_atTimestamp when the event was created
event.opOperation type: INSERT, UPDATE, DELETE, or MANUAL
event.data.oldPrevious row data (null for inserts; null for manual triggers)
event.data.newUpdated row data (null for deletes)
event.session_variablesSession variables of the user who triggered the change
event.trace_contextTrace context with span_id and trace_id
delivery_infoCurrent retry attempt and max retries configured
trigger.nameName of the event trigger
table.schemaSchema of the table that triggered the event
table.nameName of the table that triggered the event

For working handler examples, see:

The event trigger sidebar in Events > Event Triggers lists all triggers. Each trigger has Edit and Delete actions.

Selecting a trigger opens its detail page with two tabs:

Displays the trigger configuration: data source, schema, table, webhook URL, trigger operations, update columns, retry settings, request headers, and transformation configuration.

Event Trigger Overview

Lists all events fired by this trigger. Each event shows its created time, delivery status, ID, and number of tries.

Event Trigger Events

Expand an event to see its invocation logs. Each invocation shows the HTTP status code and has two actions:

  • Redeliver — re-sends the webhook for that invocation
  • View Details — opens the full request and response (URL, method, headers, body, status)

Event Trigger Invocation Details