How to check return status of parallel branches in jenkins pipeline I am running a Jenkins job on multiple slaves. Following is the code structure:

def branches = [:]
def allNodes = Jenkins.getInstance().getNodes()
for (int i =0; i &lt; allNodes.size(); i++) {
branches[allNodes[i].name.toString()] = {
    node(allNodes[i].name.toString()) { 
    .
    .
    stuff
    }
}
parallel branches


Now, I want to get the status of the job parts running on nodes so that in case some job part fails on some node I can mark that node as offline. Is there any way to do this?
You may want to try the Join plugin. Some more details about this plugin (from the linked page):


  This plugin allows a job to be run after all the immediate downstream jobs have completed. In this way, the execution can branch out and perform many steps in parallel, and then run a final aggregation step just once after all the parallel work is finished.
  
  The plugin is useful for creating a 'diamond' shape project dependency.   This means there is a single parent job that starts several downstream jobs. Once those jobs are finished, a single aggregation job runs.


For more details on that, refer to my self answered question about "Why trigger something remotely (using Jenkins) and then just forget about it?".