detection of when wf finishes, and is successful or not