Sleep Retry doesn't seem to work

Are there any “Unwritten rules” for this sleep task? When trying to attach to an invoice, for some reason, if the group is locked, it errors out. (why? I don’t know, that’s another question). But you can retry once there isn’t a user in the group and it works fine. So I figured I could just put a sleep and retry loop in there. Now that we’re hooked up to live, I don’t really have a way to test, so I wired it up and waited for the issue to happen.

Here’s the sleep task.

Sure enough, I had some today. Sweet, I’ll wait a bit and see what happens.

I can see in the history that it retried, but it failed again.
image

Now, I can’t at this point 100% rule out that it wasn’t still a timing issue, and someone had their grubby little hands in the group. However, whenever I hit the await button manually, it completes. I’ve never actually had one not work when doing it manually come to think of it.

As I typed this, I realize that the screen shot that I took on this one was more than 1/2 hour later, and it should have tried again by this time.

The most obvious is, Does it have to be in whole hour increments?

Or is there something else I’m missing? Looking at the stock sleep functions that come with the integration, I think I’m setting it up the same way. (however, I’ve never actually seen those work either… we haven’t need to yet.)

We’ve not done this, but I understand that there is a Wait task at the end of the AP Invoice V2 workflow to wait for payment info - we took it out, but it’s there in the original.

1 Like

I have seen some delays on the sleep task.

Usually + 7 minutes over the sleep percentage.

.02 of an hour is the lowest value I’ve used.

.02 x 60 = 1.2

1.2 + 7 = 8 minutes minimum

Usually I find a loop will occur and I need to evaluate/ stop with a sleep step. Loop limit for on prem is in ecm configuration.

The issue you are finding with the sleep may point to a setting that needs a longer sleep time. Sleep can fail / not refresh without showing on screen. I’ve had sleep work and not visually update try refresh your browser while waiting.

Another option might be sending to another workflow to sleep and clear the document status after the sleep occurs. In the other workflow you could route it back with another change workflow use a variable set in the sleep step to skip all indexing and go back to the unlock and create attachments.

3 Likes

If you can prevent the workflow from getting to that point where it gets to the create step and beyond, that is the best option.

I’ve created a datalink to search for a locked invoice group.
select
[APInvGrp].[Company],
[APInvGrp].[GroupID],
[APInvGrp].[ActiveUserID]
from Erp.APInvGrp as APInvGrp
where ((APInvGrp.Company = @company and APInvGrp.GroupID = @“YourGroupName”) and APInvGrp.GroupID is not null)

Create a branch so if the group is locked, it stops at a “wait” step. Add your wait action.
You can test it by clicking the refresh. You don’t have to actually wait. If it doesn’t re-try. Tweak hours in the settings. I’ve seen start to work when you change the settings if this was used from the Actions Library.
Make sure you clear the status at some point too.

3 Likes

Great solution Anthony!