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.
... View more