calculate the max parallel degree of a workflow