Check workflow execution status for a form record

Our client wants a workflow where form submissions are sent to salesforce, and if successful, deleted from Umbraco Forms.

If the submission fails, it should be retried, and after 3 attempts, it should be emailed to a specified address.

I plan on doing this using a daily hangfire task, I was just wondering how I can get the status of the workflows for a particular field record. I know that custom workflows return a WorkflowExecutionStatus object, so getting access to this would be ideal.

Alternatively, is there an event I can listen on, to find out when a forms workflow completes successfully, so the record can be deleted immediately?

Any help would be appreciated.

Thanks.


This is a companion discussion topic for the original entry at https://our.umbraco.com/forum/94560-check-workflow-execution-status-for-a-form-record