Trigger Points
Transformations run at specific points in the data pipeline:
| Trigger Point | Direction | Description |
|---|---|---|
| post_sync | Inbound | After data is synced from a bridge, before saving |
| pre_push | Outbound | Before data is pushed to a bridge |
| post_webhook | Inbound | After a webhook payload is processed |
| pre_operation | Internal | Before an operation action is applied |
post_sync
Runs after a bridge sync task fetches data. The transformation receives the raw synced records and can modify them before they’re saved to the database.
// Normalize Shopify order data
function transform(order) {
return {
...order,
tags: order.tags.split(',').map(t => t.trim()),
metadata: {
...order.metadata,
sourceChannel: order.source_name || 'web',
},
};
}pre_push
Runs before data is pushed to an external platform. Use this to format data according to the target platform’s requirements.
// Format fulfillment for Shopify
function transform(fulfillment) {
return {
...fulfillment,
tracking_company: mapCarrierName(fulfillment.carrier),
notify_customer: true,
};
}Selecting a Trigger Point
When creating a transformation, specify which trigger point and bridge it applies to:
POST /api/transformations
{
"name": "Normalize Shopify SKUs",
"triggerPoint": "post_sync",
"bridgeId": "uuid-of-shopify-bridge",
"code": "function transform(record) { ... }"
}