Process error handling with subprocesses

I have built a service for handling an error that occurs in our main process which logs the error and resubmits at the failed step to restart the process. If the error happens in the subprocess however, there is no error information available and there doesn’t seem to be any services available to get the supprocess information. The getStepDetails services only returns ContextID and InstanceID(of the parent process).

Is there any way to get the subprocess ID using the parent process ID?

you are referring callable process or subprocess here ?