This advanced other workflow component, Error handler, sets which workflow to call if an error should occur during processing.
This is similar to the On error workflow on the workflow inputs. An alternative or addition is the general error report email option for the whole tenant.
The error handler workflow component selects which workflow to call in case of an error. It works for the workflow sub-tree starting with this component - until another error handler is found. An error handler overrules the optional On error workflow, that can be setup on the workflow input.
Here is an example of how to move files to an error folder, if an error occurred. You can also use an error handler in the main workflow in that.
The error handler has this parameter:
On error workflow
Here you select (via a drop down list) the other workflow, that is to be called from now on, if an error should occur.
The other workflow must be created first, and the other workflow need to have the input type, From other workflow in order to be listed here.
Keep the initial payload for the error workflow
Find out which workflow ran when the error occurred
You might want to know the name of the workflow that ran when the error occurred - in the error workflow. That information is not directly available, but you can setup your workflows to make this known. An important part of this is the predefined variable, interform.workflow.name. This variable always contains the name of the workflow, that is currently running. Unfortunately the value of this variable also changes to the name of the error workflow, then an error triggers it. So you need yourself to make sure to save the name of the original workflow before the error can occur. You can do that e.g. if you define your own variable and copy the value of interform.workflow.name into it in the main workflow. Then you can retrieve the name of the original workflow in the error workflow by using your own variable.
So here you could add this workflow component in the main workflow:
And then refer to the variable, OriginalWorkflow in the error workflow.