Search code examples
workflow-foundation-4

What is the minimum time required for a delay activity to cause a persist?


I am trying to force a workflow service to persist (for "recovery/restart" purposes) and need to know if there is a minimum delay required to force a persist of the workflow. In most cases, I would do a bit of testing and see if I could determine the minimum, but am in a crunch because it appears that an alternate method is not working for me. The service is configured to immediately persist by the following, which is in my web.config:

<workflowIdle timeToUnload="0"/>

So, if I do a delay of, say, one second, will this be enough to force a persist? Should I just add a Persist activity rather than the delay? Or must I just try values until it either works or I determine I have to move on to another method?


Solution

  • The workflowIdle behavior kicks in when a workflow enters the Idle state. This will occur even with a delay as short as 1ms.

    However, based on your requirement it is better to use the Persist activity to force persistence.