FortiSOAR Discussions
Fabien1
New Contributor II

For loop and pagination

Hello,

 

In some data ingestion steps that are relying on pagination ( OpenCTI "Get Indicators" action for instance ), while using for loop in playbook step, we need to provide the output  variable of one loop as an input for the next loop to be executed. How can we achieve this?

 

Regards

Fabien

1 Solution
okumbhar

You can create one parent playbook and one child playbook which is self referenced

View solution in original post

7 REPLIES 7
okumbhar
Staff
Staff

You can set variables in a playbook step, use those variables in next steps and then after that you can use decision step to go back to any previous step based on the condition that you define.

Harsukhrpeet

Thank you for your reply.
We tried this but it does not allow us to go back to any previous step again, i.e : one step can be executed only once.

Here is the error message for reference: 
"CS-WF-13: Invalid Playbook. Playbook should always be Directed Acyclic Graph"

okumbhar

You can create one parent playbook and one child playbook which is self referenced

Harsukhrpeet

Hi @okumbhar 

Thank you for the answer.
This helped us for a smaller set of data but for huge data : lets say 2k or more , it gets stuck with error : CS-WF-52: Possible infinite recursion detected. Aborting after a depth of 10 runs referencing the same playbook.

 

okumbhar

I think we need to add a new checkbox parameter 'Fetch All Records' in the action, which will return all records, so the logic of fetching all records can be written in backend code instead of trying to implement it in playbook.

Harsukhrpeet

When can this be implemented. Also is it not possible to implement a feature which  calls a [playbook step]/playbook recursively with a definite number of times which can be defined by the user,  so that it does not assume that it will go to infinite loop

Anonymous
Not applicable

Thank you for your valuable suggestion! We've taken note of your request and will explore its feasibility for future consideration. Given our current focus on multiple customer priorities, it's challenging to commit to a specific timeframe, but please know we'll diligently pursue this matter.