Invoke event trigger manually
- Console
- API
You can select the Via console
trigger operation while creating an event trigger
to allow invoking the event trigger on rows manually using the Hasura console.
In the Data -> [table-name] -> Browse Rows
tab, clicking the
invoke trigger
button next to any row lets you invoke "manual event
triggers" configured on the table with that row as payload (the button
will be shown only if you have any triggers configured):

Click on the event trigger you want to run and a modal will pop up with the request and response.

When creating an event trigger over the pg_create_event_trigger
metadata API, you can set the argument enable_manual
to true.
Then you can use the pg_invoke_event_trigger metadata API to invoke triggers manually:
POST /v1/metadata HTTP/1.1
Content-Type: application/json
X-Hasura-Role: admin
{
"type" : "pg_invoke_event_trigger",
"args" : {
"source": "<db_name>",
"name": "send_email",
"payload": {}
}
}