Abort execution in For Each Workflow

Discussion created by Alwin_Groot_Bluemink_8727 on Dec 22, 2016
Latest reply on Dec 23, 2016 by Alwin_Groot_Bluemink_8727


I am looking for some help on how to correctly abort processing of a For Each Workflow.


Context: I am configuring a Workflow that should behave like this, from a high-level perspective:

1: Look for trigger files on FTP location;

2: Loop each trigger file

  a: Copy similar-named file to external system

  b: Copy that same file to some archive location

  c: Remove trigger file


I have everything working, however I cannot seem to get the error scenarios covered in the way I would like. I would like the Loop to abort when something goes wrong, e.g. archive location is out of disk space, or some directory doesn't exist.

From a technical point-of-view I have a For Each Workflow with two FTP Agent Jobs inside. The first job performs task 2a and the other job performs 2b and on success 2c. I configured both jobs On Failure to "Skip remaining files and abort the job". On failure however, the For Each Workflow is not aborted. I configured, in Post Processing a MODIFY_STATE, but that also doesn't abort the For Each Workflow.

I can think of a very ugly workaround -- create and populate some variable "ERROR_OCCURRED" and read that in Pre Processing in every step in the For Each Workflow...but there has to be a better way!