Automation
Platform triggers
RidgeCRM platform automation, implemented as JavaScript handlers or webhooks.
Trigger definition
Platform triggers are org-owned definitions that decide when RidgeCRM should run code or call a webhook around record events. They are source-controlled extension points for teams that need deeper behavior than declarative automation rules.
| Field | Meaning |
|---|---|
| objectTypeKey | The object slot, such as Account, Lead, Case, or a custom object key. |
| triggerEvent | Before/after create/update/delete or field-change style event. |
| handlerType | `CODE_KEY` for JavaScript handlers or `WEBHOOK` for external delivery. |
| handlerKey | Lookup key registered by source code in the app fork. |
| order | Execution order when multiple triggers match. |
Handler code
Handlers live in the repository and are registered during server startup. Setup can display handler snippets and metadata, but source control remains the authority for behavior.
Record event
A create, update, delete, or field-change event enters the record service.
Trigger match
Active definitions match object type, event, order, and handler type.
Execute
RidgeCRM runs a JavaScript handler key or queues an outbound webhook.
Observe
Log outcomes, surface failures, and test behavior in an isolated org.
javascript
Conceptual handler registration
registerPlatformTriggerHandler('lead.enrich.afterCreate', async ({ record, orgId, prisma }) => {
// Look up context, update fields, enqueue a webhook, or create follow-up work.
return { recordId: record.id, orgId };
});Webhook triggers
Webhook triggers turn record events into outbound HTTP calls. Document headers, signing expectations, queue behavior, retries, and payload shape before teams rely on them for production integrations.