Skip to content

The Onboarded™ application includes robust error handling for API operations, including automatic retry capabilities and deferred processing when system limits are reached.

Error Sync Queue Overview

The Onboarded_Sync_Queue__c object stores sync requests that cannot be processed immediately. Requests are queued in the following scenarios:

  • Queueable Limits Reached: Salesforce limits the number of queueable jobs that can be enqueued. When this limit is reached, requests are stored for later processing.
  • Inbound Sync In Progress: To prevent conflicts, outbound sync requests made during an inbound sync are deferred.
  • API Failures: Failed API calls may result in records being queued for retry.

Queue Mechanics

When a record is inserted into the Sync Queue, an after insert trigger automatically fires and enqueues a Queueable job to process pending records. The processor:

  1. Retrieves all pending records from the queue (up to 200 at a time)
  2. Attempts to process each request by making the appropriate API call
  3. Updates the record status based on the result
  4. Increments the retry count for failed attempts

The trigger includes safeguards to prevent re-entrancy and will skip processing if an inbound sync is already in progress or if queueable limits have been reached. In those cases, records remain in Pending status and will be processed when the next queue record is inserted or when capacity becomes available.

Queue Record Statuses

StatusDescription
PendingRecord is waiting to be processed
ProcessingRecord is currently being processed
FailedRequest failed after maximum retry attempts

Self-Cleaning Behavior

The Sync Queue is self-cleaning. Successfully processed records are immediately deleted from the queue. There is no "Completed" status — once a request is successfully processed, the queue record is removed.

Only records that have failed processing remain in the queue for review.

Important: While the queue is self-cleaning for successful operations, you should monitor this object for any failed records. Failed records indicate sync issues that may require manual intervention, such as:

  • Invalid data that the Onboarded™ API rejected
  • Authentication issues
  • Records that exceeded the maximum retry count
  • API endpoint availability issues

Queue Monitoring

To monitor sync queue health:

  1. Create a List View on Onboarded_Sync_Queue__c filtered to show Status = Failed
  2. Review the Error_Message__c field for details on why the request failed
  3. Check the Retry_Count__c field to see how many attempts were made
  4. Consider creating a Report or Dashboard to track queue health over time

Tip: Set up a workflow rule or Flow to send email notifications when records enter a Failed status, so you can address issues promptly.

Both the Employee Onboarded and Workflow Onboarded components also support an optional inline error log panel — enable the Show Error Logs design property in Lightning App Builder to surface the last 30 days of Error Log entries for the displayed record (and per-Workflow, on the Employee Onboarded component). This gives HR users visibility into sync failures without leaving the record page.

Failed Record Resolution

When you encounter failed queue records:

  1. Review the error message to understand why the request failed
  2. Fix the underlying issue (e.g., correct invalid data, resolve authentication problems)
  3. Reset the record for retry by changing the Status back to Pending and setting Retry_Count__c to 0
  4. Delete the record if it's no longer needed or the data has been synced through other means