How to send an email when a task fails
I'll be honest this is very difficult to answer.
For example - what is an error?
Is it Wrong data, is it a failed connector, is it a problem with a third party (as you've seen in your similar question here.
The simple fact is you should actually design your process with failure in mind as well.
People do this unconsciously however a process must have it specified. Oh - this field is wrong I'll just fix it...vs this field is wrong crash/fail.
If wrong data then you have to restructure your inputs to make sure the data is clean before it gets to the process (validation etc.)
Connectors can throw a Error event which can then be used to do what you need
Third party issues are harder but similar to Connectors Throw an Error Event.
Processes should ALWAYS be built with failure in mind and then act on them. It's one part of BPM that is so often ignored with the end result that changes have to built very quickly to the design.
Is it possible to double the size of a simple process by adding Error Processing - Absolutely, but that's the cost of automation.
Have a look here
for more information on Error Event handling.
PS: As this reply offers an answer your question, and if you like it, please Mark UP and/or as Resolved.