Nintex Workflow – Error Handling

hat do you do if your workflow fails mid process? Well, you will have to click on the status link of that workflow and then click the Terminate Workflow link.

When it comes to Nintex Workflows, this isn’t always the case. Granted, some errors can not be caught, but there are some actions that Nintex provides, that have built in Error Handling capabilities.

These include :
Call Web Service
Create Appointment (Exchange 2007)
Create Task (Exchange 2007)
Execute SQL
Query BDC
Query Excel Services
Query LDAP
Query XML
Update XML
Web Request
Create List
Convert Value
Add User To AD Group
Create AD Account
Create AD Group
Decommission AD Account
Delete AD Group
Enable LCS/OCS
Provision User on Exchange
Remove User from AD Group
Update AD Account
Copy to SharePoint
Create a Site
Create Site Collection
Decommission Site Collection
Delete a Site

That’s 27 actions that we can work with, where if an error occurs, we can capture it and intelligently design our workflow so that the workflow doesn’t just fail.

As an example, I’m going to have a fairly simple workflow that has a Call Web Service action. If the web service call fails, then the workflow would throw and example and you would see the error in the workflow history. Again, you’d need to terminate the workflow, resolve the issue and start it the workflow again from the beginning.

Now we enable error handling.

First we’ll need a workflow variable of type Text. This is where the error will be stored when (if) it is caught.

Now, in our Call Web Service action, we scroll down to the very bottom, and click on the “Error Handling” section to expand it.

For the first field “Capture Errors”, we set it “Yes”. This turns error handling on.
For the third field “Store error text in”, we set it to our text variable. If an error occurs, then the text variable will contain the error message that is caught.

t’s all good that we have the error, but what should we do with it? The first thing to do is use a Set a Condition action. Here we need to check if our text variable contains any data. If it doesn’t, the action completely successfully. If it contains data, then we need to perform some business logic to handle the error.

In the workflow for this atricle, I decided to use an Assign a Todo Task action, and ask the initiator of the workflow, whether we should continue with the with workflow or not. The details of which is another article I will hopefully put together in the future. But this is just a small example of how we can perform error handling and continue workflow processing.

Another example would be :
A Call Web Service action goes an asks a web service for a date for when a project should conclude. For some reason, the web service is down, or failing for another reason. We can capture this, and instead defer to an alternative way of getting this date (such as asking a project manager).

elow is a screenshot of the workflow I have been playing with. It’s not something that I would necessarily put into production, but it’s a place to start.



Useful Downloads :

Download Workflow

Leave a Reply

Your email address will not be published. Required fields are marked *