For the complete documentation index, see llms.txt. This page is also available as Markdown.

Custom hook

Pre run hook

At the start of each sync run, the Sync Engine lists all stored procedures named SYNC_RUN_PRE_HOOK, with a single object parameter. All that exist are executed with the following parameter value:

{
  "branch_id": <the id of the branch, or null>,
  "new_health_state": <the new health state of the run, e.g. "HEALTHY">,
  "sync_id": <the id of the sync>,
  "sync_slug": <the slug of the sync>,
  "sync_run_id": <the id of the sync run>,
  "previous_sync_run_id", <the id of the previous sync run, or null if this is the first run>,
  "previous_health_state", <the health state of the previous run, or null if this is the first run>
}

Note: Health states are listed here.

Post run hook

At the end of each sync run, the Sync Engine lists all stored procedures named SYNC_RUN_POST_HOOK, with a single object parameter. All that exist are executed with the following parameter value:

{
  "branch_id": <the id of the branch, or null>,
  "new_health_state": <the new health state of the run, e.g. "HEALTHY">,
  "sync_id": <the id of the sync>,
  "sync_slug": <the slug of the sync>,
  "sync_run_id": <the id of the sync run>
}

Note: Health states are listed here.

Example

Below is an example of a hook which simply writes the run information to a table:

Last updated