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 :
Microsoft Dynamics AX (Archived)

Workflow issue/performance

(0) ShareShare
ReportReport
Posted on by 50

Hi All,

My client is facing a serious workflow performance issue and have a lot of records end up with Error(stop). The workflow tables are very huge and have a lot of records in MessageQueueTable (few millions). It takes around 1 hour to assign to the approval or change the status (we schedule the batch job every 1 min).

We already separated the dedicated server for workflow with very high spec.

I would like to check if there any way to scale the workflow server or host in multiple servers? I have found a resource page for the workflow but it doesn't mention anything regarding with load balancing or cleaning up the history workflow.

Have you encountered the same issue before? How do you resolve it? As I am app consultant with little knowledge in technical, I would like to have some idea which I can talk to my technical team.

thanks for your time. Appreciate for any advice.

Regards,

Yuan

*This post is locked for comments

I have the same question (0)
  • André Arnaud de Calavon Profile Picture
    301,020 Super User 2025 Season 2 on at

    Hi Yuan,

    The causes can be more than one. How many workflows are defined in this environment? Per workflow how many instances are processed every day?

    Do you have some information about the stopped workflows? Is this related to a failed batch job or stopped in the history form? If it is on the history form, then please find some error messages. They may help you find the cause.

    Per batch job run, how much time does this take?

    Is there any index maintenance on the SQL server? The workflow tables do have GUID in the indexes which may cause fragmented indexes, also causing slowness. Is any fill factor set on the workflow table indexes?

  • Myo Sandar Profile Picture
    50 on at

    Hi Andre,

    Thanks for your reply. In fact, we only configure one workflow for Production in this server. Workflows for other UATs are installed in separated server.

    My client usage on workflow is quite huge. They have 10 workflows type in each entity and there are more than 15 entities. They have complex workflow configuration for PR and PO (PO is our customized workflow) with more than 50 steps in few entities. So, i think it makes server keep busy processing.

    We do have 350 instances daily during month ends.

    Workflow stopped with below errors (we check from workflow history form):

    1) Cannot edit a record in Workflow Messages Table (WorkflowMessageTable). Workflow message id: xxxx. Deadlock, where one or more users have simultaneously locked the whole table or part of it. (recently we have a lot of instances end up with this error)

    2) Failed to find workflow instance. Failed to find workflow instance.

    When we check from the event viewer, the error message is 'the thread is being aborted xxx'.

    In batch job history, I also see the batch job end up with Error due to Dead lock in workflow message table.

    For each batch job to complete, it takes few hours.

    I do not think the SQL server is doing index maintenance.

    Is the workflow is scalable effectively?

    Do you have any idea for deadlock on workflowmessagetable?

    We recently change the Maximum batch threads from 8 to 12. When we start encountering this deadlock issue, thus we changed back to 8 but the deadlock remain and still happening.

    Thanks for your time and share the thoughts.

    Regards,

    Yuan

  • André Arnaud de Calavon Profile Picture
    301,020 Super User 2025 Season 2 on at

    Hi Yuan,

    Do you have multiple AOS machines where batch jobs are running? If so, did you try to setup batches for some workflows on one and other workflows on another batch server within the same environment? This is not clear from your answer.

    Would it be possible to disable the batch jobs related to workflow temporary and run the TutorialWorkflow class instead? Probably the workflow message processing is taking too much time and gets into conflicts with due date or line item batch jobs.

    I would seriously try to find out if you can do some maintenance on your database. Also set a fillfactor on the tables where you see a lot of fragmented indexes.

    Scripts from Ola Hallegren would help to get a good start. Note that for AX the scrips can be enhanced for better performance.

    Also try to find out how much time each workflow instance is consuming to be processed. See if some steps can be done in a different way. I have seen some large workflows using many decisions to find a correct person for approval. In these cases, probably creating a new workflow participant provider would be faster and improves the overview of your workflow setup.

  • Myo Sandar Profile Picture
    50 on at

    Hi Andre,

    My client have 6 AOSs with load balancing. We configured different batch groups and run in different servers. For workflow batch group, we use one dedicated server just for run workflow batch job. No AX client access to this except workflow. All the workflow types approval go to this server only. The rest of the batch job (non-workflow related) process in another server.

    I would try to run from workflow tutorial form as per your advice.

    I am also thinking to re-configure the complex workflow to simpler one but not sure it would resolve our current deadlock issue.

    Regards,

    Myo Sandar

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 > 🔒一 Microsoft Dynamics AX (Archived)

#1
Priya_K Profile Picture

Priya_K 4

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#3
Ali Zaidi Profile Picture

Ali Zaidi 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans