Home Dashboard Directory Help
Search

Add ability to resume failed workflows at failed activities (say, Resume-Job as is or with -Retry). by Roman Kuzmin


Status: 

Active


1
0
Sign in
to vote
Type: Suggestion
ID: 770743
Opened: 11/11/2012 5:29:08 PM
Access Restriction: Public
0
Workaround(s)
view

Description

In a sequence of long running tasks it is useful to be able to resume the
failed sequence exactly at the beginning of the failed task, after fixing
transient errors causing a failure. This scenario would be especially useful in
workflows because they are designed for long running and reliable task
sequences.

A workaround exists but it is difficult and ugly to code for every activity.
E.g. (after a failure Resume-Job repeats the failed task):

    Workflow WorkflowWithPossibleFailures
    {
    ...
        # wrap an activity by a retry-able loop
        for($go = 1; $go;) {
            try {
                #<activity that can fail>
                $go = 0
                Checkpoint-Workflow
            }
            catch {
                Write-Warning -Message $_
                Suspend-Workflow
            }
        }
    ...
    }

Right now Resume-Job can be invoked on failed workflow jobs but apparently
nothing happens (an error would be less confusing, perhaps).

If I miss something and the proposed ability to resume failed workflows exists
or if there is a more elegant workaround please let me know.
Details
Sign in to post a comment.
Sign in to post a workaround.