Heads Up :
The post you are writing will appear in a public forum. Please ensure all content is appropriate for public consumption. Review the employee guidelines for the community here.
If we are using this in a compound workflow, it won't work. Because this code is looking in the GUI report for Workflow name and status. Child SRs usually not shown in GUI report.