Asynchronous (async) processing overview

It's often desirable to offload AL execution from the UI thread to a background session.

Here are some examples of this performance pattern:

  • Don't let the user wait for batches
  • Split large tasks into smaller tasks and run them in parallel

There are many different ways to spin up a new session:

They come with different characteristics as described in this table:

Method to start a new asynchronous operation Characteristics
Page Background Task Can (will) be canceled
Read-only
Runs in a child session, which is bound to its parent session.
Bound to a page.
Lightweight
StartSession Created immediately
Runs on same server as the session that starts it.
Runs as a background session.
Not as controlled as a Page Background Task
Task Queued up
Any server in a cluster can start it
Runs as a background session.
Survives server restarts
No logging in Business Central.
Job queue Scheduled
Recurrence
Any server in a cluster can start it
Runs as a scheduled task
Survives server restarts
Logging of results in Business Central.

Operational Limits for Business Central Online

To ensure the availability and quality of Business Central services, there are limits on certain operations, such as how many child or background sessions, or scheduled tasks that can run at the same time. For more information, see Operational Limits for Business Central Online.

Operational Limits for Business Central on-premises

For Business Central on-premises environments, you can control limits for operations related to sessions, such as how many child or background sessions, or scheduled tasks that can run at the same time. For more information, see Configuring Business Central Server.

See also

Job queue
Page background tasks
Task scheduler
Operational Limits for Business Central Online
Performance Articles for Developers