locked
Understanding WorkflowIdle TimeToUnload RRS feed

  • Question

  • Per documentation, I am able to set the WorkflowIdle TimeToUnload value to TimeSpan.MaxValue or Zero. Will there be performance issue if it were to be setup either way and is it advised? This is the only way I've found to get my DelayActivity working in my workflow as it would not hydrate after the set delay time has expired. Typically, the our delay activity is set for a month but may vary as it is configurable.

    Documentation: http://msdn.microsoft.com/en-us/library/ee818710(v=vs.110).aspx

    Thanks in advance!



    • Edited by DJ Frenzy Tuesday, January 20, 2015 8:04 PM
    Tuesday, January 20, 2015 7:13 PM

Answers

  • DJ Frenzy,

    Since you are using the WorkflowIdleBehavior, I am going to assume that your workflow is a workflow service which is hosted inside WorkflowServiceHost. You weren't explicit in that regard, so I wanted to make sure that this was the case.

    Are you also using IIS to host the workflow? Or do you have a different process that is creating the WorkflowServiceHost object instance for hosting the workflow.

    I am going to state that obvious and indicate that the hosting process for the workflow must be running in order for the Delay activity to wake up after its specified amount of delay time. The hosting process needs to monitor SqlWorkflowInstanceStore events so that it can be told when an instance is ready to run after its pending timer has expired. Hosting in IIS will do this for you automatically. But if the hosting w3wp.exe process has recycled, an existing instance will not wake up until another instance has been started or is loaded as the result of receiving a WCF message into the service.

    But if you have your own process that is creating the WorkflowServiceHost object instance, your host process will need to call SqlWorkflowInstanceStore.WaitForEvents, waiting for the HasRunnableWorkflowEvent or it needs to have a thread that polls executing the TryLoadRunnableWorkflowCommand.

    Jim

                   

    • Marked as answer by Angie Xu Thursday, January 29, 2015 7:24 AM
    Saturday, January 24, 2015 12:36 AM

All replies

  • Hi DJ Frenzy,

    Thanks for your feedback in workflow forum.

    For this workflowidle issue, here are more explanation in MSDN library.

    Workflows go idle when they encounter a bookmark that must be resumed by some external stimulus. WorkflowIdleBehavior is a behavior that allows you to specify the time between when a service instance goes idle and when the instance is persisted or unloaded.

    TimeToUnload specifies the time span between when a workflow service instance goes idle and when the workflow service instance is unloaded, where unload means persisting the instance to the instance store and removing it from memory. This topic explains how to configure the WorkflowIdleBehavior in a configuration file.  

    Further resource: Configure Idle Behavior with WorkflowServiceHost

    Please let me know if there is anything that I can do to help.

    Best regards,

    Angie


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Wednesday, January 21, 2015 3:19 AM
  • DJ Frenzy,

    Since you are using the WorkflowIdleBehavior, I am going to assume that your workflow is a workflow service which is hosted inside WorkflowServiceHost. You weren't explicit in that regard, so I wanted to make sure that this was the case.

    Are you also using IIS to host the workflow? Or do you have a different process that is creating the WorkflowServiceHost object instance for hosting the workflow.

    I am going to state that obvious and indicate that the hosting process for the workflow must be running in order for the Delay activity to wake up after its specified amount of delay time. The hosting process needs to monitor SqlWorkflowInstanceStore events so that it can be told when an instance is ready to run after its pending timer has expired. Hosting in IIS will do this for you automatically. But if the hosting w3wp.exe process has recycled, an existing instance will not wake up until another instance has been started or is loaded as the result of receiving a WCF message into the service.

    But if you have your own process that is creating the WorkflowServiceHost object instance, your host process will need to call SqlWorkflowInstanceStore.WaitForEvents, waiting for the HasRunnableWorkflowEvent or it needs to have a thread that polls executing the TryLoadRunnableWorkflowCommand.

    Jim

                   

    • Marked as answer by Angie Xu Thursday, January 29, 2015 7:24 AM
    Saturday, January 24, 2015 12:36 AM