Driver FixRecommendedSound, Wi-Fi or graphics acting up? Check drivers firstFind missing or outdated drivers fast.Check DriversOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PC×
Skip to content
World desk5 min

When Should You Use Queueable Apex in Salesforce?

Queueable Apex suits discrete background tasks that need job tracking, richer inputs, or serial stages. Compare it with Batch Apex, future methods, and Continuations before you enqueue.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use Queueable Apex for discrete background work that should run outside the current transaction and benefits from a trackable job ID, complex input, or sequential stages. Choose Batch Apex for very large record sets that need chunking; consider Continuations when a Lightning UI must remain responsive during a long-running callout. Queueable execution is deferred until Salesforce has capacity, so enqueueing a job does not mean it will finish immediately.

When should I use Queueable Apex?

Queueable Apex is a good fit when the initiating transaction can continue without waiting for the work, and the work is suitable for asynchronous execution—such as a long-running database operation or an external web service callout. Salesforce recommends Queueable Apex over Apex future methods for new asynchronous Apex work. The official Apex Developer Guide explains the feature and its limits.

  • You need richer inputs: Queueable jobs can receive non-primitive values, including sObjects and custom Apex types. Decide whether the job should use the values captured when it was enqueued or reread records at execution time; records may change while the job waits.
  • You need to identify or monitor the job: System.enqueueJob() returns an ID for the corresponding AsyncApexJob record, which can be queried or inspected in Apex Jobs.
  • You need sequential stages: A running Queueable can enqueue one successor. This supports deliberate serial workflows, not unlimited branching.
  • The caller can tolerate delay: Salesforce schedules asynchronous work when system resources become available. Do not make a user-facing process depend on an immediate completion time.

Queueable vs. Batch Apex

The key distinction is whether the workload is a discrete job or a large population that should be divided into chunks. Salesforce’s asynchronous processing decision guide identifies Batch Apex as an option for large-volume processing.

Question Queueable Apex Batch Apex
What fits best? A discrete asynchronous task, or a serial sequence of stages. A very large record population, especially when processing should be split into manageable chunks.
Can it process millions of records? Not the default choice for a population that needs chunked processing. Often the better starting point for millions of records that need chunking.
Can one execution launch more work? A running Queueable can enqueue one child job, according to Salesforce Trailhead. Choose based on the batch design and its requirements; do not assume Queueable’s one-child chain is an equivalent chunking mechanism.

Use the size and shape of the work—not the fact that both options run asynchronously—to choose between them. A chain of Queueables is appropriate for serial stages; it is not a substitute for a design that deliberately divides a large record population into batches.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Queueable Apex vs. future method

For a new asynchronous Apex implementation, Queueable is usually the stronger default. Salesforce states, “Salesforce recommends that you use Queueable Apex instead of Apex future methods.” Queueable provides a returned job ID, accepts non-primitive constructor state, and allows a running job to enqueue a successor. Future methods may still suit a simple method moved out of band when those capabilities are unnecessary, including some existing synchronous/asynchronous designs. The recommendation is not a reason to refactor every legacy future method automatically.

Can Queueable Apex make callouts?

Yes. Queueable Apex can perform external web service callouts when the job is designed and configured for callouts. It is appropriate when the initiating transaction need not wait for the external response. If a Lightning interaction needs a responsive experience around a long-running callout, compare Apex Continuations: Salesforce says one Continuation can contain up to three callouts and can support parallel callouts. A Continuation’s initial method cannot perform DML, although its callback can. See Salesforce’s Continuations documentation.

Can I enqueue Queueable Apex from a trigger?

Yes, but enqueueing from a trigger requires bulk and execution-context safeguards. Avoid a design that enqueues once per record: a single synchronous transaction can enqueue up to 50 Queueable jobs according to Trailhead, and asynchronous callers have stricter constraints. Salesforce Architects warns that direct trigger enqueueing can be risky; review its trigger automation decision guide when selecting an automation pattern.

  • Bulkify the trigger caller and consolidate records into appropriately sized work.
  • Check enqueue capacity for the current execution context rather than assuming the synchronous limit applies.
  • For high-volume or event-driven automation, compare Queueable with Flow, platform events, and Change Data Capture against the requirements and platform limits.

What limits and failure cases should I plan for?

Enqueue limits are context-specific

The 50-job figure is for a synchronous transaction; it is not a general per-job or per-org allowance. Asynchronous callers and batch or trigger execution contexts can have stricter constraints. Check current Apex limits and the target org’s available capacity before deployment.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Daily capacity is shared

Queueable does not have a separate daily execution allocation. Queueable, Batch, future, and Scheduled Apex use the shared DailyAsyncApexExecutions limit. Salesforce Help describes a typical org-level allocation of 250,000 executions per 24 hours or a license-based calculation, whichever is greater; this is not a universal per-feature Queueable limit, and the applicable value depends on the org and current platform rules. Check the current Salesforce Help limit information and the org’s live limits rather than hard-coding that figure.

Rollback cancels the queued work

If the transaction that enqueues a Queueable rolls back, Salesforce does not process that queued job. Enqueueing therefore does not make work independent of the initiating transaction’s success.

Delay and failure need an operating plan

Execution order and timing depend on available system resources. For work with business consequences, record job state and errors, make processing idempotent where possible, and define retries or reconciliation for transient failures. A chain should also have an explicit recovery path if a stage fails rather than assuming its successor will run.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

How do I monitor a Queueable job?

Keep the ID returned by System.enqueueJob() when you need to associate the caller’s request with a job. Use that ID to inspect its AsyncApexJob record or locate it in Setup’s Apex Jobs page. Monitoring should support the business workflow: identify whether work is pending, completed, or failed, and provide a way to investigate errors and reconcile records that were not processed.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

How to choose an asynchronous pattern

Requirement Pattern to evaluate
Discrete background task needing a job ID, rich inputs, or serial stages Queueable Apex
Very large population requiring chunked processing Batch Apex
Simple asynchronous method without a need for Queueable features Future method may suffice, particularly in an existing design
Responsive Lightning experience around a long-running callout Apex Continuations
Declarative or event-driven automation Compare Flow, platform events, and Change Data Capture with Apex options and applicable limits

Before choosing, assess data volume and chunking, serial versus independent work, whether the caller must wait or show an interactive result, the shape and freshness of inputs, monitoring and recovery needs, available enqueue and daily capacity, and whether the process belongs in Apex or another automation pattern.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
PC Slower Than It Used to Be?Free scan - under a minute
Crashes, No Sound, or Screen Glitches?Free driver scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.