Break on Error
Roland Schubert
Entscheidungs- und ergebnisorienierte Datenanalyse für Finance, Marketing & HR - Von der Strategie bis zur Umsetzung | Planungs- und Analyseprozesse effizient gestalten, optimieren und automatisieren | Alteryx ACE
An error has occurred in a workflow and it continues to run anyway??Sometimes that's all right, but only sometimes.
However, the default setting is that an error does not lead to cancellation. Of course, it is particularly annoying when an error occurs right at the beginning of a workflow and then it continues to run ( perceived) endlessly. If, for example, in a workflow like this, the Excel file cannot be read in for some reason, while access to the database works perfectly.
Okay, let's perhaps also look at the volume of data to be read here.
By default, the database table would now be read completely and the workflow would continue to be executed; in the end, no usable results would be produced.
Of course, you can now cancel the workflow by simply clicking "Stop".
However, this is only possible if you continue to watch the workflow after it has started and notice that there is an error - I don't do this in every case, in particular I like to let workflows that have been running for a longer period of time work unobserved.?
However, there is an option to set individually for each workflow whether it should be cancelled immediately in case of an error. In the workflow configuration, under Runtime, there is the option "Cancel Running Workflow on Error", which controls exactly this behavior.
领英推荐
If you select this option, the first error leads to the immediate cancellation of the workflow - subsequent steps are not even started. Here, too, a "Cancel" leads to the termination of the workflow, but this time an automatic one triggered by the setting.
This way you can avoid that an error in the workflow leads to faulty results!?
But this option can of course also be used for other purposes. Often a workflow only needs to be executed if a certain condition is met. Here you can use the TEST tool, which can be found in the Developer Tool Palette and which offers the option of checking one or more conditions. If a condition is not fulfilled, an error is output - in conjunction with the setting "Cancel Running Workflow on Error", this can be used to ensure that the workflow only continues to run if it is "successful".??
However, the TEST Tool has no Output Anchor, so a little trick is required. We can use a BLOCK UNTIL DONE tool here, to whose Output Anchor 1 the TEST tool is attached to execute the check, to Output Anchor 2 then hangs the "normal" subsequent processing that is to be executed if the check was successful. In the case of an unsuccessful condition, the workflow is aborted and the tools behind Output Anchor 2 are no longer processed.
The setting "Cancel Running Workflow on Error" thus gives us additional design options besides its actual main function!
?