Solved

Limiting Workflow Lifecycle

  • 2 February 2023
  • 8 replies
  • 152 views

Badge +5

Is there a mechanism to set a time limit for Workflow Life Cycle?  I want to know this on both: per individual workflow and per whole tenant.
For example, if I have a workflow, can I set a time limit so that it will automatically Terminate if it was active for over 30 days?

icon

Best answer by Prineel_V3 2 February 2023, 18:16

View original

8 replies

Userlevel 3
Badge +8

Hi @artmov ,

 

I dont think there is a mechanism for that, however, you can build something like this into your workflows:

You can use a parallel path action and on your second branch, you can pause the duration for that path for 30 days and terminate the workflow after 30 days assuming the workflow is still active.

In your parallel path action you can set a Boolean condition indicate when the workflow should end (so set that value = true at the end of your workflow):

On the terminate workflow instance action, you can get the instance ID from the context tab under variables:
 

 

hope this helps :)

Badge +5

Hi @Prineel_V3 ,

This is an interesting solution.  So with this, if I have multiple tasks within the workflow, then I will have to implement this parallel path around all tasks.

I am curious, what is the difference between Terminate Workflow Instance action End This Workflow action?

Regards,

Art.

Userlevel 3
Badge +8

Hi @artmov,

If its just for tasks (assuming you don't want to end the whole process), under the escalation options, there is an option to auto complete tasks:
 

As for the difference between termination and end the workflow, I'm not entirely sure, other than the actual status as well as a reason is required on the terminated action which will reflect on the instance details/activity page. You can also terminate other workflow instances from separate workflows with the terminate action (so if you want to terminate a sub workflow, then you can pass the instance ID and terminate that instance from a parent workflow)

Badge +5

Hi @Prineel_V3 

This is very helpful.

Thank you.

Badge +5

Hi @Prineel_V3 

I do not see Autocomplete option in my tasks:

Any idea?

Regards,

Art.

Userlevel 3
Badge +8

Hi @artmov 

If that is the normal “Assign a task” action, that action has been deprecated for new workflows (see link below):

Perhaps try dragging a new “Assign a task to multiple users” on your canvas and see if it pops up there. I would also advise you to upgrade any “Assign a task” action to the “Assign a task to multiple users” as you do get more benefits as mentioned in the article above. Note: You can also assign a task to a single user, you don't have to assign it to multiple users.

Hope this helps :)

Userlevel 6
Badge +16

Hi @Prineel_V3 ,

This is an interesting solution.  So with this, if I have multiple tasks within the workflow, then I will have to implement this parallel path around all tasks.

I am curious, what is the difference between Terminate Workflow Instance action End This Workflow action?

Regards,

Art.

 

Hi @artmov

Hi @Prineel_V3 great idea!!

End this Workflow - is specific to the current workflow. As such you don’t need to specify the workflow Instance ID. You should use this instead of the Terminate Workflow Instance action. 

Terminate workflow instance - Depending on the configuration, this is able to terminate any running workflow instance. Hence, it requires a Connection setting. You will need the workflow instance ID to target the workflow for termination.

Example. A workflow upon triggered, could save its workflow instance ID to a SP column or SQL table. A killer workflow could be activated to go through all the all the active workflow. Using a loop to read all the workflow instance ID and then terminating all those workflows. 

Hope that makes sense.

Badge +5

Hi @Prineel_V3 

I appreciate all of your help.

Regards.

Reply