Automic Workload Automation

Expand all | Collapse all

Blocked workflows use queue slots. Can this behavior be configured?

  • 1.  Blocked workflows use queue slots. Can this behavior be configured?

    Posted 08-31-2018 12:51 PM

    Hi,

    I would like to serialize the execution of a workflow.

    I have done by using a specific queue with maximum slots set to 1.

    The problem is that if one workflow fails during its execution it blocks (I need it like this because I want to be able to keep the state and restart the failed task), the queue has just one slot available which is used by the blocked workflow. It would be nice to have the queue ignore the blocked workflow, given it is blocked and start the workflow waiting for a queue slot.

    Is there a way to achieve this?

     

    Best regards,

    Marco



  • 2.  Re: Blocked workflows use queue slots. Can this behavior be configured?

    Posted 08-31-2018 01:18 PM

    A few thoughts off the top:

    1) Would it be possible to apply the queue to the job(s) in question rather than the workflow?  

    2) Could the workflow be configured to abort when the job fails rather than blocking?  

    3) Rather than relying on queues, could you use sync objects to achieve the single-threading you're after?



  • 3.  Re: Blocked workflows use queue slots. Can this behavior be configured?

    Posted 08-31-2018 03:36 PM

    Hi,

    thanks for your input.

    1. No, it's not. I need the workflow to be executed just once and the other workflows to queue up. When one is finished the next one should be started. I just want to avoid that if a workflow blocks the system does nothing.
    2. The current version we have in production aborts the workflow if a task fails. The problem is the workflow is running a number of long-running tasks that may fail from time to time. I want to be able to save the state, investigate the root cause of the failure and restart from where it stopped. Restarting everything from scratch is a waste of time.
    3. Yes, I have a solution working with variables but it does suffer of the problem that when the workflow is manually cancelled a lock is hold. I have open the VARA and remove the right key. Quite boring. I have not thought of using SYNC because I think the lock is not released when the workflow is blocked.


  • 4.  Re: Blocked workflows use queue slots. Can this behavior be configured?

    Posted 08-31-2018 03:57 PM

    Re: option #3:

    • If you apply the sync object to each task in the workflow, you could have it release the lock on abend.  It wouldn't have to do anything to the sync object on start or end -- just on abend. (Of course, this only works if you're okay applying the sync object to each job in these workflows, as well as to the workflows themselves.)
    • Instead of applying the sync object to each task, you could release the lock dynamically by using :SET_SYNC on your jobs' post-process tab.  (I haven't actually tried this approach myself, but it looks like it should work.)


  • 5.  Re: Blocked workflows use queue slots. Can this behavior be configured?

    Posted 08-31-2018 04:48 PM

    I get the idea, but I am not sure that would work, I have to try. I will keep you posted.



  • 6.  Re: Blocked workflows use queue slots. Can this behavior be configured?

    Posted 08-31-2018 04:43 PM

    I don't know if I understand all of your requirements correctly.  But here is my take on it.

     

    You want the workflow to block, but you don't want the workflow to block.  If I understand correctly, you only want it to block so it will be easy to find in the activity window and follow up on recovery.  But in the mean time you need the next execution to flow through.

     

    I would consider re-programming the workflow so that failure does not cause it to block, and make sure that failures send appropriate alerts to staff so they know they need to go back into the workflow statistics and recover the failed execution from there, instead of from the activity window.

     

    To force single-threading, I would set Attributes/RuntimeParameters/TasksRunningParallel to 0001.



  • 7.  Re: Blocked workflows use queue slots. Can this behavior be configured?

    Posted 08-31-2018 04:53 PM

    Not exactly. Say I have a workflow triggered twice with different parameters.

    The first workflow starts. At some point it blocks because of an error in a child workflow/job. I would like it to release the queue slot. I believe this to be reasonable because it is just sitting there doing nothing.

    In this way the second workflow could start using the queue slot available.

    When the problem is solved and someone restarts the failed job in workflow 1, if there is an available slot it starts, otherwise it sits until there is one.

     

    I am not sure I understand what you say about recovering the failed execution, but to recover the workflow from where it was left I have a global state to save somewhere to do that, it's not that easy.