Skip to main content

Best practices on Error handling by using Subprocesses

Handling errors with Subprocesses

Ossi Galkin avatar
Written by Ossi Galkin
Updated over a year ago

Error handling by using Subprocesses

Subprocesses are good tools for handling errors. You can create Subprocesses to handle specific errors or you can handle general errors which might occur in any step of the Process. First, let's take a look at handling specific errors.

If you have a step in your Process which might throw an error in a specific case, even though that error can be handled in the Process, the handling of that error may require multiple steps. You should consider using a Subprocess to handle that error. You can use a Catch Element to catch an error from a step or scope and then execute a Subprocess to handle the error. Below is an example of a case where you try to fetch data from a database, but for some reason the data is not available and the Task will throw an error. The Process then handles the error by calling a Subprocess which fetches the data from other databases.

The second case is that you want to handle any errors that might occur during a Process execution. For example, you want to send an email notification if a Process execution fails in any step of the Process. This can be done using Subprocesses. In Process settings you can find an option for adding a Subprocess to process unhandled exceptions. You can provide parameters for the Subprocess as you would when using a call Subprocess Element. The selected Subprocess is triggered when any error occurs during Process execution which is not handled by a Catch Element.

Did this answer your question?