for task steps you could proceed as Gerardo proposed in his post. For other steps I think that the pipeline is only saved for resubmitable steps. In your case you just need one variable. I would use logged fields in that case. Just mark the value you need to check as a logged field and use e.g. pub.monitor.process.instanceSteps:getStepCustomData or pub.monitor.process.instance:getInstanceCustomData to retrieve the value. (I am not completely sure about the service but there should be one to retrieve logged fields).