locked
workflow performance bottleneck when called from js? RRS feed

  • Question

  • Hello, I'm executing a workflow via SDK.SAMPLES.ExecuteWorkflowRequest.js. This workflow is used to reactivate a case. After the js executes the w/f, a js function polls the crm db for status. As soon as the status is Active, the js function reloads the page.

    * The js method that triggers the w/f returns success almost instantaneously. 
    * The workflow code itself completes in < .75s.
    * The js method that polls the system does not find an active status for about 10s.

    I'm trying to understand where the performance bottleneck is coming from. My 2 theories would be:

    1. Although the js function receives an immediate success notification after calling the wf, crm takes a while to actually queue up, initialize and run the w/f.
    2. Although the w/f code completes quickly, crm internal processes take a while to update related internal data and execute related internal processes before the updated status can be returned via an odata query.

    Based on the setup and delays I'm describing, do you have any insight as to what might be causing this delay?
    Tuesday, April 8, 2014 10:10 PM

All replies

  • Hi Andrew,

    The Async server is responsible for running workflows and it can take a number of seconds for this to happen depending on the work load it is under. Essentially each async operation is entered into a queue and the async server then polls the database and can only execute a finite number of operations in parallel. This polling time and parallel process limit is configurable for OnPrem servers, but I don't recommend change them.

    Hope this helps,

    Scott

    Scott Durow
    Blog www.develop1.net    Follow Me
    Rockstar365
    If this post answers your question, please click "Mark As Answer" on the post and "Mark as Helpful"

    Wednesday, April 9, 2014 1:15 AM
    Answerer