Is there a way to check whether a workflow is scheduled?
For example, we have electronic payments that require verification. The verification is done recurrently until the payment is settled.
However, sometimes the workflows fail to schedule recurrently and we end up with a ghosted transaction. To resume this transaction verification I need to run the workflow on that transaction again.
I would like to have a way to check that workflow X is scheduled with data thing Y as parameter. If not then I would show a “verify” button to re-schedule the workflow.
So what’s needed is a way to inquire about scheduled workflows. Is there a way?
I have a similar requirement and what I do seems to work fine for me.
When your user clicks “verify”, perform the following:
Schedule your verification workflow
Update the payment row’s new field (let’s call it verifyID) with the results of Step One. This will load the ID of the just-scheduled workflow.
When your verification workflow runs, do the following:
Do your regular verifying stuff.
If the verifying stuff worked, blank out the corresponding payment row’s verifyID. This would indicate that the payment row has been verified.
IF the verifying stuff did NOT work, reschedule your verification workflow AND then update your payment row’s verifyID with the result of the rescheduling.
Since your new verifyID field is just a simple text field, you can even populate it with “verified” if your verifying stuff worked. That way, you can check all of your payments and the successful ones will show “verified” and unsuccessful ones (or ones that haven’t run yet) will show a string of numbers.