web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Suggested Answer

Scheduled tasks changes timeout duration to default after hitting timeout error on the first run

(4) ShareShare
ReportReport
Posted on by 8
Hi,
 
I am having trouble with a recurring job queue and its timeout duration. The job queue runs approximately once a day and has a timeout configured at 16 hours and a maximum number of attempts set to 10. A few days a month the job hits the timeout limit and throws an error. So far so good, but when the next task is created from the job queue the timeout value is set to 12 hours, which differs from the configuration. Why would the value differ from the job queue configuration? 
 
Job queue setup
 
 
Log entries
 
 
Next scheduled task created after it failed due to timeout error
I have the same question (0)
  • Suggested answer
    Sohail Ahmed Profile Picture
    11,136 Super User 2025 Season 2 on at

    The default Job Timeout is typically set to 12 hours, which overrides the custom setting unless it's explicitly reapplied.

    To work around this, you can:

    • Manually reapply the 16-hour timeout after failure (not ideal), or
    • Use a custom codeunit or Job Queue Category logic to programmatically reset the timeout value each time the job is scheduled.
     

    ✅ Mark this answer as verified if it helps you

  • Suggested answer
    Jeffrey Bulanadi Profile Picture
    8,760 on at

    Hi,

    It’s a subtle but known behavior in BC’s Task Scheduler. When a job queue entry fails due to a timeout, the system may regenerate the next scheduled task using the default timeout value, which is 12 hours for online environments. This override can happen even if your original job queue entry was configured with a longer timeout (e.g., 16 hours).

    Here’s what’s happening:

    • The Scheduled Task created after a timeout doesn’t always inherit the original job queue’s timeout setting. Instead, it falls back to the default unless explicitly redefined in AL or via telemetry.
    • This behavior is tied to how the TaskScheduler.CreateTask method handles retries. If the task is recreated automatically after failure, and no timeout is passed in the retry logic, it defaults to 12 hours.
    • The discrepancy is visible in the Scheduled Task table, where the Timeout field shows 12h even though the Job Queue Entry still says 16h.


    To fix this:

    • Consider customizing the job queue logic to explicitly pass the timeout value when creating tasks via AL. You can use TaskScheduler.CreateTask with a timeout parameter to enforce your desired duration.
    • Alternatively, monitor task creation via telemetry and use TaskScheduler.SetTaskReady to adjust the timeout before execution.
    • If you’re using retry logic, ensure that the failure codeunit or retry handler re-applies the original timeout value.


    Helpful References:
    Analyzing Task Scheduler Telemetry – Microsoft Learn
    Problems with Job Queue Entries – Mibuso Forum
    Task Scheduler Timeout Behavior – Microsoft Docs
    Session Timeout Settings – Microsoft Learn


    If you find this helpful, feel free to mark this as the suggested or verified answer.

    Cheers
    Jeffrey

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 3,143

#2
Jainam M. Kothari Profile Picture

Jainam M. Kothari 1,694 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 1,067 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans