Configure a sub-playbook to run in a loop.
Looping uses sub-playbooks to create loops within the main playbook. When running the loop, the values are calculated based on the context data for the sub-playbook and not the main playbook.
Note
Consider the following when adding a loop:
The maximum number of loops (default is 100). A high number of loops or a high wait time combined with a large number of issues may affect performance.
Periodically check looping conditions to ensure they are still valid for the data set.
If you want a sub playbook task to loop over an array passed into its input, you need to configure a loop. Otherwise it takes in the whole array and runs once.
In the Playbooks page, select the parent playbook that contains the sub-playbook task you want to run in a loop.
Right click and select Edit.
If the playbook is installed from a content pack, you need to duplicate or detach the playbook before editing.
Click the sub-playbook for which you want to create the loop.
In the Task Details pane, click the Loop tab.
Click one of the following options to define loop settings:
None: (Default) The sub-playbook does not loop.
Built-in: Use built-in functions to define loop settings:
Option
Description
Exit when
Enables you to define when to exit the loop. Click {} and expand the source category. Hover over the required source and click Filter & Transform to the left of the source to manipulate the data.
Equals (String)
Select the operator to define how the values should be evaluated.
Max iterations
The number of times the loop should run.
Tip
Balance between the number of iterations and the interval so you do not overload the server.
Sleep
The number of seconds to wait between iterations.
recommends that you balance between the number of iterations and the number of seconds to wait between iterations so you don't overload the server.
For each input: Runs the sub-playbook based on defined inputs. Enter the number of seconds to wait between iterations.
Choose Loop automation: Select the automation from the drop-down list to define when to exit the loop. The parameters that appear are applicable to the selected automation.
To save the changes, click OK.