You are viewing limited content. For full access, please sign in.

Question

Question

Why is my Terminated Workflow starting again on its own?

asked on April 19, 2018 Show version history

Our IT recently made changes to our Email services and now I am getting many error messages for "Failure to send Email".  We are troubleshooting that issue, but this post is about a different part of what I see happening.

One of our permit creating WF's is terminating with the Failure to send Email message and the Workflow restarts!  Which results in two permits!  The second permit email is successful, but the problem is I now have two permits, because the first WF created the permit just fine and stored it in LF before attempting the email.

What might be causing the WF to restart?  I've never seen this happen before. 

The Workflow is initiated from within a LF Forms process and I have the “Wait for the workflow to finish before proceeding?” checked off as Yes.

The only starting rules on the BP WF are:

0 0

Answer

SELECTED ANSWER
replied on April 19, 2018

Connie,

When LF Forms is used to initiate a workflow it will automatically try again if the workflow is terminated. What you are seeing is that the workflow terminates, forms detects the failure, then Forms automatically tries to run it again. A safer approach would be to include a try-catch on the email task in the workflow to ensure that it does not terminate because this is what triggers the retry in the Forms BP.

0 0
replied on April 19, 2018

Thanks, Jason.  I'm definitely going to want to build in that try-catch activity.

0 0
replied on April 19, 2018

This white paper describes how to exclude workflows from Forms' automatic retries for suspended tasks.

 

3 0
replied on April 19, 2018 Show version history

So, do I just copy my Email activity into the Catch Branch after placing it in the Try Branch, so that it is in both sides?

Maybe add a delay activity?

0 0
replied on April 19, 2018 Show version history

You can do it that way so it retries within the workflow. I would add at least a 1-minute delay to be safe.

Just be aware that if it fails again inside the Catch Branch, it will terminate the workflow and cause the same issue.

Sometimes I will do a try-catch within the catch so it would try up to 2 times, then give up and move on.

When the email (or other activity) is more important I will do the following:

  1. Create a "email sent" Boolean token with a value of "FALSE"
  2. Add a Repeat
    1. Set it to check "email sent" after running the activities and repeat if the "email sent" is FALSE
  3. Update the token to TRUE after the email activity
    1. If the activity fails, then it will hit the Catch Branch and never update the token to TRUE
    2. If the activity succeeds, then it will update the token and end the Repeat loop
  4. Add a 1-Minute delay in the Catch Branch as a "cool down" between attempts

This way, if it fails, the repeat will catch that it failed and try again as many times as you allow it to in the iteration limit, you won't need to nest try-catches, you reuse the same email activity, and if something is seriously wrong to the point where it will never succeed you won't have to worry about Forms starting the process over and over for eternity.

1 0

Replies

You are not allowed to reply in this post.
You are not allowed to follow up in this post.

Sign in to reply to this post.