How to set a timeout for a sub playbook task ?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements

How to set a timeout for a sub playbook task ?

L1 Bithead

Dear Members , 

 

Hoe you are all doing well.

 

What is the best option to set a timeout for a sub playbook task, so if that playbook run exceed x amount of time it continues to the next task in the playbook.

 

Thanks.

 

 

4 REPLIES 4

L2 Linker

I think you can use execution timeout section.

YilmazDincer_0-1686730140492.png

With this configuration, if the sub playbook task exceeds the specified timeout duration, it will be automatically terminated, and the playbook will continue to the next task.

for a task of type sub playbook , its not showing the execution timeout option.

please see the screenshot.

 

2023-06-14 - __Remote.png

L1 Bithead

any other suggested soliton please ? 

L3 Networker

So I think the first thing I should address here is that you shouldn't do this.

 

Either the results of the results of the subplaybook are required for the main playbook to continue, or they aren't.

If they are, then doing this is just going to cause the rest of the main playbook to fail.

If they aren't, then there's no clear point in waiting for the subplaybook to complete at all, just run it simultaneously with the rest of the playbook.

 

Whatever you're trying to do here, it's likely that the downsides of actually implementing this will outweigh the upsides. Something like SLA timers to warn users of excessively long running playbooks so they can manually review seems like a better approach.

 

That said, this was an interesting technical challenge so I have a solution.

 

You'll want to create two separate branches: A timeout branch (left) and a subplaybook branch (right). The end of the subplaybook branch should set a key in the context to let us know it's finished. The left branch will then use the built-in "Context Polling - Generic" playbook to finish *either* when the subplaybook finished context key is set OR the context polling timeout is reached (default 10 minutes). Note that the polling mechanism will introduce a delay of up to 1 minute (or more if you set a longer poll time) in the event the subplaybook does actually finish before the timeout.

  • 1664 Views
  • 4 replies
  • 0 Likes
Like what you see?

Show your appreciation!

Click Like if a post is helpful to you or if you just want to show your support.

Click Accept as Solution to acknowledge that the answer to your question has been provided.

The button appears next to the replies on topics you’ve started. The member who gave the solution and all future visitors to this topic will appreciate it!

These simple actions take just seconds of your time, but go a long way in showing appreciation for community members and the LIVEcommunity as a whole!

The LIVEcommunity thanks you for your participation!