- Access exclusive content
- Connect with peers
- Share your expertise
- Find support resources
11-16-2025 06:15 AM
Hello Everyone,
I want to ask about the while loop condition in XSOAR, is it possible to do that? for example i want to check condition the agent status to see whether it is connected or not, if it is not connected set 10minutes delay and then check the condition again
Thank you!
12-27-2025 11:37 PM
Loop condition is indeed an option!
You can achieve it by 2 examples:
personally - option 2 is preferred, much more simple to create and test.
Good luck!
01-05-2026 08:53 PM
Thanks for your answer @ofmoalem , I used technique no 2, but I got this error
Error from Scripts is : Script failed to run:
Timeout Error: Docker code script failed due to timeout (exampleScript). Consider changing timeout value for this automation. (2604) (2603)
to resolved this issue I increased the timeout and the number of retries but I don't think this is same as we used to while True condition
01-29-2026 12:10 AM
Well, this is because you try to implement the wrong logic into automation script which meant to be one time flow and not endless recursive loop.
in case where the waiting time is not consistent and not static - Schedule Commands decorators are you friends-to-go.
XSOAR features option that built exactly for that use case - unknown number of loops needed.
regular tasks within playbook running via workers, but schedule commands do not run via workers, which means they are not limited by time - they are limited BY RESULTS.
schedule tasks give you the option to run the loop over and over until you get the output you wish for via code.
you can read more about it via offical docs:
Scheduled Commands | Cortex XSOAR
the last example there is a great baseline for your use case!
Best of luck!
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!

