Custom Sync Types #
The sync queue routes items by type. Free types include user, contact, wc_customer, and form. You can add custom types:
add_filter('ghl_crm_execute_sync', function($handled, $item) {
if ($item->type === 'my_custom_type') {
// Process your custom sync
my_custom_sync_handler($item);
return true; // Mark as handled
}
return $handled;
}, 10, 2);
Adding Items to the Queue #
Use the sync queue API to add items for processing:
// The queue handles deduplication, rate limiting, and retry logic
$queue = GHL_CRM_Queue::get_instance();
$queue->add([
'type' => 'my_custom_type',
'data' => ['key' => 'value'],
]);
Dependencies #
Queue items can specify dependencies (prerequisite tasks that must complete first). This is used internally for contact-before-association workflows.
