---
url: https://apexfluently.beyondthecloud.dev/libraries/async-lib.md
description: >-
  Handle Queueable, Batch, and Scheduled jobs with a unified API. Eliminates
  queueable limits with smart chaining and retry logic.
---

# Async Lib

Handle complex asynchronous operations in Apex. Chain queueable jobs, manage delays, and implement retry logic with a simple API.

::: info Documentation
You can find the full documentation at [async.beyondthecloud.dev](https://async.beyondthecloud.dev).
:::

## What Does It Solve?

* **Too Many Queueable Jobs** - Hitting governor limits when enqueuing multiple jobs in a single transaction.
* **Incompatible Async Interfaces** - Different interfaces for Queueable, Batchable, and Schedulable with no unified approach.
* **Job Observability Gap** – No native way to monitor Queueable chains or access job outputs.
* **Async Chain Orchestration** – Hard to enforce order, handle failures, or resume without custom boilerplate.

Read more about technical challenges [here](https://async.beyondthecloud.dev/explanations/initial-scheduled-queuable-batch-job.html#why-do-we-need-queueablechainbatch).

## Why Async Lib?

* **Eliminates Queueable Limits** - Automatically handles "Too many queueable jobs" by intelligent chaining and batch overflow.
* **Unified API** - Single, consistent interface for all async job types (Queueable, Batchable, Schedulable).
* **Smart Prioritization** - Jobs execute based on priority with automatic sorting.
* **Advanced Error Handling** - Built-in error recovery, rollback options, and continuation strategies.
* **Job Tracking** - Comprehensive tracking with custom job IDs and result records.
* **Configuration-Driven** - Control job behavior through custom metadata without code changes.
* **Support Finalizers** - Execute cleanup logic after job completion with full context.

## Quick Start

```apex
public class MyQueueableJob extends QueueableJob {
    public override void work() {
        // Your business logic here
        System.debug('Processing job: ' + Async.getQueueableJobContext().currentJob.customJobId);
    }
}
```

```apex {2,8,13}
// Queueable Job
Async.queueable(new MyQueueableJob())
    .priority(10)
    .delay(5)
    .enqueue();

// Batch Job
Async.batchable(new MyBatchJob())
    .scopeSize(100)
    .execute();

// Schedulable Job
Async.schedulable(new MySchedulableJob())
    .name('Daily Cleanup')
    .cronExpression('0 0 2 * * ? *')
    .skipWhenAlreadyScheduled()
    .schedule();
```

## Documentation

* [GitHub Repository](https://github.com/beyond-the-cloud-dev/async-lib)
* [Documentation](https://async.beyondthecloud.dev/)

## Installation

Choose the best installation option for you:

* [Deploy via Button](https://async.beyondthecloud.dev/introduction/installation.html#deploy-via-button)
* [Copy and Deploy](https://async.beyondthecloud.dev/introduction/installation.html#copy-and-deploy)
