Hi,
I am just curious if anyone knows how to check on the completion status of a child playbook.
For example:
Playbook A calls Playbook B.
Playbook B completes and returns back to Playbook A.
Playbook A now wants to check on the completion status (success/failure & any possible message)
Perhaps something to do with the playbook_run_id from the phantom.playbook() call?
Assuming that the child playbook is running syncronously you can use playbook.completed.
in the docs --> docs/automation/api_playbook#completed
phantom.completed(action_names=None, playbook_names=None, trace=False)
This API checks to see if all of the actions and child playbooks (synchronously launched) in the the given list of action_names and playbook names have finished executing or not. Succeeded or Failed implies 'Done'. Returns True if and only if all the actions and playbooks are done or else returns False. This API is used primarily in the join function where certain blocks are being executed in parallel but the next block has to be called only when all the joining blocks have completed executing.
action_names [required] This is a list of names given to an action via phantom.act() API in the parameter 'name'.
playbook_names [required] This is a list of names given to a playbook execution via phantom.playbook() API in the parameter 'name'.