Running things in the background
Background processing in AL for Business Central: page background tasks, Session.StartSession, the task scheduler and the job queue. It answers questions about choosing a mechanism, scheduling codeunits and reports, handling errors and retries, and concurrency and timeout limits online and on-premises.
- 7Learn pages
- 1subtopics
- 1videos
Path: Development > Programming in the AL language > Running things in the background · tier official · system development · narrative reviewed (checked by Opus)
Overview
This area covers the ways AL code can run work outside the user’s foreground session. An overview page compares the mechanisms: page background tasks, Session.StartSession, the task scheduler and the job queue. It notes that each has limits for concurrency and timeouts, and that these differ between online and on-premises environments.\n\nPage background tasks, the task scheduler and the job queue each have their own page. Page Background Tasks covers read-only computations that keep a page responsive, with parent and child sessions, dictionary parameters, timeouts and error levels. The task scheduler page covers running codeunits and reports at a set date and time, with retry for transient errors and failure codeunits. The job queue page covers end-user scheduling of recurring background jobs through a dispatcher codeunit, with error handling and permissions. A subtopic holds the AL language reference pages for background processing.\n\nStart with the asynchronous processing overview to pick a mechanism and check its limits. Then read the page for that mechanism.
Key points
- The overview compares page background tasks, Session.StartSession, task scheduler and job queue.
- Concurrency and timeout limits differ between online and on-premises; settings named include ChildSessionsMaxConcurrency and BackgroundSessionsMaxConcurrent.
- Page background tasks run read-only computations and long processes without blocking the user.
- Page background tasks use parent and child sessions, dictionary parameters for input, configurable timeouts, and error levels Ignore, Warning and Error.
- Page background tasks can be re-enqueued or conditionally cancelled.
- The task scheduler uses CreateTask, SetTaskReady, TaskExists and CancelTask to run codeunits and reports at a given date and time.
- The task scheduler retries retriable exceptions and can run failure codeunits.
- The job queue lets end users schedule recurring background jobs via a dispatcher and an error handler, with parameter passing and permissions.
Subtopics
More Learn pages
- Asynchronous Processing in AL for Business Central: Compare asynchronous processing options in Business Central. Choose page background tasks, background sessions, scheduled tasks, or job queues for your AL code.
- Job queue: Learn about how the job queue works
- Page Background Tasks: Explains how to create page background tasks in Business Central.
- Task scheduler: Learn about scheduled tasks and how the task scheduler works.
Videos, posts and code changes
Linked by a Haiku matcher with a grounding quote from the item’s summary (link/topics.ts); machine-generated.
- #11257 Fix duplicate retention continuations for Waiting jobs (code change): “Fix duplicate retention continuations for Waiting jobs”
- #11262 Fix retention policy deletion-limit stop propagation (code change): “Fix retention policy deletion-limit stop propagation”
- #11890 Adding an in-product email storage cleanup (code change): “Scheduler proactively sends admins remediation steps”
- #11950 Adding an in-product email storage cleanup (backport to releases/29.x) (code change): “Adds codeunits for cleanup, a runner, a scheduler and inbox row deletion”
- #12117 [Job Queue] Clearer message and attempt number for runs interrupted by the platform (code change): “platform interrupts a job queue run, the log entry message now says”
- #14135 [Job Queue] Don’t cancel the executed task when scheduling the next run (code change): “Job Queue schedules the next run after a successful recurring run or a retry”
- #14485 [Job Queue] Apply Job Timeout to tasks re-created by the dispatcher (code change): “Job Queue entries are now terminated according to their configured Job Timeout”
- #14499 Job Queue: resume interrupted finalization on task retry (code change): “Job Queue: resume interrupted finalization on task retry”
- #9820 Use ReadCommitted isolation for CalcFields in Job Queue Entry GetXmlContent (code change): “Job Queue Entry GetXmlContent method now uses ReadCommitted isolation when reading”
- #148 Add Job Queue reliability and scheduling guidance (code change): “Require external side effects in Job Queue handlers to be idempotent”
- #237 knowledge(data-modeling): keep business state independent of Job Queue lifetime (code change): “Deleting a Job Queue Entry can lose business state”
- Background Page Tasks in Business Central Explained (community post): “Background page tasks enable pages to automatically refresh themselves”
- Dynamics 365 Business Central: the mistery around the “Parallel Session Management” codeunit. (community post): “Codeunit 490 is a manual, in-memory orchestrator using scope OnPrem procedures without async/await or platform-managed queues”
- If You Can’t Make It Fast, Make It Feel Fast (community post): “moving blocking work to the background instead of waiting for user input”
- 20260223 - If You Can’t Make It Fast, Make It Feel Fast (video): “background processing; job queue; page background task; task scheduler”
Source: Microsoft Learn (CC BY 4.0). Descriptions are Learn’s own.
What Learn documents here 7 Learn pages
- learnAsynchronous Processing in AL for Business Central2026-10-23
- learnJob queue2023-12-18
- learnPage Background Tasks2021-04-01
- learnSession.StartSession(var Integer, Integer [, Text] [, var Record]) Method2026-10-01
- learnSession.StopSession(Integer [, Text]) Method2026-10-01
- learnTask scheduler2024-09-09
- learnTaskScheduler data type2026-10-01