Understanding the Sync Queue
The sync queue is the heart of Xero Sync, managing all synchronization operations between Blesta and Xero.
How the Queue Works
Event-Driven Queuing
When something happens in Blesta, an event is triggered:
- Invoice created → Queue invoice sync
- Payment received → Queue payment sync
- Client updated → Queue contact sync
Queue Processing
A cron task runs every 5 minutes to process the queue:
- Picks up pending items (oldest first)
- Attempts to sync each item to Xero
- Records success or failure
- Removes successful items
- Retries failed items (with exponential backoff)
Queue Page Overview
Navigate to Tools → Xero Sync → Queue to view:
Pending Items
Items waiting to be processed:
| Column |
Description |
| Type |
Entity type (contact, invoice, payment) |
| ID |
Blesta entity ID |
| Action |
Operation (create, update) |
| Scheduled |
When it will be processed |
| Attempts |
Number of processing attempts |
Failed Items
Items that failed after maximum retry attempts:
| Column |
Description |
| Type |
Entity type |
| ID |
Blesta entity ID |
| Error |
Last error message |
| Attempts |
Total attempts made |
Queue Operations
Process Queue Now
Manually trigger queue processing without waiting for cron:
- Click Process Queue Now
- The queue will be processed immediately
- Results are displayed on completion
Retry Failed Item
Requeue a single failed item for another attempt:
- Find the item in the Failed Items list
- Click Retry
- Item moves back to Pending with reset attempts
Retry All Failed
Requeue all failed items at once:
- Click Retry All Failed
- All failed items move to Pending
- Useful after fixing a systemic issue
Clear Queue
Remove all pending items:
- Click Clear Queue
- Confirm the action
- All pending items are deleted
Warning: Cleared items will not be synced. Use only when intentionally stopping sync operations.
Delete Item
Remove a single queue item:
- Find the item in the list
- Click Delete
- Item is permanently removed
Priority System
Items are processed by priority:
| Priority |
Entity Type |
Reason |
| 1 (High) |
Contact |
Must exist before invoices |
| 5 (Normal) |
Invoice |
Standard priority |
| 5 (Normal) |
Payment |
Processed after invoices |
Retry Logic
Failed items use exponential backoff:
| Attempt |
Delay Before Retry |
| 1st fail |
5 minutes |
| 2nd fail |
15 minutes |
| 3rd fail |
45 minutes |
| Max reached |
Marked as failed |
Common Queue Scenarios
Queue Not Processing
- Check cron is running (Settings → Automation in Blesta)
- Verify the "Process Xero Sync Queue" task is enabled
- Check logs for errors
Items Stuck in Queue
- Items may be waiting for dependencies (contact before invoice)
- Check for API rate limiting (429 errors in logs)
- Try Process Queue Now to force processing
Too Many Failed Items
- Check Xero connection is active
- Review error messages for patterns
- Fix underlying issue, then Retry All Failed